diff options
author | Sol Jerome <solj@ices.utexas.edu> | 2010-01-24 18:47:00 +0000 |
---|---|---|
committer | Sol Jerome <solj@ices.utexas.edu> | 2010-01-24 18:47:00 +0000 |
commit | 7c6c1e10f3cc62acc919123d0067a8a9720aeffa (patch) | |
tree | a6f6cb0cc17d41e6ccbc27c2e9f986df2e37c67d /doc/unsorted/emacs_snippet.txt | |
parent | e3bd887d601dad1be9352768206cbb45a91a8cc7 (diff) | |
download | bcfg2-7c6c1e10f3cc62acc919123d0067a8a9720aeffa.tar.gz bcfg2-7c6c1e10f3cc62acc919123d0067a8a9720aeffa.tar.bz2 bcfg2-7c6c1e10f3cc62acc919123d0067a8a9720aeffa.zip |
doc: Add a lot more unsorted stuff from the wiki
Signed-off-by: Sol Jerome <solj@ices.utexas.edu>
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5703 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'doc/unsorted/emacs_snippet.txt')
-rw-r--r-- | doc/unsorted/emacs_snippet.txt | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/doc/unsorted/emacs_snippet.txt b/doc/unsorted/emacs_snippet.txt new file mode 100644 index 000000000..471a3b244 --- /dev/null +++ b/doc/unsorted/emacs_snippet.txt @@ -0,0 +1,53 @@ +.. -*- mode: rst -*- + +.. _unsorted-emacs_snippet: + +======================================= +Using Bcfg2 with Emacs + YASnippet mode +======================================= + +This page describes using emacs with YASnippet mode with a set of snippets that allow quick composition of bundles and base files. More snippets are under development. + +#. Download YASnippet from http://code.google.com/p/yasnippet/ +#. Install it into your emacs load path (typically ~/.emacs.d/site-lisp) +#. Add YASnippet initialization to your .emacs (remember to re-byte-compile it if needed) + + .. code-block:: cl + + (require 'yasnippet-bundle) + + ;;; Bcfg2 snippet + + (yas/define-snippets 'sgml-mode + '( + ("<Bundle" "<Bundle name='${1:bundlename}' version='2.0'> + $0 + </Bundle>" nil) + ("<Base" "<Base> + $0 + </Base>" nil) + ("<Group" "<Group name='${1:groupname}> + $0 + </Group>" nil) + ("<Config" "<ConfigFile name='${1:filename}'/> + $0" nil) + ("<Service" "<Service name='${1:svcname}'/> + $0" nil) + ("<Package" "<Package name='${1:packagename}'/> + $0" nil) + ("<Action" "<Action name='${1:name}'/> + $0" nil) + ("<Directory" "<Directory name='${1:name}'/> + $0" nil) + ("<SymLink" "<SymLink name='${1:name}'/> + $0" nil) + ("<Permissions" "<Permissions name='${1:name}'/> + $0" nil) + ) + ) + +#. One quick M-x eval-current-buffer, and this code is enabled + +Each of these snippets activates on the opening element, ie <Bundle. After this string is entered, but before entering a space, press <TAB>, and the snippet will be expanded. The template will be inserted into the text with a set of input prompts, which default to overwrite mode and can be tabbed through. + +The code above only works for bundles and base, but will be expanded to support other xml files as well. |