Xah Lee, 2009-02-24, ..., 2010-09-01
This pages is a set of collection of YASnippet templates for emacs lisp mode. Currently it contains 137 of the most frequently used elisp functions.
For example, typing “bsnp” or “buffer-substring-no-properties” expands to:
(buffer-substring-no-properties START▮ END)
Typing “sfr” or “search-forward-regexp” expands to:
(search-forward-regexp "▮" &optional BOUND NOERROR COUNT)
Download it here: emacs-lisp-mode.zip.
To install, uncompress the file, then put the dir inside the “text-mode” dir in your yasnippet dir. Restart emacs, or pull the menu “YASnippet‣Reload everything”.
These are tested with yasnippet-0.6.1c. Should not be a problem with earlier versions of yasnippet.
Each elisp function also support abbreviation. For example, “find-file” can be just “ff”.
if 2 functions have the same abbrev, right now the behavior is that yasnippet will popup a textual menu and you can use arrow up/down key to choose. This might be inconvenient if a lot functions have the same n-letter abbrevs, but we'll see how it works out.
This collection is not complete. I am not sure it should include ALL the functions in the elisp language, because that may be too many and some may be rarely used. But it should include all commonly used functions. “Common” should mean the top 200 or 300 most frequently called elisp functions in all elisp files bundled with emacs. (See here: Emacs Lisp Function Frequency)
If you find a function missing in your daily elisp coding, please take 30 seconds to add the function name here: http://code.google.com/p/ergoemacs/issues/detail?id=83. Everyweek i'll add them and update the zip file here. Thanks.
For a tutorial on YASnippet, see: Emacs Templates with YASnippet and How To Define Templates In YASnippet.