From b194ea56b3aa76e7b8b0f2f58d4acdfb5e4398e9 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Tue, 26 Nov 2013 21:22:57 -0500 Subject: [PATCH] incorporate old rst docs into org --- define_snippet.html | 78 - faq.html | 499 ++++-- index.html | 512 ++++--- manual.html | 1705 --------------------- snippet-development.html | 1346 +++++++++------- snippet-expansion.html | 964 +++++++----- snippet-menu.html | 369 +++-- snippet-organization.html | 535 ++++--- snippet-reference.html | 3056 +++++++++++++++++++++++++++++++++++++ 9 files changed, 5700 insertions(+), 3364 deletions(-) delete mode 100644 define_snippet.html delete mode 100644 manual.html create mode 100644 snippet-reference.html diff --git a/define_snippet.html b/define_snippet.html deleted file mode 100644 index fadfa0d..0000000 --- a/define_snippet.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - -Moved - - - - -
-
-
-
- -
-
-
-
-

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

-

This page has been moved. Click here if your browser -does not automatically redirect you

-
-
-
-
-
-
- - -
- - diff --git a/faq.html b/faq.html index c1c3cf9..0bfd996 100644 --- a/faq.html +++ b/faq.html @@ -1,189 +1,358 @@ - - - + + + - - Frequently Asked Questions - + + + + + + + + + + -
-
-
-
- -
-
-
-
-

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

-
-

Why is there 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 -don't add a newline at the end if you don't want it when you saving -the snippet file.

-

Note some editors will automatically add a newline for you. In Emacs, -if you set require-final-newline to t, it will add the final -newline for you automatically.

+
+ UP + | + HOME
-
-

Why doesn't TAB expand a snippet?

-

First check the mode line to see if there's yas. If not, then try -M-x yas/minor-mode to manually turn on the minor mode and try to + +

+ +
+ +
+

Frequently Asked Questions

+ + + + + +
+

Why is there 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 don't +add a newline at the end if you don't want it when you saving the +snippet file. +

+

+Note some editors will automatically add a newline for you. In Emacs, if +you set require-final-newline to t, it will add the final newline +for you automatically. +

+
+ +
+ +
+

Why doesn't TAB expand a snippet?

+
+ + +

+First check the mode line to see if there's yas. If not, then try +M-x yas-minor-mode to manually turn on the minor mode and try to expand the snippet again. If it works, then, you can add the following -code to your .emacs before loading YASnippet:

-
(add-hook 'the-major-mode-hook 'yas/minor-mode-on)
-
-

where the-major-mode is the major mode in which yas/minor-mode -isn't enabled by default.

-

From YASnippet 0.6 you can also use the command M-x -yas/global-mode to turn on YASnippet automatically for all major -modes.

-

If yas/minor-mode is on but the snippet still not expanded. Then -try to see what command is bound to the TAB key: press C-h k -and then press TAB. Emacs will show you the result.

-

You'll see a buffer prompted by Emacs saying that TAB runs the -command .... Alternatively, you might see <tab> runs the command -..., note the difference between TAB and <tab> where the -latter has priority. If you see <tab> bound to a command other -than yas/expand, (e.g. in org-mode) you can try the following -code to work around:

-
(add-hook 'org-mode-hook
+code to your .emacs before loading YASnippet:
+

+ + + +
(add-hook 'the-major-mode-hook 'yas-minor-mode-on)
+
+ + +

+where the-major-mode is the major mode in which yas-minor-mode isn't +enabled by default. +

+

+From YASnippet 0.6 you can also use the command M-x yas-global-mode to +turn on YASnippet automatically for all major modes. +

+

+If yas-minor-mode is on but the snippet still not expanded. Then try +to see what command is bound to the TAB key: press C-h k and then +press TAB. Emacs will show you the result. +

+

+You'll see a buffer prompted by Emacs saying that +TAB runs the command .... Alternatively, you might see +<tab> runs the command ..., note the difference between TAB and +<tab> where the latter has priority. If you see <tab> bound to a +command other than yas-expand, (e.g. in org-mode) you can try the +following code to work around: +

+ + + +
(add-hook 'org-mode-hook
           (let ((original-command (lookup-key org-mode-map [tab])))
             `(lambda ()
-               (setq yas/fallback-behavior
-                     '(apply ,original-command))
-               (local-set-key [tab] 'yas/expand))))
-
-

replace org-mode-hook and org-mode-map with the major mode -hook you are dealing with (Use C-h m to see what major mode you -are in).

-

As an alternative, you can also try

-
(defun yas/advise-indent-function (function-symbol)
-  (eval `(defadvice ,function-symbol (around yas/try-expand-first activate)
+               (setq yas-fallback-behavior
+                     '(apply ,original-command))
+               (local-set-key [tab] 'yas-expand))))
+
+ + +

+replace org-mode-hook and org-mode-map with the major mode hook you +are dealing with (Use C-h m to see what major mode you are in). +

+

+As an alternative, you can also try +

+ + + +
(defun yas-advise-indent-function (function-symbol)
+  (eval `(defadvice ,function-symbol (around yas-try-expand-first activate)
            ,(format
-             "Try to expand a snippet before point, then call `%s' as usual"
+             "Try to expand a snippet before point, then call `%s' as usual"
              function-symbol)
-           (let ((yas/fallback-behavior nil))
+           (let ((yas-fallback-behavior nil))
              (unless (and (interactive-p)
-                          (yas/expand))
+                          (yas-expand))
                ad-do-it)))))
 
-(yas/advise-indent-function 'ruby-indent-line)
-
-

To advise the modes indentation function bound to TAB, (in this case -ruby-indent-line) to first try to run yas/expand.

-

If the output of C-h k RET <tab> tells you that <tab> is -indeed bound to yas/expand but YASnippet still doesn't work, check -your configuration and you may also ask for help on the discussion -group. See this -particular thread for -quite some solutions and alternatives.

-

Don't forget to attach the information on what command is bound to TAB -as well as the mode information (Can be obtained by C-h m).

+(yas-advise-indent-function 'ruby-indent-line) + + + +

+To advise the modes indentation function bound to TAB, (in this case +ruby-indent-line) to first try to run yas-expand. +

+

+If the output of C-h k RET <tab> tells you that <tab> is indeed +bound to yas-expand but YASnippet still doesn't work, check your +configuration and you may also ask for help on the discussion group. +See this particular thread for quite some solutions and alternatives. +

+

+Don't forget to attach the information on what command is bound to TAB +as well as the mode information (Can be obtained by C-h m). +

-
-

Why doesn't TAB navigation work with flyspell

-

A workaround is to inhibit flyspell overlays while the snippet is active:

-
(add-hook 'flyspell-incorrect-hook
-        #'(lambda (dummy1 dummy2 dymmy3)
-            (and yas/active-field-overlay
-                 (overlay-buffer yas/active-field-overlay))))
-
-

This is apparently related to overlay priorities. For some reason, the -keymap property of flyspell's overlays always takes priority over -the same property in yasnippet's overlays, even if one sets the -latter's priority property to something big. If you know -emacs-lisp and can solve this problem, drop a line in the discussion -group.

+
-
-

How do I turn off the minor mode where in some buffers

-

The best way, since version 0.6.1c, is to set the default value of the -variable yas/dont-activate to a lambda function like so:

-
(set-default 'yas/dont-activate
-           #'(lambda ()
-               (and yas/root-directory
-                    (null (yas/get-snippet-tables)))))
-
-

This is also the default value starting for that version. It skips the + +

+

Why doesn't TAB navigation work with flyspell

+
+ + +

+A workaround is to inhibit flyspell overlays while the snippet is +active: +

+ + + +
(add-hook 'flyspell-incorrect-hook
+          #'(lambda (dummy1 dummy2 dymmy3)
+              (and yas-active-field-overlay
+                   (overlay-buffer yas-active-field-overlay))))
+
+ + +

+This is apparently related to overlay priorities. For some reason, the +keymap property of flyspell's overlays always takes priority over the +same property in yasnippet's overlays, even if one sets the latter's +priority property to something big. If you know emacs-lisp and can +solve this problem, drop a line in the +discussion group. +

+
+ +
+ +
+

How do I turn off the minor mode where in some buffers

+
+ + +

+The best way, since version 0.6.1c, is to set the default value of the +variable yas-dont-activate to a lambda function like so: +

+ + + +
(set-default 'yas-dont-activate
+             #'(lambda ()
+                 (and yas-root-directory
+                      (null (yas-get-snippet-tables)))))
+
+ + +

+This is also the default value starting for that version. It skips the minor mode in buffers where it is not applicable (no snippet tables), -but only once you have setup your yas/root-directory.

+but only once you have setup your yas-root-directory. +

-
-

How do I define an abbrev key containing characters not supported by the filesystem?

-
-
Note: This question applies if you're still defining snippets
-
whose key is the filename. This is behavior stil provided by -version 0.6 for backward compatibilty, but is somewhat deprecated...
-
-

For example, you want to define a snippet by the key < which is -not a valid character for filename on Windows. This means you can't -use the filename as a trigger key in this case.

-

You should rather use the # key: directive to specify the key of -the defined snippet explicitly and name your snippet with an arbitrary -valid filename, lt.yasnippet for example, using < for the -# key: directive:

-
#key: <
-#name: <...></...>
+
+
+ +
+

How do I define an abbrev key containing characters not supported by

+
+ +

the filesystem? +

+
    +
  • Note: This question applies if you're still defining snippets + whose key is the filename. This is behavior still provided by + version 0.6 for backward compatibilty, but is somewhat + deprecated… +
  • +
+ + +

+For example, you want to define a snippet by the key < which is not a +valid character for filename on Windows. This means you can't use the +filename as a trigger key in this case. +

+

+You should rather use the # key: directive to specify the key of the +defined snippet explicitly and name your snippet with an arbitrary valid +filename, lt.yasnippet for example, using < for the # key: +directive: +

+ + + +
# key: <
+# name: <...></...>
 # --
 <${1:div}>$0</$1>
-
+ +
-
-
-
-
-
- - +
+ +
+

Date: 2013-11-26T21:02-0500

+

Org version 7.9.3f with Emacs version 24

+Validate XHTML 1.0 +
diff --git a/index.html b/index.html index 57b24bc..af2cb08 100644 --- a/index.html +++ b/index.html @@ -1,201 +1,345 @@ - - - + + + - - -Yet Another Snippet extension - +Yet another snippet extension + + + + + + + + + + -
-
-
-
- -
-
-
-
-

- 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
  • -
  • Installation
      -
    • Install with yasnippet-bundle.el
    • -
    • Normal Install
    • +
      + UP + | + HOME +
      + +
      + +
      + +
      +

      Yet another snippet extension

      + + +
      +

      Table of Contents

      + -

      YASnippet is a template system for Emacs. It allows you to type an -abbreviation and automatically expand it into function -templates. Bundled language templates includes: C, C++, C#, Perl, -Python, Ruby, SQL, LaTeX, HTML, CSS and more.

      -

      The snippet syntax is inspired from TextMate's syntax, you can even -import -import most TextMate templates. YASnippet is a re-write of the -extension smart-snippet. Both are original creations of pluskid.

      -
      -

      Video Demo

      - - - - -

      Watch the demo at YouTube (download a higher -resolution version: yasnippet.avi).

      -
      -

      Installation

      -

      There are two archives you can download. To quickly tryout YASnippet, -download the simpler "bundle" version. If you plan to modify the -bundled templates and/or build your own, download the "normal" -package.

      -
      -

      Install with yasnippet-bundle.el

      -
        -
      1. Download the latest yasnippet-bundle-x.y.z.el.tgz and unpack it.
      2. -
      3. You'll get a file named yasnippet-bundle.el, put it under -~/.emacs.d/plugins/ (create the directory if not exists).
      4. -
      5. Open the file in Emacs, and type Alt+x eval-buffer.
      6. + +
        +

        Quick start

        +
        + + +

        + YASnippet is a template system for Emacs. It allows you to type an + abbreviation and automatically expand it into function templates. Bundled + language templates includes: C, C++, C#, Perl, Python, Ruby, SQL, LaTeX, HTML, + CSS and more. The snippet syntax is inspired from TextMate's syntax, you can + even import most TextMate snippets +

        +

        + YASnippet is an original creation of pluskid who also wrote its predecessor + smart-snippet. +

        + +
        + +
        +

        Watch a demo

        +
        + + +

        + On youtube. +

        +
        + +
        + +
        +

        Installation

        +
        + + +

        + Clone this repository somewhere +

        + + + +
        $ cd ~/.emacs.d/plugins
        +$ git clone https://github.com/capitaomorte/yasnippet
        +
        + + +

        + Add the following in your .emacs file: +

        + + + +
        (add-to-list 'load-path
        +              "~/.emacs.d/plugins/yasnippet")
        +(require 'yasnippet)
        +(yas-global-mode 1)
        +
        + + +

        + Add your own snippets to ~/.emacs.d/snippets by placing files there or + invoking yas-new-snippet. +

        +
        + +
        + +
        +

        Import textmate snippets (rails example)

        +
        + + +

        + YASnippet lets you use TextMate bundles directly: +

        + + + +
        $ cd ~/.emacs.d/plugins
        +$ git clone https://github.com/capitaomorte/yasnippet
        +$ cd yasnippet
        +$ git submodule init
        +$ git submodule update
        +$ gem install plist trollop
        +$ rake convert_bundles             # will convert ruby, rails and html bundles from drnic
        +
        + + +

        + Then, in your .emacs file +

        + + + +
        (add-to-list 'load-path
        +              "~/.emacs.d/plugins/yasnippet")
        +(require 'yasnippet)
        +(setq yas-snippet-dirs '("~/.emacs.d/snippets" "~/.emacs.d/extras/imported"))
        +(yas-global-mode 1)
        +
        + + +

        + Open some rails file (model, app, etc) and start using the textmate + snippets. Consider that this is a work-in-progress and many snippets/commands + might not work. Patches welcome! +

        +
        + +
        + +
        +

        Contributing snippets

        +
        + + +

        + Please do not ask me to add snippets to the default collection under + /snippets. This collection is considered frozen. By customizing + yas-snippet-dirs you can point yasnippet to good + snippet collections out there. +

        +

        + The extras/textmate-import.rb tool can import many actual Textmate + snippets. I'm focusing on developing it and the accompanying yas-setup.el + files that guide it with more difficult importations. The idea is to deprecate + /snippets and replace it with extras/imported. +

        +
        + +
        + +
        +

        Documentation

        +
        + + +

        + The documentation has been split into separate parts: +

        +
          +
        1. Organizing Snippets + Describes ways to organize your snippets in the hard disk. + +
        2. +
        3. Expanding Snippets + Describes how YASnippet chooses snippets for expansion at point. + +

          + Maybe, you'll want some snippets to be expanded in a particular mode, + or only under certain conditions, or be prompted using ido, etc… +

          +
        4. +
        5. Writing Snippets + Describes the YASnippet definition syntax, which is very close (but + not equivalent) to Textmate's. Includes a section about converting + TextMate snippets. + +
        6. +
        7. The YASnippet menu + Explains how to use the YASnippet menu to explore, learn and modify + snippets. + +
        8. +
        9. YASnippet Symbol Reference + An automatically generated listing of all YASnippet commands, + (customization) variables, and functions. +
        -

        That's it. Now open any one of your language file, you'll see a menu -YASnippet. you can pull the menu to insert a template. Or, you can -type the a trigger key then press TAB to expand it.

        -

        To have Emacs load YASnippet automatically when it starts, put the -following in your ~/.emacs file:

        -
        -
        (add-to-list 'load-path
        -              "~/.emacs.d/plugins")
        -(require 'yasnippet-bundle)
        -
        -
        -

        The youtube video -demonstrates this quick installation.

        + +
        -
        -

        Normal Install

        -

        To install YASnippet as a normal emacs package, download and unpack -the latest yasnippet-x.y.z.tar.bz2. You'll get a directory named -yasnippet-x.y.z, which you can put it in your -~/.emacs.d/plugins and add the following in your .emacs file:

        -
        -
        (add-to-list 'load-path
        -              "~/.emacs.d/plugins/yasnippet-x.y.z")
        -(require 'yasnippet) ;; not yasnippet-bundle
        -(yas/initialize)
        -(yas/load-directory "~/.emacs.d/plugins/yasnippet-x.y.z/snippets")
        -
        -
        -

        Please refer to the documentation for full customization, or use the -customization group.

        + +
        + +
        +

        Bugs, discussion, contributions, etc

        +
        + + +

        + If you think you've found a bug, please report it on the GitHub issue tracker + (please **do not** submit new issues to the old googlecode tracker). +

        +

        + If you run into problems using YASnippet, or have snippets to contribute, + post to the yasnippet forum. Thank you very much for using YASnippet! +

        -
        -

        How to use YASnippet

        -

        Since version 0.6, YASnippet contains more functionality. You don't -need to know all of it to use it successfully, but you it can improve -your snippeting experience.

        -

        Hence this section has been split into separate documents:

        -
          -
        1. Organizing Snippets
        2. -
        -
        -Describes ways to organize your snippets in the hard disk (or not -organize them at all and just use yasnippet-bundle.el.
        -
          -
        1. Expanding Snippets
        2. -
        -
        -

        Describes how YASnippet chooses snippets for expansion at point.

        -

        Maybe, you'll want some snippets to be expanded in a particular -mode, or only under certain conditions, or be prompted using -ido, etc...

        -
        -
          -
        1. Writing Snippets
        2. -
        -
        -Describes the YASnippet definition syntax, which is very close (but -not equivalent) to Textmate's. Includes a section about converting -TextMate snippets.
        -
          -
        1. The YASnippet menu
        2. -
        -
        -Explains how to use the YASnippet menu to explore, learn and modify -snippets.
        -
        -

        Bugs, Contribution and Support

        -
          -
        • If you find a bug, please report it at Issue List.
        • -
        • If you have problem using YASnippet, or have some new ideas, -including snippets, please post to the discussion group.
        • -
        -

        Thank you very much for using YASnippet!

        -
        -
        -
        -
      -
      -
      -
      - - + +
      +

      Date: 2013-11-26T21:02-0500

      +

      Org version 7.9.3f with Emacs version 24

      +Validate XHTML 1.0 +
      diff --git a/manual.html b/manual.html deleted file mode 100644 index af34928..0000000 --- a/manual.html +++ /dev/null @@ -1,1705 +0,0 @@ - - - - -Yet another snippet extension - - - - - - - - - - - - - - -
      - -
      - -
      -

      Yet another snippet extension

      - - - - - - - - -
      -

      1 Quick start

      -
      - - -

      - YASnippet is a template system for Emacs. It allows you to type an - abbreviation and automatically expand it into function templates. Bundled - language templates includes: C, C++, C#, Perl, Python, Ruby, SQL, LaTeX, HTML, - CSS and more. The snippet syntax is inspired from TextMate's syntax, you can - even import most TextMate snippets -

      -

      - YASnippet is an original creation of http://pluskid.lifegoo.org who also wrote its predecessor - http://code.google.com/p/smart-snippet. -

      - -
      - -
      -

      1.1 Watch a demo

      -
      - - -

      - On youtube. -

      -
      - -
      - -
      -

      1.2 Installation

      -
      - - -

      - Clone this repository somewhere -

      - - - -
      $ cd ~/.emacs.d/plugins
      -$ git clone https://github.com/capitaomorte/yasnippet
      -
      - - -

      - Add the following in your .emacs file: -

      - - - -
      (add-to-list 'load-path
      -              "~/.emacs.d/plugins/yasnippet")
      -(require 'yasnippet)
      -(yas-global-mode 1)
      -
      - - -

      - Add your own snippets to ~/.emacs.d/snippets by placing files there or - invoking yas-new-snippet. -

      -
      - -
      - -
      -

      1.3 Import textmate snippets (rails example)

      -
      - - -

      - YASnippet lets you use TextMate bundles directly: -

      - - - -
      $ cd ~/.emacs.d/plugins
      -$ git clone https://github.com/capitaomorte/yasnippet
      -$ cd yasnippet
      -$ git submodule init
      -$ git submodule update
      -$ gem install plist trollop
      -$ rake convert_bundles             # will convert ruby, rails and html bundles from drnic
      -
      - - -

      - Then, in your .emacs file -

      - - - -
      (add-to-list 'load-path
      -              "~/.emacs.d/plugins/yasnippet")
      -(require 'yasnippet)
      -(setq yas-snippet-dirs '("~/.emacs.d/snippets" "~/.emacs.d/extras/imported"))
      -(yas-global-mode 1)
      -
      - - -

      - Open some rails file (model, app, etc) and start using the textmate - snippets. Consider that this is a work-in-progress and many snippets/commands - might not work. Patches welcome! -

      -
      - -
      - -
      -

      1.4 Contributing snippets

      -
      - - -

      - Please do not ask me to add snippets to the default collection under - /snippets. This collection is considered frozen. By customizing - yas-snippet-dirs you can point yasnippet to good - snippet collections out there. -

      -

      - The extras/textmate-import.rb tool can import many actual Textmate - snippets. I'm focusing on developing it and the accompanying yas-setup.el - files that guide it with more difficult importations. The idea is to deprecate - /snippets and replace it with extras/imported. -

      -
      - -
      - -
      -

      1.5 Documentation, issues, etc

      -
      - - -

      - Please refer to the comprehensive documentation for full - customization and support. If you think you've found a bug, please report it - on the GitHub issue tracker. (please **do not** submit new - issues to the old googlecode tracker) -

      -

      - If you run into problems using YASnippet, or have snippets to contribute, - post to the yasnippet forum. Thank you very much for using - YASnippet! -

      -
      -
      - -
      - -
      -

      2 Organizing snippets

      -
      - - - -
      - -
      -

      2.1 Basic structure

      -
      - - -

      - Snippet collections can be stored in plain text files. They are arranged by - sub-directories naming snippet tables. These mostly name Emacs major names. -

      - - - -
      .
      -|-- c-mode
      -|   `-- printf
      -|-- java-mode
      -|   `-- println
      -`-- text-mode
      -    |-- email
      -    `-- time
      -
      - - -

      - The collections are loaded into snippet tables which the triggering - mechanism (see Expanding snippets) looks up and - (hopefully) cause the right snippet to be expanded for you. -

      -
      - -
      - -
      -

      2.2 Setting up yas-snippet-dirs

      -
      - - -

      - The emacs variable yas-snippet-dirs tells YASnippet - which collections to consider. It's used when you activate - yas-global-mode or call - yas-reload-all interactively. -

      -

      - The default considers: -

      -
        -
      • a personal collection that lives in ~/.emacs.d/snippets -
      • -
      • the bundled collection, taken as a relative path to yasnippet.el localtion -
      • -
      - - -

      - When you come across other snippet collections, do the following to try them - out: -

      - - - -
      ;; Develop in ~/emacs.d/mysnippets, but also
      -;; try out snippets in ~/Downloads/interesting-snippets
      -(setq yas-snippet-dirs '("~/emacs.d/mysnippets"
      -                           "~/Downloads/interesting-snippets"))
      -
      -;; OR, keeping yasnippet's defaults try out ~/Downloads/interesting-snippets
      -(setq yas-snippet-dirs (append yas-snippet-dirs
      -                               '("~/Downloads/interesting-snippets")))
      -
      - - -

      - Collections appearing earlier in the list shadow snippets with same names - appearing in collections later in the list. yas-new-snippet always stores - snippets in the first collection. -

      -
      - -
      - -
      -

      2.3 The .yas-parents file

      -
      - - -

      - It's very useful to have certain modes share snippets between themselves. To do - this, choose a mode subdirectory and place a .yas-parents containing a - whitespace-separated list of other mode names. When you reload those modes - become parents of the original mode. -

      - - - -
      .
      -|-- c-mode
      -|   |-- .yas-parents    # contains "cc-mode text-mode"
      -|   `-- printf
      -|-- cc-mode
      -|   |-- for
      -|   `-- while
      -|-- java-mode
      -|   |-- .yas-parents    # contains "cc-mode text-mode"
      -|   `-- println
      -`-- text-mode
      -    |-- email
      -    `-- time
      -
      - - -
      - -
      - -
      -

      2.4 TODO The .yas-make-groups file

      -
      - - -

      - If you place an empty plain text file .yas-make-groups inside one of the - mode directories, the names of these sub-directories are considered groups of - snippets and the menu is organized much more cleanly: -

      -

      - (TODO image) -

      -

      - Another alternative way to achieve this is to place a # group: directive - inside the snippet definition. See Writing Snippets -

      - - - -
      $ tree ruby-mode/
      -ruby-mode/
      -|-- .yas-make-groups
      -|-- collections
      -|   |-- each
      -|   `-- ...
      -|-- control structure
      -|   |-- forin
      -|   `-- ...
      -|-- definitions
      -|   `-- ...
      -`-- general
      -   `-- ...
      -
      - - -

      - Yet another way to create a nice snippet menu is to write into - .yas-make-groups a menu definition. TODO -

      -
      - -
      - -
      -

      2.5 TODO The .yas-setup.el file

      -
      - - - -
      - -
      -

      2.5.1 TODO

      -
      - - -
      -
      - -
      - -
      -

      2.6 TODO The .yas-compiled-snippet.el file

      -
      - - - -
      - -
      -

      2.6.1 TODO

      -
      - - -
      -
      - -
      - -
      -

      2.7 The .yas-skip file

      -
      - - -
      -
      - -
      - -
      -

      3 Expanding Snippets

      -
      - - - -

      - This section describes how YASnippet chooses snippets for expansion at point. -

      -

      - Maybe, you'll want some snippets to be expanded in a particular - mode, or only under certain conditions, or be prompted using -

      - -
      - -
      -

      3.1 Triggering expansion

      -
      - - -

      - To make a snippet expand after the cursor: -

      -
        -
      • Type the snippet's trigger key then calling yas-expand. It's bound to - TAB and <tab> by default, to change it use -
      • -
      - - - - - -
      (define-key yas-minor-mode-map (kbd "<tab>") nil)
      -(define-key yas-minor-mode-map (kbd "TAB") nil)
      -(define-key yas-minor-mode-map (kbd "<the new key>") 'yas-expand)
      -
      - - -
        -
      • Use the snippet's keybinding. - -
      • -
      • Call yas-insert-snippet (use M-x yas-insert-snippet= or its keybinding C-c & C-s). - -
      • -
      • By expanding directly from the "YASnippet" menu in the menu-bar - -
      • -
      • Using hippie-expand - -
      • -
      • Use m2m's excellent auto-complete -
      • -
      - - -
      -
      - -
      - -
      -

      4 Reference

      -
      - - - - - -
      - -
      -

      4.1 Interactive functions

      -
      - - -
      - -
      -

      4.1.1 yas-skip-and-clear-or-delete-char (&optional field)

      -
      - -

      /WARNING/: no doc for symbol yas-skip-and-clear-or-delete-char -

      -
      - -
      - -
      -

      4.1.2 yas-exit-all-snippets ()

      -
      - -

      /WARNING/: no doc for symbol yas-exit-all-snippets -

      -
      - -
      - -
      -

      4.1.3 yas-exit-snippet (snippet)

      -
      - -

      /WARNING/: no doc for symbol yas-exit-snippet -

      -
      - -
      - -
      -

      4.1.4 yas-abort-snippet (&optional snippet)

      -
      - -

      /WARNING/: no doc for symbol yas-abort-snippet -

      -
      - -
      - -
      -

      4.1.5 yas-prev-field ()

      -
      - -

      /WARNING/: no doc for symbol yas-prev-field -

      -
      - -
      - -
      -

      4.1.6 yas-next-field (&optional arg)

      -
      - -

      /WARNING/: no doc for symbol yas-next-field -

      -
      - -
      - -
      -

      4.1.7 yas-next-field-or-maybe-expand ()

      -
      - -

      /WARNING/: no doc for symbol yas-next-field-or-maybe-expand -

      -
      - -
      - -
      -

      4.1.8 yas-describe-tables (&optional choose)

      -
      - -

      /WARNING/: no doc for symbol yas-describe-tables -

      -
      - -
      - -
      -

      4.1.9 yas-tryout-snippet (&optional debug)

      -
      - -

      /WARNING/: no doc for symbol yas-tryout-snippet -

      -
      - -
      - -
      -

      4.1.10 yas-load-snippet-buffer (table &optional interactive)

      -
      - -

      /WARNING/: no doc for symbol yas-load-snippet-buffer -

      -
      - -
      - -
      -

      4.1.11 yas-new-snippet (&optional no-template)

      -
      - -

      /WARNING/: no doc for symbol yas-new-snippet -

      -
      - -
      - -
      -

      4.1.12 yas-visit-snippet-file ()

      -
      - -

      /WARNING/: no doc for symbol yas-visit-snippet-file -

      -
      - -
      - -
      -

      4.1.13 yas-insert-snippet (&optional no-condition)

      -
      - -

      /WARNING/: no doc for symbol yas-insert-snippet -

      -
      - -
      - -
      -

      4.1.14 yas-expand-from-keymap ()

      -
      - -

      Expand/run snippets from keymaps, possibly falling back to original binding. -

      - -
      - -
      - -
      -

      4.1.15 yas-expand-from-trigger-key (&optional field)

      -
      - -

      /WARNING/: no doc for symbol yas-expand-from-trigger-key -

      -
      - -
      - -
      -

      4.1.16 yas-about ()

      -
      - -

      /WARNING/: no doc for symbol yas-about -

      -
      - -
      - -
      -

      4.1.17 yas-recompile-all ()

      -
      - -

      /WARNING/: no doc for symbol yas-recompile-all -

      -
      - -
      - -
      -

      4.1.18 yas-compile-directory (top-level-dir)

      -
      - -

      /WARNING/: no doc for symbol yas-compile-directory -

      -
      - -
      - -
      -

      4.1.19 yas-reload-all (&optional interactive)

      -
      - -

      /WARNING/: no doc for symbol yas-reload-all -

      -
      - -
      - -
      -

      4.1.20 yas-load-directory (top-level-dir &optional use-jit interactive)

      -
      - -

      /WARNING/: no doc for symbol yas-load-directory -

      -
      - -
      - -
      -

      4.1.21 yas-minor-mode-on ()

      -
      - -

      /WARNING/: no doc for symbol yas-minor-mode-on -

      -
      - -
      - -
      -

      4.1.22 yas-direct-keymaps-reload ()

      -
      - -

      /WARNING/: no doc for symbol yas-direct-keymaps-reload -

      -
      - -
      - -
      -

      4.1.23 yas-global-mode (&optional arg)

      -
      - -

      Non-nil if Yas-Global mode is enabled. -See the command yas-global-mode for a description of this minor mode. -Setting this variable directly does not take effect; -either customize it (see the info node `Easy Customization') -or call the function yas-global-mode. -

      -
      - -
      - -
      -

      4.1.24 yas-minor-mode (&optional arg)

      -
      - -

      Non-nil if yas minor mode is enabled. -Use the command yas-minor-mode to change this variable. -

      -
      - -
      - -
      -

      4.1.25 yas-expand (&optional field)

      -
      - -

      Expand a snippet before point. If no snippet -expansion is possible, call command org-self-insert-command. -

      -

      -Optional argument FIELD is for non-interactive use and is an -object satisfying yas–field-p to restrict the expansion to. -

      -
      - -
      - -
      -

      4.2 Customization variables

      -
      - - -
      - -
      -

      4.2.1 yas-expand-only-for-last-commands

      -
      - - -

      -List of last-command values to restrict tab-triggering to, or nil. -

      -

      -Leave this set at nil (the default) to be able to trigger an -expansion simply by placing the cursor after a valid tab trigger, -using whichever commands. -

      -

      -Optionally, set this to something like '(self-insert-command) if -you to wish restrict expansion to only happen when the last -letter of the snippet tab trigger was typed immediately before -the trigger key itself. -

      -
      - -
      - -
      -

      4.2.2 yas-visit-from-menu

      -
      - - -

      -If non-nil visit snippets's files from menu, instead of expanding them. -

      -

      -This can only work when snippets are loaded from files. -

      -
      - -
      - -
      -

      4.2.3 yas-good-grace

      -
      - - -

      -If non-nil, don't raise errors in inline elisp evaluation. -

      -

      -An error string "[yas] error" is returned instead. -

      -
      - -
      - -
      -

      4.2.4 yas-wrap-around-region

      -
      - - -

      -If non-nil, snippet expansion wraps around selected region. -

      -

      -The wrapping occurs just before the snippet's exit marker. This -can be overridden on a per-snippet basis. -

      -
      - -
      - -
      -

      4.2.5 yas-trigger-symbol

      -
      - - -

      -The text that will be used in menu to represent the trigger. -

      -
      - -
      - -
      -

      4.2.6 yas-use-menu

      -
      - - -

      -Display a /YAS/nippet menu in the menu bar. -

      -

      -When non-nil, submenus for each snippet table will be listed -under the menu "Yasnippet". -

      -
        -
      • If set to abbreviate, only the current major-mode -
      • -
      - -

      menu and the modes set in yas-extra-modes are listed. -

      -
        -
      • If set to full, every submenu is listed - -
      • -
      • It set to nil, don't display a menu at all (this requires a - yas-reload-all call if the menu is already visible). -
      • -
      - - -

      -Any other non-nil value, every submenu is listed. -

      -
      - -
      - -
      -

      4.2.7 yas-choose-tables-first

      -
      - - -

      -If non-nil, and multiple eligible snippet tables, prompts user for tables first. -

      -

      -Otherwise, user chooses between the merging together of all -eligible tables. -

      -

      -This affects yas-insert-snippet, yas-visit-snippet-file -

      -
      - -
      - -
      -

      4.2.8 yas-choose-keys-first

      -
      - - -

      -If non-nil, prompt for snippet key first, then for template. -

      -

      -Otherwise prompts for all possible snippet names. -

      -

      -This affects yas-insert-snippet and yas-visit-snippet-file. -

      -
      - -
      - -
      -

      4.2.9 yas-fallback-behavior

      -
      - - -

      -How to act when yas-expand does not expand a snippet. -

      -
        -
      • call-other-command means try to temporarily disable /YAS/nippet - and call the next command bound to whatever key was used to - invoke yas-expand. - -
      • -
      • nil or the symbol return-nil mean do nothing. (and - yas-expand returns nil) - -
      • -
      • A Lisp form (apply COMMAND . ARGS) means interactively call - COMMAND, if ARGS is non-nil, call COMMAND non-interactively - with ARGS as arguments. -
      • -
      - - -
      - -
      - -
      -

      4.2.10 yas-triggers-in-field

      -
      - - -

      -If non-nil, allow stacked expansions (snippets inside snippets). -

      -

      -Otherwise yas-next-field-or-maybe-expand just moves on to the -next field -

      -
      - -
      - -
      -

      4.2.11 yas-snippet-revival

      -
      - - -

      -Non-nil means re-activate snippet fields after undo/redo. -

      -
      - -
      - -
      -

      4.2.12 yas-also-auto-indent-first-line

      -
      - - -

      -Non-nil means also auto indent first line according to mode. -

      -

      -Naturally this is only valid when yas-indent-line is auto -

      -
      - -
      - -
      -

      4.2.13 yas-indent-line

      -
      - - -

      -Controls indenting applied to a recent snippet expansion. -

      -

      -The following values are possible: -

      -
        -
      • fixed Indent the snippet to the current column; - -
      • -
      • auto Indent each line of the snippet with indent-according-to-mode -
      • -
      - - -

      -Every other value means don't apply any snippet-side indentation -after expansion (the manual per-line "$>" indentation still -applies). -

      -
      - -
      - -
      -

      4.2.14 yas-prompt-functions

      -
      - - -

      -Functions to prompt for keys, templates, etc interactively. -

      -

      -These functions are called with the following arguments: -

      -
        -
      • PROMPT: A string to prompt the user - -
      • -
      • CHOICES: a list of strings or objects. - -
      • -
      • optional DISPLAY-FN : A function that, when applied to each of -
      • -
      - -

      the objects in CHOICES will return a string. -

      -

      -The return value of any function you put here should be one of -the objects in CHOICES, properly formatted with DISPLAY-FN (if -that is passed). -

      -
        -
      • To signal that your particular style of prompting is -
      • -
      - -

      unavailable at the moment, you can also have the function return -nil. -

      -
        -
      • To signal that the user quit the prompting process, you can -
      • -
      - -

      signal quit with -

      -

      - (signal 'quit "user quit!"). -

      -
      - -
      - -
      -

      4.2.15 yas-snippet-dirs ()

      -
      - -

      Directory or list of snippet dirs for each major mode. -

      -

      -The directory where user-created snippets are to be stored. Can -also be a list of directories. In that case, when used for -bulk (re)loading of snippets (at startup or via -yas-reload-all), directories appearing earlier in the list -shadow other dir's snippets. Also, the first directory is taken -as the default for storing the user's new snippets. -

      -
      - -
      - -
      -

      4.3 Useful functions

      -
      - - -
      - -
      -

      4.3.1 yas-active-keys ()

      -
      - -

      /WARNING/: no doc for symbol yas-active-keys -

      -
      - -
      - -
      -

      4.3.2 yas-hippie-try-expand (first-time?)

      -
      - -

      /WARNING/: no doc for symbol yas-hippie-try-expand -

      -
      - -
      - -
      -

      4.3.3 yas-define-condition-cache (func doc &rest body)

      -
      - -

      /WARNING/: no doc for symbol yas-define-condition-cache -

      -
      - -
      - -
      -

      4.3.4 yas-unimplemented (&optional missing-feature)

      -
      - -

      /WARNING/: no doc for symbol yas-unimplemented -

      -
      - -
      - -
      -

      4.3.5 yas-inside-string ()

      -
      - -

      /WARNING/: no doc for symbol yas-inside-string -

      -
      - -
      - -
      -

      4.3.6 yas-default-from-field (number)

      -
      - -

      /WARNING/: no doc for symbol yas-default-from-field -

      -
      - -
      - -
      -

      4.3.7 yas-selected-text ()

      -
      - -

      The selected region deleted on the last snippet expansion. -

      -
      - -
      - -
      -

      4.3.8 yas-text ()

      -
      - -

      Contains current field text. -

      -
      - -
      - -
      -

      4.3.9 yas-field-value (number)

      -
      - -

      /WARNING/: no doc for symbol yas-field-value -

      -
      - -
      - -
      -

      4.3.10 yas-verify-value (possibilities)

      -
      - -

      /WARNING/: no doc for symbol yas-verify-value -

      -
      - -
      - -
      -

      4.3.11 yas-throw (text)

      -
      - -

      /WARNING/: no doc for symbol yas-throw -

      -
      - -
      - -
      -

      4.3.12 yas-key-to-value (alist)

      -
      - -

      /WARNING/: no doc for symbol yas-key-to-value -

      -
      - -
      - -
      -

      4.3.13 yas-choose-value (&rest possibilities)

      -
      - -

      /WARNING/: no doc for symbol yas-choose-value -

      -
      - -
      - -
      -

      4.3.14 yas-substr (str pattern &optional subexp)

      -
      - -

      /WARNING/: no doc for symbol yas-substr -

      -
      - -
      - -
      -

      4.3.15 yas-text ()

      -
      - -

      Contains current field text. -

      -
      - -
      - -
      -

      4.3.16 yas-define-menu (mode menu &optional omit-items)

      -
      - -

      /WARNING/: no doc for symbol yas-define-menu -

      -
      - -
      - -
      -

      4.3.17 yas-define-snippets (mode snippets)

      -
      - -

      /WARNING/: no doc for symbol yas-define-snippets -

      -
      - -
      - -
      -

      4.3.18 yas-expand-snippet (content &optional start end expand-env)

      -
      - -

      /WARNING/: no doc for symbol yas-expand-snippet -

      -
      - -
      - -
      -

      4.3.19 yas-dropdown-prompt (prompt choices &optional display-fn)

      -
      - -

      /WARNING/: no doc for symbol yas-dropdown-prompt -

      -
      - -
      - -
      -

      4.3.20 yas-completing-prompt (prompt choices &optional display-fn completion-fn)

      -
      - -

      /WARNING/: no doc for symbol yas-completing-prompt -

      -
      - -
      - -
      -

      4.3.21 yas-no-prompt (prompt choices &optional display-fn)

      -
      - -

      /WARNING/: no doc for symbol yas-no-prompt -

      -
      - -
      - -
      -

      4.3.22 yas-ido-prompt (prompt choices &optional display-fn)

      -
      - -

      /WARNING/: no doc for symbol yas-ido-prompt -

      -
      - -
      - -
      -

      4.3.23 yas-x-prompt (prompt choices &optional display-fn)

      -
      - -

      /WARNING/: no doc for symbol yas-x-prompt -

      -
      - -
      - -
      -

      4.4 Useful variables

      -
      - - -
      - -
      -

      4.4.1 yas-moving-away-p

      -
      - - -

      -Non-nil if user is about to exit field. -

      -
      - -
      - -
      -

      4.4.2 yas-modified-p

      -
      - - -

      -Non-nil if field has been modified by user or transformation. -

      -
      - -
      - -
      -

      4.4.3 yas-snippet-end

      -
      - - -

      -End position of the last snippet committed. -

      -
      - -
      - -
      -

      4.4.4 yas-snippet-beg

      -
      - - -

      -Beginning position of the last snippet committed. -

      -
      - -
      - -
      -

      4.4.5 yas-dont-activate

      -
      - - -

      -If non-nil don't let yas-global-mode affect some buffers. -

      -

      -If a function of zero arguments, then its result is used. -

      -

      -If a list of functions, then all functions must return nil to -activate yas for this buffer. -

      -

      -In Emacsen <= 23, this variable is buffer-local. Because -yas-minor-mode-on is called by yas-global-mode after -executing the buffer's major mode hook, setting this variable -there is an effective way to define exceptions to the "global" -activation behaviour. -

      -

      -In Emacsen > 23, only the global value is used. To define -per-mode exceptions to the "global" activation behaviour, call -yas-minor-mode with a negative argument directily in the major -mode's hook. -

      -
      - -
      - -
      -

      4.4.6 yas-buffer-local-condition

      -
      - - -

      -Snippet expanding condition. -

      -

      -This variable is a Lisp form which is evaluated every time a -snippet expansion is attempted: -

      -
        -
      • If it evaluates to nil, no snippets can be expanded. - -
      • -
      • If it evaluates to the a cons (require-snippet-condition - . REQUIREMENT) - -
          -
        • Snippets bearing no "# condition:" directive are not - considered - -
        • -
        • Snippets bearing conditions that evaluate to nil (or - produce an error) won't be considered. - -
        • -
        • If the snippet has a condition that evaluates to non-nil - RESULT: - -
            -
          • If REQUIREMENT is t, the snippet is considered - -
          • -
          • If REQUIREMENT is eq RESULT, the snippet is - considered - -
          • -
          • Otherwise, the snippet is not considered. - -
          • -
          - -
        • -
        - -
      • -
      • If it evaluates to the symbol 'always, all snippets are - considered for expansion, regardless of any conditions. - -
      • -
      • If it evaluates to t or some other non-nil value - -
          -
        • Snippet bearing no conditions, or conditions that - evaluate to non-nil, are considered for expansion. - -
        • -
        • Otherwise, the snippet is not considered. -
        • -
        - -
      • -
      - - -

      -Here's an example preventing snippets from being expanded from -inside comments, in python-mode only, with the exception of -snippets returning the symbol 'force-in-comment in their -conditions. -

      -

      - (add-hook 'python-mode-hook - '(lambda () - (setq yas-buffer-local-condition - '(if (python-in-string/comment) - '(require-snippet-condition . force-in-comment) - t)))) -

      -

      -The default value is similar, it filters out potential snippet -expansions inside comments and string literals, unless the -snippet itself contains a condition that returns the symbol -force-in-comment. -

      -
      - -
      - -
      -

      4.4.7 yas-before-expand-snippet-hook

      -
      - - -

      -Hooks to run just before expanding a snippet. -

      -
      - -
      - -
      -

      4.4.8 yas-after-exit-snippet-hook

      -
      - - -

      -Hooks to run after a snippet exited. -

      -

      -The hooks will be run in an environment where some variables bound to -proper values: -

      -

      -yas-snippet-beg : The beginning of the region of the snippet. -

      -

      -yas-snippet-end : Similar to beg. -

      -

      -Attention: These hooks are not run when exiting nested/stacked snippet expansion! -

      -
      - -
      - -
      -

      4.4.9 yas-key-syntaxes

      -
      - - -

      -List of character syntaxes used to find a trigger key before point. -The list is tried in the order while scanning characters -backwards from point. For example, if the list is '("w" "w_") -first look for trigger keys which are composed exclusively of -"word"-syntax characters, and then, if that fails, look for -keys which are either of "word" or "symbol" -syntax. Triggering after -

      -

      -foo-bar -

      -

      -will, according to the "w" element first try "bar". If that -isn't a trigger key, "foo-bar" is tried, respecting a second -"w_" element. -

      -
      - -
      - -
      -

      4.4.10 yas-extra-modes

      -
      - - -

      -A list of modes for which to also lookup snippets. -

      -

      -This variable probably makes more sense as buffer-local, so -ensure your use make-local-variable when you set it. -

      -
      - -
      - -
      -

      4.4.11 yas-verbosity

      -
      - - -

      -Log level for yas–message 4 means trace most anything, 0 means nothing. -

      -
      - -
      - -
      -

      4.4.12 yas-keymap

      -
      - - -

      -The active keymap while a snippet expansion is in progress. -

      -
      -
      -
      -
      -
      - -
      -

      Date: 2013-11-24T12:11-0500

      -

      Author: Noam Postavsky

      -

      Org version 7.9.3f with Emacs version 24

      -Validate XHTML 1.0 - -
      - - diff --git a/snippet-development.html b/snippet-development.html index b61da91..86a30f8 100644 --- a/snippet-development.html +++ b/snippet-development.html @@ -1,224 +1,399 @@ - - - + + + - - Writing snippets - + + + + + + + + + + -
      -
      -
      -
      - -
      -
      -
      -
      -

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

      -
      -

      Contents

      - +
      + UP + | + HOME
      -
      -

      Snippet development

      -
      -

      Quickly finding snippets

      -

      There are some ways you can quickly find a snippet file:

      + +
      + +
      + +
      +

      Writing snippets

      + + + +
      +

      Table of Contents

      +
        -
      • M-x yas/new-snippet

        -

        Prompts you for a snippet name, then tries to guess a suitable -directory to store it, prompting you for creation if it does not -exist. Finally, places you in a new buffer set to snippet-mode -so you can write your snippet.

        -
      • -
      • M-x yas/find-snippets

        -

        Lets you find the snippet file in the directory the snippet was -loaded from (if it exists) like find-file-other-window. The -directory searching logic is similar to M-x yas/new-snippet.

        -
      • -
      • M-x yas/visit-snippet-file

        -

        Prompts you for possible snippet expansions like -yas/insert-snippet, but instead of expanding it, takes you -directly to the snippet definition's file, if it exists.

        -
      • -
      -

      Once you find this file it will be set to snippet-mode (see ahead) -and you can start editing your snippet.

      -
      -
      -

      Using the snippet-mode major mode

      -

      There is a major mode snippet-mode to edit snippets. You can set -the buffer to this mode with M-x snippet-mode. It provides -reasonably useful syntax highlighting.

      -

      Two commands are defined in this mode:

      +
    • Snippet development
        -
      • M-x yas/load-snippet-buffer

        -
        -

        When editing a snippet, this loads the snippet into the correct -mode and menu. Bound to C-c C-c by default while in -snippet-mode.

        -
        -
      • -
      • M-x yas/tryout-snippet

        -
        -

        When editing a snippet, this opens a new empty buffer, sets it to -the appropriate major mode and inserts the snippet there, so you -can see what it looks like. This is bound to C-c C-t while in -snippet-mode.

        -
        -
      • +
      • Quickly finding snippets
      • +
      • Using the snippet-mode major mode
      • +
      +
    • +
    • File content + +
    • +
    • Template syntax + +
    • +
    • Importing TextMate snippets
    -

    There are also snippets for writing snippets: vars, $f and -$m :-).

-
-

File content

-

A file defining a snippet generally contains the template to be -expanded.

-

Optionally, if the file contains a line of # --, the lines above -it count as comments, some of which can be directives (or meta -data). Snippet directives look like # property: value and tweak -certain snippets properties described below. If no # -- is found, -the whole file is considered the snippet template.

-

Here's a typical example:

-
#contributor : pluskid <pluskid@gmail.com>
-#name : __...__
+
+
+

Snippet development

+
+ + + +
+ +
+

Quickly finding snippets

+
+ + +

+There are some ways you can quickly find a snippet file: +

+
    +
  • M-x yas-new-snippet + +

    + Prompts you for a snippet name, then tries to guess a suitable + directory to store it, prompting you for creation if it does not + exist. Finally, places you in a new buffer set to snippet-mode so + you can write your snippet. +

    +
  • +
  • M-x yas-find-snippets + +

    + Lets you find the snippet file in the directory the snippet was + loaded from (if it exists) like find-file-other-window. The + directory searching logic is similar to M-x yas-new-snippet. +

    +
  • +
  • M-x yas-visit-snippet-file + +

    + Prompts you for possible snippet expansions like + yas-insert-snippet, but instead of expanding it, takes you directly + to the snippet definition's file, if it exists. +

  • +
+ + +

+Once you find this file it will be set to snippet-mode (see ahead) and +you can start editing your snippet. +

+
+ +
+ +
+

Using the snippet-mode major mode

+
+ + +

+There is a major mode snippet-mode to edit snippets. You can set the +buffer to this mode with M-x snippet-mode. It provides reasonably +useful syntax highlighting. +

+

+Two commands are defined in this mode: +

+
    +
  • M-x yas-load-snippet-buffer + +

    + When editing a snippet, this loads the snippet into the correct + mode and menu. Bound to C-c C-c by default while in + snippet-mode. +

    +
  • +
  • M-x yas-tryout-snippet + +

    + When editing a snippet, this opens a new empty buffer, sets it to + the appropriate major mode and inserts the snippet there, so you + can see what it looks like. This is bound to C-c C-t while in + snippet-mode. +

  • +
+ + +

+There are also snippets for writing snippets: vars, $f and $m +:-). +

+
+
+ +
+ +
+

File content

+
+ + +

+A file defining a snippet generally contains the template to be +expanded. +

+

+Optionally, if the file contains a line of # --, the lines above it +count as comments, some of which can be directives (or meta data). +Snippet directives look like # property: value and tweak certain +snippets properties described below. If no # -- is found, the whole +file is considered the snippet template. +

+

+Here's a typical example: +

+ + + +
# contributor: pluskid <pluskid@gmail.com>
+# name: __...__
 # --
 __${init}__
-
-

Here's a list of currently supported directives:

-
-

# key: snippet abbrev

-

This is the probably the most important directive, it's the abbreviation you -type to expand a snippet just before hitting yas/trigger-key. If you don't -specify this the snippet will not be expandable through the key mechanism.

+
+ + +

+Here's a list of currently supported directives: +

+
-
-

# name: snippet name

-

This is a one-line description of the snippet. It will be displayed in -the menu. It's a good idea to select a descriptive name for a -snippet -- especially distinguishable among similar snippets.

-

If you omit this name it will default to the file name the snippet was -loaded from.

+ +
+

# key: snippet abbrev

+
+ + +

+This is the probably the most important directive, it's the abbreviation +you type to expand a snippet just before hitting yas-trigger-key. If +you don't specify this the snippet will not be expandable through the +key mechanism. +

-
-

# condition: snippet condition

-

This is a piece of Emacs-lisp code. If a snippet has a condition, then it -will only be expanded when the condition code evaluate to some non-nil -value.

-

See also yas/buffer-local-condition in Expanding snippets

+
-
-

# group: snippet menu grouping

-

When expanding/visiting snippets from the menu-bar menu, snippets for a -given mode can be grouped into sub-menus . This is useful if one has -too many snippets for a mode which will make the menu too -long.

-

The # group: property only affect menu construction (See the -YASnippet menu) and the same effect can be achieved by grouping -snippets into sub-directories and using the .yas-make-groups -special file (for this see Organizing Snippets

-

Refer to the bundled snippets for ruby-mode for examples on the -# group: directive. Group can also be nested, e.g. control -structure.loops tells that the snippet is under the loops group -which is under the control structure group.

+ +
+

# name: snippet name

+
+ + +

+This is a one-line description of the snippet. It will be displayed in +the menu. It's a good idea to select a descriptive name for a snippet -- +especially distinguishable among similar snippets. +

+

+If you omit this name it will default to the file name the snippet was +loaded from. +

-
-

# expand-env: expand environment

-

This is another piece of Emacs-lisp code in the form of a let -varlist form, i.e. a list of lists assigning values to variables. It -can be used to override variable values while the snippet is being -expanded.

-

Interesting variables to override are yas/wrap-around-region and -yas/indent-line (see Expanding Snippets).

-

As an example, you might normally have yas/indent-line set to -'auto and yas/wrap-around-region set to t, but for this -particularly brilliant piece of ASCII art these values would mess up -your hard work. You can then use:

-
# name : ASCII home
-# expand-env: ((yas/indent-line 'fixed) (yas/wrap-around-region 'nil))
+
+
+ +
+

# condition: snippet condition

+
+ + +

+This is a piece of Emacs-lisp code. If a snippet has a condition, then +it will only be expanded when the condition code evaluate to some +non-nil value. +

+

+See also yas-buffer-local-condition in +Expanding snippets +

+
+ +
+ +
+

# group: snippet menu grouping

+
+ + +

+When expanding/visiting snippets from the menu-bar menu, snippets for a +given mode can be grouped into sub-menus . This is useful if one has too +many snippets for a mode which will make the menu too long. +

+

+The # group: property only affect menu construction (See +the YASnippet menu) and the same effect can be +achieved by grouping snippets into sub-directories and using the +.yas-make-groups special file (for this see +Organizing Snippets +

+

+Refer to the bundled snippets for ruby-mode for examples on the +# group: directive. Group can also be nested, e.g. +control structure.loops tells that the snippet is under the loops +group which is under the control structure group. +

+
+ +
+ +
+

# expand-env: expand environment

+
+ + +

+This is another piece of Emacs-lisp code in the form of a let varlist form, i.e. a list of lists assigning values to variables. It can be +used to override variable values while the snippet is being expanded. +

+

+Interesting variables to override are yas-wrap-around-region and +yas-indent-line (see Expanding Snippets). +

+

+As an example, you might normally have yas-indent-line set to 'auto +and yas-wrap-around-region set to t, but for this particularly +brilliant piece of ASCII art these values would mess up your hard work. +You can then use: +

+ + + +
# name: ASCII home
+# expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region 'nil))
 # --
                 welcome to my
             X      humble
@@ -230,120 +405,237 @@ your hard work. You can then use:

| +-+ | | | | | +--+-+--+ -
+ + +
-
-

# binding: direct keybinding

-

You can use this directive to expand a snippet directly from a normal -Emacs keybinding. The keybinding will be registered in the Emacs -keymap named after the major mode the snippet is active -for.

-

Additionally a variable yas/prefix is set to to the prefix -argument you normally use for a command. This allows for small -variations on the same snippet, for example in this "html-mode" -snippet.

-
#name : <p>...</p>
-#binding: C-c C-c C-m
+
+
+ +
+

# binding: direct keybinding

+
+ + +

+You can use this directive to expand a snippet directly from a normal +Emacs keybinding. The keybinding will be registered in the Emacs keymap +named after the major mode the snippet is active for. +

+

+Additionally a variable yas-prefix is set to to the prefix argument +you normally use for a command. This allows for small variations on the +same snippet, for example in this "html-mode" snippet. +

+ + + +
# name: <p>...</p>
+# binding: C-c C-c C-m
 # --
-<p>`(when yas/prefix "\n")`$0`(when yas/prefix "\n")`</p>
-
-

This binding will be recorded in the keymap -html-mode-map. To expand a paragraph tag newlines, just -press C-u C-c C-c C-m. Omitting the C-u will expand the -paragraph tag without newlines.

+<p>`(when yas-prefix "\n")`$0`(when yas-prefix "\n")`</p> + + + +

+This binding will be recorded in the keymap html-mode-map. To expand a +paragraph tag newlines, just press C-u C-c C-c C-m. Omitting the C-u +will expand the paragraph tag without newlines. +

-
-

# contributor: snippet author

-

This is optional and has no effect whatsoever on snippet -functionality, but it looks nice.

+ +
+ +
+

# contributor: snippet author

+
+ + +

+This is optional and has no effect whatsoever on snippet functionality, +but it looks nice. +

-
-

Template syntax

-

The syntax of the snippet template is simple but powerful, very -similar to TextMate's.

-
-

Plain Text

-

Arbitrary text can be included as the content of a template. They are -usually interpreted as plain text, except $ and `. You need to -use \ to escape them: \$ and \`. The \ itself may also -needed to be escaped as \\ sometimes.

+
-
-

Embedded Emacs-lisp code

-

Emacs-Lisp code can be embedded inside the template, written inside -back-quotes (`). The lisp forms are evaluated when the snippet is + +

+

Template syntax

+
+ + +

+The syntax of the snippet template is simple but powerful, very similar +to TextMate's. +

+ +
+ +
+

Plain Text

+
+ + +

+Arbitrary text can be included as the content of a template. They are +usually interpreted as plain text, except $ and ==. You need to +use \` to escape them: \$ and \. The \` itself may also needed to be +escaped as \\ sometimes. +

+
+ +
+ +
+

Embedded Emacs-lisp code

+
+ + +

+Emacs-Lisp code can be embedded inside the template, written inside +back-quotes (==). The lisp forms are evaluated when the snippet is being expanded. The evaluation is done in the same buffer as the -snippet being expanded.

-

Here's an example for c-mode to calculate the header file guard -dynamically:

-
#ifndef ${1:_`(upcase (file-name-nondirectory (file-name-sans-extension (buffer-file-name))))`_H_}
+snippet being expanded. 
+

+

+Here's an example for c-mode` to calculate the header file guard +dynamically: +

+ + + +
#ifndef ${1:_`(upcase (file-name-nondirectory (file-name-sans-extension (buffer-file-name))))`_H_}
 #define $1
 
 $0
 
 #endif /* $1 */
-
-

From version 0.6, snippets expansions are run with some special -Emacs-lisp variables bound. One of this is yas/selected-text. You -can therefore define a snippet like:

-
for ($1;$2;$3) {
-  `yas/selected-text`$0
+
+ + +

+From version 0.6, snippets expansions are run with some special +Emacs-lisp variables bound. One of this is yas-selected-text. You can +therefore define a snippet like: +

+ + + +
for ($1;$2;$3) {
+  `yas-selected-text`$0
 }
-
-

to "wrap" the selected region inside your recently inserted -snippet. Alternatively, you can also customize the variable -yas/wrap-around-region to t which will do this automatically.

+ + + +

+to "wrap" the selected region inside your recently inserted snippet. +Alternatively, you can also customize the variable +yas-wrap-around-region to t which will do this automatically. +

-
-

Tab stop fields

-

Tab stops are fields that you can navigate back and forth by TAB -and S-TAB. They are written by $ followed with a -number. $0 has the special meaning of the exit point of a -snippet. That is the last place to go when you've traveled all the -fields. Here's a typical example:

-
<div$1>
+
+
+ +
+

Tab stop fields

+
+ + +

+Tab stops are fields that you can navigate back and forth by TAB and +S-TAB. They are written by $ followed with a number. $0 has the +special meaning of the exit point of a snippet. That is the last place +to go when you've traveled all the fields. Here's a typical example: +

+ + + +
<div$1>
     $0
 </div>
-
+ +
-
-

Placeholder fields

-

Tab stops can have default values -- a.k.a placeholders. The syntax is -like this:

-
${N:default value}
-
-

They acts as the default value for a tab stop. But when you firstly -type at a tab stop, the default value will be replaced by your -typing. The number can be omitted if you don't want to create -mirrors or transformations for this field.

+
-
-

Mirrors

-

We refer the tab stops with placeholders as a field. A field can have + +

+

Placeholder fields

+
+ + +

+Tab stops can have default values – a.k.a placeholders. The syntax is +like this: +

+ + + +
${N:default value}
+
+ + +

+They acts as the default value for a tab stop. But when you firstly +type at a tab stop, the default value will be replaced by your typing. +The number can be omitted if you don't want to create mirrors or +transformations for this field. +

+
+ +
+ +
+

Mirrors

+
+ + +

+We refer the tab stops with placeholders as a field. A field can have mirrors. Its mirrors will get updated when you change the text of a -field. Here's an example:

-
\begin{${1:enumerate}}
+field. Here's an example:
+

+ + + +
\begin{${1:enumerate}}
     $0
 \end{$1}
-
-

When you type "document" at ${1:enumerate}, the word -"document" will also be inserted at \end{$1}. The best -explanation is to see the screencast(YouTube or avi video).

-

The tab stops with the same number to the field act as its mirrors. If -none of the tab stops has an initial value, the first one is selected -as the field and others mirrors.

+ + + +

+When you type "document" at ${1:enumerate}, the word "document" will +also be inserted at \end{$1}. The best explanation is to see the +screencast(YouTube or avi video). +

+

+The tab stops with the same number to the field act as its mirrors. If +none of the tab stops has an initial value, the first one is selected as +the field and others mirrors. +

-
-

Mirrors with transformations

-

If the value of an ${n:-construct starts with and contains $(, -then it is interpreted as a mirror for field n with a -transformation. The mirror's text content is calculated according to -this transformation, which is Emacs-lisp code that gets evaluated in -an environment where the variable text (or yas/text) is bound -to the text content (string) contained in the field n.Here's an -example for Objective-C:

-
- (${1:id})${2:foo}
+
+
+ +
+

Mirrors with transformations

+
+ + +

+If the value of an ${n:-construct starts with and contains $(, then +it is interpreted as a mirror for field n with a transformation. The +mirror's text content is calculated according to this transformation, +which is Emacs-lisp code that gets evaluated in an environment where the +variable text (or yas-text) is bound to the text content (string) +contained in the field n.Here's an example for Objective-C: +

+ + + +
- (${1:id})${2:foo}
 {
     return $2;
 }
@@ -354,248 +646,270 @@ example for Objective-C:

$2 = [aValue retain]; } $0 -
-

Look at ${2:$(capitalize text)}, it is a mirror with -transformation instead of a field. The actual field is at the first -line: ${2:foo}. When you type text in ${2:foo}, the -transformation will be evaluated and the result will be placed there -as the transformed text. So in this example, if you type "baz" in the -field, the transformed text will be "Baz". This example is also -available in the screencast.

-

Another example is for rst-mode. In reStructuredText, the document -title can be some text surrounded by "===" below and above. The "===" -should be at least as long as the text. So

-
=====
+
+ + +

+Look at ${2:$(capitalize text)}, it is a mirror with transformation +instead of a field. The actual field is at the first line: ${2:foo}. +When you type text in ${2:foo}, the transformation will be evaluated +and the result will be placed there as the transformed text. So in this +example, if you type "baz" in the field, the transformed text will be +"Baz". This example is also available in the screencast. +

+

+Another example is for rst-mode. In reStructuredText, the document +title can be some text surrounded by "===" below and above. The "===" +should be at least as long as the text. So +

+ + + +
=====
 Title
 =====
-
-

is a valid title but

-
===
+
+ + +

+is a valid title but +

+ + + +
===
 Title
 ===
-
-

is not. Here's an snippet for rst title:

-
${1:$(make-string (string-width text) ?\=)}
+
+ + +

+is not. Here's an snippet for rst title: +

+ + + +
${1:$(make-string (string-width text) ?\=)}
 ${1:Title}
 ${1:$(make-string (string-width text) ?\=)}
 
 $0
-
+ + +
-
-

Fields with transformations

-

From version 0.6 on, you can also have lisp transformation inside -fields. These work mostly mirror transformations but are evaluated -when you first enter the field, after each change you make to the -field and also just before you exit the field.

-

The syntax is also a tiny bit different, so that the parser can -distinguish between fields and mirrors. In the following example

-
#define "${1:mydefine$(upcase yas/text)}"
-
-

mydefine gets automatically upcased to MYDEFINE once you enter -the field. As you type text, it gets filtered through the -transformation every time.

-

Note that to tell this kind of expression from a mirror with a -transformation, YASnippet needs extra text between the : and the -transformation's $. If you don't want this extra-text, you can use -two $'s instead.

-
#define "${1:$$(upcase yas/text)}"
-
-

Please note that as soon as a transformation takes place, it changes -the value of the field and sets it its internal modification state to -true. As a consequence, the auto-deletion behaviour of normal -fields does not take place. This is by design.

+
-
-

Choosing fields value from a list and other tricks

-

As mentioned, the field transformation is invoked just after you enter + +

+

Fields with transformations

+
+ + +

+From version 0.6 on, you can also have lisp transformation inside +fields. These work mostly mirror transformations but are evaluated when +you first enter the field, after each change you make to the field and +also just before you exit the field. +

+

+The syntax is also a tiny bit different, so that the parser can +distinguish between fields and mirrors. In the following example +

+
+ #define "${1:mydefine$(upcase yas-text)}"
+
+ + +

+mydefine gets automatically upcased to MYDEFINE once you enter the +field. As you type text, it gets filtered through the transformation +every time. +

+

+Note that to tell this kind of expression from a mirror with a +transformation, YASnippet needs extra text between the : and the +transformation's $. If you don't want this extra-text, you can use two +$'s instead. +

+
+ #define "${1:$$(upcase yas-text)}"
+
+ + +

+Please note that as soon as a transformation takes place, it changes the +value of the field and sets it its internal modification state to +true. As a consequence, the auto-deletion behaviour of normal fields +does not take place. This is by design. +

+
+ +
+ +
+

Choosing fields value from a list and other tricks

+
+ + +

+As mentioned, the field transformation is invoked just after you enter the field, and with some useful variables bound, notably -yas/field-modified-p and yas/moving-away-p. Because of this -feature you can place a transformation in the primary field that lets -you select default values for it.

-

The yas/choose-value does this work for you. For example:

-
<div align="${2:$$(yas/choose-value '("right" "center" "left"))}">
+yas-modified-p and yas-moving-away-p. Because of this feature you
+can place a transformation in the primary field that lets you select
+default values for it.
+

+

+The yas-choose-value does this work for you. For example: +

+ + + +
<div align="${2:$$(yas-choose-value '("right" "center" "left"))}">
   $0
 </div>
-
-

See the definition of yas/choose-value to see how it was written -using the two variables.

-

Here's another use, for LaTeX-mode, which calls reftex-label just as -you enter snippet field 2. This one makes use of yas/modified-p -directly.

-
\section{${1:"Titel der Tour"}}%
+
+ + +

+See the definition of yas-choose-value to see how it was written using +the two variables. +

+

+Here's another use, for LaTeX-mode, which calls reftex-label just as you +enter snippet field 2. This one makes use of yas-modified-p directly. +

+ + + +
\section{${1:"Titel der Tour"}}%
 \index{$1}%
-\label{{2:"waiting for reftex-label call..."$(unless yas/modified-p (reftex-label nil 'dont-
-insert))}}%
-
-

The function yas/verify-value has another neat trick, and makes -use of yas/moving-away-p. Try it and see! Also, check out this -thread

+\label{{2:"waiting for reftex-label call..."$(unless yas-modified-p (reftex-label nil 'dont- +insert))}}% + + + +

+The function yas-verify-value has another neat trick, and makes use of +yas-moving-away-p. Try it and see! Also, check out this +thread +

-
-

Nested placeholder fields

-

From version 0.6 on, you can also have nested placeholders of the type:

-
<div${1: id="${2:some_id}"}>$0</div>
-
-

This allows you to choose if you want to give this div an id + +

+ +
+

Nested placeholder fields

+
+ + +

+From version 0.6 on, you can also have nested placeholders of the type: +

+ + + +
<div${1: id="${2:some_id}"}>$0</div>
+
+ + +

+This allows you to choose if you want to give this div an id attribute. If you tab forward after expanding it will let you change -"some_id" to whatever you like. Alternatively, you can just press -C-d (which executes yas/skip-and-clear-or-delete-char) and go -straight to the exit marker.

-

By the way, C-d will only clear the field if you cursor is at the -beginning of the field and it hasn't been changed yet. Otherwise, it -performs the normal Emacs delete-char command.

+"some_id" to whatever you like. Alternatively, you can just press C-d +(which executes yas-skip-and-clear-or-delete-char) and go straight to +the exit marker. +

+

+By the way, C-d will only clear the field if you cursor is at the +beginning of the field and it hasn't been changed yet. Otherwise, it +performs the normal Emacs delete-char command. +

-
-

Customizable variables

-
-

yas/trigger-key

-

The key bound to yas/expand when function yas/minor-mode is -active.

-

Value is a string that is converted to the internal Emacs key -representation using read-kbd-macro.

-

Default value is "TAB".

+
-
-

yas/next-field-key

-

The key to navigate to next field when a snippet is active.

-

Value is a string that is converted to the internal Emacs key -representation using read-kbd-macro.

-

Can also be a list of keys.

-

Default value is "TAB".

-
-
-

yas/prev-field-key

-

The key to navigate to previous field when a snippet is active.

-

Value is a string that is converted to the internal Emacs key -representation using read-kbd-macro.

-

Can also be a list of keys.

-

Default value is ("<backtab>" "<S-tab>)".

-
-
-

yas/skip-and-clear-key

-

The key to clear the currently active field.

-

Value is a string that is converted to the internal Emacs key -representation using read-kbd-macro.

-

Can also be a list of keys.

-

Default value is "C-d".

-
-
-

yas/good-grace

-

If non-nil, don't raise errors in inline Emacs-lisp evaluation inside -snippet definitions. An error string "[yas] error" is returned instead.

-
-
-

yas/indent-line

-

The variable yas/indent-line controls the indenting. It is bound -to 'auto by default, which causes your snippet to be indented -according to the mode of the buffer it was inserted in.

-

Another variable yas/also-auto-indent-first-line, when non-nil -does exactly that :-).

-

To use the hard-coded indentation in your snippet template, set this -variable to fixed.

-

To control indentation on a per-snippet basis, see also the directive -# expand-env: in Writing Snippets.

-

For backward compatibility with earlier versions of YASnippet, you can -also place a $> in your snippet, an (indent-according-to-mode) -will be executed there to indent the line. This only takes effect when -yas/indent-line is set to something other than 'auto.

-
for (${int i = 0}; ${i < 10}; ${++i})
-{$>
-$0$>
-}$>
-
-
-
-

yas/wrap-around-region

-

If non-nil, YASnippet will try to expand the snippet's exit marker -around the currently selected region. When this variable is set to t, -this has the same effect has using the `yas/selected-text` inline -evaluation.

-

Because on most systems starting to type deletes the currently -selected region, this works mostly for snippets with direct -keybindings or with the yas/insert-snippet command.

-

However, when the value is of this variable is cua YASnippet will -additionally look-up any recently selected that you deleted by starting -typing. This allows you select a region, type a snippet key (deleting -the region), then press yas/trigger-key to see the deleted region -spring back to life inside your new snippet.

-
-
-

yas/triggers-in-field

-

If non-nil, yas/next-field-key can trigger stacked expansions, -that is a snippet expansion inside another snippet -expansion. Otherwise, yas/next-field-key just tries to move on to -the next field.

-
-
-

yas/snippet-revival

-

Non-nil means re-activate snippet fields after undo/redo.

-
-
-

yas/after-exit-snippet-hook and yas/before-expand-snippet-hook

-

These hooks are called, respectively, before the insertion of a -snippet and after exiting the snippet. If you find any strange but -functional use for them, that's probably a design flaw in YASnippet, -so let us know.

-
-
-
-

Importing TextMate snippets

-

There are a couple of tools that take TextMate's ".tmSnippet" xml -files and create YASnippet definitions:

-
-
-

In this section, i'll shortly cover the second option.

-

Download the textmate_import.rb tool and the TextMate -bundle you're interested in.

-
$ curl -O http://yasnippet.googlecode.com/svn/trunk/extras/textmate_import.rb
+
+
+
+

+In this section, i'll shortly cover the second option. +

+

+Download the textmate_import.rb tool and the TextMate bundle you're +interested in. +

+ + + +
$ curl -O http://yasnippet.googlecode.com/svn/trunk/extras/textmate_import.rb
 $ svn export http://svn.textmate.org/trunk/Bundles/HTML.tmbundle/
-
-

Then invoke textmate_import.rb like this:

-
$ ./textmate_import.rb -d HTML.tmbundle/Snippets/ -o html-mode -g HTML.tmbundle/info.plist
-
-

You should end up with a html-mode subdir containing snippets -exported from textmate.

-
$ tree html-mode # to view dir contents, if you have 'tree' installed
-
-

The -g is optional but helps the tool figure out the grouping. -According to Organizing Snippets, don't forget to touch -.yas-make-groups and .yas-ignore-filename-triggers inside the -html-mode dir.

-

Also try textmate_import.rb --help for a list of options.

-

Please note that snippet importation is not yet perfect. You'll -probably have some adjustments to some/many snippets. Please -contribute these adjustments to the google group or, better yet, patch -the textmate_import.rb to automatically perform them and submit -that.

- - - + + + +

+Then invoke textmate_import.rb like this: +

+ + + +
$ ./textmate_import.rb -d HTML.tmbundle/Snippets/ -o html-mode -g HTML.tmbundle/info.plist
+
+ + +

+You should end up with a html-mode subdir containing snippets exported +from textmate. +

+ + + +
$ tree html-mode # to view dir contents, if you have 'tree' installed
+
+ + +

+The -g is optional but helps the tool figure out the grouping. +According to Organizing Snippets, don't forget to touch +.yas-make-groups and .yas-ignore-filename-triggers inside the +html-mode dir. +

+

+Also try textmate_import.rb --help for a list of options. +

+

+Please note that snippet importation is not yet perfect. You'll probably +have some adjustments to some/many snippets. Please contribute these +adjustments to the google group or, better yet, patch the +textmate_import.rb to automatically perform them and submit that. +

-
-
-
-
-
- - + +
+

Date: 2013-11-26T21:02-0500

+

Org version 7.9.3f with Emacs version 24

+Validate XHTML 1.0 +
diff --git a/snippet-expansion.html b/snippet-expansion.html index 3dcd564..ce25a23 100644 --- a/snippet-expansion.html +++ b/snippet-expansion.html @@ -1,432 +1,626 @@ - - - + + + - - Expanding snippets - + + + + + + + + + + -
-
-
-
- -
-
-
-
-

- 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
      -
    • Trigger key
        -
      • Fallback bahaviour
      • +
        + UP + | + HOME +
        + +
        + +
        + +
        +

        Expanding snippets

        + + +

        + This section describes how YASnippet chooses snippets for expansion at point. +

        +

        + Maybe, you'll want some snippets to be expanded in a particular + mode, or only under certain conditions, or be prompted using +

        + +
        +

        Table of Contents

        + -
        -

        Triggering expansion

        -

        You can use YASnippet to expand snippets in different ways:

        -
          -
        • By typing an abbrev, the snippet trigger key, and then pressing -the key defined in yas/trigger-key (which defaults to -"TAB"). This works in buffers where the minor mode -yas/minor-mode is active;
        • -
        • By invoking the command yas/insert-snippet (either by typing -M-x yas/insert-snippet or its keybinding). This does not -require yas/minor-mode to be active.
        • -
        • By using the keybinding associated with an active snippet. This also -requires yas/minor-mode to be active;
        • -
        • By expanding directly from the "YASnippet" menu in the menu-bar
        • -
        • By using hippie-expand
        • -
        • Expanding from emacs-lisp code
        • +
        + +
        +

        Triggering expansion

        +
        + + +

        + You can use YASnippet to expand snippets in different ways: +

        +
          +
        • When yas-minor-mode is active: +
            +
          • Type the snippet's trigger key then calling yas-expand + (bound to TAB by default). + +
          • +
          • Use the snippet's keybinding. + +
          • +
          • By expanding directly from the "YASnippet" menu in the menu-bar + +
          • +
          • Using hippie-expand + +
          -
          -

          Trigger key

          -

          When yas/minor-mode is enabled, the keybinding taken from -yas/trigger-key will take effect.

          -

          yas/trigger-key invokes yas/expand, which tries to expand a -snippet abbrev (also known as snippet key) before point.

          -

          The default key is "TAB", however, you can freely set it to some -other key.

          -images/minor-mode-indicator.png -

          To enable the YASnippet minor mode in all buffers globally use the -command yas/global-mode.

          -

          When you use yas/global-mode you can also selectively disable + +

        • +
        • Call yas-insert-snippet (use M-x yas-insert-snippet= or its + keybinding C-c & C-s). + +
        • +
        • Use m2m's excellent auto-complete + TODO: example for this + +
        • +
        • Expanding from emacs-lisp code +
        • +
        + + + +
        + +
        +

        Trigger key

        +
        + + +

        +yas-expand tries to expand a snippet abbrev (also known as +snippet key) before point. +

        +

        +When yas-minor-mode is enabled, it binds yas-expand to TAB and +<tab> by default, however, you can freely set it to some other key: +

        + + + +
        (define-key yas-minor-mode-map (kbd "<tab>") nil)
        +(define-key yas-minor-mode-map (kbd "TAB") nil)
        +(define-key yas-minor-mode-map (kbd "<the new key>") 'yas-expand)
        +
        + + +

        +To enable the YASnippet minor mode in all buffers globally use the +command yas-global-mode. This will enable a modeline indicator, +yas: +

        +

        +./images/minor-mode-indicator.png +

        +

        +When you use yas-global-mode you can also selectively disable YASnippet in some buffers by setting the buffer-local variable -yas/dont-active in the buffer's mode hook.

        -

        Trouble when using or understanding the yas/trigger-key is easily -the most controversial issue in YASsnippet. See the FAQ.

        -
        -

        Fallback bahaviour

        -

        yas/fallback-behaviour is a customization variable bound to -'call-other-command by default. If yas/expand failed to find -any suitable snippet to expand, it will disable the minor mode -temporarily and find if there's any other command bound the -yas/trigger-key.

        -

        If found, the command will be called. Usually this works very well -- -when there's a snippet, expand it, otherwise, call whatever command -originally bind to the trigger key.

        -

        However, you can change this behavior by customizing the -yas/fallback-behavior variable. If you set this variable to -'return-nil, it will return nil instead of trying to call the -original command when no snippet is found.

        +yas-dont-active in the buffer's mode hook. +

        + +
        + +
        +

        Fallback bahaviour

        +
        + + +

        +yas-fallback-behaviour is a customization variable bound to +'call-other-command by default. If yas-expand failed to find any +suitable snippet to expand, it will disable the minor mode temporarily +and find if there's any other command bound to the same key. +

        +

        +If found, the command will be called. Usually this works very well +–when there's a snippet, expand it, otherwise, call whatever command +originally bind to the trigger key. +

        +

        +However, you can change this behavior by customizing the +yas-fallback-behavior variable. If you set this variable to +'return-nil, it will return nil instead of trying to call the +original command when no snippet is found. +

        -
        -

        Insert at point

        -

        The command M-x yas/insert-snippet lets you insert snippets at -point for you current major mode. It prompts you for the snippet -key first, and then for a snippet template if more than one template -exists for the same key.

        -

        The list presented contains the snippets that can be inserted at -point, according to the condition system. If you want to see all -applicable snippets for the major mode, prefix this command with -C-u.

        -

        The prompting methods used are again controlled by -yas/prompt-functions.

        +
        -
        -

        Snippet keybinding

        -

        See the section of the # binding: directive in Writing -Snippets.

        + +
        +

        Insert at point

        +
        + + +

        +The command yas-insert-snippet lets you insert snippets at point +for your current major mode. It prompts you for the snippet key +first, and then for a snippet template if more than one template +exists for the same key. +

        +

        +The list presented contains the snippets that can be inserted at point, +according to the condition system. If you want to see all applicable +snippets for the major mode, prefix this command with C-u. +

        +

        +The prompting methods used are again controlled by +yas-prompt-functions. +

        - -
        -

        Expanding with hippie-expand

        -

        To integrate with hippie-expand, just put -yas/hippie-try-expand in -hippie-expand-try-functions-list. This probably makes more sense -when placed at the top of the list, but it can be put anywhere you -prefer.

        + +
        +

        Snippet keybinding

        +
        + + +

        +See the section of the # binding: directive in +Writing Snippets. +

        -
        -

        Expanding from emacs-lisp code

        -

        Sometimes you might want to expand a snippet directly from you own -elisp code. You should call yas/expand-snippet instead of -yas/expand in this case.

        -

        As with expanding from the menubar, the condition system and multiple + +

        + +
        +

        Expanding from the menu

        +
        + + +

        +See the YASnippet Menu. +

        +
        + +
        + +
        +

        Expanding with hippie-expand

        +
        + + +

        +To integrate with hippie-expand, just put yas-hippie-try-expand in +hippie-expand-try-functions-list. This probably makes more sense when +placed at the top of the list, but it can be put anywhere you prefer. +

        +
        + +
        + +
        +

        Expanding from emacs-lisp code

        +
        + + +

        +Sometimes you might want to expand a snippet directly from you own elisp +code. You should call yas-expand-snippet instead of yas-expand in +this case. +

        +

        +As with expanding from the menubar, the condition system and multiple candidates doesn't affect expansion. In fact, expanding from the -YASnippet menu has the same effect of evaluating the follow code:

        -
        (yas/expand-snippet template)
        -
        -

        See the internal documentation on yas/expand-snippet for more -information.

        +YASnippet menu has the same effect of evaluating the follow code: +

        + + + +
        (yas-expand-snippet template)
        +
        + + +

        +See the internal documentation on yas-expand-snippet for more +information. +

        -
        -

        Controlling expansion

        -
        -

        Eligible snippets

        -

        YASnippet does quite a bit of filtering to find out which snippets are -eligible for expanding at the current cursor position.

        -

        In particular, the following things matter:

        + +
        + +
        +

        Controlling expansion

        +
        + + + +
        + +
        +

        Eligible snippets

        +
        + + +

        +YASnippet does quite a bit of filtering to find out which snippets are +eligible for expanding at the current cursor position. +

        +

        +In particular, the following things matter: +

          -
        • Currently loaded snippets tables

          -

          These are loaded from a directory hierarchy in your file system. See -Organizing Snippets. They are named after major modes like -html-mode, ruby-mode, etc...

          +
        • Currently loaded snippets tables + +

          + These are loaded from a directory hierarchy in your file system. See + Organizing Snippets. They are named + after major modes like html-mode, ruby-mode, etc… +

        • -
        • Major mode of the current buffer

          -

          If the currrent major mode matches one of the loaded snippet tables, -then all that table's snippets are considered for expansion. Use -M-x describe-variable RET major-mode RET to find out which major -mode you are in currently.

          +
        • Major mode of the current buffer + +

          + If the currrent major mode matches one of the loaded snippet tables, + then all that table's snippets are considered for expansion. Use + M-x describe-variable RET major-mode RET to find out which major + mode you are in currently. +

        • -
        • Parent tables

          -

          Snippet tables defined as the parent of some other eligible table -are also considered. This works recursively, i.e. parents of parents -of eligible tables are also considered.

          -
        • -
        • Buffer-local yas/mode-symbol variable

          -

          This can be used to consider snippet tables whose name does not -correspond to a major mode. If you set this variable to a name , -like rinari-minor-mode, you can have some snippets expand only -in that minor mode. Naturally, you want to set this conditionally, -i.e. only when entering that minor mode, so using a hook is a good -idea.

          +
        • Parent tables + +

          + Snippet tables defined as the parent of some other eligible table are + also considered. This works recursively, i.e. parents of parents of + eligible tables are also considered. +

        • +
        • Buffer-local list of extra modes + +

          + Use yas-activate-extra-mode to consider snippet tables whose name + does not correspond to a major mode. Typically, you call this from + a minor mode hook, for example: +

        -
        ;; When entering rinari-minor-mode, consider also the snippets in the
        -;; snippet table "rails-mode"
        -(add-hook 'rinari-minor-mode-hook
        -          #'(lambda ()
        -              (setq yas/mode-symbol 'rails-mode)))
        -
        + + + + + +
        ;; When entering rinari-minor-mode, consider also the snippets in the
        +;; snippet table "rails-mode"
        +(add-hook 'rinari-minor-mode-hook
        +          #'(lambda ()
        +              (yas-activate-extra-mode 'rails-mode)))
        +
        + +
          -
        • Buffer-local yas/buffer-local-condition variable

          -

          This variable provides finer grained control over what snippets can -be expanded in the current buffer. The default value won't let you -expand snippets inside comments or string literals for example. See -The condition system for more info.

          -
        • +
        • Buffer-local yas-buffer-local-condition variable + +

          + This variable provides finer grained control over what snippets can + be expanded in the current buffer. The default value won't let you + expand snippets inside comments or string literals for example. See + The condition system_ for more info. +

        + +
        -
        -

        The condition system

        -

        Consider this scenario: you are an old Emacs hacker. You like the -abbrev-way and set yas/trigger-key to "SPC". However, -you don't want if to be expanded as a snippet when you are typing -in a comment block or a string (e.g. in python-mode).

        -

        If you use the # condition : directive (see Writing Snippets) -you could just specify the condition for if to be (not -(python-in-string/comment)). But how about while, for, -etc. ? Writing the same condition for all the snippets is just -boring. So has a buffer local variable -yas/buffer-local-condition. You can set this variable to (not -(python-in-string/comment)) in python-mode-hook.

        -

        Then, what if you really want some particular snippet to expand even -inside a comment? This is also possible! But let's stop telling the -story and look at the rules:

        -
          -
        • If yas/buffer-local-condition evaluate to nil, no snippets will -be considered for expansion.
        • -
        • If it evaluates to the a cons cell where the car is the symbol -require-snippet-condition and the cdr is a symbol (let's -call it requirement), then:
            -
          • Snippets having no # condition: directive won't be considered;
          • -
          • Snippets with conditions that evaluate to nil (or produce an -error) won't be considered;
          • -
          • If the snippet has a condition that evaluates to non-nil (let's -call it result):
              -
            • If requirement is t, the snippet is ready to be -expanded;
            • -
            • If requirement is eq to result, the snippet is ready -to be expanded;
            • -
            • Otherwise the snippet won't be considered.
            • -
            -
          • -
          -
        • -
        • If it evaluates to the symbol always, all snippets are -considered for expansion, regardless of any conditions.
        • -
        • If it evaluate to t or some other non-nil value:
            -
          • If the snippet has no condition, or has a condition that evaluate -to non-nil, it is ready to be expanded.
          • -
          • Otherwise, it won't be considered.
          • -
          -
        • -
        -

        In the mentioned scenario, set yas/buffer-local-condition like -this

        -
        (add-hook 'python-mode-hook
        -          '(lambda ()
        -             (setq yas/buffer-local-condition
        -                   '(if (python-in-string/comment)
        -                        '(require-snippet-condition . force-in-comment)
        -                      t))))
        -
        -

        ... and specify the condition for a snippet that you're going to -expand in comment to be evaluated to the symbol -force-in-comment. Then it can be expanded as you expected, while -other snippets like if still can't expanded in comment.

        +
        -
        -

        Multiples snippet with the same key

        -

        The rules outlined above can return more than -one snippet to be expanded at point.

        -

        When there are multiple candidates, YASnippet will let you select -one. The UI for selecting multiple candidate can be customized through -yas/prompt-functions , which defines your preferred methods of -being prompted for snippets.

        -

        You can customize it with M-x customize-variable RET -yas/prompt-functions RET. Alternatively you can put in your -emacs-file:

        -
        (setq yas/prompt-functions '(yas/x-prompt yas/dropdown-prompt))
        -
        -

        Currently there are some alternatives solution with YASnippet.

        -images/x-menu.png -
        -

        Use the X window system

        -

        The function yas/x-prompt can be used to show a popup menu for you -to select. This menu will be part of you native window system widget, -which means:

        -
          + +
          +

          The condition system

          +
          + + +

          +Consider this scenario: you are an old Emacs hacker. You like the +abbrev-way and bind yas-expand to SPC. However, you don't want +if to be expanded as a snippet when you are typing in a comment +block or a string (e.g. in python-mode). +

          +

          +If you use the # condition : directive (see +Writing Snippets) you could just specify +the condition for if to be (not (python-in-string/comment)). But how +about while, for, etc. ? Writing the same condition for all the +snippets is just boring. So has a buffer local variable +yas-buffer-local-condition. You can set this variable to +(not (python-in-string/comment)) in python-mode-hook. +

          +

          +Then, what if you really want some particular snippet to expand even +inside a comment? Set yas-buffer-local-condition like this +

          + + + +
          (add-hook 'python-mode-hook
          +          (lambda ()
          +            (setq yas-buffer-local-condition
          +                  '(if (python-in-string/comment)
          +                       '(require-snippet-condition . force-in-comment)
          +                     t))))
          +
          + + +

          +… and specify the condition for a snippet that you're going to expand +in comment to be evaluated to the symbol force-in-comment. Then it can +be expanded as you expected, while other snippets like if still can't +expanded in comment. +

          +

          +For the full set of possible conditions, see the documentation for +yas-buffer-local-condition. +

          +
          + +
          + +
          +

          Multiples snippet with the same key

          +
          + + +

          +The rules outlined above can return more than +one snippet to be expanded at point. +

          +

          +When there are multiple candidates, YASnippet will let you select one. +The UI for selecting multiple candidate can be customized through +yas-prompt-functions , which defines your preferred methods of being +prompted for snippets. +

          +

          +You can customize it with +M-x customize-variable RET yas-prompt-functions RET. Alternatively you +can put in your emacs-file: +

          + + + +
          (setq yas-prompt-functions '(yas-x-prompt yas-dropdown-prompt))
          +
          + + +

          +Currently there are some alternatives solution with YASnippet. +

          + +
          + +
          +

          Use the X window system

          +
          + + +

          +./images/x-menu.png +

          +

          +The function yas-x-prompt can be used to show a popup menu for you to +select. This menu will be part of you native window system widget, which +means: +

          +
          • It usually looks beautiful. E.g. when you compile Emacs with gtk -support, this menu will be rendered with your gtk theme.
          • -
          • Your window system may or may not allow to you use C-n, C-p -to navigate this menu.
          • -
          • This function can't be used when in a terminal.
          • + support, this menu will be rendered with your gtk theme. + +
          • Your window system may or may not allow to you use C-n, C-p to + navigate this menu. +
          • +
          • This function can't be used when in a terminal. +
          -images/ido-menu.png + +
          -
          -

          Minibuffer prompting

          -

          You can use functions yas/completing-prompt for the classic emacs -completion method or yas/ido-prompt for a much nicer looking -method. The best way is to try it. This works in a terminal.

          -images/dropdown-menu.png +
          -
          -

          Use dropdown-menu.el

          -

          The function yas/dropdown-prompt can also be placed in the -yas/prompt-functions list.

          -

          This works in both window system and terminal and is customizable, you -can use C-n, C-p to navigate, q to quit and even press -6 as a shortcut to select the 6th candidate.

          + +
          +

          Minibuffer prompting

          +
          + + +

          +./images/ido-menu.png +

          +

          +You can use functions yas-completing-prompt for the classic emacs +completion method or yas-ido-prompt for a much nicer looking method. +The best way is to try it. This works in a terminal. +

          -
          -

          Roll your own

          -

          See below for the documentation on variable yas/prompt-functions

          + +
          + +
          +

          Use dropdown-menu.el

          +
          + + +

          +./images/dropdown-menu.png +

          +

          +The function yas-dropdown-prompt can also be placed in the +yas-prompt-functions list. +

          +

          +This works in both window system and terminal and is customizable, you +can use C-n, C-p to navigate, q to quit and even press 6 as a +shortcut to select the 6th candidate. +

          +
          + +
          + +
          +

          Roll your own

          +
          + + +

          +See the documentation on variable yas-prompt-functions +

          -
          -

          Customizable Variables

          -
          -

          yas/prompt-functions

          -

          You can write a function and add it to the yas/prompt-functions -list. These functions are called with the following arguments:

          -
            -
          • PROMPT: A string to prompt the user;
          • -
          • CHOICES: A list of strings or objects;
          • -
          • optional DISPLAY-FN : A function. When applied to each of the -objects in CHOICES it will return a string;
          • -
          -

          The return value of any function you put here should be one of -the objects in CHOICES, properly formatted with DISPLAY-FN (if -that is passed).

          -
            -
          • To signal that your particular style of prompting is unavailable at -the moment, you can also have the function return nil.
          • -
          • To signal that the user quit the prompting process, you can signal -quit with (signal 'quit "user quit!")
          • -
          -
          -
          -

          yas/fallback-behavior

          -

          How to act when yas/expand does not expand a snippet.

          -
          -
          call-other-command means try to temporarily disable YASnippet and
          -
          call the next command bound to yas/trigger-key.
          -
          -

          return-nil means return nil. (i.e. do nothing)

          -

          An entry (apply COMMAND . ARGS) means interactively call COMMAND, if -ARGS is non-nil, call COMMAND non-interactively with ARGS as -arguments.

          -
          -
          -

          yas/choose-keys-first

          -

          If non-nil, prompt for snippet key first, then for template.

          -

          Otherwise prompts for all possible snippet names.

          -

          This affects yas/insert-snippet and yas/visit-snippet-file.

          -
          -
          -

          yas/choose-tables-first

          -

          If non-nil, and multiple eligible snippet tables, prompts user for -tables first.

          -

          Otherwise, user chooses between the merging together of all -eligible tables.

          -

          This affects yas/insert-snippet, yas/visit-snippet-file

          -
          -
          -

          yas/key-syntaxes

          -

          The default searching strategy is quite powerful. For example, in -c-mode, bar, foo_bar, "#foo_bar" can all be recognized -as a snippet key. Furthermore, the searching is in that order. In -other words, if bar is found to be a key to some valid snippet, -then that snippet is expanded and replaces the bar. Snippets -pointed to by foo_bar and "#foobar won't be considered.

          -

          However, this strategy can also be customized easily from the -yas/key-syntaxes variable. It is a list of syntax rules, the -default value is ("w" "w_" "w_." "^ "). Which means search the -following thing until found one:

          -
            -
          • a word.
          • -
          • a symbol. In lisp, - and ? can all be part of a symbol.
          • -
          • a sequence of characters of either word, symbol or punctuation.
          • -
          • a sequence of characters of non-whitespace characters.
          • -
          -

          But you'd better keep the default value unless you want to understand -how Emacs's syntax rules work...

          -
          -
          -
          -
        -
        -
        - - + +
        +

        Date: 2013-11-26T21:02-0500

        +

        Org version 7.9.3f with Emacs version 24

        +Validate XHTML 1.0 +
        diff --git a/snippet-menu.html b/snippet-menu.html index ebfdb09..586b695 100644 --- a/snippet-menu.html +++ b/snippet-menu.html @@ -1,141 +1,266 @@ - - - + + + - - YASnippet menu - + + + + + + + + + + -
        -
        -
        -
        - -
        -
        -
        -
        -

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

        -
        -

        Contents

        - +
        + UP + | + HOME
        -

        When yas/minor-mode is active, YASnippet will setup a menu just -after the "Buffers" menu in the menubar.

        -

        In this menu, you can find

        -
          + +
          + +
          + +
          +

          YASnippet menu

          + + +

          +When yas-minor-mode is active, YASnippet will setup a menu just after +the "Buffers" menu in the menubar. +

          +

          +In this menu, you can find +

          +
          • The currently loaded snippet definitions, organized by major mode, -and optional grouping.
          • + and optional grouping. + +
          • A rundown of the most common commands, (followed by their -keybindings) including commands to load directories and reload all -snippet definitions.
          • + keybindings) including commands to load directories and reload all + snippet definitions. + +
          • A series of submenus for customizing and exploring YASnippet -behavior.
          • + behavior. + +
          + + +

          +./images/menu-1.png +

          + +
          +

          Table of Contents

          +
          + -images/menu-1.png -
          -

          Loading snippets from menu

          -

          Invoking "Load snippets..." from the menu invokes -yas/load-directory and prompts you for a snippet directory -hierarchy to load.

          -

          Also useful is the "Reload all" options which uncondionally reloads -all the snippets directories defined in yas/root-directory and -rebuilds the menus.

          -
          -

          Snippet menu behavior

          -

          YASnippet will list in this section all the loaded snippet definitions -organized by snippet table name.

          -

          You can use this section to explore currently loaded snippets. If you +

          + +
          +

          Loading snippets from menu

          +
          + + +

          +Invoking "Load snippets…" from the menu invokes yas-load-directory +and prompts you for a snippet directory hierarchy to load. +

          +

          +Also useful is the "Reload everything" item to invoke yas-reload-all +which uncondionally reloads all the snippets directories defined in +yas-snippet-dirs and rebuilds the menus. +

          +
          + +
          + +
          +

          Snippet menu behavior

          +
          + + +

          +YASnippet will list in this section all the loaded snippet definitions +organized by snippet table name. +

          +

          +You can use this section to explore currently loaded snippets. If you click on one of them, the default behavior is to expand it, -unconditionally, inside the current buffer.

          -

          You can however, customize variable yas/visit-from-menu to be -t which will take you to the snippet definition file when you -select it from the menu.

          -

          If you want the menu show only snippet tables whose name corresponds -to a "real" major mode. You do this by setting yas/use-menu to -'real-modes.

          -

          Finally, to have the menu show only the tables for the currently -active mode, set yas/use-menu to abbreviate.

          -

          These customizations can also be found in the menu itself, under the -"Snippet menu behavior" submenu.

          +unconditionally, inside the current buffer. +

          +

          +You can however, customize variable yas-visit-from-menu to be t +which will take you to the snippet definition file when you select it +from the menu. +

          +

          +If you want the menu show only snippet tables whose name corresponds to +a "real" major mode. You do this by setting yas-use-menu to +'real-modes. +

          +

          +Finally, to have the menu show only the tables for the currently active +mode, set yas-use-menu to abbreviate. +

          +

          +These customizations can also be found in the menu itself, under the +"Snippet menu behavior" submenu. +

          -
          -

          Controlling indenting

          -

          The "Indenting" submenu contains options to control the values of -yas/indent-line and yas/also-auto-indent-first-line. See -Writing snippets .

          +
          -
          -

          Prompting method

          -

          The "Prompting method" submenu contains options to control the value -of yas/prompt-functions. See Expanding snippets .

          + +
          +

          Controlling indenting

          +
          + + +

          +The "Indenting" submenu contains options to control the values of +yas-indent-line and yas-also-auto-indent-first-line. See +Writing snippets . +

          -
          -

          Misc

          -

          The "Misc" submenu contains options to control the values of more -variables.

          +
          -
          -
          -
          -
          -
          + +
          +

          Prompting method

          +
          + + +

          +The "Prompting method" submenu contains options to control the value of +yas-prompt-functions. See Expanding snippets . +

          - - + +
          + +
          +

          Misc

          +
          + + +

          +The "Misc" submenu contains options to control the values of more +variables. +

          +
          +
          + +
          +

          Date: 2013-11-26T21:02-0500

          +

          Org version 7.9.3f with Emacs version 24

          +Validate XHTML 1.0 +
          diff --git a/snippet-organization.html b/snippet-organization.html index b92e1db..68bc122 100644 --- a/snippet-organization.html +++ b/snippet-organization.html @@ -1,171 +1,295 @@ - - - + + + - - Organizing snippets - + + + + + + + + + + -
          -
          -
          -
          - -
          -
          -
          -
          -

          - 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
          • -
          • Organizing snippets
              -
            • The .yas.parents file
            • -
            • The .yas-make-groups file
            • +
              + UP + | + HOME +
              + +
              + +
              + +
              +

              Organizing snippets

              + + + +
              +

              Table of Contents

              + -
              -

              Loading snippets

              -

              Snippet definitions are stored in files in the filesystem. Unless you -use the simpler bundle version), these -are arranged so that YASnippet can load them into snippet -tables. The triggering mechanisms (see Expanding snippets) will -look up these snippet tables and (hopefully) expand the snippet you -intended.

              -

              The non-bundle version of YASnippet, once unpacked, comes with a full -directory of snippets, which you can copy somewhere and use. You can -also create or download more directories.

              - -

              - Once these directories are in place reference them in the variable - - yas-snippet-dirs - - and then load YASnippet as usual: -

              - -
              -
              ;; Develop and keep personal snippets under ~/emacs.d/mysnippets
              -(setq yas-snippet-dirs '("~/emacs.d/mysnippets"))
              -
              -;; Load yasnippet
              -(yas-global-mode 1)
              -
              - -

              - The point in using - - yas-snippet-dirs - - is considering "~/emacs.d/mysnippets" for snippet development, so - you can use commands like - - yas/new-snippet - - and others described in section - Writing Snippets. -

              +
              +

              Basic structure

              +
              + +

              - Note: In the past, - - yas/root-directory - - is the variable that stores the list of snippet directories. This method is - deprecated and only exists for backward-compatibility reason. + Snippet collections can be stored in plain text files. They are arranged by + sub-directories naming snippet tables. These mostly name Emacs major names.

              -
              -

              Organizing snippets

              -

              Once you've setup yas-snippet-dirs , you can store snippets -inside sub-directories of these directories.

              -

              Snippet definitions are put in plain text files. They are arranged -by sub-directories, and the snippet tables are named after these -directories.

              -

              The name corresponds to the Emacs mode where you want expansion to -take place. For example, snippets for c-mode are put in the -c-mode sub-directory.

              -
              -

              The .yas.parents file

              -

              It's very useful to have certain modes share snippets between -themselves. To do this, choose a mode subdirectory and place a -.yas-parents containing a whitespace-separated list of other -mode names. When you reload those modes become parents of the -original mode.

              -
              $ tree
              -.
              +
              +
              +
              .
               |-- c-mode
              -|   |-- .yas-parents    # contains "cc-mode text-mode"
              +|   `-- printf
              +|-- java-mode
              +|   `-- println
              +`-- text-mode
              +    |-- email
              +    `-- time
              +
              + + +

              + The collections are loaded into snippet tables which the + triggering mechanism (see Expanding Snippets) looks up and + (hopefully) causes the right snippet to be expanded for you. +

              +
              + +
              + +
              +

              Setting up yas-snippet-dirs

              +
              + + +

              + The emacs variable yas-snippet-dirs tells YASnippet + which collections to consider. It's used when you activate + yas-global-mode or call + yas-reload-all interactively. +

              +

              + The default considers: +

              +
                +
              • a personal collection that lives in ~/.emacs.d/snippets +
              • +
              • the bundled collection, taken as a relative path to yasnippet.el localtion +
              • +
              + + +

              + When you come across other snippet collections, do the following to try them + out: +

              + + + +
              ;; Develop in ~/emacs.d/mysnippets, but also
              +;; try out snippets in ~/Downloads/interesting-snippets
              +(setq yas-snippet-dirs '("~/emacs.d/mysnippets"
              +                           "~/Downloads/interesting-snippets"))
              +
              +;; OR, keeping yasnippet's defaults try out ~/Downloads/interesting-snippets
              +(setq yas-snippet-dirs (append yas-snippet-dirs
              +                               '("~/Downloads/interesting-snippets")))
              +
              + + +

              + Collections appearing earlier in the list shadow snippets with same names + appearing in collections later in the list. yas-new-snippet always stores + snippets in the first collection. +

              +
              + +
              + +
              +

              The .yas-parents file

              +
              + + +

              + It's very useful to have certain modes share snippets between + themselves. To do this, choose a mode subdirectory and place a + .yas-parents containing a whitespace-separated list of other mode + names. When you reload those modes become parents of the original + mode. +

              + + + +
              .
              +|-- c-mode
              +|   |-- .yas-parents    # contains "cc-mode text-mode"
               |   `-- printf
               |-- cc-mode
               |   |-- for
               |   `-- while
               |-- java-mode
              -|   |-- .yas-parents    # contains "cc-mode text-mode"
              +|   |-- .yas-parents    # contains "cc-mode text-mode"
               |   `-- println
               `-- text-mode
                   |-- email
                   `-- time
              -
              + + + +
              -
              -

              The .yas-make-groups file

              -images/menu-groups.png -

              If you place an empty plain text file .yas-make-groups inside one -of the mode directories, the names of these sub-directories are -considered groups of snippets and The YASnippet Menu is organized -much more cleanly, as you can see in the image.

              -

              Another alternative way to achieve this is to place a # group: -directive inside the snippet definition. See Writing Snippets.

              -
              $ tree ruby-mode/
              +
              +
              + +
              +

              TODO The .yas-make-groups file

              +
              + + +

              + If you place an empty plain text file .yas-make-groups inside one + of the mode directories, the names of these sub-directories are + considered groups of snippets and the menu is organized much more + cleanly: +

              +

              + ./images/menu-groups.png +

              +

              + Another way to achieve this is to place a # group: directive + inside the snippet definition. See Writing Snippets. +

              + + + +
              $ tree ruby-mode/
               ruby-mode/
               |-- .yas-make-groups
               |-- collections
              @@ -177,83 +301,76 @@ ruby-mode/
               |-- definitions
               |   `-- ...
               `-- general
              -    `-- ...
              -
              -
              -
              -
              -

              YASnippet bundle

              -

              The most convenient way to define snippets for YASnippet is to put -them in a directory arranged by the mode and use -yas/load-directory to load them.

              -

              However, this might slow down the Emacs start-up speed if you have many -snippets. You can use yas/define-snippets to define a bunch of -snippets for a particular mode in an Emacs-lisp file.

              -

              Since this is hard to maintain, there's a better way: define your -snippets in directory and then call M-x yas/compile-bundle to -compile it into a bundle file when you modified your snippets.

              -

              The release bundle of YASnippet is produced by -yas/compile-bundle. The bundle uses yas/define-snippets to -define snippets. This avoids the IO and parsing overhead when loading -snippets.

              -

              Further more, the generated bundle is a stand-alone file not depending -on yasnippet.el. The released bundles of YASnippet are all -generated this way.

              -

              See the internal documentation for these functions

              -
                -
              • M-x describe-function RET yas/define-snippets RET
              • -
              • M-x describe-function RET yas/compile-bundle RET.
              • -
              -
              -
              -

              Customizable variables

              -
              + `-- ... + -

              - yas-snippet-dirs -

              - List of directories that store the snippets for each major mode. -

              - -

              - The first element of the list is always the user-created snippets - directory. Other directories are used for bulk reloading of all snippets - using - - yas/reload-all - . + Yet another way to create a nice snippet menu is to write into + .yas-make-groups a menu definition. TODO

              +
              -
              -

              yas/ignore-filenames-as-triggers

              -

              If non-nil, don't derive tab triggers from filenames.

              -

              This means a snippet without a # key: directive wont have a tab -trigger.

              - - - +
              +

              TODO The .yas-setup.el file

              +
              + + + +
              + +
              +

              TODO

              +
              + +
              -
              -
              -
              -
              -
              +
              - - + +
              +

              TODO The .yas-compiled-snippet.el file

              +
              + + + +
              + +
              +

              TODO

              +
              + + +
              +
              + +
              + +
              +

              TODO The .yas-skip file

              +
              + + + +
              + +
              +

              TODO

              +
              + +
              +
              +
              +
              + +
              +

              Date: 2013-11-26T21:02-0500

              +

              Org version 7.9.3f with Emacs version 24

              +Validate XHTML 1.0 +
              diff --git a/snippet-reference.html b/snippet-reference.html new file mode 100644 index 0000000..610f651 --- /dev/null +++ b/snippet-reference.html @@ -0,0 +1,3056 @@ + + + + +Reference + + + + + + + + + + + + +
              + UP + | + HOME +
              + +
              + +
              + +
              +

              Reference

              + + + +
              +

              Table of Contents

              +
              + +
              +
              + +
              +

              Reference

              +
              + + + + + + +
              + +
              +

              Interactive functions

              +
              + + +
              + +
              +

              yas-skip-and-clear-or-delete-char (&optional field)

              +
              + +

              /WARNING/: no doc for symbol yas-skip-and-clear-or-delete-char +

              +
              + +
              + +
              +

              yas-exit-all-snippets ()

              +
              + +

              /WARNING/: no doc for symbol yas-exit-all-snippets +

              +
              + +
              + +
              +

              yas-exit-snippet (snippet)

              +
              + +

              /WARNING/: no doc for symbol yas-exit-snippet +

              +
              + +
              + +
              +

              yas-abort-snippet (&optional snippet)

              +
              + +

              /WARNING/: no doc for symbol yas-abort-snippet +

              +
              + +
              + +
              +

              yas-prev-field ()

              +
              + +

              /WARNING/: no doc for symbol yas-prev-field +

              +
              + +
              + +
              +

              yas-next-field (&optional arg)

              +
              + +

              /WARNING/: no doc for symbol yas-next-field +

              +
              + +
              + +
              +

              yas-next-field-or-maybe-expand ()

              +
              + +

              /WARNING/: no doc for symbol yas-next-field-or-maybe-expand +

              +
              + +
              + +
              +

              yas-describe-tables (&optional choose)

              +
              + +

              /WARNING/: no doc for symbol yas-describe-tables +

              +
              + +
              + +
              +

              yas-tryout-snippet (&optional debug)

              +
              + +

              /WARNING/: no doc for symbol yas-tryout-snippet +

              +
              + +
              + +
              +

              yas-load-snippet-buffer (table &optional interactive)

              +
              + +

              /WARNING/: no doc for symbol yas-load-snippet-buffer +

              +
              + +
              + +
              +

              yas-new-snippet (&optional no-template)

              +
              + +

              /WARNING/: no doc for symbol yas-new-snippet +

              +
              + +
              + +
              +

              yas-visit-snippet-file ()

              +
              + +

              /WARNING/: no doc for symbol yas-visit-snippet-file +

              +
              + +
              + +
              +

              yas-insert-snippet (&optional no-condition)

              +
              + +

              /WARNING/: no doc for symbol yas-insert-snippet +

              +
              + +
              + +
              +

              yas-expand-from-keymap ()

              +
              + +

              Expand/run snippets from keymaps, possibly falling back to original binding. +

              + +
              + +
              + +
              +

              yas-expand-from-trigger-key (&optional field)

              +
              + +

              /WARNING/: no doc for symbol yas-expand-from-trigger-key +

              +
              + +
              + +
              +

              yas-about ()

              +
              + +

              /WARNING/: no doc for symbol yas-about +

              +
              + +
              + +
              +

              yas-recompile-all ()

              +
              + +

              /WARNING/: no doc for symbol yas-recompile-all +

              +
              + +
              + +
              +

              yas-compile-directory (top-level-dir)

              +
              + +

              /WARNING/: no doc for symbol yas-compile-directory +

              +
              + +
              + +
              +

              yas-reload-all (&optional interactive)

              +
              + +

              /WARNING/: no doc for symbol yas-reload-all +

              +
              + +
              + +
              +

              yas-load-directory (top-level-dir &optional use-jit interactive)

              +
              + +

              /WARNING/: no doc for symbol yas-load-directory +

              +
              + +
              + +
              +

              yas-minor-mode-on ()

              +
              + +

              /WARNING/: no doc for symbol yas-minor-mode-on +

              +
              + +
              + +
              +

              yas-direct-keymaps-reload ()

              +
              + +

              /WARNING/: no doc for symbol yas-direct-keymaps-reload +

              +
              + +
              + +
              +

              yas-global-mode (&optional arg)

              +
              + +

              Non-nil if Yas-Global mode is enabled. +See the command yas-global-mode for a description of this minor mode. +Setting this variable directly does not take effect; +either customize it (see the info node `Easy Customization') +or call the function yas-global-mode. +

              +
              + +
              + +
              +

              yas-minor-mode (&optional arg)

              +
              + +

              Non-nil if yas minor mode is enabled. +Use the command yas-minor-mode to change this variable. +

              +
              + +
              + +
              +

              yas-expand (&optional field)

              +
              + +

              Expand a snippet before point. If no snippet +expansion is possible, call command `(keymap + (keymap + (/M-/f8 . yas–internal-link-snippet) + (25 . org-yank) + (11 . org-kill-line) + (5 . org-end-of-line) + (1 . org-beginning-of-line) + (menu-bar keymap + (show . undefined) + (hide . undefined) + (headings . undefined) + (Org menu-item "Org" + (keymap "Org" + (Show/Hide menu-item "Show/Hide" + (keymap "Show/Hide" + (Cycle\ Visibility menu-item "Cycle Visibility" org-cycle :enable + (or + (bobp) + (outline-on-heading-p))) + (Cycle\ Global\ Visibility menu-item "Cycle Global Visibility" org-shifttab :enable + (not + (org-at-table-p))) + (Sparse\ Tree\.\.\. menu-item "Sparse Tree…" org-sparse-tree) + (Reveal\ Context menu-item "Reveal Context" org-reveal) + (Show\ All menu-item "Show All" show-all) + (nil menu-item "–") + (Subtree\ to\ indirect\ buffer menu-item "Subtree to indirect buffer" org-tree-to-indirect-buffer))) + (nil menu-item "–") + (New\ Heading menu-item "New Heading" org-insert-heading) + (Navigate\ Headings menu-item "Navigate Headings" + (keymap "Navigate Headings" + (Up menu-item "Up" outline-up-heading) + (Next menu-item "Next" outline-next-visible-heading) + (Previous menu-item "Previous" outline-previous-visible-heading) + (Next\ Same\ Level menu-item "Next Same Level" outline-forward-same-level) + (Previous\ Same\ Level menu-item "Previous Same Level" outline-backward-same-level) + (nil menu-item "–") + (Jump menu-item "Jump" org-goto))) + (Edit\ Structure menu-item "Edit Structure" + (keymap "Edit Structure" + (Refile\ Subtree menu-item "Refile Subtree" org-refile :enable + (org-in-subtree-not-table-p)) + (nil menu-item "–") + (Move\ Subtree\ Up menu-item "Move Subtree Up" org-shiftmetaup :enable + (org-in-subtree-not-table-p)) + (Move\ Subtree\ Down menu-item "Move Subtree Down" org-shiftmetadown :enable + (org-in-subtree-not-table-p)) + (nil-4 menu-item "–") + (Copy\ Subtree menu-item "Copy Subtree" org-copy-special :enable + (org-in-subtree-not-table-p)) + (Cut\ Subtree menu-item "Cut Subtree" org-cut-special :enable + (org-in-subtree-not-table-p)) + (Paste\ Subtree menu-item "Paste Subtree" org-paste-special :enable + (not + (org-at-table-p))) + (nil-8 menu-item "–") + (Clone\ subtree\,\ shift\ time menu-item "Clone subtree, shift time" org-clone-subtree-with-time-shift) + (nil-10 menu-item "–") + (Copy\ visible\ text menu-item "Copy visible text" org-copy-visible) + (nil-12 menu-item "–") + (Promote\ Heading menu-item "Promote Heading" org-metaleft :enable + (org-in-subtree-not-table-p)) + (Promote\ Subtree menu-item "Promote Subtree" org-shiftmetaleft :enable + (org-in-subtree-not-table-p)) + (Demote\ Heading menu-item "Demote Heading" org-metaright :enable + (org-in-subtree-not-table-p)) + (Demote\ Subtree menu-item "Demote Subtree" org-shiftmetaright :enable + (org-in-subtree-not-table-p)) + (nil-17 menu-item "–") + (Sort\ Region/Children menu-item "Sort Region/Children" org-sort) + (nil-19 menu-item "–") + (Convert\ to\ odd\ levels menu-item "Convert to odd levels" org-convert-to-odd-levels) + (Convert\ to\ odd/even\ levels menu-item "Convert to odd/even levels" org-convert-to-oddeven-levels))) + (Editing menu-item "Editing" + (keymap "Editing" + (Emphasis\.\.\. menu-item "Emphasis…" org-emphasize) + (Edit\ Source\ Example menu-item "Edit Source Example" org-edit-special) + (nil menu-item "–") + (Footnote\ new/jump menu-item "Footnote new/jump" org-footnote-action) + (Footnote\ extra menu-item "Footnote extra" menu-function-18 :keys "/C-/u /C-/c /C-/x f"))) + (Archive menu-item "Archive" + (keymap "Archive" + (Archive\ \(default\ method\) menu-item "Archive (default method)" org-archive-subtree-default :enable + (org-in-subtree-not-table-p)) + (nil menu-item "–") + (Move\ Subtree\ to\ Archive\ file menu-item "Move Subtree to Archive file" org-advertized-archive-subtree :enable + (org-in-subtree-not-table-p)) + (Toggle\ ARCHIVE\ tag menu-item "Toggle ARCHIVE tag" org-toggle-archive-tag :enable + (org-in-subtree-not-table-p)) + (Move\ subtree\ to\ Archive\ sibling menu-item "Move subtree to Archive sibling" org-archive-to-archive-sibling :enable + (org-in-subtree-not-table-p)))) + (nil-7 menu-item "–") + (Hyperlinks menu-item "Hyperlinks" + (keymap "Hyperlinks" + (Store\ Link\ \(Global\) menu-item "Store Link (Global)" org-store-link) + (Find\ existing\ link\ to\ here menu-item "Find existing link to here" org-occur-link-in-agenda-files) + (Insert\ Link menu-item "Insert Link" org-insert-link) + (Follow\ Link menu-item "Follow Link" org-open-at-point) + (nil menu-item "–") + (Next\ link menu-item "Next link" org-next-link) + (Previous\ link menu-item "Previous link" org-previous-link) + (nil-7 menu-item "–") + (Descriptive\ Links menu-item "Descriptive Links" org-toggle-link-display :button + (:radio . org-descriptive-links)) + (Literal\ Links menu-item "Literal Links" org-toggle-link-display :button + (:radio not org-descriptive-links)))) + (nil-9 menu-item "–") + (TODO\ Lists menu-item "TODO Lists" + (keymap "TODO Lists" + (TODO///DONE/- menu-item "TODO///DONE/-" org-todo) + (Select\ keyword menu-item "Select keyword" + (keymap "Select keyword" + (Next\ keyword menu-item "Next keyword" org-shiftright :enable + (org-at-heading-p)) + (Previous\ keyword menu-item "Previous keyword" org-shiftleft :enable + (org-at-heading-p)) + (Complete\ Keyword menu-item "Complete Keyword" pcomplete :enable + (assq :todo-keyword + (org-context))) + (Next\ keyword\ set menu-item "Next keyword set" org-shiftcontrolright :enable + (and + (> + (length org-todo-sets) +

                +
              1. +
              2. +
              + +

              (org-at-heading-p))) + (Previous\ keyword\ set menu-item "Previous keyword set" org-shiftcontrolright :enable + (and + (> + (length org-todo-sets) +

                +
              1. +
              2. +
              + +

              (org-at-heading-p))))) + (Show\ TODO\ Tree menu-item "Show TODO Tree" org-show-todo-tree :keys "C-/c / t") (Global\ /TODO\ list menu-item "Global TODO list" org-todo-list :keys "/C-/c a t") + (nil menu-item "–") + (Enforce\ dependencies menu-item "Enforce dependencies" menu-function-19 :key-sequence nil :button + (:toggle . org-enforce-todo-dependencies)) + (nil-6 menu-item "Settings for tree at point") + (Do\ Children\ sequentially menu-item "Do Children sequentially" org-toggle-ordered-property :enable org-enforce-todo-dependencies :keys "C-/c /C-/x o" :button (:radio org-entry-get nil "/ORDERED")) + (Do\ Children\ parallel menu-item "Do Children parallel" org-toggle-ordered-property :enable org-enforce-todo-dependencies :keys "/C-/c /C-/x o" :button + (:radio not + (org-entry-get nil "ORDERED"))) + (nil-9 menu-item "–") + (Set\ Priority menu-item "Set Priority" org-priority) + (Priority\ Up menu-item "Priority Up" org-shiftup) + (Priority\ Down menu-item "Priority Down" org-shiftdown) + (nil-13 menu-item "–") + (Get\ news\ from\ all\ feeds menu-item "Get news from all feeds" org-feed-update-all) + (Go\ to\ the\ inbox\ of\ a\ feed\.\.\. menu-item "Go to the inbox of a feed…" org-feed-goto-inbox) + (Customize\ feeds menu-item "Customize feeds" menu-function-20 :key-sequence nil))) + (TAGS\ and\ Properties menu-item "TAGS and Properties" + (keymap "TAGS and Properties" + (Set\ Tags menu-item "Set Tags" org-set-tags-command :enable + (not + (org-before-first-heading-p))) + (Change\ tag\ in\ region menu-item "Change tag in region" org-change-tag-in-region :enable + (org-region-active-p)) + (nil menu-item "–") + (Set\ property menu-item "Set property" org-set-property :enable + (not + (org-before-first-heading-p))) + (Column\ view\ of\ properties menu-item "Column view of properties" org-columns) + (Insert\ Column\ View\ /DB/lock menu-item "Insert Column View /DB/lock" org-insert-columns-dblock))) + (Dates\ and\ Scheduling menu-item "Dates and Scheduling" + (keymap "Dates and Scheduling" + (Timestamp menu-item "Timestamp" org-time-stamp :enable + (not + (org-before-first-heading-p))) + (Timestamp\ \(inactive\) menu-item "Timestamp (inactive)" org-time-stamp-inactive :enable + (not + (org-before-first-heading-p))) + (Change\ Date menu-item "Change Date" + (keymap "Change Date" + (1\ Day\ Later menu-item "1 Day Later" org-shiftright :enable + (org-at-timestamp-p)) + (1\ Day\ Earlier menu-item "1 Day Earlier" org-shiftleft :enable + (org-at-timestamp-p)) + (1\ \.\.\.\ Later menu-item "1 … Later" org-shiftup :enable + (org-at-timestamp-p)) + (1\ \.\.\.\ Earlier menu-item "1 … Earlier" org-shiftdown :enable + (org-at-timestamp-p)))) + (Compute\ Time\ Range menu-item "Compute Time Range" org-evaluate-time-range) + (Schedule\ Item menu-item "Schedule Item" org-schedule :enable + (not + (org-before-first-heading-p))) + (Deadline menu-item "Deadline" org-deadline :enable + (not + (org-before-first-heading-p))) + (nil menu-item "–") + (Custom\ time\ format menu-item "Custom time format" org-toggle-time-stamp-overlays :button + (:radio . org-display-custom-times)) + (nil-8 menu-item "–") + (Goto\ Calendar menu-item "Goto Calendar" org-goto-calendar) + (Date\ from\ Calendar menu-item "Date from Calendar" org-date-from-calendar) + (nil-11 menu-item "–") + (Start/Restart\ Timer menu-item "Start/Restart Timer" org-timer-start) + (Pause/Continue\ Timer menu-item "Pause/Continue Timer" org-timer-pause-or-continue) + (Stop\ Timer menu-item "Stop Timer" org-timer-pause-or-continue :keys "/C-/u /C-/c /C-/x ,") + (Insert\ Timer\ String menu-item "Insert Timer String" org-timer) + (Insert\ Timer\ Item menu-item "Insert Timer Item" org-timer-item))) + (Logging\ work menu-item "Logging work" + (keymap "Logging work" + (Clock\ in menu-item "Clock in" org-clock-in :keys "/C-/c /C-/x /C-/i") + (Switch\ task menu-item "Switch task" menu-function-21 :keys "/C-/u /C-/c /C-/x /C-/i") + (Clock\ out menu-item "Clock out" org-clock-out) + (Clock\ cancel menu-item "Clock cancel" org-clock-cancel) + (nil menu-item "–") + (Mark\ as\ default\ task menu-item "Mark as default task" org-clock-mark-default-task) + (Clock\ in\,\ mark\ as\ default menu-item "Clock in, mark as default" menu-function-22 :keys "/C-/u /C-/u /C-/c /C-/x /C-/i") + (Goto\ running\ clock menu-item "Goto running clock" org-clock-goto) + (nil-8 menu-item "–") + (Display\ times menu-item "Display times" org-clock-display) + (Create\ clock\ table menu-item "Create clock table" org-clock-report) + (nil-11 menu-item "–") + (Record\ DONE\ time menu-item "Record DONE time" menu-function-23 :key-sequence nil :button + (:toggle . org-log-done)))) + (nil-14 menu-item "–") + (Agenda\ Command\.\.\. menu-item "Agenda Command…" org-agenda) + (Set\ Restriction\ Lock menu-item "Set Restriction Lock" org-agenda-set-restriction-lock) + (File\ List\ for\ Agenda menu-item "File List for Agenda" + (keymap "File List for Agenda" + (Edit\ File\ List menu-item "Edit File List" menu-function-45 :key-sequence nil) + (Add/Move\ Current\ File\ to\ Front\ of\ List menu-item "Add/Move Current File to Front of List" org-agenda-file-to-front) + (Remove\ Current\ File\ from\ List menu-item "Remove Current File from List" org-remove-file) + (Cycle\ through\ agenda\ files menu-item "Cycle through agenda files" org-cycle-agenda-files) + (Occur\ in\ all\ agenda\ files menu-item "Occur in all agenda files" org-occur-in-agenda-files) + (nil menu-item "–"))) + (Special\ views\ current\ file menu-item "Special views current file" + (keymap "Special views current file" + (TODO\ Tree menu-item "TODO Tree" org-show-todo-tree) + (Check\ Deadlines menu-item "Check Deadlines" org-check-deadlines) + (Timeline menu-item "Timeline" org-timeline) + (Tags/Property\ tree menu-item "Tags/Property tree" org-match-sparse-tree))) + (nil-19 menu-item "–") + (Export/Publish\.\.\. menu-item "Export/Publish…" org-export) + (LaTeX menu-item "LaTeX" + (keymap "LaTeX" + (Org\ /CDL/aTeX\ mode menu-item "Org /CDL/aTeX mode" org-cdlatex-mode :button + (:toggle . org-cdlatex-mode)) + (Insert\ Environment menu-item "Insert Environment" cdlatex-environment :enable + (fboundp 'cdlatex-environment)) + (Insert\ math\ symbol menu-item "Insert math symbol" cdlatex-math-symbol :enable + (fboundp 'cdlatex-math-symbol)) + (Modify\ math\ symbol menu-item "Modify math symbol" org-cdlatex-math-modify :enable + (org-inside-LaTe/X-/fragment-p)) + (Insert\ citation menu-item "Insert citation" org-reftex-citation) + (nil menu-item "–") + (Template\ for\ BEAMER menu-item "Template for BEAMER" menu-function-24 :key-sequence nil))) + (nil-22 menu-item "–") + (MobileOrg menu-item "MobileOrg" + (keymap "MobileOrg" + (Push\ Files\ and\ Views menu-item "Push Files and Views" org-mobile-push) + (Get\ Captured\ and\ Flagged menu-item "Get Captured and Flagged" org-mobile-pull) + (Find\ FLAGGED\ Tasks menu-item "Find FLAGGED Tasks" menu-function-25 :keys "/C-/c a ?") + (nil menu-item "–") + (Setup menu-item "Setup" menu-function-26 :key-sequence nil))) + (nil-24 menu-item "–") + (Documentation menu-item "Documentation" + (keymap "Documentation" + (Show\ Version menu-item "Show Version" org-version) + (Info\ Documentation menu-item "Info Documentation" org-info))) + (Customize menu-item "Customize" + (keymap "Customize" + (Browse\ Org\ Group menu-item "Browse Org Group" org-customize) + (nil menu-item "–") + (Expand\ This\ Menu menu-item "Expand This Menu" org-create-customize-menu :enable + (fboundp 'customize-menu-create)))) + (Send\ bug\ report menu-item "Send bug report" org-submit-bug-report) + (nil-28 menu-item "–") + (Refresh/Reload menu-item "Refresh/Reload" + (keymap "Refresh/Reload" + (Refresh\ setup\ current\ buffer menu-item "Refresh setup current buffer" org-mode-restart) + (Reload\ Org\ \(after\ update\) menu-item "Reload Org (after update)" org-reload) + (Reload\ Org\ uncompiled menu-item "Reload Org uncompiled" menu-function-27 :keys "/C-/u /C-/c /C-/x !"))))) + (Tbl menu-item "Tbl" + (keymap "Tbl" + (Align menu-item "Align" org-ctrl-c-ctrl-c :enable + (org-at-table-p)) + (Next\ Field menu-item "Next Field" org-cycle :enable + (org-at-table-p)) + (Previous\ Field menu-item "Previous Field" org-shifttab :enable + (org-at-table-p)) + (Next\ Row menu-item "Next Row" org-return :enable + (org-at-table-p)) + (nil menu-item "–") + (Blank\ Field menu-item "Blank Field" org-table-blank-field :enable + (org-at-table-p)) + (Edit\ Field menu-item "Edit Field" org-table-edit-field :enable + (org-at-table-p)) + (Copy\ Field\ from\ Above menu-item "Copy Field from Above" org-table-copy-down :enable + (org-at-table-p)) + (nil-8 menu-item "–") + (Column menu-item "Column" + (keymap "Column" + (Move\ Column\ Left menu-item "Move Column Left" org-metaleft :enable + (org-at-table-p)) + (Move\ Column\ Right menu-item "Move Column Right" org-metaright :enable + (org-at-table-p)) + (Delete\ Column menu-item "Delete Column" org-shiftmetaleft :enable + (org-at-table-p)) + (Insert\ Column menu-item "Insert Column" org-shiftmetaright :enable + (org-at-table-p)))) + (Row menu-item "Row" + (keymap "Row" + (Move\ Row\ Up menu-item "Move Row Up" org-metaup :enable + (org-at-table-p)) + (Move\ Row\ Down menu-item "Move Row Down" org-metadown :enable + (org-at-table-p)) + (Delete\ Row menu-item "Delete Row" org-shiftmetaup :enable + (org-at-table-p)) + (Insert\ Row menu-item "Insert Row" org-shiftmetadown :enable + (org-at-table-p)) + (Sort\ lines\ in\ region menu-item "Sort lines in region" org-table-sort-lines :enable + (org-at-table-p)) + (nil menu-item "–") + (Insert\ Hline menu-item "Insert Hline" org-ctrl-c-minus :enable + (org-at-table-p)))) + (Rectangle menu-item "Rectangle" + (keymap "Rectangle" + (Copy\ Rectangle menu-item "Copy Rectangle" org-copy-special :enable + (org-at-table-p)) + (Cut\ Rectangle menu-item "Cut Rectangle" org-cut-special :enable + (org-at-table-p)) + (Paste\ Rectangle menu-item "Paste Rectangle" org-paste-special :enable + (org-at-table-p)) + (Fill\ Rectangle menu-item "Fill Rectangle" org-table-wrap-region :enable + (org-at-table-p)))) + (nil-12 menu-item "–") + (Calculate menu-item "Calculate" + (keymap "Calculate" + (Set\ Column\ Formula menu-item "Set Column Formula" org-table-eval-formula :enable + (org-at-table-p)) + (Set\ Field\ Formula menu-item "Set Field Formula" menu-function-15 :enable + (org-at-table-p) + :keys "/C-/u /C-/c =") + (Edit\ Formulas menu-item "Edit Formulas" org-edit-special :enable + (org-at-table-p)) + (nil menu-item "–") + (Recalculate\ line menu-item "Recalculate line" org-table-recalculate :enable + (org-at-table-p)) + (Recalculate\ all menu-item "Recalculate all" menu-function-16 :enable + (org-at-table-p) + :keys "/C-/u /C-/c *") + (Iterate\ all menu-item "Iterate all" menu-function-17 :enable + (org-at-table-p) + :keys "/C-/u /C-/u /C-/c *") + (nil-7 menu-item "–") + (Toggle\ Recalculate\ Mark menu-item "Toggle Recalculate Mark" org-table-rotate-recalc-marks :enable + (org-at-table-p)) + (nil-9 menu-item "–") + (Sum\ Column/Rectangle menu-item "Sum Column/Rectangle" org-table-sum :enable + (or + (org-at-table-p) + (org-region-active-p))) + (Which\ Column\? menu-item "Which Column?" org-table-current-column :enable + (org-at-table-p)))) + (Debug\ Formulas menu-item "Debug Formulas" org-table-toggle-formula-debugger :button + (:toggle org-bound-and-true-p org-table-formula-debug)) + (Show\ Col/Row\ Numbers menu-item "Show Col/Row Numbers" org-table-toggle-coordinate-overlays :button + (:toggle org-bound-and-true-p org-table-overlay-coordinates)) + (nil-16 menu-item "–") + (Create menu-item "Create" org-table-create :enable + (and + (not + (org-at-table-p)) + org-enable-table-editor)) + (Convert\ Region menu-item "Convert Region" org-table-convert-region :enable + (not + (org-at-table-p 'any))) + (Import\ from\ File menu-item "Import from File" org-table-import :enable + (not + (org-at-table-p))) + (Export\ to\ File menu-item "Export to File" org-table-export :enable + (org-at-table-p)) + (nil-21 menu-item "–") + (Create/Convert\ from/to\ table\.el menu-item "Create/Convert from/to table.el" org-table-create-with-table\.el)))) + (124 . org-force-self-insert) + (67108899 . org-table-rotate-recalc-marks) + (10 . org-return-indent) + (13 . org-return) + (67108903 . org-cycle-agenda-files) + (67108908 . org-cycle-agenda-files) + (/C-S-/return . org-insert-todo-heading-respect-content) + (/C-/return . org-insert-heading-respect-content) + (/C-S-/down . org-shiftcontroldown) + (/C-S-/up . org-shiftcontrolup) + (/C-S-/left . org-shiftcontrolleft) + (/C-S-/right . org-shiftcontrolright) + (/S-/right . org-shiftright) + (/S-/left . org-shiftleft) + (/S-/down . org-shiftdown) + (/S-/up . org-shiftup) + (/M-S-/down . org-shiftmetadown) + (/M-S-/up . org-shiftmetaup) + (/M-S-/right . org-shiftmetaright) + (/M-S-/left . org-shiftmetaleft) + (/M-/down . org-metadown) + (/M-/up . org-metaup) + (/M-/right . org-metaright) + (/M-/left . org-metaleft) + (/M-/return . org-meta-return) + (/M-S-/return . org-insert-todo-heading) + (/S-/return . org-table-copy-down) + (backtab . org-shifttab) + (/S-/tab . org-shifttab) + (/S-/iso-lefttab . org-shifttab) + (27 keymap + (101 . org-forward-sentence) + (97 . org-backward-sentence) + (104 . org-mark-element) + (13 . org-insert-heading) + (123 . org-backward-element) + (125 . org-forward-element) + (20 . org-transpose-element) + (/S-/down . org-shiftmetadown) + (/S-/up . org-shiftmetaup) + (/S-/right . org-shiftmetaright) + (/S-/left . org-shiftmetaleft) + (/S-/return . org-insert-todo-heading) + (tab . pcomplete) + (down . org-metadown) + (up . org-metaup) + (right . org-metaright) + (left . org-metaleft) + (return . org-meta-return) + (9 . pcomplete)) + (/C-/tab . org-force-cycle-archived) + (tab . org-cycle) + (9 . org-cycle) + (3 keymap + (67108906 . org-list-make-subtree) + (64 . org-mark-subtree) + (58 . org-toggle-fixed-width-section) + (5 . org-export) + (123 . org-table-toggle-formula-debugger) + (125 . org-table-toggle-coordinate-overlays) + (126 . org-table-create-with-table\.el) + (124 . org-table-create-or-convert-from-region) + (96 . org-table-edit-field) + (39 . org-edit-special) + (61 . org-table-eval-formula) + (43 . org-table-sum) + (32 . org-table-blank-field) + (63 . org-table-field-info) + (35 . org-update-statistics-cookies) + (11 . org-kill-note-or-show-branches) + (3 . org-ctrl-c-ctrl-c) + (94 . org-sort) + (42 . org-ctrl-c-star) + (45 . org-ctrl-c-minus) + (93 . org-remove-file) + (91 . org-agenda-file-to-front) + (60 . org-date-from-calendar) + (62 . org-goto-calendar) + (25 . org-evaluate-time-range) + (44 . org-priority) + (33 . org-time-stamp-inactive) + (46 . org-time-stamp) + (26 . org-add-note) + (38 . org-mark-ring-goto) + (37 . org-mark-ring-push) + (15 . org-open-at-point) + (27 keymap + (12 . org-insert-all-links)) + (12 . org-insert-link) + (13 . org-ctrl-c-ret) + (92 . org-match-sparse-tree) + (47 . org-sparse-tree) + (23 . org-refile) + (59 . org-toggle-comment) + (4 . org-deadline) + (19 . org-schedule) + (17 . org-set-tags-command) + (20 . org-todo) + (10 . org-goto) + (36 . org-archive-subtree) + (2 . org-backward-heading-same-level) + (6 . org-forward-heading-same-level) + (31 . org-down-element) + (30 . org-up-element) + (18 . org-reveal) + (1 . org-attach) + (right . org-shiftright) + (left . org-shiftleft) + (down . org-shiftdown) + (up . org-shiftup) + (22 keymap + (27 keymap + (8 . org-babel-mark-block)) + (120 . org-babel-do-key-sequence-in-edit-buffer) + (24 . org-babel-do-key-sequence-in-edit-buffer) + (104 . org-babel-describe-bindings) + (97 . org-babel-sha1-hash) + (1 . org-babel-sha1-hash) + (122 . org-babel-switch-to-session-with-code) + (26 . org-babel-switch-to-session) + (73 . org-babel-view-src-block-info) + (105 . org-babel-lob-ingest) + (9 . org-babel-view-src-block-info) + (108 . org-babel-load-in-session) + (12 . org-babel-load-in-session) + (106 . org-babel-insert-header-arg) + (10 . org-babel-insert-header-arg) + (99 . org-babel-check-src-block) + (3 . org-babel-check-src-block) + (102 . org-babel-tangle-file) + (6 . org-babel-tangle-file) + (116 . org-babel-tangle) + (20 . org-babel-tangle) + (100 . org-babel-demarcate-block) + (4 . org-babel-demarcate-block) + (115 . org-babel-execute-subtree) + (19 . org-babel-execute-subtree) + (98 . org-babel-execute-buffer) + (2 . org-babel-execute-buffer) + (18 . org-babel-goto-named-result) + (114 . org-babel-goto-named-result) + (103 . org-babel-goto-named-src-block) + (21 . org-babel-goto-src-block-head) + (117 . org-babel-goto-src-block-head) + (118 . org-babel-expand-src-block) + (22 . org-babel-expand-src-block) + (15 . org-babel-open-src-block-result) + (111 . org-babel-open-src-block-result) + (5 . org-babel-execute-maybe) + (101 . org-babel-execute-maybe) + (14 . org-babel-next-src-block) + (110 . org-babel-next-src-block) + (16 . org-babel-previous-src-block) + (112 . org-babel-previous-src-block)) + (24 keymap + (91 . org-reftex-citation) + (71 . org-feed-goto-inbox) + (103 . org-feed-update-all) + (33 . org-reload) + (3 . org-columns) + (44 . org-timer-pause-or-continue) + (95 . org-timer-stop) + (48 . org-timer-start) + (45 . org-timer-item) + (46 . org-timer) + (58 . org-timer-cancel-timer) + (59 . org-timer-set-timer) + (105 . org-insert-columns-dblock) + (111 . org-toggle-ordered-property) + (69 . org-inc-effort) + (101 . org-set-effort) + (112 . org-set-property) + (2 . org-toggle-checkbox) + (92 . org-toggle-pretty-entities) + (22 . org-toggle-inline-images) + (12 . org-preview-latex-fragment) + (21 . org-dblock-update) + (18 . org-clock-report) + (4 . org-clock-display) + (17 . org-clock-cancel) + (10 . org-clock-goto) + (15 . org-clock-out) + (26 . org-resolve-clocks) + (24 . org-clock-in-last) + (9 . org-clock-in) + (20 . org-toggle-time-stamp-overlays) + (25 . org-paste-special) + (27 keymap + (22 . org-redisplay-inline-images) + (119 . org-copy-special)) + (23 . org-cut-special) + (13 keymap + (112 . org-mobile-push) + (103 . org-mobile-pull)) + (102 . org-footnote-action) + (6 . org-emphasize) + (62 . org-agenda-remove-restriction-lock) + (60 . org-agenda-set-restriction-lock) + (16 . org-previous-link) + (14 . org-next-link) + (118 . org-copy-visible) + (98 . org-tree-to-indirect-buffer) + (65 . org-archive-to-archive-sibling) + (97 . org-toggle-archive-tag) + (1 . org-archive-subtree-default) + (19 . org-advertized-archive-subtree) + (left . org-shiftcontrolleft) + (right . org-shiftcontrolright) + (68 . org-shiftmetadown) + (85 . org-shiftmetaup) + (82 . org-shiftmetaright) + (76 . org-shiftmetaleft) + (100 . org-insert-drawer) + (117 . org-metaup) + (114 . org-metaright) + (108 . org-metaleft) + (109 . org-meta-return) + (77 . org-insert-todo-heading) + (99 . org-clone-subtree-with-time-shift))) + (remap keymap + (delete-backward-char . org-delete-backward-char) + (delete-char . org-delete-char) + (self-insert-command . org-self-insert-command) + (outline-insert-heading . org-ctrl-c-ret) + (outline-demote . org-demote-subtree) + (outline-promote . org-promote-subtree) + (show-branches . org-kill-note-or-show-branches) + (outline-backward-same-level . org-backward-heading-same-level) + (outline-forward-same-level . org-forward-heading-same-level) + (show-subtree . org-show-subtree) + (outline-mark-subtree . org-mark-subtree)) + keymap + (menu-bar keymap + (headings "Headings" keymap + (outline-up-heading menu-item "Up" outline-up-heading :help "Move to the visible heading line of which the present line is a subheading") + (outline-next-visible-heading menu-item "Next" outline-next-visible-heading :help "Move to the next visible heading line") + (outline-previous-visible-heading menu-item "Previous" outline-previous-visible-heading :help "Move to the previous heading line") + (outline-forward-same-level menu-item "Next Same Level" outline-forward-same-level :help "Move forward to the arg'th subheading at same level as this one") + (outline-backward-same-level menu-item "Previous Same Level" outline-backward-same-level :help "Move backward to the arg'th subheading at same level as this one.") + (outline-insert-heading menu-item "New Heading" outline-insert-heading :help "Insert a new heading at same depth at point") + (copy menu-item "Copy to Kill Ring" outline-headers-as-kill :enable mark-active :help "Save the visible outline headers in region at the start of the kill ring") + (move-subtree-up menu-item "Move Subtree Up" outline-move-subtree-up :help "Move the current subtree up past arg headlines of the same level") + (move-subtree-down menu-item "Move Subtree Down" outline-move-subtree-down :help "Move the current subtree down past arg headlines of the same level") + (promote-subtree menu-item "Promote Subtree" outline-promote :help "Promote headings higher up the tree") + (demote-subtree menu-item "Demote Subtree" outline-demote :help "Demote headings lower down the tree") + "Headings") + (show "Show" keymap + (show-all menu-item "Show All" show-all :help "Show all of the text in the buffer") + (show-entry menu-item "Show Entry" show-entry :help "Show the body directly following this heading") + (show-branches menu-item "Show Branches" show-branches :help "Show all subheadings of this heading, but not their bodies") + (show-children menu-item "Show Children" show-children :help "Show all direct subheadings of this heading") + (show-subtree menu-item "Show Subtree" show-subtree :help "Show everything after this heading at deeper levels") + "Show") + (hide "Hide" keymap + (hide-leaves menu-item "Hide Leaves" hide-leaves :help "Hide the body after this heading and at deeper levels") + (hide-body menu-item "Hide Body" hide-body :help "Hide all body lines in buffer, leaving all headings visible") + (hide-entry menu-item "Hide Entry" hide-entry :help "Hide the body directly following this heading") + (hide-subtree menu-item "Hide Subtree" hide-subtree :help "Hide everything after this heading at deeper levels") + (hide-sublevels menu-item "Hide Sublevels" hide-sublevels :help "Hide everything but the top LEVELS levels of headers, in whole buffer") + (hide-other menu-item "Hide Other" hide-other :help "Hide everything except current body and parent and top-level headings") + "Hide")) + (3 keymap + (13 . outline-insert-heading) + (67108926 . outline-demote) + (67108924 . outline-promote) + (22 . outline-move-subtree-down) + (30 . outline-move-subtree-up) + (15 . hide-other) + (17 . hide-sublevels) + (11 . show-branches) + (12 . hide-leaves) + (5 . show-entry) + (3 . hide-entry) + (1 . show-all) + (20 . hide-body) + (2 . outline-backward-same-level) + (6 . outline-forward-same-level) + (21 . outline-up-heading) + (4 . hide-subtree) + (19 . show-subtree) + (9 . show-children) + (16 . outline-previous-visible-heading) + (14 . outline-next-visible-heading) + (64 . outline-mark-subtree)) + keymap + (27 keymap + (9 . ispell-complete-word))) + (keymap + #[nil nil keymap + #^[3 0 set-mark-command move-beginning-of-line backward-char mode-specific-command-prefix delete-char move-end-of-line forward-char keyboard-quit help-command indent-for-tab-command newline-and-indent kill-line recenter-top-bottom newline next-line open-line previous-line quoted-insert isearch-backward isearch-forward transpose-chars universal-argument scroll-up-command kill-region Control-/X-/prefix yank suspend-frame /ESC-/prefix toggle-input-method abort-recursive-edit nil undo self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command delete-backward-char] + #^[1 0 + #^[2 0 + #^[3 0 set-mark-command move-beginning-of-line backward-char mode-specific-command-prefix delete-char move-end-of-line forward-char keyboard-quit help-command indent-for-tab-command newline-and-indent kill-line recenter-top-bottom newline next-line open-line previous-line quoted-insert isearch-backward isearch-forward transpose-chars universal-argument scroll-up-command kill-region Control-/X-/prefix yank suspend-frame /ESC-/prefix toggle-input-method abort-recursive-edit nil undo self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command delete-backward-char] + self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command] + self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command] + self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command] + (/S-/mouse-3 . kmacro-end-call-mouse) + (/C-/mouse-5 . mwheel-scroll) + (/S-/mouse-5 . mwheel-scroll) + (mouse-5 . mwheel-scroll) + (/C-/mouse-4 . mwheel-scroll) + (/S-/mouse-4 . mwheel-scroll) + (mouse-4 . mwheel-scroll) + (tool-bar menu-item "tool bar" ignore :filter tool-bar-make-keymap) + (f10 . menu-bar-open) + (vertical-line keymap + (mouse-1 . mouse-select-window) + (down-mouse-1 . mouse-drag-vertical-line) + (/C-/mouse-2 . mouse-split-window-vertically)) + (vertical-scroll-bar keymap + (drag-mouse-3 . scroll-bar-scroll-down) + (mouse-3 . scroll-bar-scroll-down) + (down-mouse-2 . scroll-bar-drag) + (drag-mouse-1 . scroll-bar-scroll-up) + (mouse-1 . scroll-bar-scroll-up) + (/C-/mouse-2 . mouse-split-window-vertically)) + (header-line keymap + (mouse-1 . mouse-select-window) + (down-mouse-1 . mouse-drag-header-line)) + (mode-line keymap + (/C-/mouse-2 . mouse-split-window-horizontally) + (mouse-3 . mouse-delete-window) + (mouse-2 . mouse-delete-other-windows) + (down-mouse-1 . mouse-drag-mode-line) + (drag-mouse-1 . mouse-select-window) + (mouse-1 . mouse-select-window)) + (/C-/down-mouse-3 menu-item "Menu Bar" ignore :filter + (lambda + (_) + (if + (zerop + (or + (frame-parameter nil 'menu-bar-lines) + 0)) + (mouse-menu-bar-map) + (mouse-menu-major-mode-map)))) + (/S-/down-mouse-1 . mouse-appearance-menu) + (/C-/down-mouse-1 . mouse-buffer-menu) + (mouse-3 . mouse-save-then-kill) + (mouse-2 . mouse-yank-primary) + (triple-mouse-1 . mouse-set-point) + (double-mouse-1 . mouse-set-point) + (drag-mouse-1 . mouse-set-region) + (mouse-1 . mouse-set-point) + (down-mouse-1 . mouse-drag-region) + (/M-/mouse-2 . mouse-yank-secondary) + (/M-/mouse-3 . mouse-secondary-save-then-kill) + (/M-/down-mouse-1 . mouse-drag-secondary) + (/M-/drag-mouse-1 . mouse-set-secondary) + (/M-/mouse-1 . mouse-start-secondary) + (/C-/down-mouse-2 . facemenu-menu) + (compose-last-chars . compose-last-chars) + (f1 . help-command) + (help . help-command) + (f2 . 2/C-/command) + (menu-bar keymap + (file "File" keymap + (new-file menu-item "Visit New File…" find-file :enable + (menu-bar-non-minibuffer-window-p) + :help "Specify a new file's name, to edit the file") + (open-file menu-item "Open File…" menu-find-file-existing :enable + (menu-bar-non-minibuffer-window-p) + :help "Read an existing file into an Emacs buffer") + (dired menu-item "Open Directory…" dired :enable + (menu-bar-non-minibuffer-window-p) + :help "Read a directory, to operate on its files") + (insert-file menu-item "Insert File…" insert-file :enable + (menu-bar-non-minibuffer-window-p) + :help "Insert another file into current buffer") + (kill-buffer menu-item "Close" kill-this-buffer :enable + (kill-this-buffer-enabled-p) + :help "Discard (kill) current buffer") + (separator-save "–") + (save-buffer menu-item "Save" save-buffer :enable + (and + (buffer-modified-p) + (buffer-file-name) + (menu-bar-non-minibuffer-window-p)) + :help "Save current buffer to its file") + (write-file menu-item "Save As…" write-file :enable + (and + (menu-bar-menu-frame-live-and-visible-p) + (menu-bar-non-minibuffer-window-p)) + :help "Write current buffer to another file") + (revert-buffer menu-item "Revert Buffer" revert-buffer :enable + (or revert-buffer-function revert-buffer-insert-file-contents-function + (and buffer-file-number + (or + (buffer-modified-p) + (not + (verify-visited-file-modtime + (current-buffer)))))) + :help "Re-read current buffer from its file") + (recover-session menu-item "Recover Crashed Session" recover-session :enable + (and auto-save-list-file-prefix + (file-directory-p + (file-name-directory auto-save-list-file-prefix)) + (directory-files + (file-name-directory auto-save-list-file-prefix) + nil + (concat "\\`" + (regexp-quote + (file-name-nondirectory auto-save-list-file-prefix))) + t)) + :help "Recover edits from a crashed session") + (separator-print "–") + (print-buffer menu-item "Print Buffer" print-buffer :enable + (menu-bar-menu-frame-live-and-visible-p) + :help "Print current buffer with page headings") + (print-region menu-item "Print Region" print-region :enable mark-active :help "Print region between mark and current position") + (ps-print-buffer-faces menu-item "PostScript Print Buffer" ps-print-buffer-with-faces :enable + (menu-bar-menu-frame-live-and-visible-p) + :help "Pretty-print current buffer to PostScript printer") + (ps-print-region-faces menu-item "PostScript Print Region" ps-print-region-with-faces :enable mark-active :help "Pretty-print marked region to PostScript printer") + (ps-print-buffer menu-item "PostScript Print Buffer (B+W)" ps-print-buffer :enable + (menu-bar-menu-frame-live-and-visible-p) + :help "Pretty-print current buffer in black and white to PostScript printer") + (ps-print-region menu-item "PostScript Print Region (B+W)" ps-print-region :enable mark-active :help "Pretty-print marked region in black and white to PostScript printer") + (separator-window "–") + (new-window-below menu-item "New Window Below" split-window-below :enable + (and + (menu-bar-menu-frame-live-and-visible-p) + (menu-bar-non-minibuffer-window-p)) + :help "Make new window below selected one") + (new-window-on-right menu-item "New Window on Right" split-window-right :enable + (and + (menu-bar-menu-frame-live-and-visible-p) + (menu-bar-non-minibuffer-window-p)) + :help "Make new window on right of selected one") + (one-window menu-item "Remove Other Windows" delete-other-windows :enable + (not + (one-window-p t nil)) + :help "Make selected window fill whole frame") + (separator-frame "–") + (make-frame menu-item "New Frame" make-frame-command :visible + (fboundp 'make-frame-command) + :help "Open a new frame") + (make-frame-on-display menu-item "New Frame on Display…" make-frame-on-display :visible + (fboundp 'make-frame-on-display) + :help "Open a new frame on another display") + (delete-this-frame menu-item "Delete Frame" delete-frame :visible + (fboundp 'delete-frame) + :enable + (delete-frame-enabled-p) + :help "Delete currently selected frame") + (separator-exit "–") + (exit-emacs menu-item "Quit" save-buffers-kill-terminal :help "Save unsaved buffers, then exit") + "File") + (edit "Edit" keymap + (undo menu-item "Undo" undo :enable + (and + (not buffer-read-only) + (not + (eq t buffer-undo-list)) + (if + (eq last-command 'undo) + (listp pending-undo-list) + (consp buffer-undo-list))) + :help "Undo last operation") + (cut menu-item "Cut" kill-region :enable + (and mark-active + (not buffer-read-only)) + :help "Cut (kill) text in region between mark and current position") + (copy menu-item "Copy" kill-ring-save :enable mark-active :help "Copy text in region between mark and current position" :keys "\\[kill-ring-save]") + (paste menu-item "Paste" yank :enable + (and + (or + (and + (fboundp 'x-selection-exists-p) + (x-selection-exists-p 'CLIPBOARD)) + (if + (featurep 'ns) + (cdr yank-menu) + kill-ring)) + (not buffer-read-only)) + :help "Paste (yank) text most recently cut/copied") + (paste-from-menu menu-item "Paste from Kill Menu" yank-menu :enable + (and + (cdr yank-menu) + (not buffer-read-only)) + :help "Choose a string from the kill ring and paste it") + (clear menu-item "Clear" delete-region :enable + (and mark-active + (not buffer-read-only)) + :help "Delete the text in region between mark and current position") + (mark-whole-buffer menu-item "Select All" mark-whole-buffer :help "Mark the whole buffer for a subsequent cut/copy") + (separator-search "–") + (search menu-item "Search" + (keymap + (search-forward menu-item "String Forward…" nonincremental-search-forward :help "Search forward for a string") + (search-backward menu-item "String Backwards…" nonincremental-search-backward :help "Search backwards for a string") + (re-search-forward menu-item "Regexp Forward…" nonincremental-re-search-forward :help "Search forward for a regular expression") + (re-search-backward menu-item "Regexp Backwards…" nonincremental-re-search-backward :help "Search backwards for a regular expression") + (separator-repeat-search "–") + (repeat-search-fwd menu-item "Repeat Forward" nonincremental-repeat-search-forward :enable + (or + (and + (eq menu-bar-last-search-type 'string) + search-ring) + (and + (eq menu-bar-last-search-type 'regexp) + regexp-search-ring)) + :help "Repeat last search forward") + (repeat-search-back menu-item "Repeat Backwards" nonincremental-repeat-search-backward :enable + (or + (and + (eq menu-bar-last-search-type 'string) + search-ring) + (and + (eq menu-bar-last-search-type 'regexp) + regexp-search-ring)) + :help "Repeat last search backwards") + (separator-tag-search "–") + (tags-srch menu-item "Search Tagged Files…" tags-search :help "Search for a regexp in all tagged files") + (tags-continue menu-item "Continue Tags Search" tags-loop-continue :help "Continue last tags search operation") + (separator-tag-isearch "–") + (i-search menu-item "Incremental Search" + (keymap + (isearch-forward menu-item "Forward String…" isearch-forward :help "Search forward for a string as you type it") + (isearch-backward menu-item "Backward String…" isearch-backward :help "Search backwards for a string as you type it") + (isearch-forward-regexp menu-item "Forward Regexp…" isearch-forward-regexp :help "Search forward for a regular expression as you type it") + (isearch-backward-regexp menu-item "Backward Regexp…" isearch-backward-regexp :help "Search backwards for a regular expression as you type it") + "Incremental Search")) + "Search")) + (replace menu-item "Replace" + (keymap + (query-replace menu-item "Replace String…" query-replace :enable + (not buffer-read-only) + :help "Replace string interactively, ask about each occurrence") + (query-replace-regexp menu-item "Replace Regexp…" query-replace-regexp :enable + (not buffer-read-only) + :help "Replace regular expression interactively, ask about each occurrence") + (separator-replace-tags "–") + (tags-repl menu-item "Replace in Tagged Files…" tags-query-replace :help "Interactively replace a regexp in all tagged files") + (tags-repl-continue menu-item "Continue Replace" tags-loop-continue :help "Continue last tags replace operation") + "Replace")) + (goto menu-item "Go To" + (keymap + (go-to-line menu-item "Goto Line…" goto-line :help "Read a line number and go to that line") + (go-to-pos menu-item "Goto Buffer Position…" goto-char :help "Read a number N and go to buffer position N") + (beg-of-buf menu-item "Goto Beginning of Buffer" beginning-of-buffer) + (end-of-buf menu-item "Goto End of Buffer" end-of-buffer) + (separator-tags "–") + (find-tag menu-item "Find Tag…" find-tag :help "Find definition of function or variable") + (find-tag-otherw menu-item "Find Tag in Other Window…" find-tag-other-window :help "Find function/variable definition in another window") + (next-tag menu-item "Find Next Tag" menu-bar-next-tag :enable + (and + (boundp 'tags-location-ring) + (not + (ring-empty-p tags-location-ring))) + :help "Find next function/variable matching last tag name") + (next-tag-otherw menu-item "Next Tag in Other Window" menu-bar-next-tag-other-window :enable + (and + (boundp 'tags-location-ring) + (not + (ring-empty-p tags-location-ring))) + :help "Find next function/variable matching last tag name in another window") + (apropos-tags menu-item "Tags Apropos…" tags-apropos :help "Find function/variables whose names match regexp") + (separator-tag-file "–") + (set-tags-name menu-item "Set Tags File Name…" visit-tags-table :help "Tell Tags commands which tag table file to use") + "Go To")) + (bookmark menu-item "Bookmarks" menu-bar-bookmark-map) + (separator-bookmark "–") + (fill menu-item "Fill" fill-region :enable + (and mark-active + (not buffer-read-only)) + :help "Fill text in region to fit between left and right margin") + (props menu-item "Text Properties" facemenu-menu) + "Edit") + (options "Options" keymap + (transient-mark-mode menu-item "Highlight Active Region" transient-mark-mode :enable + (not cua-mode) + :help "Make text in active region stand out in color (Transient Mark mode)" :button + (:toggle and + (default-boundp 'transient-mark-mode) + (default-value 'transient-mark-mode))) + (highlight-paren-mode menu-item "Highlight Matching Parentheses" show-paren-mode :help "Highlight matching/mismatched parentheses at cursor (Show Paren mode)" :button + (:toggle and + (default-boundp 'show-paren-mode) + (default-value 'show-paren-mode))) + (highlight-separator "–") + (line-wrapping menu-item "Line Wrapping in This Buffer" + (keymap + (window-wrap menu-item "Wrap at Window Edge" + #[nil "\203\300\303!\210\304\n\205\305\306!\207" + [visual-line-mode word-wrap truncate-lines 0 nil toggle-truncate-lines -1] + 2 nil nil] + :help "Wrap long lines at window edge" :button + (:radio and + (null truncate-lines) + (not + (truncated-partial-width-window-p)) + (not word-wrap)) + :visible + (menu-bar-menu-frame-live-and-visible-p) + :enable + (not + (truncated-partial-width-window-p))) + (truncate menu-item "Truncate Long Lines" + #[nil "\203\300\302!\210\303\304\305!\207" + [visual-line-mode word-wrap 0 nil toggle-truncate-lines 1] + 2 nil nil] + :help "Truncate long lines at window edge" :button + (:radio or truncate-lines + (truncated-partial-width-window-p)) + :visible + (menu-bar-menu-frame-live-and-visible-p) + :enable + (not + (truncated-partial-width-window-p))) + (word-wrap menu-item "Word Wrap (Visual Line mode)" + #[nil "\204\300\301!\210\302\303!\207" + [visual-line-mode 1 message "Visual-Line mode enabled"] + 2 nil nil] + :help "Wrap long lines at word boundaries" :button + (:radio and + (null truncate-lines) + (not + (truncated-partial-width-window-p)) + word-wrap) + :visible + (menu-bar-menu-frame-live-and-visible-p)) + "Line Wrapping")) + (auto-fill-mode menu-item "Auto Fill in Text Modes" menu-bar-text-mode-auto-fill :help "Automatically fill text while typing (Auto Fill mode)" :button + (:toggle if + (listp text-mode-hook) + (member 'turn-on-auto-fill text-mode-hook) + (eq 'turn-on-auto-fill text-mode-hook))) + (case-fold-search menu-item "Ignore Case for Search" toggle-case-fold-search :help "Ignore letter-case in search commands" :button + (:toggle and + (default-boundp 'case-fold-search) + (default-value 'case-fold-search))) + (cua-emulation-mode menu-item "Shift movement mark region (CUA)" cua-mode :visible + (and + (boundp 'cua-enable-cua-keys) + (not cua-enable-cua-keys)) + :help "Use shifted movement keys to set and extend the region" :button + (:toggle and + (default-boundp 'cua-mode) + (default-value 'cua-mode))) + (cua-mode menu-item "Use CUA Keys (Cut/Paste with /C-/x//C-/c//C-/v)" cua-mode :visible + (or + (not + (boundp 'cua-enable-cua-keys)) + cua-enable-cua-keys) + :help "Use /C-/z//C-/x//C-/c//C-/v keys for undo/cut/copy/paste" :button + (:toggle and + (default-boundp 'cua-mode) + (default-value 'cua-mode))) + (edit-options-separator "–") + (uniquify menu-item "Use Directory Names in Buffer Names" toggle-uniquify-buffer-names :help "Uniquify buffer names by adding parent directory names" :button + (:toggle and + (default-boundp 'uniquify-buffer-name-style) + (default-value 'uniquify-buffer-name-style))) + (save-place menu-item "Save Place in Files between Sessions" toggle-save-place-globally :help "Visit files of previous session when restarting Emacs" :button + (:toggle and + (default-boundp 'save-place) + (default-value 'save-place))) + (cursor-separator "–") + (blink-cursor-mode menu-item "Blink Cursor" blink-cursor-mode :help "Whether the cursor blinks (Blink Cursor mode)" :button + (:toggle and + (default-boundp 'blink-cursor-mode) + (default-value 'blink-cursor-mode))) + (debugger-separator "–") + (debug-on-error menu-item "Enter Debugger on Error" toggle-debug-on-error :help "Enter Lisp debugger when an error is signaled" :button + (:toggle and + (default-boundp 'debug-on-error) + (default-value 'debug-on-error))) + (debug-on-quit menu-item "Enter Debugger on Quit//C-/g" toggle-debug-on-quit :help "Enter Lisp debugger when /C-/g is pressed" :button + (:toggle and + (default-boundp 'debug-on-quit) + (default-value 'debug-on-quit))) + (mule-separator "–") + (mule menu-item "Multilingual Environment" + (keymap + (set-language-environment menu-item "Set Language Environment" + (keymap + (Default menu-item "Default" setup-specified-language-environment) + "Set Language Environment" + (Chinese "Chinese" . setup-chinese-environment-map) + (Cyrillic "Cyrillic" . setup-cyrillic-environment-map) + (Indian "Indian" . setup-indian-environment-map) + (Sinhala "Sinhala" . setup-specified-language-environment) + (English "English" . setup-specified-language-environment) + (ASCII "ASCII" . setup-specified-language-environment) + (Ethiopic "Ethiopic" . setup-specified-language-environment) + (European "European" . setup-european-environment-map) + (Turkish "Turkish" . setup-specified-language-environment) + (Greek "Greek" . setup-specified-language-environment) + (Hebrew "Hebrew" . setup-specified-language-environment) + (Windows-1255 "Windows-1255" . setup-specified-language-environment) + (Japanese "Japanese" . setup-specified-language-environment) + (Korean "Korean" . setup-specified-language-environment) + (Lao "Lao" . setup-specified-language-environment) + (TaiViet "TaiViet" . setup-specified-language-environment) + (Thai "Thai" . setup-specified-language-environment) + (Tibetan "Tibetan" . setup-specified-language-environment) + (Vietnamese "Vietnamese" . setup-specified-language-environment) + (IPA "IPA" . setup-specified-language-environment) + (Arabic "Arabic" . setup-specified-language-environment) + (Persian "Persian" . setup-specified-language-environment) + (/UTF-/8 "/UTF-/8" . setup-specified-language-environment) + (Khmer "Khmer" . setup-specified-language-environment) + (Burmese "Burmese" . setup-specified-language-environment) + (Cham "Cham" . setup-specified-language-environment))) + (separator-mule "–") + (toggle-input-method menu-item "Toggle Input Method" toggle-input-method) + (set-input-method menu-item "Select Input Method…" set-input-method) + (separator-input-method "–") + (set-various-coding-system menu-item "Set Coding Systems" + (keymap + (universal-coding-system-argument menu-item "For Next Command" universal-coding-system-argument :help "Coding system to be used by next command") + (separator-1 "–") + (set-buffer-file-coding-system menu-item "For Saving This Buffer" set-buffer-file-coding-system :help "How to encode this buffer when saved") + (revert-buffer-with-coding-system menu-item "For Reverting This File Now" revert-buffer-with-coding-system :enable buffer-file-name :help "Revisit this file immediately using specified coding system") + (set-file-name-coding-system menu-item "For File Name" set-file-name-coding-system :help "How to decode/encode file names") + (separator-2 "–") + (set-keyboard-coding-system menu-item "For Keyboard" set-keyboard-coding-system :help "How to decode keyboard input") + (set-terminal-coding-system menu-item "For Terminal" set-terminal-coding-system :enable + (null + (memq initial-window-system + '(x w32 ns))) + :help "How to encode terminal output") + (separator-3 "–") + (set-selection-coding-system menu-item "For X Selections/Clipboard" set-selection-coding-system :visible + (display-selections-p) + :help "How to en/decode data to/from selection/clipboard") + (set-next-selection-coding-system menu-item "For Next X Selection" set-next-selection-coding-system :visible + (display-selections-p) + :help "How to en/decode next selection/clipboard operation") + (set-buffer-process-coding-system menu-item "For I/O with Subprocess" set-buffer-process-coding-system :visible + (fboundp 'start-process) + :enable + (get-buffer-process + (current-buffer)) + :help "How to en/decode I/O from/to subprocess connected to this buffer") + "Set Coding System") + :enable + (default-value 'enable-multibyte-characters)) + (view-hello-file menu-item "Show Multilingual Sample Text" view-hello-file :enable + (file-readable-p + (expand-file-name "HELLO" data-directory)) + :help "Demonstrate various character sets") + (separator-coding-system "–") + (describe-language-environment menu-item "Describe Language Environment" + (keymap + (Default menu-item "Default" describe-specified-language-support) + "Describe Language Environment" + (Chinese "Chinese" . describe-chinese-environment-map) + (Cyrillic "Cyrillic" . describe-cyrillic-environment-map) + (Indian "Indian" . describe-indian-environment-map) + (Sinhala "Sinhala" . describe-specified-language-support) + (English "English" . describe-specified-language-support) + (ASCII "ASCII" . describe-specified-language-support) + (Ethiopic "Ethiopic" . describe-specified-language-support) + (European "European" . describe-european-environment-map) + (Turkish "Turkish" . describe-specified-language-support) + (Greek "Greek" . describe-specified-language-support) + (Hebrew "Hebrew" . describe-specified-language-support) + (Windows-1255 "Windows-1255" . describe-specified-language-support) + (Japanese "Japanese" . describe-specified-language-support) + (Korean "Korean" . describe-specified-language-support) + (Lao "Lao" . describe-specified-language-support) + (TaiViet "TaiViet" . describe-specified-language-support) + (Thai "Thai" . describe-specified-language-support) + (Tibetan "Tibetan" . describe-specified-language-support) + (Vietnamese "Vietnamese" . describe-specified-language-support) + (IPA "IPA" . describe-specified-language-support) + (Arabic "Arabic" . describe-specified-language-support) + (Persian "Persian" . describe-specified-language-support) + (/UTF-/8 "/UTF-/8" . describe-specified-language-support) + (Khmer "Khmer" . describe-specified-language-support) + (Burmese "Burmese" . describe-specified-language-support)) + :help "Show multilingual settings for a specific language") + (describe-input-method menu-item "Describe Input Method" describe-input-method) + (describe-coding-system menu-item "Describe Coding System…" describe-coding-system) + (list-character-sets menu-item "List Character Sets" list-character-sets :help "Show table of available character sets") + (mule-diag menu-item "Show All Multilingual Settings" mule-diag :help "Display multilingual environment settings") + "Mule (Multilingual Environment)")) + (showhide-separator "–") + (showhide menu-item "Show/Hide" + (keymap + (showhide-tool-bar menu-item "Tool-bar" toggle-tool-bar-mode-from-frame :help "Turn tool-bar on/off" :visible + (display-graphic-p) + :button + (:toggle menu-bar-positive-p + (frame-parameter + (menu-bar-frame-for-menubar) + 'tool-bar-lines))) + (menu-bar-mode menu-item "Menu-bar" toggle-menu-bar-mode-from-frame :help "Turn menu-bar on/off" :button + (:toggle menu-bar-positive-p + (frame-parameter + (menu-bar-frame-for-menubar) + 'menu-bar-lines))) + (showhide-tooltip-mode menu-item "Tooltips" tooltip-mode :help "Turn tooltips on/off" :visible + (and + (display-graphic-p) + (fboundp 'x-show-tip)) + :button + (:toggle . tooltip-mode)) + (showhide-scroll-bar menu-item "Scroll-bar" + (keymap + (none menu-item "None" menu-bar-no-scroll-bar :help "Turn off scroll-bar" :visible + (display-graphic-p) + :button + (:radio eq + (cdr + (assq 'vertical-scroll-bars + (frame-parameters))) + nil)) + (left menu-item "On the Left" menu-bar-left-scroll-bar :help "Scroll-bar on the left side" :visible + (display-graphic-p) + :button + (:radio eq + (cdr + (assq 'vertical-scroll-bars + (frame-parameters))) + 'left)) + (right menu-item "On the Right" menu-bar-right-scroll-bar :help "Scroll-bar on the right side" :visible + (display-graphic-p) + :button + (:radio eq + (cdr + (assq 'vertical-scroll-bars + (frame-parameters))) + 'right)) + "Scroll-bar") + :visible + (display-graphic-p)) + (showhide-fringe menu-item "Fringe" + (keymap + (none menu-item "None" menu-bar-showhide-fringe-menu-customize-disable :help "Turn off fringe" :visible + (display-graphic-p) + :button + (:radio eq fringe-mode 0)) + (left menu-item "On the Left" menu-bar-showhide-fringe-menu-customize-left :help "Fringe only on the left side" :visible + (display-graphic-p) + :button + (:radio equal fringe-mode + '(nil . 0))) + (right menu-item "On the Right" menu-bar-showhide-fringe-menu-customize-right :help "Fringe only on the right side" :visible + (display-graphic-p) + :button + (:radio equal fringe-mode + '(0))) + (default menu-item "Default" menu-bar-showhide-fringe-menu-customize-reset :help "Default width fringe on both left and right side" :visible + (display-graphic-p) + :button + (:radio eq fringe-mode nil)) + (customize menu-item "Customize Fringe" menu-bar-showhide-fringe-menu-customize :help "Detailed customization of fringe" :visible + (display-graphic-p)) + (indicate-empty-lines menu-item "Empty Line Indicators" toggle-indicate-empty-lines :help "Indicate trailing empty lines in fringe, globally" :button + (:toggle and + (default-boundp 'indicate-empty-lines) + (default-value 'indicate-empty-lines))) + (showhide-fringe-ind menu-item "Buffer Boundaries" + (keymap + (none menu-item "No Indicators" menu-bar-showhide-fringe-ind-none :help "Hide all buffer boundary indicators and arrows" :visible + (display-graphic-p) + :button + (:radio eq indicate-buffer-boundaries nil)) + (left menu-item "In Left Fringe" menu-bar-showhide-fringe-ind-left :help "Show buffer boundaries and arrows in left fringe" :visible + (display-graphic-p) + :button + (:radio eq indicate-buffer-boundaries 'left)) + (right menu-item "In Right Fringe" menu-bar-showhide-fringe-ind-right :help "Show buffer boundaries and arrows in right fringe" :visible + (display-graphic-p) + :button + (:radio eq indicate-buffer-boundaries 'right)) + (box menu-item "Opposite, No Arrows" menu-bar-showhide-fringe-ind-box :help "Show top/bottom indicators in opposite fringes, no arrows" :visible + (display-graphic-p) + :button + (:radio equal indicate-buffer-boundaries + '((top . left) + (bottom . right)))) + (mixed menu-item "Opposite, Arrows Right" menu-bar-showhide-fringe-ind-mixed :help "Show top/bottom indicators in opposite fringes, arrows in right" :visible + (display-graphic-p) + :button + (:radio equal indicate-buffer-boundaries + '((t . right) + (top . left)))) + (customize menu-item "Other (Customize)" menu-bar-showhide-fringe-ind-customize :help "Additional choices available through Custom buffer" :visible + (display-graphic-p) + :button + (:radio not + (member indicate-buffer-boundaries + '(nil left right + ((top . left) + (bottom . right)) + ((t . right) + (top . left)))))) + "Buffer boundaries") + :visible + (display-graphic-p) + :help "Indicate buffer boundaries in fringe") + "Fringe") + :visible + (display-graphic-p)) + (showhide-speedbar menu-item "Speedbar" speedbar-frame-mode :help "Display a Speedbar quick-navigation frame" :button + (:toggle and + (boundp 'speedbar-frame) + (frame-live-p + (symbol-value 'speedbar-frame)) + (frame-visible-p + (symbol-value 'speedbar-frame)))) + (datetime-separator "–") + (showhide-date-time menu-item "Time, Load and Mail" display-time-mode :help "Display time, system load averages and mail status in mode line" :button + (:toggle and + (default-boundp 'display-time-mode) + (default-value 'display-time-mode))) + (showhide-battery menu-item "Battery Status" display-battery-mode :help "Display battery status information in mode line" :button + (:toggle and + (default-boundp 'display-battery-mode) + (default-value 'display-battery-mode))) + (linecolumn-separator "–") + (size-indication-mode menu-item "Size Indication" size-indication-mode :help "Show the size of the buffer in the mode line" :button + (:toggle and + (default-boundp 'size-indication-mode) + (default-value 'size-indication-mode))) + (line-number-mode menu-item "Line Numbers" line-number-mode :help "Show the current line number in the mode line" :button + (:toggle and + (default-boundp 'line-number-mode) + (default-value 'line-number-mode))) + (column-number-mode menu-item "Column Numbers" column-number-mode :help "Show the current column number in the mode line" :button + (:toggle and + (default-boundp 'column-number-mode) + (default-value 'column-number-mode))) + "Show/Hide")) + (menu-system-font menu-item "Use System Font" toggle-use-system-font :help "Use the monospaced font defined by the system" :button + (:toggle and + (default-boundp 'font-use-system-font) + (default-value 'font-use-system-font))) + (menu-set-font menu-item "Set Default Font…" menu-set-font :visible + (display-multi-font-p) + :help "Select a default font") + (custom-separator "–") + (save menu-item "Save Options" menu-bar-options-save :help "Save options set from the menu above") + (package menu-item "Manage Emacs Packages" package-list-packages :help "Install or uninstall additional Emacs packages") + (customize menu-item "Customize Emacs" + (keymap + (customize-themes menu-item "Custom Themes" customize-themes :help "Choose a pre-defined customization theme") + (customize menu-item "Top-level Customization Group" customize :help "The master group called `Emacs'") + (customize-browse menu-item "Browse Customization Groups" customize-browse :help "Browse all customization groups") + (separator-3 "–") + (customize-saved menu-item "Saved Options" customize-saved :help "Customize previously saved options") + (customize-changed-options menu-item "New Options…" customize-changed-options :help "Options added or changed in recent Emacs versions") + (separator-2 "–") + (customize-option menu-item "Specific Option…" customize-option :help "Customize value of specific option") + (customize-face menu-item "Specific Face…" customize-face :help "Customize attributes of specific face") + (customize-group menu-item "Specific Group…" customize-group :help "Customize settings of specific group") + (separator-1 "–") + (customize-apropos menu-item "All Settings Matching…" customize-apropos :help "Browse customizable settings matching a regexp or word list") + (customize-apropos-options menu-item "Options Matching…" customize-apropos-options :help "Browse options matching a regexp or word list") + (customize-apropos-faces menu-item "Faces Matching…" customize-apropos-faces :help "Browse faces matching a regexp or word list") + "Customize")) + "Options") + (buffer "Buffers" keymap "Select Buffer" + [("scratch " + (nil) + lambda nil + (interactive) + (funcall menu-bar-select-buffer-function #<buffer scratch*>)) ("*Messages *" + (nil) + lambda nil + (interactive) + (funcall menu-bar-select-buffer-function #<buffer *Messages*>))] + (command-separator "–") + (next-buffer menu-item "Next Buffer" next-buffer :help "Switch to the \"next\" buffer in a cyclic order") + (previous-buffer menu-item "Previous Buffer" previous-buffer :help "Switch to the \"previous\" buffer in a cyclic order") + (select-named-buffer menu-item "Select Named Buffer…" switch-to-buffer :help "Prompt for a buffer name, and select that buffer in the current window") + (list-all-buffers menu-item "List All Buffers" list-buffers :help "Pop up a window listing all Emacs buffers")) + (tools "Tools" keymap + (grep menu-item "Search Files (Grep)…" grep :help "Search files for strings or regexps (with Grep)") + (compile menu-item "Compile…" compile :help "Invoke compiler or Make, view compilation errors") + (shell menu-item "Shell Command…" shell-command :help "Invoke a shell command and catch its output") + (shell-on-region menu-item "Shell Command on Region…" shell-command-on-region :enable mark-active :help "Pass marked region to a shell command") + (gdb menu-item "Debugger (GDB)…" gdb :help "Debug a program from within Emacs with GDB") + (ede menu-item "Project support (EDE)" global-ede-mode :help "Toggle the Emacs Development Environment (Global EDE mode)" :button + (:toggle bound-and-true-p global-ede-mode)) + (semantic menu-item "Source Code Parsers (Semantic)" semantic-mode :help "Toggle automatic parsing in source code buffers (Semantic mode)" :button + (:toggle bound-and-true-p semantic-mode)) + (separator-prog "–") + (spell menu-item "Spell Checking" ispell-menu-map) + (separator-spell "–") + (compare menu-item "Compare (Ediff)" menu-bar-ediff-menu) + (ediff-merge menu-item "Merge" menu-bar-ediff-merge-menu) + (epatch menu-item "Apply Patch" menu-bar-epatch-menu) + (separator-compare "–") + (vc menu-item "Version Control" vc-menu-map :filter vc-menu-map-filter) + (separator-vc "–") + (gnus menu-item "Read Net News (Gnus)" gnus :help "Read network news groups") + (rmail menu-item + (format "Read Mail (with %s)" + (read-mail-item-name)) + menu-bar-read-mail :visible + (and read-mail-command + (not + (eq read-mail-command 'ignore))) + :help "Read your mail and reply to it") + (compose-mail menu-item + (format "Send Mail (with %s)" + (send-mail-item-name)) + compose-mail :visible + (and mail-user-agent + (not + (eq mail-user-agent 'ignore))) + :help "Send a mail message") + (directory-search menu-item "Directory Search" eudc-tools-menu) + (separator-net "–") + (calendar menu-item "Calendar" calendar :help "Invoke the Emacs built-in calendar") + (calc menu-item "Programmable Calculator" calc :help "Invoke the Emacs built-in full scientific calculator") + (simple-calculator menu-item "Simple Calculator" calculator :help "Invoke the Emacs built-in quick calculator") + (separator-encryption-decryption "–") + (encryption-decryption menu-item "Encryption/Decryption" + (keymap + (decrypt-file menu-item "Decrypt File…" epa-decrypt-file :help "Decrypt a file") + (encrypt-file menu-item "Encrypt File…" epa-encrypt-file :help "Encrypt a file") + (verify-file menu-item "Verify File…" epa-verify-file :help "Verify digital signature of a file") + (sign-file menu-item "Sign File…" epa-sign-file :help "Create digital signature of a file") + (separator-file "–") + (decrypt-region menu-item "Decrypt Region" epa-decrypt-region :help "Decrypt the current region") + (encrypt-region menu-item "Encrypt Region" epa-encrypt-region :help "Encrypt the current region") + (verify-region menu-item "Verify Region" epa-verify-region :help "Verify digital signature of the current region") + (sign-region menu-item "Sign Region" epa-sign-region :help "Create digital signature of the current region") + (separator-keys "–") + (list-keys menu-item "List Keys" epa-list-keys :help "Browse your public keyring") + (import-keys menu-item "Import Keys from File…" epa-import-keys :help "Import public keys from a file") + (import-keys-region menu-item "Import Keys from Region" epa-import-keys-region :help "Import public keys from the current region") + (export-keys menu-item "Export Keys" epa-export-keys :help "Export public keys to a file") + (insert-keys menu-item "Insert Keys" epa-insert-keys :help "Insert public keys after the current point") + "Encryption/Decryption")) + (separator-games "–") + (games menu-item "Games" + (keymap + (5x5 menu-item "5x5" 5x5 :help "Fill in all the squares on a 5x5 board") + (adventure menu-item "Adventure" dunnet :help "Dunnet, a text Adventure game for Emacs") + (black-box menu-item "Blackbox" blackbox :help "Find balls in a black box by shooting rays") + (bubbles menu-item "Bubbles" bubbles :help "Remove all bubbles using the fewest moves") + (gomoku menu-item "Gomoku" gomoku :help "Mark 5 contiguous squares (like tic-tac-toe)") + (hanoi menu-item "Towers of Hanoi" hanoi :help "Watch Towers-of-Hanoi puzzle solved by Emacs") + (land menu-item "Landmark" landmark :help "Watch a neural-network robot learn landmarks") + (life menu-item "Life" life :help "Watch how John Conway's cellular automaton evolves") + (mult menu-item "Multiplication Puzzle" mpuz :help "Exercise brain with multiplication") + (pong menu-item "Pong" pong :help "Bounce the ball to your opponent") + (snake menu-item "Snake" snake :help "Move snake around avoiding collisions") + (solitaire menu-item "Solitaire" solitaire :help "Get rid of all the stones") + (tetris menu-item "Tetris" tetris :help "Falling blocks game") + (zone menu-item "Zone Out" zone :help "Play tricks with Emacs display when Emacs is idle") + "Games")) + "Tools") + (mouse-1 . tmm-menubar-mouse) + (help-menu "Help" keymap + (emacs-tutorial menu-item "Emacs Tutorial" help-with-tutorial :help "Learn how to use Emacs") + (emacs-tutorial-language-specific menu-item "Emacs Tutorial (choose language)…" help-with-tutorial-spec-language :help "Learn how to use Emacs (choose a language)") + (emacs-faq menu-item "Emacs FAQ" view-emacs-/FAQ/ :help "Frequently asked (and answered) questions about Emacs") + (emacs-news menu-item "Emacs News" view-emacs-news :help "New features of this version") + (emacs-known-problems menu-item "Emacs Known Problems" view-emacs-problems :help "Read about known problems with Emacs") + (emacs-manual-bug menu-item "How to Report a Bug" info-emacs-bug :help "Read about how to report an Emacs bug") + (send-emacs-bug-report menu-item "Send Bug Report…" report-emacs-bug :help "Send e-mail to Emacs maintainers") + (emacs-psychotherapist menu-item "Emacs Psychotherapist" doctor :help "Our doctor will help you feel better") + (sep1 "–") + (search-documentation menu-item "Search Documentation" + (keymap + (emacs-terminology menu-item "Emacs Terminology" search-emacs-glossary :help "Display the Glossary section of the Emacs manual") + (lookup-subject-in-emacs-manual menu-item "Look Up Subject in User Manual…" emacs-index-search :help "Find description of a subject in Emacs User manual") + (lookup-subject-in-elisp-manual menu-item "Look Up Subject in /EL/isp Manual…" elisp-index-search :help "Find description of a subject in Emacs Lisp manual") + (lookup-key-in-manual menu-item "Look Up Key in User Manual…" Info-goto-emacs-key-command-node :help "Display manual section that describes a key") + (lookup-command-in-manual menu-item "Look Up Command in User Manual…" Info-goto-emacs-command-node :help "Display manual section that describes a command") + (sep1 "–") + (find-commands-by-name menu-item "Find Commands by Name…" apropos-command :help "Find commands whose names match a regexp") + (find-options-by-name menu-item "Find Options by Name…" apropos-variable :help "Find variables whose names match a regexp") + (find-option-by-value menu-item "Find Options by Value…" apropos-value :help "Find variables whose values match a regexp") + (find-any-object-by-name menu-item "Find Any Object by Name…" apropos :help "Find symbols of any kind whose names match a regexp") + (search-documentation-strings menu-item "Search Documentation Strings…" apropos-documentation :help "Find functions and variables whose doc strings match a regexp") + "Search Documentation")) + (describe menu-item "Describe" + (keymap + (describe-mode menu-item "Describe Buffer Modes" describe-mode :help "Describe this buffer's major and minor mode") + (describe-key-1 menu-item "Describe Key or Mouse Operation…" describe-key :help "Display documentation of command bound to a key, a click, or a menu-item") + (describe-function menu-item "Describe Function…" describe-function :help "Display documentation of function/command") + (describe-variable menu-item "Describe Variable…" describe-variable :help "Display documentation of variable/option") + (describe-face menu-item "Describe Face…" describe-face :help "Display the properties of a face") + (describe-package menu-item "Describe Package…" describe-package :help "Display documentation of a Lisp package") + (describe-current-display-table menu-item "Describe Display Table" describe-current-display-table :help "Describe the current display table") + (list-keybindings menu-item "List Key Bindings" describe-bindings :help "Display all current key bindings (keyboard shortcuts)") + (separator-desc-mule "–") + (describe-language-environment menu-item "Describe Language Environment" + (keymap + (Default menu-item "Default" describe-specified-language-support) + "Describe Language Environment" + (Chinese "Chinese" . describe-chinese-environment-map) + (Cyrillic "Cyrillic" . describe-cyrillic-environment-map) + (Indian "Indian" . describe-indian-environment-map) + (Sinhala "Sinhala" . describe-specified-language-support) + (English "English" . describe-specified-language-support) + (ASCII "ASCII" . describe-specified-language-support) + (Ethiopic "Ethiopic" . describe-specified-language-support) + (European "European" . describe-european-environment-map) + (Turkish "Turkish" . describe-specified-language-support) + (Greek "Greek" . describe-specified-language-support) + (Hebrew "Hebrew" . describe-specified-language-support) + (Windows-1255 "Windows-1255" . describe-specified-language-support) + (Japanese "Japanese" . describe-specified-language-support) + (Korean "Korean" . describe-specified-language-support) + (Lao "Lao" . describe-specified-language-support) + (TaiViet "TaiViet" . describe-specified-language-support) + (Thai "Thai" . describe-specified-language-support) + (Tibetan "Tibetan" . describe-specified-language-support) + (Vietnamese "Vietnamese" . describe-specified-language-support) + (IPA "IPA" . describe-specified-language-support) + (Arabic "Arabic" . describe-specified-language-support) + (Persian "Persian" . describe-specified-language-support) + (/UTF-/8 "/UTF-/8" . describe-specified-language-support) + (Khmer "Khmer" . describe-specified-language-support) + (Burmese "Burmese" . describe-specified-language-support))) + (describe-input-method menu-item "Describe Input Method…" describe-input-method :visible + (default-value 'enable-multibyte-characters) + :help "Keyboard layout for specific input method") + (describe-coding-system menu-item "Describe Coding System…" describe-coding-system :visible + (default-value 'enable-multibyte-characters)) + (describe-coding-system-briefly menu-item "Describe Coding System (Briefly)" describe-current-coding-system-briefly :visible + (default-value 'enable-multibyte-characters)) + (mule-diag menu-item "Show All of Mule Status" mule-diag :visible + (default-value 'enable-multibyte-characters) + :help "Display multilingual environment settings") + "Describe")) + (emacs-manual menu-item "Read the Emacs Manual" info-emacs-manual :help "Full documentation of Emacs features") + (more-manuals menu-item "More Manuals" + (keymap + (emacs-lisp-intro menu-item "Introduction to Emacs Lisp" menu-bar-read-lispintro :help "Read the Introduction to Emacs Lisp Programming") + (emacs-lisp-reference menu-item "Emacs Lisp Reference" menu-bar-read-lispref :help "Read the Emacs Lisp Reference manual") + (other-manuals menu-item "All Other Manuals (Info)" Info-directory :help "Read any of the installed manuals") + (lookup-subject-in-all-manuals menu-item "Lookup Subject in all Manuals…" info-apropos :help "Find description of a subject in all installed manuals") + (order-emacs-manuals menu-item "Ordering Manuals" view-order-manuals :help "How to order manuals from the Free Software Foundation") + (sep2 "–") + (man menu-item "Read Man Page…" manual-entry :help "Man-page docs for external commands and libraries") + "More Manuals")) + (find-emacs-packages menu-item "Search Built-in Packages" finder-by-keyword :help "Find built-in packages and features by keyword") + (external-packages menu-item "Finding Extra Packages" menu-bar-help-extra-packages :help "Lisp packages distributed separately for use in Emacs") + (sep2 "–") + (getting-new-versions menu-item "Getting New Versions" describe-distribution :help "How to get the latest version of Emacs") + (describe-copying menu-item "Copying Conditions" describe-copying :help "Show the Emacs license (GPL)") + (describe-no-warranty menu-item "(Non)Warranty" describe-no-warranty :help "Explain that Emacs has NO WARRANTY") + (sep4 "–") + (about-emacs menu-item "About Emacs" about-emacs :help "Display version number, copyright info, and basic help") + (about-gnu-project menu-item "About GNU" describe-gnu-project :help "About the GNU System, GNU Project, and /GNU//Linux") + "Help")) + (f4 . kmacro-end-or-call-macro) + (f3 . kmacro-start-macro-or-insert-counter) + (/C-M-/end . end-of-defun) + (/C-M-/home . beginning-of-defun) + (/C-M-/down . down-list) + (/C-M-/up . backward-up-list) + (/C-M-/right . forward-sexp) + (/C-M-/left . backward-sexp) + (/S-/delete . kill-region) + (/C-/backspace . backward-kill-word) + (/C-/delete . kill-word) + (/C-/left . left-word) + (/C-/right . right-word) + (/M-/left . left-word) + (/M-/right . right-word) + (mouse-movement . ignore) + (deletechar . delete-forward-char) + (deleteline . kill-line) + (insertline . open-line) + (open . find-file) + (again . repeat-complex-command) + (redo . repeat-complex-command) + (undo . undo) + (/S-/insertchar . yank) + (/C-/insertchar . kill-ring-save) + (insertchar . overwrite-mode) + (/S-/insert . yank) + (/C-/insert . kill-ring-save) + (insert . overwrite-mode) + (execute . execute-extended-command) + (/M-/begin . beginning-of-buffer-other-window) + (begin . beginning-of-buffer) + (/M-/end . end-of-buffer-other-window) + (/C-/end . end-of-buffer) + (end . move-end-of-line) + (/M-/prior . scroll-other-window-down) + (/M-/next . scroll-other-window) + (/C-/next . scroll-left) + (/C-/prior . scroll-right) + (/C-/down . forward-paragraph) + (/C-/up . backward-paragraph) + (next . scroll-up-command) + (prior . scroll-down-command) + (down . next-line) + (right . right-char) + (up . previous-line) + (left . left-char) + (/M-/home . beginning-of-buffer-other-window) + (/C-/home . beginning-of-buffer) + (home . move-beginning-of-line) + (/C-S-/backspace . kill-whole-line) + (find . search-forward) + (menu . execute-extended-command) + (67108896 . set-mark-command) + (67108909 . negative-argument) + (67108921 . digit-argument) + (67108920 . digit-argument) + (67108919 . digit-argument) + (67108918 . digit-argument) + (67108917 . digit-argument) + (67108916 . digit-argument) + (67108915 . digit-argument) + (67108914 . digit-argument) + (67108913 . digit-argument) + (67108912 . digit-argument) + (/XF/86Back . previous-buffer) + (/XF/86Forward . next-buffer) + (67108911 . undo) + (make-frame-visible . ignore-event) + (iconify-frame . ignore-event) + (delete-frame . handle-delete-frame) + (select-window . handle-select-window) + (switch-frame . handle-switch-frame))) +'. +

              +

              +Optional argument FIELD is for non-interactive use and is an +object satisfying yas–field-p to restrict the expansion to. +

              +
              + +
              + +
              +

              Customization variables

              +
              + + +
              + +
              +

              yas-expand-only-for-last-commands

              +
              + + +

              +List of last-command values to restrict tab-triggering to, or nil. +

              +

              +Leave this set at nil (the default) to be able to trigger an +expansion simply by placing the cursor after a valid tab trigger, +using whichever commands. +

              +

              +Optionally, set this to something like '(self-insert-command) if +you to wish restrict expansion to only happen when the last +letter of the snippet tab trigger was typed immediately before +the trigger key itself. +

              +
              + +
              + +
              +

              yas-visit-from-menu

              +
              + + +

              +If non-nil visit snippets's files from menu, instead of expanding them. +

              +

              +This can only work when snippets are loaded from files. +

              +
              + +
              + +
              +

              yas-good-grace

              +
              + + +

              +If non-nil, don't raise errors in inline elisp evaluation. +

              +

              +An error string "[yas] error" is returned instead. +

              +
              + +
              + +
              +

              yas-wrap-around-region

              +
              + + +

              +If non-nil, snippet expansion wraps around selected region. +

              +

              +The wrapping occurs just before the snippet's exit marker. This +can be overridden on a per-snippet basis. +

              +
              + +
              + +
              +

              yas-trigger-symbol

              +
              + + +

              +The text that will be used in menu to represent the trigger. +

              +
              + +
              + +
              +

              yas-use-menu

              +
              + + +

              +Display a /YAS/nippet menu in the menu bar. +

              +

              +When non-nil, submenus for each snippet table will be listed +under the menu "Yasnippet". +

              +
                +
              • If set to abbreviate, only the current major-mode +
              • +
              + +

              menu and the modes set in yas–extra-modes are listed. +

              +
                +
              • If set to full, every submenu is listed + +
              • +
              • It set to nil, don't display a menu at all (this requires a + yas-reload-all call if the menu is already visible). +
              • +
              + + +

              +Any other non-nil value, every submenu is listed. +

              +
              + +
              + +
              +

              yas-choose-tables-first

              +
              + + +

              +If non-nil, and multiple eligible snippet tables, prompts user for tables first. +

              +

              +Otherwise, user chooses between the merging together of all +eligible tables. +

              +

              +This affects yas-insert-snippet, yas-visit-snippet-file +

              +
              + +
              + +
              +

              yas-choose-keys-first

              +
              + + +

              +If non-nil, prompt for snippet key first, then for template. +

              +

              +Otherwise prompts for all possible snippet names. +

              +

              +This affects yas-insert-snippet and yas-visit-snippet-file. +

              +
              + +
              + +
              +

              yas-fallback-behavior

              +
              + + +

              +How to act when yas-expand does not expand a snippet. +

              +
                +
              • call-other-command means try to temporarily disable /YAS/nippet + and call the next command bound to whatever key was used to + invoke yas-expand. + +
              • +
              • nil or the symbol return-nil mean do nothing. (and + yas-expand returns nil) + +
              • +
              • A Lisp form (apply COMMAND . ARGS) means interactively call + COMMAND, if ARGS is non-nil, call COMMAND non-interactively + with ARGS as arguments. +
              • +
              + + +
              + +
              + +
              +

              yas-triggers-in-field

              +
              + + +

              +If non-nil, allow stacked expansions (snippets inside snippets). +

              +

              +Otherwise yas-next-field-or-maybe-expand just moves on to the +next field +

              +
              + +
              + +
              +

              yas-snippet-revival

              +
              + + +

              +Non-nil means re-activate snippet fields after undo/redo. +

              +
              + +
              + +
              +

              yas-also-auto-indent-first-line

              +
              + + +

              +Non-nil means also auto indent first line according to mode. +

              +

              +Naturally this is only valid when yas-indent-line is auto +

              +
              + +
              + +
              +

              yas-indent-line

              +
              + + +

              +Controls indenting applied to a recent snippet expansion. +

              +

              +The following values are possible: +

              +
                +
              • fixed Indent the snippet to the current column; + +
              • +
              • auto Indent each line of the snippet with indent-according-to-mode +
              • +
              + + +

              +Every other value means don't apply any snippet-side indentation +after expansion (the manual per-line "$>" indentation still +applies). +

              +
              + +
              + +
              +

              yas-prompt-functions

              +
              + + +

              +Functions to prompt for keys, templates, etc interactively. +

              +

              +These functions are called with the following arguments: +

              +
                +
              • PROMPT: A string to prompt the user + +
              • +
              • CHOICES: a list of strings or objects. + +
              • +
              • optional DISPLAY-FN : A function that, when applied to each of +
              • +
              + +

              the objects in CHOICES will return a string. +

              +

              +The return value of any function you put here should be one of +the objects in CHOICES, properly formatted with DISPLAY-FN (if +that is passed). +

              +
                +
              • To signal that your particular style of prompting is +
              • +
              + +

              unavailable at the moment, you can also have the function return +nil. +

              +
                +
              • To signal that the user quit the prompting process, you can +
              • +
              + +

              signal quit with +

              +

              + (signal 'quit "user quit!"). +

              +
              + +
              + +
              +

              yas-snippet-dirs ()

              +
              + +

              Directory or list of snippet dirs for each major mode. +

              +

              +The directory where user-created snippets are to be stored. Can +also be a list of directories. In that case, when used for +bulk (re)loading of snippets (at startup or via +yas-reload-all), directories appearing earlier in the list +shadow other dir's snippets. Also, the first directory is taken +as the default for storing the user's new snippets. +

              +
              + +
              + +
              +

              Useful functions

              +
              + + +
              + +
              +

              yas-active-keys ()

              +
              + +

              /WARNING/: no doc for symbol yas-active-keys +

              +
              + +
              + +
              +

              yas-hippie-try-expand (first-time?)

              +
              + +

              /WARNING/: no doc for symbol yas-hippie-try-expand +

              +
              + +
              + +
              +

              yas-define-condition-cache (func doc &rest body)

              +
              + +

              /WARNING/: no doc for symbol yas-define-condition-cache +

              +
              + +
              + +
              +

              yas-unimplemented (&optional missing-feature)

              +
              + +

              /WARNING/: no doc for symbol yas-unimplemented +

              +
              + +
              + +
              +

              yas-inside-string ()

              +
              + +

              /WARNING/: no doc for symbol yas-inside-string +

              +
              + +
              + +
              +

              yas-default-from-field (number)

              +
              + +

              /WARNING/: no doc for symbol yas-default-from-field +

              +
              + +
              + +
              +

              yas-selected-text ()

              +
              + +

              The selected region deleted on the last snippet expansion. +

              +
              + +
              + +
              +

              yas-text ()

              +
              + +

              Contains current field text. +

              +
              + +
              + +
              +

              yas-field-value (number)

              +
              + +

              /WARNING/: no doc for symbol yas-field-value +

              +
              + +
              + +
              +

              yas-verify-value (possibilities)

              +
              + +

              /WARNING/: no doc for symbol yas-verify-value +

              +
              + +
              + +
              +

              yas-throw (text)

              +
              + +

              /WARNING/: no doc for symbol yas-throw +

              +
              + +
              + +
              +

              yas-key-to-value (alist)

              +
              + +

              /WARNING/: no doc for symbol yas-key-to-value +

              +
              + +
              + +
              +

              yas-choose-value (&rest possibilities)

              +
              + +

              /WARNING/: no doc for symbol yas-choose-value +

              +
              + +
              + +
              +

              yas-substr (str pattern &optional subexp)

              +
              + +

              /WARNING/: no doc for symbol yas-substr +

              +
              + +
              + +
              +

              yas-text ()

              +
              + +

              Contains current field text. +

              +
              + +
              + +
              +

              yas-define-menu (mode menu &optional omit-items)

              +
              + +

              /WARNING/: no doc for symbol yas-define-menu +

              +
              + +
              + +
              +

              yas-define-snippets (mode snippets)

              +
              + +

              /WARNING/: no doc for symbol yas-define-snippets +

              +
              + +
              + +
              +

              yas-expand-snippet (content &optional start end expand-env)

              +
              + +

              /WARNING/: no doc for symbol yas-expand-snippet +

              +
              + +
              + +
              +

              yas-dropdown-prompt (prompt choices &optional display-fn)

              +
              + +

              /WARNING/: no doc for symbol yas-dropdown-prompt +

              +
              + +
              + +
              +

              yas-completing-prompt (prompt choices &optional display-fn completion-fn)

              +
              + +

              /WARNING/: no doc for symbol yas-completing-prompt +

              +
              + +
              + +
              +

              yas-no-prompt (prompt choices &optional display-fn)

              +
              + +

              /WARNING/: no doc for symbol yas-no-prompt +

              +
              + +
              + +
              +

              yas-ido-prompt (prompt choices &optional display-fn)

              +
              + +

              /WARNING/: no doc for symbol yas-ido-prompt +

              +
              + +
              + +
              +

              yas-x-prompt (prompt choices &optional display-fn)

              +
              + +

              /WARNING/: no doc for symbol yas-x-prompt +

              +
              + +
              + +
              +

              Useful variables

              +
              + + +
              + +
              +

              yas-moving-away-p

              +
              + + +

              +Non-nil if user is about to exit field. +

              +
              + +
              + +
              +

              yas-modified-p

              +
              + + +

              +Non-nil if field has been modified by user or transformation. +

              +
              + +
              + +
              +

              yas-snippet-end

              +
              + + +

              +End position of the last snippet committed. +

              +
              + +
              + +
              +

              yas-snippet-beg

              +
              + + +

              +Beginning position of the last snippet committed. +

              +
              + +
              + +
              +

              yas-dont-activate

              +
              + + +

              +If non-nil don't let yas-global-mode affect some buffers. +

              +

              +If a function of zero arguments, then its result is used. +

              +

              +If a list of functions, then all functions must return nil to +activate yas for this buffer. +

              +

              +In Emacsen <= 23, this variable is buffer-local. Because +yas-minor-mode-on is called by yas-global-mode after +executing the buffer's major mode hook, setting this variable +there is an effective way to define exceptions to the "global" +activation behaviour. +

              +

              +In Emacsen > 23, only the global value is used. To define +per-mode exceptions to the "global" activation behaviour, call +yas-minor-mode with a negative argument directily in the major +mode's hook. +

              +
              + +
              + +
              +

              yas-buffer-local-condition

              +
              + + +

              +Snippet expanding condition. +

              +

              +This variable is a Lisp form which is evaluated every time a +snippet expansion is attempted: +

              +
                +
              • If it evaluates to nil, no snippets can be expanded. + +
              • +
              • If it evaluates to the a cons (require-snippet-condition + . REQUIREMENT) + +
                  +
                • Snippets bearing no "# condition:" directive are not + considered + +
                • +
                • Snippets bearing conditions that evaluate to nil (or + produce an error) won't be considered. + +
                • +
                • If the snippet has a condition that evaluates to non-nil + RESULT: + +
                    +
                  • If REQUIREMENT is t, the snippet is considered + +
                  • +
                  • If REQUIREMENT is eq RESULT, the snippet is + considered + +
                  • +
                  • Otherwise, the snippet is not considered. + +
                  • +
                  + +
                • +
                + +
              • +
              • If it evaluates to the symbol 'always, all snippets are + considered for expansion, regardless of any conditions. + +
              • +
              • If it evaluates to t or some other non-nil value + +
                  +
                • Snippet bearing no conditions, or conditions that + evaluate to non-nil, are considered for expansion. + +
                • +
                • Otherwise, the snippet is not considered. +
                • +
                + +
              • +
              + + +

              +Here's an example preventing snippets from being expanded from +inside comments, in python-mode only, with the exception of +snippets returning the symbol 'force-in-comment in their +conditions. +

              +

              + (add-hook 'python-mode-hook + '(lambda () + (setq yas-buffer-local-condition + '(if (python-in-string/comment) + '(require-snippet-condition . force-in-comment) + t)))) +

              +

              +The default value is similar, it filters out potential snippet +expansions inside comments and string literals, unless the +snippet itself contains a condition that returns the symbol +force-in-comment. +

              +
              + +
              + +
              +

              yas-before-expand-snippet-hook

              +
              + + +

              +Hooks to run just before expanding a snippet. +

              +
              + +
              + +
              +

              yas-after-exit-snippet-hook

              +
              + + +

              +Hooks to run after a snippet exited. +

              +

              +The hooks will be run in an environment where some variables bound to +proper values: +

              +

              +yas-snippet-beg : The beginning of the region of the snippet. +

              +

              +yas-snippet-end : Similar to beg. +

              +

              +Attention: These hooks are not run when exiting nested/stacked snippet expansion! +

              +
              + +
              + +
              +

              yas-key-syntaxes

              +
              + + +

              +List of character syntaxes used to find a trigger key before point. +The list is tried in the order while scanning characters +backwards from point. For example, if the list is '("w" "w_") +first look for trigger keys which are composed exclusively of +"word"-syntax characters, and then, if that fails, look for +keys which are either of "word" or "symbol" +syntax. Triggering after +

              +

              +foo-bar +

              +

              +will, according to the "w" element first try "bar". If that +isn't a trigger key, "foo-bar" is tried, respecting a second +"w_" element. +

              +
              + +
              + +
              +

              yas-extra-modes

              +
              + + +

              +/WARNING/: no doc for symbol yas-extra-modes +

              +
              + +
              + +
              +

              yas-verbosity

              +
              + + +

              +Log level for yas–message 4 means trace most anything, 0 means nothing. +

              +
              + +
              + +
              +

              yas-keymap

              +
              + + +

              +The active keymap while a snippet expansion is in progress. +

              + +
              +
              +
              +
              +
              + +
              +

              Date: 2013-11-26T21:02-0500

              +

              Org version 7.9.3f with Emacs version 24

              +Validate XHTML 1.0 + +
              + +