From 4cb1ab2ba78bc44c01b0e14671c07c42c9d65534 Mon Sep 17 00:00:00 2001 From: capitaomorte Date: Wed, 26 Aug 2009 15:34:37 +0000 Subject: [PATCH] Added warning about applicability to the documentation --- doc/changelog.html | 13 +++++++---- doc/changelog.rst | 3 +-- doc/faq.html | 9 +++++++- doc/index.html | 9 +++++++- doc/snippet-development.html | 9 +++++++- doc/snippet-expansion.html | 11 ++++++++-- doc/snippet-menu.html | 11 ++++++++-- doc/snippet-organization.html | 11 ++++++++-- doc/template.txt | 9 +++++++- yasnippet.el | 41 ++++++++++------------------------- 10 files changed, 80 insertions(+), 46 deletions(-) diff --git a/doc/changelog.html b/doc/changelog.html index 19a9009..37890e7 100644 --- a/doc/changelog.html +++ b/doc/changelog.html @@ -3,7 +3,7 @@ - + ChangeLog @@ -47,8 +47,14 @@
-
-

0.6.1b / 2009-08-23

+

+ Important: This documentation applies to + the SVN trunk of YASnippet, which you + get here. Documentation + for other versions can be found here. +

+

Upcoming release:

-

0.6.0c / 2009-07-27

    diff --git a/doc/changelog.rst b/doc/changelog.rst index 72028e4..8d13782 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -7,8 +7,7 @@ ChangeLog .. _Writing Snippets: snippet-development.html .. _The YASnippet Menu: snippet-menu.html -0.6.1b / 2009-08-23 -=================== +**Upcoming** release: * Much more powerful menu. See `The YASnippet menu`_. * New ways to organize snippets. See `Organizing snippets`_. diff --git a/doc/faq.html b/doc/faq.html index 1ca145f..e6fd036 100644 --- a/doc/faq.html +++ b/doc/faq.html @@ -49,7 +49,14 @@
    -
    +

    + Important: This documentation applies to + the SVN trunk of YASnippet, which you + get here. Documentation + for other versions can be found here. +

    +

    Why there's an extra newline?

    If you have a newline at the end of the snippet definition file, then YASnippet will add a newline when you expanding a snippet. Please diff --git a/doc/index.html b/doc/index.html index 820a2b0..c8a7136 100644 --- a/doc/index.html +++ b/doc/index.html @@ -47,7 +47,14 @@

    -
    +

    + Important: This documentation applies to + the SVN trunk of YASnippet, which you + get here. Documentation + for other versions can be found here. +

    +

    Contents

    • Video Demo
    • diff --git a/doc/snippet-development.html b/doc/snippet-development.html index 9d1b042..2e18833 100644 --- a/doc/snippet-development.html +++ b/doc/snippet-development.html @@ -47,7 +47,14 @@
      -
      +

      + Important: This documentation applies to + the SVN trunk of YASnippet, which you + get here. Documentation + for other versions can be found here. +

      +

      Contents

      • Snippet development
          diff --git a/doc/snippet-expansion.html b/doc/snippet-expansion.html index 9ebcade..d22b25e 100644 --- a/doc/snippet-expansion.html +++ b/doc/snippet-expansion.html @@ -3,7 +3,7 @@ - + Expanding snippets @@ -47,7 +47,14 @@
          -
          +

          + Important: This documentation applies to + the SVN trunk of YASnippet, which you + get here. Documentation + for other versions can be found here. +

          +

          Contents

          • Triggering expansion
              diff --git a/doc/snippet-menu.html b/doc/snippet-menu.html index d85464f..c6802c3 100644 --- a/doc/snippet-menu.html +++ b/doc/snippet-menu.html @@ -3,7 +3,7 @@ - + YASnippet menu @@ -47,7 +47,14 @@
              -
              +

              + Important: This documentation applies to + the SVN trunk of YASnippet, which you + get here. Documentation + for other versions can be found here. +

              +

              Contents

              • Loading snippets from menu
              • diff --git a/doc/snippet-organization.html b/doc/snippet-organization.html index ab409b0..9873066 100644 --- a/doc/snippet-organization.html +++ b/doc/snippet-organization.html @@ -3,7 +3,7 @@ - + Organizing snippets @@ -47,7 +47,14 @@
                -
                +

                + Important: This documentation applies to + the SVN trunk of YASnippet, which you + get here. Documentation + for other versions can be found here. +

                +

                Contents

                • Loading snippets
                • diff --git a/doc/template.txt b/doc/template.txt index 59c3f56..7ed318a 100644 --- a/doc/template.txt +++ b/doc/template.txt @@ -40,7 +40,14 @@
                  - %(body)s +

                  + Important: This documentation applies to + the SVN trunk of YASnippet, which you + get here. Documentation + for other versions can be found here. +

                  + %(body)s
                  diff --git a/yasnippet.el b/yasnippet.el index b258071..d30eeeb 100644 --- a/yasnippet.el +++ b/yasnippet.el @@ -1863,34 +1863,15 @@ visited file in `snippet-mode'." (message "This snippet was not loaded from a file!"))))) (defun yas/guess-snippet-directory () - "Try to guess suitable directories based on `major-mode' and -also the current active tables." + "Try to guess suitable directories based on the current active +tables." (let ((main-dir (or (and (listp yas/root-directory) (first yas/root-directory)) yas/root-directory - "~/.emacs.d/snippets")) - (mode major-mode) - (options)) - ;; Lookup main mode and add that to the options - ;; - (push (format "%s/%s" main-dir mode) options) - ;; Next lookup the main active table - ;; - (let ((active-tables (first (yas/get-snippet-tables))) - other-path-alternative) - (when active-tables - (setq active-tables (cons active-tables - (yas/snippet-table-get-all-parents active-tables)))) - (dolist (table (reverse active-tables)) - (setq other-path-alternative - (concat main-dir "/" (yas/snippet-table-name table)))) - (when other-path-alternative - (push other-path-alternative options))) - ;; Finally add to the options the guessed parent of major-mode - ;; (this is almost never works out) - (when (get mode 'derived-mode-parent) - (push (format "%s/%s" main-dir (get mode 'derived-mode-parent)) options)) - (reverse options))) + "~/.emacs.d/snippets"))) + (mapcar #'(lambda (table) + (concat main-dir "/" (yas/snippet-table-name table))) + (yas/get-snippet-tables)))) (defun yas/new-snippet (&optional same-window) "Create a new snippet in guessed current mode's directory." @@ -1899,14 +1880,14 @@ also the current active tables." (read-from-minibuffer "Enter snippet name: "))) -(defun yas/find-snippets (&optional same-window file-name) +(defun yas/find-snippets (&optional same-window snippet-name ) "Look for user snippets in guessed current mode's directory. Calls `find-file' interactively in the guessed directory. With prefix arg SAME-WINDOW opens the buffer in the same window. -With optional FILE-NAME, finds the file directly, i.e. `find-file' is +With optional SNIPPET-NAME, finds the file directly, i.e. `find-file' is called non-interactively. Because snippets can be loaded from many different locations, @@ -1936,10 +1917,10 @@ otherwise, proposes to create the first option returned by (when target-directory (let ((default-directory target-directory)) - (setq buffer (if file-name + (setq buffer (if snippet-name (if same-window - (find-file file-name) - (find-file-other-window file-name)) + (find-file snippet-name) + (find-file-other-window snippet-name)) (call-interactively (if same-window 'find-file 'find-file-other-window))))