From e53952ad1d356a73a1ba5c6f54c3792d21bffb7e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Mon, 24 Sep 2012 13:30:44 +0800 Subject: [PATCH] Add yasnippet. --- packages/yasnippet/dropdown-list.el | 253 + .../yasnippet/snippets/c++-mode/.yas-parents | 1 + packages/yasnippet/snippets/c++-mode/beginend | 4 + packages/yasnippet/snippets/c++-mode/class | 9 + packages/yasnippet/snippets/c++-mode/ns | 4 + packages/yasnippet/snippets/c++-mode/template | 4 + packages/yasnippet/snippets/c++-mode/using | 5 + .../yasnippet/snippets/c-mode/.yas-parents | 1 + packages/yasnippet/snippets/c-mode/fopen | 4 + packages/yasnippet/snippets/c-mode/printf | 7 + .../yasnippet/snippets/cc-mode/.yas-parents | 1 + packages/yasnippet/snippets/cc-mode/do | 7 + packages/yasnippet/snippets/cc-mode/for | 7 + packages/yasnippet/snippets/cc-mode/if | 7 + packages/yasnippet/snippets/cc-mode/inc | 4 + packages/yasnippet/snippets/cc-mode/inc.1 | 4 + packages/yasnippet/snippets/cc-mode/main | 8 + packages/yasnippet/snippets/cc-mode/once | 9 + packages/yasnippet/snippets/cc-mode/struct | 7 + .../snippets/cperl-mode/.yas-parents | 1 + .../snippets/csharp-mode/.yas-parents | 1 + .../yasnippet/snippets/csharp-mode/attrib | 8 + .../yasnippet/snippets/csharp-mode/attrib.1 | 22 + .../yasnippet/snippets/csharp-mode/attrib.2 | 22 + packages/yasnippet/snippets/csharp-mode/class | 22 + .../yasnippet/snippets/csharp-mode/comment | 7 + .../yasnippet/snippets/csharp-mode/comment.1 | 5 + .../yasnippet/snippets/csharp-mode/comment.2 | 5 + .../yasnippet/snippets/csharp-mode/comment.3 | 5 + .../yasnippet/snippets/csharp-mode/method | 11 + .../yasnippet/snippets/csharp-mode/namespace | 8 + packages/yasnippet/snippets/csharp-mode/prop | 17 + .../yasnippet/snippets/csharp-mode/region | 7 + packages/yasnippet/snippets/csharp-mode/using | 5 + .../yasnippet/snippets/csharp-mode/using.1 | 5 + .../yasnippet/snippets/csharp-mode/using.2 | 5 + .../yasnippet/snippets/css-mode/.yas-parents | 1 + packages/yasnippet/snippets/css-mode/bg | 4 + packages/yasnippet/snippets/css-mode/bg.1 | 4 + packages/yasnippet/snippets/css-mode/bor | 4 + packages/yasnippet/snippets/css-mode/cl | 5 + .../yasnippet/snippets/css-mode/disp.block | 5 + .../yasnippet/snippets/css-mode/disp.inline | 5 + .../yasnippet/snippets/css-mode/disp.none | 5 + packages/yasnippet/snippets/css-mode/ff | 5 + packages/yasnippet/snippets/css-mode/fs | 5 + .../yasnippet/snippets/css-mode/mar.bottom | 5 + packages/yasnippet/snippets/css-mode/mar.left | 5 + packages/yasnippet/snippets/css-mode/mar.mar | 5 + .../yasnippet/snippets/css-mode/mar.margin | 5 + .../yasnippet/snippets/css-mode/mar.right | 5 + packages/yasnippet/snippets/css-mode/mar.top | 5 + .../yasnippet/snippets/css-mode/pad.bottom | 5 + packages/yasnippet/snippets/css-mode/pad.left | 5 + packages/yasnippet/snippets/css-mode/pad.pad | 5 + .../yasnippet/snippets/css-mode/pad.padding | 5 + .../yasnippet/snippets/css-mode/pad.right | 5 + packages/yasnippet/snippets/css-mode/pad.top | 5 + .../snippets/emacs-lisp-mode/.read_me | 7 + .../snippets/emacs-lisp-mode/.yas-parents | 1 + .../emacs-lisp-mode/add-hook.yasnippet | 6 + .../snippets/emacs-lisp-mode/and.yasnippet | 6 + .../snippets/emacs-lisp-mode/append.yasnippet | 5 + .../snippets/emacs-lisp-mode/apply.yasnippet | 5 + .../snippets/emacs-lisp-mode/aref.yasnippet | 5 + .../snippets/emacs-lisp-mode/aset.yasnippet | 5 + .../snippets/emacs-lisp-mode/assq.yasnippet | 5 + .../emacs-lisp-mode/autoload.yasnippet | 5 + .../emacs-lisp-mode/backward-char.yasnippet | 6 + .../beginning-of-line.yasnippet | 6 + .../bounds-of-thing-at-point.yasnippet | 6 + .../buffer-file-name.yasnippet | 6 + .../buffer-modified-p.yasnippet | 6 + .../buffer-substring-no-properties.yasnippet | 6 + .../buffer-substring.yasnippet | 6 + .../snippets/emacs-lisp-mode/car.yasnippet | 5 + .../snippets/emacs-lisp-mode/cdr.yasnippet | 5 + .../snippets/emacs-lisp-mode/concat.yasnippet | 5 + .../snippets/emacs-lisp-mode/cond.yasnippet | 8 + .../emacs-lisp-mode/condition-case.yasnippet | 6 + .../snippets/emacs-lisp-mode/cons.yasnippet | 5 + .../snippets/emacs-lisp-mode/consp.yasnippet | 5 + .../emacs-lisp-mode/copy-directory.yasnippet | 6 + .../emacs-lisp-mode/copy-file.yasnippet | 6 + .../emacs-lisp-mode/current-buffer.yasnippet | 6 + .../emacs-lisp-mode/custom-autoload.yasnippet | 6 + .../emacs-lisp-mode/defalias.yasnippet | 5 + .../emacs-lisp-mode/defcustom.yasnippet | 5 + .../emacs-lisp-mode/define-key.yasnippet | 6 + .../emacs-lisp-mode/defsubst.yasnippet | 5 + .../snippets/emacs-lisp-mode/defun.yasnippet | 12 + .../snippets/emacs-lisp-mode/defvar.yasnippet | 5 + .../emacs-lisp-mode/delete-char.yasnippet | 6 + .../delete-directory.yasnippet | 6 + .../emacs-lisp-mode/delete-file.yasnippet | 6 + .../emacs-lisp-mode/delete-region.yasnippet | 6 + .../emacs-lisp-mode/directory-files.yasnippet | 6 + .../snippets/emacs-lisp-mode/dolist.yasnippet | 5 + .../emacs-lisp-mode/end-of-line.yasnippet | 6 + .../snippets/emacs-lisp-mode/eq.yasnippet | 5 + .../snippets/emacs-lisp-mode/equal.yasnippet | 5 + .../snippets/emacs-lisp-mode/error.yasnippet | 5 + .../expand-file-name.yasnippet | 6 + .../snippets/emacs-lisp-mode/f.yasnippet | 5 + .../emacs-lisp-mode/fboundp.yasnippet | 5 + .../file-name-directory.yasnippet | 6 + .../file-name-extension.yasnippet | 6 + .../file-name-nondirectory.yasnippet | 6 + .../file-name-sans-extension.yasnippet | 6 + .../file-relative-name.yasnippet | 6 + .../emacs-lisp-mode/find-file.yasnippet | 6 + .../snippets/emacs-lisp-mode/format.yasnippet | 5 + .../emacs-lisp-mode/forward-char.yasnippet | 6 + .../emacs-lisp-mode/forward-line.yasnippet | 6 + .../emacs-lisp-mode/funcall.yasnippet | 5 + .../emacs-lisp-mode/function.yasnippet | 5 + .../snippets/emacs-lisp-mode/get.yasnippet | 5 + .../emacs-lisp-mode/global-set-key.yasnippet | 6 + .../emacs-lisp-mode/goto-char.yasnippet | 6 + .../snippets/emacs-lisp-mode/if.yasnippet | 5 + .../insert-file-contents.yasnippet | 6 + .../snippets/emacs-lisp-mode/insert.yasnippet | 6 + .../emacs-lisp-mode/interactive.yasnippet | 5 + .../snippets/emacs-lisp-mode/kbd.yasnippet | 5 + .../emacs-lisp-mode/kill-buffer.yasnippet | 6 + .../snippets/emacs-lisp-mode/lambda.yasnippet | 5 + .../snippets/emacs-lisp-mode/length.yasnippet | 5 + .../snippets/emacs-lisp-mode/let.yasnippet | 8 + .../line-beginning-position.yasnippet | 6 + .../line-end-position.yasnippet | 6 + .../snippets/emacs-lisp-mode/list.yasnippet | 5 + .../emacs-lisp-mode/looking-at.yasnippet | 6 + .../emacs-lisp-mode/make-directory.yasnippet | 6 + .../make-local-variable.yasnippet | 6 + .../snippets/emacs-lisp-mode/mapc.yasnippet | 5 + .../snippets/emacs-lisp-mode/mapcar.yasnippet | 5 + .../emacs-lisp-mode/match-beginning.yasnippet | 6 + .../emacs-lisp-mode/match-end.yasnippet | 6 + .../emacs-lisp-mode/match-string.yasnippet | 6 + .../snippets/emacs-lisp-mode/memq.yasnippet | 5 + .../emacs-lisp-mode/message.yasnippet | 6 + .../snippets/emacs-lisp-mode/not.yasnippet | 6 + .../snippets/emacs-lisp-mode/nth.yasnippet | 5 + .../snippets/emacs-lisp-mode/null.yasnippet | 5 + .../number-to-string.yasnippet | 6 + .../snippets/emacs-lisp-mode/or.yasnippet | 6 + .../emacs-lisp-mode/point-max.yasnippet | 5 + .../emacs-lisp-mode/point-min.yasnippet | 6 + .../snippets/emacs-lisp-mode/point.yasnippet | 6 + .../snippets/emacs-lisp-mode/princ.yasnippet | 5 + .../snippets/emacs-lisp-mode/print.yasnippet | 5 + .../snippets/emacs-lisp-mode/progn.yasnippet | 5 + .../snippets/emacs-lisp-mode/push.yasnippet | 5 + .../snippets/emacs-lisp-mode/put.yasnippet | 5 + .../re-search-backward.yasnippet | 6 + .../re-search-forward.yasnippet | 6 + .../emacs-lisp-mode/region-active-p.yasnippet | 6 + .../region-beginning.yasnippet | 6 + .../emacs-lisp-mode/region-end.yasnippet | 6 + .../emacs-lisp-mode/rename-file.yasnippet | 6 + .../snippets/emacs-lisp-mode/repeat.yasnippet | 5 + .../replace-regexp-in-string.yasnippet | 6 + .../emacs-lisp-mode/replace-regexp.yasnippet | 6 + .../emacs-lisp-mode/require.yasnippet | 5 + .../emacs-lisp-mode/save-buffer.yasnippet | 6 + .../emacs-lisp-mode/save-excursion.yasnippet | 6 + .../search-backward-regexp.yasnippet | 6 + .../emacs-lisp-mode/search-backward.yasnippet | 6 + .../search-forward-regexp.yasnippet | 6 + .../emacs-lisp-mode/search-forward.yasnippet | 6 + .../emacs-lisp-mode/set-buffer.yasnippet | 6 + .../emacs-lisp-mode/set-file-modes.yasnippet | 6 + .../emacs-lisp-mode/set-mark.yasnippet | 6 + .../snippets/emacs-lisp-mode/set.yasnippet | 5 + .../snippets/emacs-lisp-mode/setq.yasnippet | 6 + .../skip-chars-backward.yasnippet | 6 + .../skip-chars-forward.yasnippet | 6 + .../emacs-lisp-mode/split-string.yasnippet | 6 + .../emacs-lisp-mode/string-match.yasnippet | 6 + .../string-to-number.yasnippet | 6 + .../snippets/emacs-lisp-mode/string.yasnippet | 5 + .../emacs-lisp-mode/string=.yasnippet | 5 + .../emacs-lisp-mode/stringp.yasnippet | 5 + .../emacs-lisp-mode/substring.yasnippet | 5 + .../emacs-lisp-mode/thing-at-point.yasnippet | 6 + .../snippets/emacs-lisp-mode/unless.yasnippet | 5 + .../snippets/emacs-lisp-mode/vector.yasnippet | 6 + .../snippets/emacs-lisp-mode/when.yasnippet | 5 + .../snippets/emacs-lisp-mode/while.yasnippet | 5 + .../emacs-lisp-mode/widget-get.yasnippet | 6 + .../with-current-buffer.yasnippet | 6 + .../x-dired.process_marked.yasnippet | 17 + .../emacs-lisp-mode/x-file.process.yasnippet | 18 + .../x-file.read-lines.yasnippet | 18 + .../emacs-lisp-mode/x-find-replace.yasnippet | 18 + .../emacs-lisp-mode/x-grabstring.yasnippet | 5 + .../emacs-lisp-mode/x-grabthing.yasnippet | 5 + .../emacs-lisp-mode/x-traverse_dir.yasnippet | 7 + .../x-word-or-region.yasnippet | 28 + .../emacs-lisp-mode/y-or-n-p.yasnippet | 6 + .../emacs-lisp-mode/yes-or-no-p.yasnippet | 5 + .../snippets/erlang-mode/.yas-parents | 1 + packages/yasnippet/snippets/erlang-mode/after | 5 + packages/yasnippet/snippets/erlang-mode/begin | 6 + packages/yasnippet/snippets/erlang-mode/beh | 5 + packages/yasnippet/snippets/erlang-mode/case | 6 + .../yasnippet/snippets/erlang-mode/compile | 5 + packages/yasnippet/snippets/erlang-mode/def | 5 + packages/yasnippet/snippets/erlang-mode/exp | 6 + packages/yasnippet/snippets/erlang-mode/fun | 4 + packages/yasnippet/snippets/erlang-mode/if | 7 + packages/yasnippet/snippets/erlang-mode/ifdef | 6 + .../yasnippet/snippets/erlang-mode/ifndef | 6 + packages/yasnippet/snippets/erlang-mode/imp | 6 + packages/yasnippet/snippets/erlang-mode/inc | 5 + .../yasnippet/snippets/erlang-mode/inc.lib | 5 + packages/yasnippet/snippets/erlang-mode/loop | 9 + packages/yasnippet/snippets/erlang-mode/mod | 7 + packages/yasnippet/snippets/erlang-mode/rcv | 6 + .../yasnippet/snippets/erlang-mode/rcv.after | 7 + packages/yasnippet/snippets/erlang-mode/rec | 5 + packages/yasnippet/snippets/erlang-mode/try | 8 + packages/yasnippet/snippets/erlang-mode/undef | 5 + .../yasnippet/snippets/f90-mode/.yas-parents | 1 + packages/yasnippet/snippets/f90-mode/au | 5 + packages/yasnippet/snippets/f90-mode/bd | 5 + packages/yasnippet/snippets/f90-mode/c | 5 + packages/yasnippet/snippets/f90-mode/ch | 5 + packages/yasnippet/snippets/f90-mode/cx | 5 + packages/yasnippet/snippets/f90-mode/dc | 5 + packages/yasnippet/snippets/f90-mode/do | 7 + packages/yasnippet/snippets/f90-mode/dp | 5 + packages/yasnippet/snippets/f90-mode/eq | 5 + packages/yasnippet/snippets/f90-mode/ib | 5 + packages/yasnippet/snippets/f90-mode/ic | 5 + packages/yasnippet/snippets/f90-mode/ich | 5 + packages/yasnippet/snippets/f90-mode/if | 7 + packages/yasnippet/snippets/f90-mode/ii | 5 + packages/yasnippet/snippets/f90-mode/il | 5 + packages/yasnippet/snippets/f90-mode/in | 5 + packages/yasnippet/snippets/f90-mode/inc | 5 + packages/yasnippet/snippets/f90-mode/intr | 5 + packages/yasnippet/snippets/f90-mode/ir | 5 + packages/yasnippet/snippets/f90-mode/l | 5 + packages/yasnippet/snippets/f90-mode/pa | 5 + packages/yasnippet/snippets/f90-mode/pr | 7 + packages/yasnippet/snippets/f90-mode/re | 5 + packages/yasnippet/snippets/f90-mode/st | 5 + packages/yasnippet/snippets/f90-mode/su | 5 + packages/yasnippet/snippets/f90-mode/wr | 5 + .../snippets/html-mode/.yas-make-groups | 0 .../yasnippet/snippets/html-mode/.yas-parents | 1 + .../yasnippet/snippets/html-mode/b.yasnippet | 5 + packages/yasnippet/snippets/html-mode/body | 7 + packages/yasnippet/snippets/html-mode/br | 5 + packages/yasnippet/snippets/html-mode/code | 7 + .../yasnippet/snippets/html-mode/code.class | 7 + packages/yasnippet/snippets/html-mode/div | 4 + .../yasnippet/snippets/html-mode/div.class | 7 + packages/yasnippet/snippets/html-mode/div.id | 7 + .../yasnippet/snippets/html-mode/div.id-class | 7 + packages/yasnippet/snippets/html-mode/dov | 12 + packages/yasnippet/snippets/html-mode/form | 7 + packages/yasnippet/snippets/html-mode/head | 7 + .../yasnippet/snippets/html-mode/header/h1 | 5 + .../yasnippet/snippets/html-mode/header/h2 | 5 + .../yasnippet/snippets/html-mode/header/h3 | 5 + .../yasnippet/snippets/html-mode/header/h4 | 5 + .../yasnippet/snippets/html-mode/header/h5 | 5 + .../yasnippet/snippets/html-mode/header/h6 | 5 + packages/yasnippet/snippets/html-mode/hr | 5 + packages/yasnippet/snippets/html-mode/href | 5 + packages/yasnippet/snippets/html-mode/html | 7 + .../yasnippet/snippets/html-mode/html.xmlns | 7 + .../yasnippet/snippets/html-mode/i.yasnippet | 5 + packages/yasnippet/snippets/html-mode/img | 5 + packages/yasnippet/snippets/html-mode/input | 5 + .../snippets/html-mode/link.stylesheet | 5 + .../snippets/html-mode/link.stylesheet-ie | 7 + packages/yasnippet/snippets/html-mode/list/dd | 5 + packages/yasnippet/snippets/html-mode/list/dl | 7 + .../yasnippet/snippets/html-mode/list/dl.id | 7 + packages/yasnippet/snippets/html-mode/list/dt | 5 + packages/yasnippet/snippets/html-mode/list/li | 5 + .../snippets/html-mode/list/li.class | 5 + packages/yasnippet/snippets/html-mode/list/ol | 7 + .../snippets/html-mode/list/ol.class | 7 + .../yasnippet/snippets/html-mode/list/ol.id | 7 + packages/yasnippet/snippets/html-mode/list/ul | 7 + .../snippets/html-mode/list/ul.class | 7 + .../yasnippet/snippets/html-mode/list/ul.id | 7 + packages/yasnippet/snippets/html-mode/mailto | 5 + .../yasnippet/snippets/html-mode/meta/doctype | 4 + .../snippets/html-mode/meta/doctype.xhml1 | 4 + .../snippets/html-mode/meta/doctype.xhtml1_1 | 4 + .../html-mode/meta/doctype.xhtml1_strict | 4 + .../meta/doctype.xhtml1_transitional | 4 + .../yasnippet/snippets/html-mode/meta/meta | 5 + .../snippets/html-mode/meta/meta.http-equiv | 5 + packages/yasnippet/snippets/html-mode/p | 5 + packages/yasnippet/snippets/html-mode/pre | 7 + .../yasnippet/snippets/html-mode/q.yasnippet | 7 + packages/yasnippet/snippets/html-mode/quote | 7 + .../snippets/html-mode/script.javascript | 7 + .../snippets/html-mode/script.javascript-src | 5 + packages/yasnippet/snippets/html-mode/span | 5 + .../yasnippet/snippets/html-mode/span.class | 5 + packages/yasnippet/snippets/html-mode/span.id | 5 + packages/yasnippet/snippets/html-mode/style | 7 + .../yasnippet/snippets/html-mode/table/table | 7 + .../yasnippet/snippets/html-mode/table/td | 5 + .../yasnippet/snippets/html-mode/table/th | 5 + .../yasnippet/snippets/html-mode/table/tr | 7 + .../yasnippet/snippets/html-mode/textarea | 5 + packages/yasnippet/snippets/html-mode/title | 5 + .../snippets/latex-mode/.yas-parents | 1 + packages/yasnippet/snippets/latex-mode/begin | 8 + packages/yasnippet/snippets/markdown-mode/+ | 6 + packages/yasnippet/snippets/markdown-mode/- | 6 + .../snippets/markdown-mode/.yas-parents | 1 + packages/yasnippet/snippets/markdown-mode/_ | 5 + packages/yasnippet/snippets/markdown-mode/__ | 5 + packages/yasnippet/snippets/markdown-mode/` | 5 + .../yasnippet/snippets/markdown-mode/h1.1 | 7 + .../yasnippet/snippets/markdown-mode/h1.2 | 8 + .../yasnippet/snippets/markdown-mode/h2.1 | 7 + .../yasnippet/snippets/markdown-mode/h2.2 | 8 + packages/yasnippet/snippets/markdown-mode/h3 | 7 + packages/yasnippet/snippets/markdown-mode/h4 | 7 + packages/yasnippet/snippets/markdown-mode/h5 | 7 + packages/yasnippet/snippets/markdown-mode/h6 | 7 + .../yasnippet/snippets/markdown-mode/hr.1 | 8 + .../yasnippet/snippets/markdown-mode/hr.2 | 8 + packages/yasnippet/snippets/markdown-mode/img | 5 + .../yasnippet/snippets/markdown-mode/link | 5 + packages/yasnippet/snippets/markdown-mode/ol | 6 + .../yasnippet/snippets/markdown-mode/rimg | 5 + packages/yasnippet/snippets/markdown-mode/rlb | 6 + .../yasnippet/snippets/markdown-mode/rlink | 5 + .../snippets/nxml-mode/.yas-make-groups | 0 .../yasnippet/snippets/nxml-mode/.yas-parents | 1 + packages/yasnippet/snippets/nxml-mode/body | 7 + packages/yasnippet/snippets/nxml-mode/br | 5 + packages/yasnippet/snippets/nxml-mode/code | 7 + packages/yasnippet/snippets/nxml-mode/div | 5 + packages/yasnippet/snippets/nxml-mode/form | 7 + packages/yasnippet/snippets/nxml-mode/head | 7 + .../yasnippet/snippets/nxml-mode/header/h1 | 5 + .../yasnippet/snippets/nxml-mode/header/h2 | 5 + .../yasnippet/snippets/nxml-mode/header/h3 | 5 + .../yasnippet/snippets/nxml-mode/header/h4 | 5 + .../yasnippet/snippets/nxml-mode/header/h5 | 5 + .../yasnippet/snippets/nxml-mode/header/h6 | 5 + packages/yasnippet/snippets/nxml-mode/hr | 5 + packages/yasnippet/snippets/nxml-mode/href | 5 + packages/yasnippet/snippets/nxml-mode/html | 7 + packages/yasnippet/snippets/nxml-mode/img | 5 + packages/yasnippet/snippets/nxml-mode/input | 5 + packages/yasnippet/snippets/nxml-mode/li | 5 + packages/yasnippet/snippets/nxml-mode/link | 5 + .../yasnippet/snippets/nxml-mode/meta/doctype | 5 + .../nxml-mode/meta/doctype.xhtml1_strict | 5 + .../meta/doctype.xhtml1_transitional | 5 + .../yasnippet/snippets/nxml-mode/meta/meta | 5 + packages/yasnippet/snippets/nxml-mode/name | 5 + packages/yasnippet/snippets/nxml-mode/ol | 7 + packages/yasnippet/snippets/nxml-mode/p | 5 + packages/yasnippet/snippets/nxml-mode/pre | 7 + packages/yasnippet/snippets/nxml-mode/quote | 7 + packages/yasnippet/snippets/nxml-mode/span | 5 + packages/yasnippet/snippets/nxml-mode/style | 7 + packages/yasnippet/snippets/nxml-mode/table | 7 + packages/yasnippet/snippets/nxml-mode/tag.1l | 5 + packages/yasnippet/snippets/nxml-mode/tag.2l | 7 + packages/yasnippet/snippets/nxml-mode/td | 5 + packages/yasnippet/snippets/nxml-mode/th | 5 + packages/yasnippet/snippets/nxml-mode/title | 5 + packages/yasnippet/snippets/nxml-mode/tr | 7 + packages/yasnippet/snippets/nxml-mode/ul | 7 + .../yasnippet/snippets/objc-mode/.yas-parents | 1 + packages/yasnippet/snippets/objc-mode/prop | 14 + .../yasnippet/snippets/perl-mode/.yas-parents | 1 + packages/yasnippet/snippets/perl-mode/eval | 9 + packages/yasnippet/snippets/perl-mode/for | 6 + packages/yasnippet/snippets/perl-mode/fore | 6 + packages/yasnippet/snippets/perl-mode/if | 6 + packages/yasnippet/snippets/perl-mode/ife | 8 + packages/yasnippet/snippets/perl-mode/ifee | 10 + packages/yasnippet/snippets/perl-mode/sub | 6 + packages/yasnippet/snippets/perl-mode/unless | 6 + packages/yasnippet/snippets/perl-mode/while | 6 + packages/yasnippet/snippets/perl-mode/xfore | 4 + packages/yasnippet/snippets/perl-mode/xif | 4 + packages/yasnippet/snippets/perl-mode/xunless | 4 + packages/yasnippet/snippets/perl-mode/xwhile | 4 + .../snippets/python-mode/.yas-parents | 1 + packages/yasnippet/snippets/python-mode/__ | 4 + packages/yasnippet/snippets/python-mode/class | 55 + packages/yasnippet/snippets/python-mode/def | 36 + packages/yasnippet/snippets/python-mode/defm | 34 + packages/yasnippet/snippets/python-mode/for | 5 + .../yasnippet/snippets/python-mode/ifmain | 5 + packages/yasnippet/snippets/python-mode/prop | 16 + packages/yasnippet/snippets/python-mode/propg | 10 + .../yasnippet/snippets/python-mode/propsg | 13 + packages/yasnippet/snippets/python-mode/while | 5 + .../yasnippet/snippets/rst-mode/.yas-parents | 1 + packages/yasnippet/snippets/rst-mode/chap | 7 + packages/yasnippet/snippets/rst-mode/sec | 7 + packages/yasnippet/snippets/rst-mode/tit | 8 + .../snippets/ruby-mode/.yas-make-groups | 0 .../yasnippet/snippets/ruby-mode/.yas-parents | 1 + .../snippets/ruby-mode/collections/all | 4 + .../snippets/ruby-mode/collections/any | 4 + .../snippets/ruby-mode/collections/classify | 4 + .../snippets/ruby-mode/collections/collect | 4 + .../snippets/ruby-mode/collections/deli | 4 + .../snippets/ruby-mode/collections/det | 4 + .../snippets/ruby-mode/collections/ea | 4 + .../snippets/ruby-mode/collections/eac | 4 + .../snippets/ruby-mode/collections/eai | 4 + .../snippets/ruby-mode/collections/eav | 4 + .../snippets/ruby-mode/collections/eawi | 4 + .../snippets/ruby-mode/collections/inject | 4 + .../snippets/ruby-mode/collections/reject | 4 + .../snippets/ruby-mode/collections/select | 4 + .../snippets/ruby-mode/collections/zip | 4 + .../ruby-mode/control structure/forin | 6 + .../snippets/ruby-mode/control structure/if | 6 + .../snippets/ruby-mode/control structure/ife | 8 + .../snippets/ruby-mode/control structure/tim | 4 + .../ruby-mode/control structure/until | 6 + .../snippets/ruby-mode/control structure/upt | 6 + .../snippets/ruby-mode/control structure/when | 6 + .../ruby-mode/control structure/while | 6 + .../snippets/ruby-mode/definitions/Comp | 8 + .../snippets/ruby-mode/definitions/am | 4 + .../snippets/ruby-mode/definitions/cla | 6 + .../snippets/ruby-mode/definitions/cls | 13 + .../snippets/ruby-mode/definitions/mm | 6 + .../snippets/ruby-mode/definitions/r | 4 + .../snippets/ruby-mode/definitions/rw | 4 + .../snippets/ruby-mode/definitions/w | 4 + .../yasnippet/snippets/ruby-mode/general/# | 4 + .../yasnippet/snippets/ruby-mode/general/=b | 6 + .../yasnippet/snippets/ruby-mode/general/app | 6 + .../yasnippet/snippets/ruby-mode/general/bm | 6 + .../yasnippet/snippets/ruby-mode/general/case | 7 + .../yasnippet/snippets/ruby-mode/general/dee | 4 + .../yasnippet/snippets/ruby-mode/general/rb | 4 + .../yasnippet/snippets/ruby-mode/general/req | 4 + .../yasnippet/snippets/ruby-mode/general/rreq | 4 + .../yasnippet/snippets/ruby-mode/general/y | 4 + .../snippets/scala-mode/.yas-parents | 1 + packages/yasnippet/snippets/scala-mode/act | 11 + .../yasnippet/snippets/scala-mode/act.arg | 11 + packages/yasnippet/snippets/scala-mode/actor | 11 + packages/yasnippet/snippets/scala-mode/ano | 5 + packages/yasnippet/snippets/scala-mode/app | 7 + .../yasnippet/snippets/scala-mode/arr.new | 5 + .../yasnippet/snippets/scala-mode/arr.val-new | 5 + packages/yasnippet/snippets/scala-mode/asof | 5 + packages/yasnippet/snippets/scala-mode/ass | 5 + .../yasnippet/snippets/scala-mode/ass.true | 5 + .../yasnippet/snippets/scala-mode/at.author | 5 + .../yasnippet/snippets/scala-mode/at.param | 5 + .../yasnippet/snippets/scala-mode/at.return | 5 + .../yasnippet/snippets/scala-mode/at.version | 5 + packages/yasnippet/snippets/scala-mode/bang | 5 + packages/yasnippet/snippets/scala-mode/case | 5 + .../snippets/scala-mode/case.match-all | 5 + packages/yasnippet/snippets/scala-mode/cast | 5 + packages/yasnippet/snippets/scala-mode/cc | 5 + packages/yasnippet/snippets/scala-mode/cl | 7 + packages/yasnippet/snippets/scala-mode/cl.abs | 7 + .../yasnippet/snippets/scala-mode/cl.abs-arg | 7 + packages/yasnippet/snippets/scala-mode/cl.arg | 7 + packages/yasnippet/snippets/scala-mode/clof | 5 + packages/yasnippet/snippets/scala-mode/co | 5 + packages/yasnippet/snippets/scala-mode/cons | 5 + .../yasnippet/snippets/scala-mode/cons.nil | 5 + .../yasnippet/snippets/scala-mode/def.arg | 5 + .../snippets/scala-mode/def.arg-body | 7 + .../yasnippet/snippets/scala-mode/def.arg-ret | 5 + .../snippets/scala-mode/def.arg-ret-body | 7 + .../yasnippet/snippets/scala-mode/def.body | 7 + .../yasnippet/snippets/scala-mode/def.ret | 5 + .../snippets/scala-mode/def.ret-body | 7 + .../yasnippet/snippets/scala-mode/def.simple | 5 + .../yasnippet/snippets/scala-mode/doc.class | 9 + .../yasnippet/snippets/scala-mode/doc.def | 7 + .../yasnippet/snippets/scala-mode/doc.file | 10 + .../snippets/scala-mode/doc.file-scala | 17 + .../snippets/scala-mode/doc.file-scala-api | 17 + .../snippets/scala-mode/doc.scaladoc | 8 + packages/yasnippet/snippets/scala-mode/expect | 7 + packages/yasnippet/snippets/scala-mode/ext | 5 + .../yasnippet/snippets/scala-mode/for.extract | 5 + packages/yasnippet/snippets/scala-mode/for.if | 7 + .../yasnippet/snippets/scala-mode/for.loop | 7 + .../yasnippet/snippets/scala-mode/for.multi | 10 + .../yasnippet/snippets/scala-mode/foreach | 5 + .../yasnippet/snippets/scala-mode/hmap.new | 5 + .../snippets/scala-mode/hmap.val-new | 5 + .../yasnippet/snippets/scala-mode/hset.new | 5 + .../snippets/scala-mode/hset.val-new | 5 + packages/yasnippet/snippets/scala-mode/if | 7 + .../yasnippet/snippets/scala-mode/if.else | 9 + packages/yasnippet/snippets/scala-mode/imp | 5 + .../yasnippet/snippets/scala-mode/intercept | 7 + packages/yasnippet/snippets/scala-mode/isof | 5 + packages/yasnippet/snippets/scala-mode/ls.new | 5 + .../yasnippet/snippets/scala-mode/ls.val-new | 5 + packages/yasnippet/snippets/scala-mode/main | 7 + packages/yasnippet/snippets/scala-mode/map | 5 + .../yasnippet/snippets/scala-mode/map.new | 5 + packages/yasnippet/snippets/scala-mode/match | 7 + .../yasnippet/snippets/scala-mode/match.can | 12 + .../snippets/scala-mode/match.option | 9 + packages/yasnippet/snippets/scala-mode/mix | 7 + packages/yasnippet/snippets/scala-mode/ob | 5 + packages/yasnippet/snippets/scala-mode/pac | 5 + .../yasnippet/snippets/scala-mode/pr.newline | 5 + .../yasnippet/snippets/scala-mode/pr.simple | 5 + .../yasnippet/snippets/scala-mode/pr.string | 5 + .../yasnippet/snippets/scala-mode/pr.trace | 5 + packages/yasnippet/snippets/scala-mode/pri | 5 + .../yasnippet/snippets/scala-mode/pri.param | 5 + packages/yasnippet/snippets/scala-mode/pro | 5 + .../yasnippet/snippets/scala-mode/pro.param | 5 + packages/yasnippet/snippets/scala-mode/suite | 9 + packages/yasnippet/snippets/scala-mode/test | 8 + packages/yasnippet/snippets/scala-mode/throw | 5 + packages/yasnippet/snippets/scala-mode/tr | 7 + packages/yasnippet/snippets/scala-mode/tr.ext | 7 + .../yasnippet/snippets/scala-mode/tr.ext-with | 7 + .../yasnippet/snippets/scala-mode/tr.with | 7 + packages/yasnippet/snippets/scala-mode/try | 10 + .../snippets/scala-mode/try.catch-finally | 12 + .../yasnippet/snippets/scala-mode/try.finally | 9 + .../yasnippet/snippets/scala-mode/tup.arrow | 5 + .../yasnippet/snippets/scala-mode/tup.paren | 5 + packages/yasnippet/snippets/scala-mode/val | 5 + .../yasnippet/snippets/scala-mode/val.new | 5 + .../yasnippet/snippets/scala-mode/val.ret | 5 + packages/yasnippet/snippets/scala-mode/var | 5 + .../yasnippet/snippets/scala-mode/var.new | 5 + .../yasnippet/snippets/scala-mode/var.ret | 5 + packages/yasnippet/snippets/scala-mode/whi | 7 + packages/yasnippet/snippets/scala-mode/with | 5 + .../snippets/snippet-mode/.yas-parents | 1 + .../yasnippet/snippets/snippet-mode/field | 6 + .../yasnippet/snippets/snippet-mode/mirror | 6 + packages/yasnippet/snippets/snippet-mode/vars | 12 + .../yasnippet/snippets/sql-mode/.yas-parents | 1 + packages/yasnippet/snippets/sql-mode/column | 5 + .../yasnippet/snippets/sql-mode/constraint | 5 + .../yasnippet/snippets/sql-mode/constraint.1 | 5 + packages/yasnippet/snippets/sql-mode/create | 11 + packages/yasnippet/snippets/sql-mode/create.1 | 13 + .../yasnippet/snippets/sql-mode/references | 5 + packages/yasnippet/snippets/text-mode/email | 4 + packages/yasnippet/snippets/text-mode/time | 4 + packages/yasnippet/yasnippet.el | 4490 +++++++++++++++++ 564 files changed, 8176 insertions(+) create mode 100644 packages/yasnippet/dropdown-list.el create mode 100644 packages/yasnippet/snippets/c++-mode/.yas-parents create mode 100644 packages/yasnippet/snippets/c++-mode/beginend create mode 100644 packages/yasnippet/snippets/c++-mode/class create mode 100644 packages/yasnippet/snippets/c++-mode/ns create mode 100644 packages/yasnippet/snippets/c++-mode/template create mode 100644 packages/yasnippet/snippets/c++-mode/using create mode 100644 packages/yasnippet/snippets/c-mode/.yas-parents create mode 100644 packages/yasnippet/snippets/c-mode/fopen create mode 100644 packages/yasnippet/snippets/c-mode/printf create mode 100644 packages/yasnippet/snippets/cc-mode/.yas-parents create mode 100644 packages/yasnippet/snippets/cc-mode/do create mode 100644 packages/yasnippet/snippets/cc-mode/for create mode 100644 packages/yasnippet/snippets/cc-mode/if create mode 100644 packages/yasnippet/snippets/cc-mode/inc create mode 100644 packages/yasnippet/snippets/cc-mode/inc.1 create mode 100644 packages/yasnippet/snippets/cc-mode/main create mode 100644 packages/yasnippet/snippets/cc-mode/once create mode 100644 packages/yasnippet/snippets/cc-mode/struct create mode 100644 packages/yasnippet/snippets/cperl-mode/.yas-parents create mode 100644 packages/yasnippet/snippets/csharp-mode/.yas-parents create mode 100644 packages/yasnippet/snippets/csharp-mode/attrib create mode 100644 packages/yasnippet/snippets/csharp-mode/attrib.1 create mode 100644 packages/yasnippet/snippets/csharp-mode/attrib.2 create mode 100644 packages/yasnippet/snippets/csharp-mode/class create mode 100644 packages/yasnippet/snippets/csharp-mode/comment create mode 100644 packages/yasnippet/snippets/csharp-mode/comment.1 create mode 100644 packages/yasnippet/snippets/csharp-mode/comment.2 create mode 100644 packages/yasnippet/snippets/csharp-mode/comment.3 create mode 100644 packages/yasnippet/snippets/csharp-mode/method create mode 100644 packages/yasnippet/snippets/csharp-mode/namespace create mode 100644 packages/yasnippet/snippets/csharp-mode/prop create mode 100644 packages/yasnippet/snippets/csharp-mode/region create mode 100644 packages/yasnippet/snippets/csharp-mode/using create mode 100644 packages/yasnippet/snippets/csharp-mode/using.1 create mode 100644 packages/yasnippet/snippets/csharp-mode/using.2 create mode 100644 packages/yasnippet/snippets/css-mode/.yas-parents create mode 100644 packages/yasnippet/snippets/css-mode/bg create mode 100644 packages/yasnippet/snippets/css-mode/bg.1 create mode 100644 packages/yasnippet/snippets/css-mode/bor create mode 100644 packages/yasnippet/snippets/css-mode/cl create mode 100644 packages/yasnippet/snippets/css-mode/disp.block create mode 100644 packages/yasnippet/snippets/css-mode/disp.inline create mode 100644 packages/yasnippet/snippets/css-mode/disp.none create mode 100644 packages/yasnippet/snippets/css-mode/ff create mode 100644 packages/yasnippet/snippets/css-mode/fs create mode 100644 packages/yasnippet/snippets/css-mode/mar.bottom create mode 100644 packages/yasnippet/snippets/css-mode/mar.left create mode 100644 packages/yasnippet/snippets/css-mode/mar.mar create mode 100644 packages/yasnippet/snippets/css-mode/mar.margin create mode 100644 packages/yasnippet/snippets/css-mode/mar.right create mode 100644 packages/yasnippet/snippets/css-mode/mar.top create mode 100644 packages/yasnippet/snippets/css-mode/pad.bottom create mode 100644 packages/yasnippet/snippets/css-mode/pad.left create mode 100644 packages/yasnippet/snippets/css-mode/pad.pad create mode 100644 packages/yasnippet/snippets/css-mode/pad.padding create mode 100644 packages/yasnippet/snippets/css-mode/pad.right create mode 100644 packages/yasnippet/snippets/css-mode/pad.top create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/.read_me create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/.yas-parents create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/add-hook.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/and.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/append.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/apply.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/aref.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/aset.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/assq.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/autoload.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/backward-char.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/beginning-of-line.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/bounds-of-thing-at-point.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/buffer-file-name.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/buffer-modified-p.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/buffer-substring-no-properties.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/buffer-substring.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/car.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/cdr.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/concat.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/cond.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/condition-case.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/cons.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/consp.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/copy-directory.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/copy-file.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/current-buffer.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/custom-autoload.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/defalias.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/defcustom.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/define-key.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/defsubst.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/defun.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/defvar.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/delete-char.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/delete-directory.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/delete-file.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/delete-region.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/directory-files.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/dolist.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/end-of-line.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/eq.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/equal.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/error.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/expand-file-name.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/f.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/fboundp.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/file-name-directory.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/file-name-extension.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/file-name-nondirectory.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/file-name-sans-extension.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/file-relative-name.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/find-file.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/format.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/forward-char.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/forward-line.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/funcall.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/function.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/get.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/global-set-key.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/goto-char.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/if.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/insert-file-contents.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/insert.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/interactive.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/kbd.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/kill-buffer.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/lambda.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/length.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/let.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/line-beginning-position.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/line-end-position.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/list.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/looking-at.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/make-directory.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/make-local-variable.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/mapc.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/mapcar.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/match-beginning.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/match-end.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/match-string.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/memq.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/message.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/not.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/nth.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/null.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/number-to-string.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/or.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/point-max.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/point-min.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/point.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/princ.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/print.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/progn.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/push.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/put.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/re-search-backward.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/re-search-forward.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/region-active-p.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/region-beginning.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/region-end.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/rename-file.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/repeat.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/replace-regexp-in-string.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/replace-regexp.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/require.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/save-buffer.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/save-excursion.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/search-backward-regexp.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/search-backward.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/search-forward-regexp.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/search-forward.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/set-buffer.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/set-file-modes.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/set-mark.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/set.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/setq.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/skip-chars-backward.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/skip-chars-forward.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/split-string.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/string-match.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/string-to-number.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/string.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/string=.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/stringp.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/substring.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/thing-at-point.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/unless.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/vector.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/when.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/while.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/widget-get.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/with-current-buffer.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/x-dired.process_marked.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/x-file.process.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/x-file.read-lines.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/x-find-replace.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/x-grabstring.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/x-grabthing.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/x-traverse_dir.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/x-word-or-region.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/y-or-n-p.yasnippet create mode 100644 packages/yasnippet/snippets/emacs-lisp-mode/yes-or-no-p.yasnippet create mode 100644 packages/yasnippet/snippets/erlang-mode/.yas-parents create mode 100644 packages/yasnippet/snippets/erlang-mode/after create mode 100644 packages/yasnippet/snippets/erlang-mode/begin create mode 100644 packages/yasnippet/snippets/erlang-mode/beh create mode 100644 packages/yasnippet/snippets/erlang-mode/case create mode 100644 packages/yasnippet/snippets/erlang-mode/compile create mode 100644 packages/yasnippet/snippets/erlang-mode/def create mode 100644 packages/yasnippet/snippets/erlang-mode/exp create mode 100644 packages/yasnippet/snippets/erlang-mode/fun create mode 100644 packages/yasnippet/snippets/erlang-mode/if create mode 100644 packages/yasnippet/snippets/erlang-mode/ifdef create mode 100644 packages/yasnippet/snippets/erlang-mode/ifndef create mode 100644 packages/yasnippet/snippets/erlang-mode/imp create mode 100644 packages/yasnippet/snippets/erlang-mode/inc create mode 100644 packages/yasnippet/snippets/erlang-mode/inc.lib create mode 100644 packages/yasnippet/snippets/erlang-mode/loop create mode 100644 packages/yasnippet/snippets/erlang-mode/mod create mode 100644 packages/yasnippet/snippets/erlang-mode/rcv create mode 100644 packages/yasnippet/snippets/erlang-mode/rcv.after create mode 100644 packages/yasnippet/snippets/erlang-mode/rec create mode 100644 packages/yasnippet/snippets/erlang-mode/try create mode 100644 packages/yasnippet/snippets/erlang-mode/undef create mode 100644 packages/yasnippet/snippets/f90-mode/.yas-parents create mode 100644 packages/yasnippet/snippets/f90-mode/au create mode 100644 packages/yasnippet/snippets/f90-mode/bd create mode 100644 packages/yasnippet/snippets/f90-mode/c create mode 100644 packages/yasnippet/snippets/f90-mode/ch create mode 100644 packages/yasnippet/snippets/f90-mode/cx create mode 100644 packages/yasnippet/snippets/f90-mode/dc create mode 100644 packages/yasnippet/snippets/f90-mode/do create mode 100644 packages/yasnippet/snippets/f90-mode/dp create mode 100644 packages/yasnippet/snippets/f90-mode/eq create mode 100644 packages/yasnippet/snippets/f90-mode/ib create mode 100644 packages/yasnippet/snippets/f90-mode/ic create mode 100644 packages/yasnippet/snippets/f90-mode/ich create mode 100644 packages/yasnippet/snippets/f90-mode/if create mode 100644 packages/yasnippet/snippets/f90-mode/ii create mode 100644 packages/yasnippet/snippets/f90-mode/il create mode 100644 packages/yasnippet/snippets/f90-mode/in create mode 100644 packages/yasnippet/snippets/f90-mode/inc create mode 100644 packages/yasnippet/snippets/f90-mode/intr create mode 100644 packages/yasnippet/snippets/f90-mode/ir create mode 100644 packages/yasnippet/snippets/f90-mode/l create mode 100644 packages/yasnippet/snippets/f90-mode/pa create mode 100644 packages/yasnippet/snippets/f90-mode/pr create mode 100644 packages/yasnippet/snippets/f90-mode/re create mode 100644 packages/yasnippet/snippets/f90-mode/st create mode 100644 packages/yasnippet/snippets/f90-mode/su create mode 100644 packages/yasnippet/snippets/f90-mode/wr create mode 100644 packages/yasnippet/snippets/html-mode/.yas-make-groups create mode 100644 packages/yasnippet/snippets/html-mode/.yas-parents create mode 100644 packages/yasnippet/snippets/html-mode/b.yasnippet create mode 100644 packages/yasnippet/snippets/html-mode/body create mode 100644 packages/yasnippet/snippets/html-mode/br create mode 100644 packages/yasnippet/snippets/html-mode/code create mode 100644 packages/yasnippet/snippets/html-mode/code.class create mode 100644 packages/yasnippet/snippets/html-mode/div create mode 100644 packages/yasnippet/snippets/html-mode/div.class create mode 100644 packages/yasnippet/snippets/html-mode/div.id create mode 100644 packages/yasnippet/snippets/html-mode/div.id-class create mode 100644 packages/yasnippet/snippets/html-mode/dov create mode 100644 packages/yasnippet/snippets/html-mode/form create mode 100644 packages/yasnippet/snippets/html-mode/head create mode 100644 packages/yasnippet/snippets/html-mode/header/h1 create mode 100644 packages/yasnippet/snippets/html-mode/header/h2 create mode 100644 packages/yasnippet/snippets/html-mode/header/h3 create mode 100644 packages/yasnippet/snippets/html-mode/header/h4 create mode 100644 packages/yasnippet/snippets/html-mode/header/h5 create mode 100644 packages/yasnippet/snippets/html-mode/header/h6 create mode 100644 packages/yasnippet/snippets/html-mode/hr create mode 100644 packages/yasnippet/snippets/html-mode/href create mode 100644 packages/yasnippet/snippets/html-mode/html create mode 100644 packages/yasnippet/snippets/html-mode/html.xmlns create mode 100644 packages/yasnippet/snippets/html-mode/i.yasnippet create mode 100644 packages/yasnippet/snippets/html-mode/img create mode 100644 packages/yasnippet/snippets/html-mode/input create mode 100644 packages/yasnippet/snippets/html-mode/link.stylesheet create mode 100644 packages/yasnippet/snippets/html-mode/link.stylesheet-ie create mode 100644 packages/yasnippet/snippets/html-mode/list/dd create mode 100644 packages/yasnippet/snippets/html-mode/list/dl create mode 100644 packages/yasnippet/snippets/html-mode/list/dl.id create mode 100644 packages/yasnippet/snippets/html-mode/list/dt create mode 100644 packages/yasnippet/snippets/html-mode/list/li create mode 100644 packages/yasnippet/snippets/html-mode/list/li.class create mode 100644 packages/yasnippet/snippets/html-mode/list/ol create mode 100644 packages/yasnippet/snippets/html-mode/list/ol.class create mode 100644 packages/yasnippet/snippets/html-mode/list/ol.id create mode 100644 packages/yasnippet/snippets/html-mode/list/ul create mode 100644 packages/yasnippet/snippets/html-mode/list/ul.class create mode 100644 packages/yasnippet/snippets/html-mode/list/ul.id create mode 100644 packages/yasnippet/snippets/html-mode/mailto create mode 100644 packages/yasnippet/snippets/html-mode/meta/doctype create mode 100644 packages/yasnippet/snippets/html-mode/meta/doctype.xhml1 create mode 100644 packages/yasnippet/snippets/html-mode/meta/doctype.xhtml1_1 create mode 100644 packages/yasnippet/snippets/html-mode/meta/doctype.xhtml1_strict create mode 100644 packages/yasnippet/snippets/html-mode/meta/doctype.xhtml1_transitional create mode 100644 packages/yasnippet/snippets/html-mode/meta/meta create mode 100644 packages/yasnippet/snippets/html-mode/meta/meta.http-equiv create mode 100644 packages/yasnippet/snippets/html-mode/p create mode 100644 packages/yasnippet/snippets/html-mode/pre create mode 100644 packages/yasnippet/snippets/html-mode/q.yasnippet create mode 100644 packages/yasnippet/snippets/html-mode/quote create mode 100644 packages/yasnippet/snippets/html-mode/script.javascript create mode 100644 packages/yasnippet/snippets/html-mode/script.javascript-src create mode 100644 packages/yasnippet/snippets/html-mode/span create mode 100644 packages/yasnippet/snippets/html-mode/span.class create mode 100644 packages/yasnippet/snippets/html-mode/span.id create mode 100644 packages/yasnippet/snippets/html-mode/style create mode 100644 packages/yasnippet/snippets/html-mode/table/table create mode 100644 packages/yasnippet/snippets/html-mode/table/td create mode 100644 packages/yasnippet/snippets/html-mode/table/th create mode 100644 packages/yasnippet/snippets/html-mode/table/tr create mode 100644 packages/yasnippet/snippets/html-mode/textarea create mode 100644 packages/yasnippet/snippets/html-mode/title create mode 100644 packages/yasnippet/snippets/latex-mode/.yas-parents create mode 100644 packages/yasnippet/snippets/latex-mode/begin create mode 100644 packages/yasnippet/snippets/markdown-mode/+ create mode 100644 packages/yasnippet/snippets/markdown-mode/- create mode 100644 packages/yasnippet/snippets/markdown-mode/.yas-parents create mode 100644 packages/yasnippet/snippets/markdown-mode/_ create mode 100644 packages/yasnippet/snippets/markdown-mode/__ create mode 100644 packages/yasnippet/snippets/markdown-mode/` create mode 100644 packages/yasnippet/snippets/markdown-mode/h1.1 create mode 100644 packages/yasnippet/snippets/markdown-mode/h1.2 create mode 100644 packages/yasnippet/snippets/markdown-mode/h2.1 create mode 100644 packages/yasnippet/snippets/markdown-mode/h2.2 create mode 100644 packages/yasnippet/snippets/markdown-mode/h3 create mode 100644 packages/yasnippet/snippets/markdown-mode/h4 create mode 100644 packages/yasnippet/snippets/markdown-mode/h5 create mode 100644 packages/yasnippet/snippets/markdown-mode/h6 create mode 100644 packages/yasnippet/snippets/markdown-mode/hr.1 create mode 100644 packages/yasnippet/snippets/markdown-mode/hr.2 create mode 100644 packages/yasnippet/snippets/markdown-mode/img create mode 100644 packages/yasnippet/snippets/markdown-mode/link create mode 100644 packages/yasnippet/snippets/markdown-mode/ol create mode 100644 packages/yasnippet/snippets/markdown-mode/rimg create mode 100644 packages/yasnippet/snippets/markdown-mode/rlb create mode 100644 packages/yasnippet/snippets/markdown-mode/rlink create mode 100644 packages/yasnippet/snippets/nxml-mode/.yas-make-groups create mode 100644 packages/yasnippet/snippets/nxml-mode/.yas-parents create mode 100644 packages/yasnippet/snippets/nxml-mode/body create mode 100644 packages/yasnippet/snippets/nxml-mode/br create mode 100644 packages/yasnippet/snippets/nxml-mode/code create mode 100644 packages/yasnippet/snippets/nxml-mode/div create mode 100644 packages/yasnippet/snippets/nxml-mode/form create mode 100644 packages/yasnippet/snippets/nxml-mode/head create mode 100644 packages/yasnippet/snippets/nxml-mode/header/h1 create mode 100644 packages/yasnippet/snippets/nxml-mode/header/h2 create mode 100644 packages/yasnippet/snippets/nxml-mode/header/h3 create mode 100644 packages/yasnippet/snippets/nxml-mode/header/h4 create mode 100644 packages/yasnippet/snippets/nxml-mode/header/h5 create mode 100644 packages/yasnippet/snippets/nxml-mode/header/h6 create mode 100644 packages/yasnippet/snippets/nxml-mode/hr create mode 100644 packages/yasnippet/snippets/nxml-mode/href create mode 100644 packages/yasnippet/snippets/nxml-mode/html create mode 100644 packages/yasnippet/snippets/nxml-mode/img create mode 100644 packages/yasnippet/snippets/nxml-mode/input create mode 100644 packages/yasnippet/snippets/nxml-mode/li create mode 100644 packages/yasnippet/snippets/nxml-mode/link create mode 100644 packages/yasnippet/snippets/nxml-mode/meta/doctype create mode 100644 packages/yasnippet/snippets/nxml-mode/meta/doctype.xhtml1_strict create mode 100644 packages/yasnippet/snippets/nxml-mode/meta/doctype.xhtml1_transitional create mode 100644 packages/yasnippet/snippets/nxml-mode/meta/meta create mode 100644 packages/yasnippet/snippets/nxml-mode/name create mode 100644 packages/yasnippet/snippets/nxml-mode/ol create mode 100644 packages/yasnippet/snippets/nxml-mode/p create mode 100644 packages/yasnippet/snippets/nxml-mode/pre create mode 100644 packages/yasnippet/snippets/nxml-mode/quote create mode 100644 packages/yasnippet/snippets/nxml-mode/span create mode 100644 packages/yasnippet/snippets/nxml-mode/style create mode 100644 packages/yasnippet/snippets/nxml-mode/table create mode 100644 packages/yasnippet/snippets/nxml-mode/tag.1l create mode 100644 packages/yasnippet/snippets/nxml-mode/tag.2l create mode 100644 packages/yasnippet/snippets/nxml-mode/td create mode 100644 packages/yasnippet/snippets/nxml-mode/th create mode 100644 packages/yasnippet/snippets/nxml-mode/title create mode 100644 packages/yasnippet/snippets/nxml-mode/tr create mode 100644 packages/yasnippet/snippets/nxml-mode/ul create mode 100644 packages/yasnippet/snippets/objc-mode/.yas-parents create mode 100644 packages/yasnippet/snippets/objc-mode/prop create mode 100644 packages/yasnippet/snippets/perl-mode/.yas-parents create mode 100644 packages/yasnippet/snippets/perl-mode/eval create mode 100644 packages/yasnippet/snippets/perl-mode/for create mode 100644 packages/yasnippet/snippets/perl-mode/fore create mode 100644 packages/yasnippet/snippets/perl-mode/if create mode 100644 packages/yasnippet/snippets/perl-mode/ife create mode 100644 packages/yasnippet/snippets/perl-mode/ifee create mode 100644 packages/yasnippet/snippets/perl-mode/sub create mode 100644 packages/yasnippet/snippets/perl-mode/unless create mode 100644 packages/yasnippet/snippets/perl-mode/while create mode 100644 packages/yasnippet/snippets/perl-mode/xfore create mode 100644 packages/yasnippet/snippets/perl-mode/xif create mode 100644 packages/yasnippet/snippets/perl-mode/xunless create mode 100644 packages/yasnippet/snippets/perl-mode/xwhile create mode 100644 packages/yasnippet/snippets/python-mode/.yas-parents create mode 100644 packages/yasnippet/snippets/python-mode/__ create mode 100644 packages/yasnippet/snippets/python-mode/class create mode 100644 packages/yasnippet/snippets/python-mode/def create mode 100644 packages/yasnippet/snippets/python-mode/defm create mode 100644 packages/yasnippet/snippets/python-mode/for create mode 100644 packages/yasnippet/snippets/python-mode/ifmain create mode 100644 packages/yasnippet/snippets/python-mode/prop create mode 100644 packages/yasnippet/snippets/python-mode/propg create mode 100644 packages/yasnippet/snippets/python-mode/propsg create mode 100644 packages/yasnippet/snippets/python-mode/while create mode 100644 packages/yasnippet/snippets/rst-mode/.yas-parents create mode 100644 packages/yasnippet/snippets/rst-mode/chap create mode 100644 packages/yasnippet/snippets/rst-mode/sec create mode 100644 packages/yasnippet/snippets/rst-mode/tit create mode 100644 packages/yasnippet/snippets/ruby-mode/.yas-make-groups create mode 100644 packages/yasnippet/snippets/ruby-mode/.yas-parents create mode 100644 packages/yasnippet/snippets/ruby-mode/collections/all create mode 100644 packages/yasnippet/snippets/ruby-mode/collections/any create mode 100644 packages/yasnippet/snippets/ruby-mode/collections/classify create mode 100644 packages/yasnippet/snippets/ruby-mode/collections/collect create mode 100644 packages/yasnippet/snippets/ruby-mode/collections/deli create mode 100644 packages/yasnippet/snippets/ruby-mode/collections/det create mode 100644 packages/yasnippet/snippets/ruby-mode/collections/ea create mode 100644 packages/yasnippet/snippets/ruby-mode/collections/eac create mode 100644 packages/yasnippet/snippets/ruby-mode/collections/eai create mode 100644 packages/yasnippet/snippets/ruby-mode/collections/eav create mode 100644 packages/yasnippet/snippets/ruby-mode/collections/eawi create mode 100644 packages/yasnippet/snippets/ruby-mode/collections/inject create mode 100644 packages/yasnippet/snippets/ruby-mode/collections/reject create mode 100644 packages/yasnippet/snippets/ruby-mode/collections/select create mode 100644 packages/yasnippet/snippets/ruby-mode/collections/zip create mode 100644 packages/yasnippet/snippets/ruby-mode/control structure/forin create mode 100644 packages/yasnippet/snippets/ruby-mode/control structure/if create mode 100644 packages/yasnippet/snippets/ruby-mode/control structure/ife create mode 100644 packages/yasnippet/snippets/ruby-mode/control structure/tim create mode 100644 packages/yasnippet/snippets/ruby-mode/control structure/until create mode 100644 packages/yasnippet/snippets/ruby-mode/control structure/upt create mode 100644 packages/yasnippet/snippets/ruby-mode/control structure/when create mode 100644 packages/yasnippet/snippets/ruby-mode/control structure/while create mode 100644 packages/yasnippet/snippets/ruby-mode/definitions/Comp create mode 100644 packages/yasnippet/snippets/ruby-mode/definitions/am create mode 100644 packages/yasnippet/snippets/ruby-mode/definitions/cla create mode 100644 packages/yasnippet/snippets/ruby-mode/definitions/cls create mode 100644 packages/yasnippet/snippets/ruby-mode/definitions/mm create mode 100644 packages/yasnippet/snippets/ruby-mode/definitions/r create mode 100644 packages/yasnippet/snippets/ruby-mode/definitions/rw create mode 100644 packages/yasnippet/snippets/ruby-mode/definitions/w create mode 100644 packages/yasnippet/snippets/ruby-mode/general/# create mode 100644 packages/yasnippet/snippets/ruby-mode/general/=b create mode 100644 packages/yasnippet/snippets/ruby-mode/general/app create mode 100644 packages/yasnippet/snippets/ruby-mode/general/bm create mode 100644 packages/yasnippet/snippets/ruby-mode/general/case create mode 100644 packages/yasnippet/snippets/ruby-mode/general/dee create mode 100644 packages/yasnippet/snippets/ruby-mode/general/rb create mode 100644 packages/yasnippet/snippets/ruby-mode/general/req create mode 100644 packages/yasnippet/snippets/ruby-mode/general/rreq create mode 100644 packages/yasnippet/snippets/ruby-mode/general/y create mode 100644 packages/yasnippet/snippets/scala-mode/.yas-parents create mode 100644 packages/yasnippet/snippets/scala-mode/act create mode 100644 packages/yasnippet/snippets/scala-mode/act.arg create mode 100644 packages/yasnippet/snippets/scala-mode/actor create mode 100644 packages/yasnippet/snippets/scala-mode/ano create mode 100644 packages/yasnippet/snippets/scala-mode/app create mode 100644 packages/yasnippet/snippets/scala-mode/arr.new create mode 100644 packages/yasnippet/snippets/scala-mode/arr.val-new create mode 100644 packages/yasnippet/snippets/scala-mode/asof create mode 100644 packages/yasnippet/snippets/scala-mode/ass create mode 100644 packages/yasnippet/snippets/scala-mode/ass.true create mode 100644 packages/yasnippet/snippets/scala-mode/at.author create mode 100644 packages/yasnippet/snippets/scala-mode/at.param create mode 100644 packages/yasnippet/snippets/scala-mode/at.return create mode 100644 packages/yasnippet/snippets/scala-mode/at.version create mode 100644 packages/yasnippet/snippets/scala-mode/bang create mode 100644 packages/yasnippet/snippets/scala-mode/case create mode 100644 packages/yasnippet/snippets/scala-mode/case.match-all create mode 100644 packages/yasnippet/snippets/scala-mode/cast create mode 100644 packages/yasnippet/snippets/scala-mode/cc create mode 100644 packages/yasnippet/snippets/scala-mode/cl create mode 100644 packages/yasnippet/snippets/scala-mode/cl.abs create mode 100644 packages/yasnippet/snippets/scala-mode/cl.abs-arg create mode 100644 packages/yasnippet/snippets/scala-mode/cl.arg create mode 100644 packages/yasnippet/snippets/scala-mode/clof create mode 100644 packages/yasnippet/snippets/scala-mode/co create mode 100644 packages/yasnippet/snippets/scala-mode/cons create mode 100644 packages/yasnippet/snippets/scala-mode/cons.nil create mode 100644 packages/yasnippet/snippets/scala-mode/def.arg create mode 100644 packages/yasnippet/snippets/scala-mode/def.arg-body create mode 100644 packages/yasnippet/snippets/scala-mode/def.arg-ret create mode 100644 packages/yasnippet/snippets/scala-mode/def.arg-ret-body create mode 100644 packages/yasnippet/snippets/scala-mode/def.body create mode 100644 packages/yasnippet/snippets/scala-mode/def.ret create mode 100644 packages/yasnippet/snippets/scala-mode/def.ret-body create mode 100644 packages/yasnippet/snippets/scala-mode/def.simple create mode 100644 packages/yasnippet/snippets/scala-mode/doc.class create mode 100644 packages/yasnippet/snippets/scala-mode/doc.def create mode 100644 packages/yasnippet/snippets/scala-mode/doc.file create mode 100644 packages/yasnippet/snippets/scala-mode/doc.file-scala create mode 100644 packages/yasnippet/snippets/scala-mode/doc.file-scala-api create mode 100644 packages/yasnippet/snippets/scala-mode/doc.scaladoc create mode 100644 packages/yasnippet/snippets/scala-mode/expect create mode 100644 packages/yasnippet/snippets/scala-mode/ext create mode 100644 packages/yasnippet/snippets/scala-mode/for.extract create mode 100644 packages/yasnippet/snippets/scala-mode/for.if create mode 100644 packages/yasnippet/snippets/scala-mode/for.loop create mode 100644 packages/yasnippet/snippets/scala-mode/for.multi create mode 100644 packages/yasnippet/snippets/scala-mode/foreach create mode 100644 packages/yasnippet/snippets/scala-mode/hmap.new create mode 100644 packages/yasnippet/snippets/scala-mode/hmap.val-new create mode 100644 packages/yasnippet/snippets/scala-mode/hset.new create mode 100644 packages/yasnippet/snippets/scala-mode/hset.val-new create mode 100644 packages/yasnippet/snippets/scala-mode/if create mode 100644 packages/yasnippet/snippets/scala-mode/if.else create mode 100644 packages/yasnippet/snippets/scala-mode/imp create mode 100644 packages/yasnippet/snippets/scala-mode/intercept create mode 100644 packages/yasnippet/snippets/scala-mode/isof create mode 100644 packages/yasnippet/snippets/scala-mode/ls.new create mode 100644 packages/yasnippet/snippets/scala-mode/ls.val-new create mode 100644 packages/yasnippet/snippets/scala-mode/main create mode 100644 packages/yasnippet/snippets/scala-mode/map create mode 100644 packages/yasnippet/snippets/scala-mode/map.new create mode 100644 packages/yasnippet/snippets/scala-mode/match create mode 100644 packages/yasnippet/snippets/scala-mode/match.can create mode 100644 packages/yasnippet/snippets/scala-mode/match.option create mode 100644 packages/yasnippet/snippets/scala-mode/mix create mode 100644 packages/yasnippet/snippets/scala-mode/ob create mode 100644 packages/yasnippet/snippets/scala-mode/pac create mode 100644 packages/yasnippet/snippets/scala-mode/pr.newline create mode 100644 packages/yasnippet/snippets/scala-mode/pr.simple create mode 100644 packages/yasnippet/snippets/scala-mode/pr.string create mode 100644 packages/yasnippet/snippets/scala-mode/pr.trace create mode 100644 packages/yasnippet/snippets/scala-mode/pri create mode 100644 packages/yasnippet/snippets/scala-mode/pri.param create mode 100644 packages/yasnippet/snippets/scala-mode/pro create mode 100644 packages/yasnippet/snippets/scala-mode/pro.param create mode 100644 packages/yasnippet/snippets/scala-mode/suite create mode 100644 packages/yasnippet/snippets/scala-mode/test create mode 100644 packages/yasnippet/snippets/scala-mode/throw create mode 100644 packages/yasnippet/snippets/scala-mode/tr create mode 100644 packages/yasnippet/snippets/scala-mode/tr.ext create mode 100644 packages/yasnippet/snippets/scala-mode/tr.ext-with create mode 100644 packages/yasnippet/snippets/scala-mode/tr.with create mode 100644 packages/yasnippet/snippets/scala-mode/try create mode 100644 packages/yasnippet/snippets/scala-mode/try.catch-finally create mode 100644 packages/yasnippet/snippets/scala-mode/try.finally create mode 100644 packages/yasnippet/snippets/scala-mode/tup.arrow create mode 100644 packages/yasnippet/snippets/scala-mode/tup.paren create mode 100644 packages/yasnippet/snippets/scala-mode/val create mode 100644 packages/yasnippet/snippets/scala-mode/val.new create mode 100644 packages/yasnippet/snippets/scala-mode/val.ret create mode 100644 packages/yasnippet/snippets/scala-mode/var create mode 100644 packages/yasnippet/snippets/scala-mode/var.new create mode 100644 packages/yasnippet/snippets/scala-mode/var.ret create mode 100644 packages/yasnippet/snippets/scala-mode/whi create mode 100644 packages/yasnippet/snippets/scala-mode/with create mode 100644 packages/yasnippet/snippets/snippet-mode/.yas-parents create mode 100644 packages/yasnippet/snippets/snippet-mode/field create mode 100644 packages/yasnippet/snippets/snippet-mode/mirror create mode 100644 packages/yasnippet/snippets/snippet-mode/vars create mode 100644 packages/yasnippet/snippets/sql-mode/.yas-parents create mode 100644 packages/yasnippet/snippets/sql-mode/column create mode 100644 packages/yasnippet/snippets/sql-mode/constraint create mode 100644 packages/yasnippet/snippets/sql-mode/constraint.1 create mode 100644 packages/yasnippet/snippets/sql-mode/create create mode 100644 packages/yasnippet/snippets/sql-mode/create.1 create mode 100644 packages/yasnippet/snippets/sql-mode/references create mode 100644 packages/yasnippet/snippets/text-mode/email create mode 100644 packages/yasnippet/snippets/text-mode/time create mode 100644 packages/yasnippet/yasnippet.el diff --git a/packages/yasnippet/dropdown-list.el b/packages/yasnippet/dropdown-list.el new file mode 100644 index 000000000..ed4e3dd25 --- /dev/null +++ b/packages/yasnippet/dropdown-list.el @@ -0,0 +1,253 @@ +;;; dropdown-list.el --- Drop-down menu interface +;; +;; Filename: dropdown-list.el +;; Description: Drop-down menu interface +;; Copyright (C) 2008-2012 Free Software Foundation, Inc. +;; Author: Jaeyoun Chung [jay.chung@gmail.com] +;; Maintainer: +;; Authors: pluskid , João Távora +;; Created: Sun Mar 16 11:20:45 2008 (Pacific Daylight Time) +;; Version: +;; Last-Updated: Sun Mar 16 12:19:49 2008 (Pacific Daylight Time) +;; By: dradams +;; Update #: 43 +;; URL: http://www.emacswiki.org/cgi-bin/wiki/dropdown-list.el +;; Keywords: convenience menu +;; Compatibility: GNU Emacs 21.x, GNU Emacs 22.x +;; +;; Features that might be required by this library: +;; +;; `cl'. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;; Commentary: +;; +;; According to Jaeyoun Chung, "overlay code stolen from company-mode.el." +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;; Change log: +;; +;; 2008/03/16 dadams +;; Clean-up - e.g. use char-to-string for control chars removed by email posting. +;; Moved example usage code (define-key*, command-selector) inside the library. +;; Require cl.el at byte-compile time. +;; Added GPL statement. +;; 2008/01/06 Jaeyoun Chung +;; Posted to gnu-emacs-sources@gnu.org at 9:10 p.m. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; This program is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;; Code: + +(eval-when-compile (require 'cl)) ;; decf, fourth, incf, loop, mapcar* + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defface dropdown-list-face + '((t :inherit default :background "lightyellow" :foreground "black")) + "*Bla." :group 'dropdown-list) + +(defface dropdown-list-selection-face + '((t :inherit dropdown-list-face :background "purple")) + "*Bla." :group 'dropdown-list) + +(defvar dropdown-list-overlays nil) + +(defun dropdown-list-hide () + (while dropdown-list-overlays + (delete-overlay (pop dropdown-list-overlays)))) + +(defun dropdown-list-put-overlay (beg end &optional prop value prop2 value2) + (let ((ov (make-overlay beg end))) + (overlay-put ov 'window t) + (when prop + (overlay-put ov prop value) + (when prop2 (overlay-put ov prop2 value2))) + ov)) + +(defun dropdown-list-line (start replacement &optional no-insert) + ;; start might be in the middle of a tab, which means we need to hide the + ;; tab and add spaces + (let ((end (+ start (length replacement))) + beg-point end-point + before-string after-string) + (goto-char (point-at-eol)) + (if (< (current-column) start) + (progn (setq before-string (make-string (- start (current-column)) ? )) + (setq beg-point (point))) + (goto-char (point-at-bol)) ;; Emacs bug, move-to-column is wrong otherwise + (move-to-column start) + (setq beg-point (point)) + (when (> (current-column) start) + (goto-char (1- (point))) + (setq beg-point (point)) + (setq before-string (make-string (- start (current-column)) ? )))) + (move-to-column end) + (setq end-point (point)) + (let ((end-offset (- (current-column) end))) + (when (> end-offset 0) (setq after-string (make-string end-offset ?b)))) + (when no-insert + ;; prevent inheriting of faces + (setq before-string (when before-string (propertize before-string 'face 'default))) + (setq after-string (when after-string (propertize after-string 'face 'default)))) + (let ((string (concat before-string replacement after-string))) + (if no-insert + string + (push (dropdown-list-put-overlay beg-point end-point 'invisible t + 'after-string string) + dropdown-list-overlays))))) + +(defun dropdown-list-start-column (display-width) + (let ((column (mod (current-column) (window-width))) + (width (window-width))) + (cond ((<= (+ column display-width) width) column) + ((> column display-width) (- column display-width)) + ((>= width display-width) (- width display-width)) + (t nil)))) + +(defun dropdown-list-move-to-start-line (candidate-count) + (decf candidate-count) + (let ((above-line-count (save-excursion (- (vertical-motion (- candidate-count))))) + (below-line-count (save-excursion (vertical-motion candidate-count)))) + (cond ((= below-line-count candidate-count) + t) + ((= above-line-count candidate-count) + (vertical-motion (- candidate-count)) + t) + ((>= (+ below-line-count above-line-count) candidate-count) + (vertical-motion (- (- candidate-count below-line-count))) + t) + (t nil)))) + +(defun dropdown-list-at-point (candidates &optional selidx) + (dropdown-list-hide) + (let* ((lengths (mapcar #'length candidates)) + (max-length (apply #'max lengths)) + (start (dropdown-list-start-column (+ max-length 3))) + (i -1) + (candidates (mapcar* (lambda (candidate length) + (let ((diff (- max-length length))) + (propertize + (concat (if (> diff 0) + (concat candidate (make-string diff ? )) + (substring candidate 0 max-length)) + (format "%3d" (+ 2 i))) + 'face (if (eql (incf i) selidx) + 'dropdown-list-selection-face + 'dropdown-list-face)))) + candidates + lengths))) + (save-excursion + (and start + (dropdown-list-move-to-start-line (length candidates)) + (loop initially (vertical-motion 0) + for candidate in candidates + do (dropdown-list-line (+ (current-column) start) candidate) + while (/= (vertical-motion 1) 0) + finally return t))))) + +(defun dropdown-list (candidates) + (let ((selection) + (temp-buffer)) + (save-window-excursion + (unwind-protect + (let ((candidate-count (length candidates)) + done key (selidx 0)) + (while (not done) + (unless (dropdown-list-at-point candidates selidx) + (switch-to-buffer (setq temp-buffer (get-buffer-create "*selection*")) + 'norecord) + (delete-other-windows) + (delete-region (point-min) (point-max)) + (insert (make-string (length candidates) ?\n)) + (goto-char (point-min)) + (dropdown-list-at-point candidates selidx)) + (setq key (read-key-sequence "")) + (cond ((and (stringp key) + (>= (aref key 0) ?1) + (<= (aref key 0) (+ ?0 (min 9 candidate-count)))) + (setq selection (- (aref key 0) ?1) + done t)) + ((member key `(,(char-to-string ?\C-p) [up] "p")) + (setq selidx (mod (+ candidate-count (1- (or selidx 0))) + candidate-count))) + ((member key `(,(char-to-string ?\C-n) [down] "n")) + (setq selidx (mod (1+ (or selidx -1)) candidate-count))) + ((member key `(,(char-to-string ?\f)))) + ((member key `(,(char-to-string ?\r) [return])) + (setq selection selidx + done t)) + (t (setq done t))))) + (dropdown-list-hide) + (and temp-buffer (kill-buffer temp-buffer))) + ;; (when selection + ;; (message "your selection => %d: %s" selection (nth selection candidates)) + ;; (sit-for 1)) + selection))) + +(defun define-key* (keymap key command) + "Add COMMAND to the multiple-command binding of KEY in KEYMAP. +Use multiple times to bind different COMMANDs to the same KEY." + (define-key keymap key (combine-command command (lookup-key keymap key)))) + +(defun combine-command (command defs) + "$$$$$ FIXME - no doc string" + (cond ((null defs) command) + ((and (listp defs) + (eq 'lambda (car defs)) + (= (length defs) 4) + (listp (fourth defs)) + (eq 'command-selector (car (fourth defs)))) + (unless (member `',command (cdr (fourth defs))) + (setcdr (fourth defs) (nconc (cdr (fourth defs)) `(',command)))) + defs) + (t + `(lambda () (interactive) (command-selector ',defs ',command))))) + +(defvar command-selector-last-command nil "$$$$$ FIXME - no doc string") + +(defun command-selector (&rest candidates) + "$$$$$ FIXME - no doc string" + (if (and (eq last-command this-command) command-selector-last-command) + (call-interactively command-selector-last-command) + (let* ((candidate-strings + (mapcar (lambda (candidate) + (format "%s" (if (symbolp candidate) + candidate + (let ((s (format "%s" candidate))) + (if (>= (length s) 7) + (concat (substring s 0 7) "...") + s))))) + candidates)) + (selection (dropdown-list candidate-strings))) + (when selection + (let ((cmd (nth selection candidates))) + (call-interactively cmd) + (setq command-selector-last-command cmd)))))) + +;;;;;;;;;;;;;;;;;;;; + +(provide 'dropdown-list) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; dropdown-list.el ends here +;; Local Variables: +;; coding: utf-8 +;; End: diff --git a/packages/yasnippet/snippets/c++-mode/.yas-parents b/packages/yasnippet/snippets/c++-mode/.yas-parents new file mode 100644 index 000000000..ce9828bdf --- /dev/null +++ b/packages/yasnippet/snippets/c++-mode/.yas-parents @@ -0,0 +1 @@ +cc-mode diff --git a/packages/yasnippet/snippets/c++-mode/beginend b/packages/yasnippet/snippets/c++-mode/beginend new file mode 100644 index 000000000..4af416f01 --- /dev/null +++ b/packages/yasnippet/snippets/c++-mode/beginend @@ -0,0 +1,4 @@ +# name: v.begin(), v.end() +# key: beginend +# -- +${1:v}.begin(), $1.end \ No newline at end of file diff --git a/packages/yasnippet/snippets/c++-mode/class b/packages/yasnippet/snippets/c++-mode/class new file mode 100644 index 000000000..f33f8b476 --- /dev/null +++ b/packages/yasnippet/snippets/c++-mode/class @@ -0,0 +1,9 @@ +# name: class ... { ... } +# key: class +# -- +class ${1:Name} +{ +public: + ${1:$(yas-substr text "[^: ]*")}($2); + virtual ~${1:$(yas-substr text "[^: ]*")}(); +}; \ No newline at end of file diff --git a/packages/yasnippet/snippets/c++-mode/ns b/packages/yasnippet/snippets/c++-mode/ns new file mode 100644 index 000000000..a3439642d --- /dev/null +++ b/packages/yasnippet/snippets/c++-mode/ns @@ -0,0 +1,4 @@ +# name: namespace ... +# key: ns +# -- +namespace \ No newline at end of file diff --git a/packages/yasnippet/snippets/c++-mode/template b/packages/yasnippet/snippets/c++-mode/template new file mode 100644 index 000000000..ed36b08e0 --- /dev/null +++ b/packages/yasnippet/snippets/c++-mode/template @@ -0,0 +1,4 @@ +# name: template +# key: template +# -- +template \ No newline at end of file diff --git a/packages/yasnippet/snippets/c++-mode/using b/packages/yasnippet/snippets/c++-mode/using new file mode 100644 index 000000000..f28937f59 --- /dev/null +++ b/packages/yasnippet/snippets/c++-mode/using @@ -0,0 +1,5 @@ +# name: using namespace ... +# key: using +# -- +using namespace ${std}; +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/c-mode/.yas-parents b/packages/yasnippet/snippets/c-mode/.yas-parents new file mode 100644 index 000000000..ce9828bdf --- /dev/null +++ b/packages/yasnippet/snippets/c-mode/.yas-parents @@ -0,0 +1 @@ +cc-mode diff --git a/packages/yasnippet/snippets/c-mode/fopen b/packages/yasnippet/snippets/c-mode/fopen new file mode 100644 index 000000000..b3339e429 --- /dev/null +++ b/packages/yasnippet/snippets/c-mode/fopen @@ -0,0 +1,4 @@ +# name: FILE *fp = fopen(..., ...); +# key: fopen +# -- +FILE *${fp} = fopen(${"file"}, "${r}"); \ No newline at end of file diff --git a/packages/yasnippet/snippets/c-mode/printf b/packages/yasnippet/snippets/c-mode/printf new file mode 100644 index 000000000..035d07e0d --- /dev/null +++ b/packages/yasnippet/snippets/c-mode/printf @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: printf +# contributor: joaotavora +# key: printf +# -- +printf ("${1:%s}\\n"${1:$(if (string-match "%" text) "," "\);") +}$2${1:$(if (string-match "%" text) "\);" "")} \ No newline at end of file diff --git a/packages/yasnippet/snippets/cc-mode/.yas-parents b/packages/yasnippet/snippets/cc-mode/.yas-parents new file mode 100644 index 000000000..eed5b442b --- /dev/null +++ b/packages/yasnippet/snippets/cc-mode/.yas-parents @@ -0,0 +1 @@ +text-mode diff --git a/packages/yasnippet/snippets/cc-mode/do b/packages/yasnippet/snippets/cc-mode/do new file mode 100644 index 000000000..a42d27f5c --- /dev/null +++ b/packages/yasnippet/snippets/cc-mode/do @@ -0,0 +1,7 @@ +# name: do { ... } while (...) +# key: do +# -- +do +{ + $0 +} while (${1:condition}); \ No newline at end of file diff --git a/packages/yasnippet/snippets/cc-mode/for b/packages/yasnippet/snippets/cc-mode/for new file mode 100644 index 000000000..1e1d4bfb5 --- /dev/null +++ b/packages/yasnippet/snippets/cc-mode/for @@ -0,0 +1,7 @@ +# name: for (...; ...; ...) { ... } +# key: for +# -- +for (${1:int i = 0}; ${2:i < N}; ${3:++i}) +{ + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/cc-mode/if b/packages/yasnippet/snippets/cc-mode/if new file mode 100644 index 000000000..5c6a12102 --- /dev/null +++ b/packages/yasnippet/snippets/cc-mode/if @@ -0,0 +1,7 @@ +# name: if (...) { ... } +# key: if +# -- +if (${1:condition}) +{ + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/cc-mode/inc b/packages/yasnippet/snippets/cc-mode/inc new file mode 100644 index 000000000..9c9ed7698 --- /dev/null +++ b/packages/yasnippet/snippets/cc-mode/inc @@ -0,0 +1,4 @@ +# name: #include "..." +# key: inc +# -- +#include "$1" \ No newline at end of file diff --git a/packages/yasnippet/snippets/cc-mode/inc.1 b/packages/yasnippet/snippets/cc-mode/inc.1 new file mode 100644 index 000000000..649cbd977 --- /dev/null +++ b/packages/yasnippet/snippets/cc-mode/inc.1 @@ -0,0 +1,4 @@ +# name: #include <...> +# key: inc +# -- +#include <$1> \ No newline at end of file diff --git a/packages/yasnippet/snippets/cc-mode/main b/packages/yasnippet/snippets/cc-mode/main new file mode 100644 index 000000000..dab1cad1c --- /dev/null +++ b/packages/yasnippet/snippets/cc-mode/main @@ -0,0 +1,8 @@ +# name: int main(argc, argv) { ... } +# key: main +# -- +int main(int argc, char *argv[]) +{ + $0 + return 0; +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/cc-mode/once b/packages/yasnippet/snippets/cc-mode/once new file mode 100644 index 000000000..ea14f9ac2 --- /dev/null +++ b/packages/yasnippet/snippets/cc-mode/once @@ -0,0 +1,9 @@ +# name: #ifndef XXX; #define XXX; #endif +# key: once +# -- +#ifndef ${1:_`(upcase (file-name-nondirectory (file-name-sans-extension (buffer-file-name))))`_H_} +#define $1 + +$0 + +#endif /* $1 */ \ No newline at end of file diff --git a/packages/yasnippet/snippets/cc-mode/struct b/packages/yasnippet/snippets/cc-mode/struct new file mode 100644 index 000000000..39ddfa80e --- /dev/null +++ b/packages/yasnippet/snippets/cc-mode/struct @@ -0,0 +1,7 @@ +# name: struct ... { ... } +# key: struct +# -- +struct ${1:name} +{ + $0 +}; \ No newline at end of file diff --git a/packages/yasnippet/snippets/cperl-mode/.yas-parents b/packages/yasnippet/snippets/cperl-mode/.yas-parents new file mode 100644 index 000000000..bfa2993ee --- /dev/null +++ b/packages/yasnippet/snippets/cperl-mode/.yas-parents @@ -0,0 +1 @@ +perl-mode diff --git a/packages/yasnippet/snippets/csharp-mode/.yas-parents b/packages/yasnippet/snippets/csharp-mode/.yas-parents new file mode 100644 index 000000000..ce9828bdf --- /dev/null +++ b/packages/yasnippet/snippets/csharp-mode/.yas-parents @@ -0,0 +1 @@ +cc-mode diff --git a/packages/yasnippet/snippets/csharp-mode/attrib b/packages/yasnippet/snippets/csharp-mode/attrib new file mode 100644 index 000000000..f617ceed3 --- /dev/null +++ b/packages/yasnippet/snippets/csharp-mode/attrib @@ -0,0 +1,8 @@ +# contributor: Alejandro Espinoza Esparza +# name: private attribute ....; +# key: attrib +# -- +/// +/// $3 +/// +private $1 $2; \ No newline at end of file diff --git a/packages/yasnippet/snippets/csharp-mode/attrib.1 b/packages/yasnippet/snippets/csharp-mode/attrib.1 new file mode 100644 index 000000000..ac967ad44 --- /dev/null +++ b/packages/yasnippet/snippets/csharp-mode/attrib.1 @@ -0,0 +1,22 @@ +# contributor: Alejandro Espinoza Esparza +# name: private attribute ....; public property ... ... { ... } +# key: attrib +# -- +/// +/// $3 +/// +private $1 $2; + +/// +/// $4 +/// +/// $5 +public $1 $2 +{ + get { + return this.$2; + } + set { + this.$2 = value; + } +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/csharp-mode/attrib.2 b/packages/yasnippet/snippets/csharp-mode/attrib.2 new file mode 100644 index 000000000..20f126364 --- /dev/null +++ b/packages/yasnippet/snippets/csharp-mode/attrib.2 @@ -0,0 +1,22 @@ +# contributor: Alejandro Espinoza Esparza +# name: private _attribute ....; public Property ... ... { ... } +# key: attrib +# -- +/// +/// $3 +/// +private $1 ${2:$(if (> (length text) 0) (format "_%s%s" (downcase (substring text 0 1)) (substring text 1 (length text))) "")}; + +/// +/// ${3:Description} +/// +/// $1 +public ${1:Type} ${2:Name} +{ + get { + return this.${2:$(if (> (length text) 0) (format "_%s%s" (downcase (substring text 0 1)) (substring text 1 (length text))) "")}; + } + set { + this.${2:$(if (> (length text) 0) (format "_%s%s" (downcase (substring text 0 1)) (substring text 1 (length text))) "")} = value; + } +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/csharp-mode/class b/packages/yasnippet/snippets/csharp-mode/class new file mode 100644 index 000000000..6c74c3792 --- /dev/null +++ b/packages/yasnippet/snippets/csharp-mode/class @@ -0,0 +1,22 @@ +# contributor: Alejandro Espinoza Esparza +# name: class ... { ... } +# key: class +# -- +${5:public} class ${1:Name} +{ + #region Ctor & Destructor + /// + /// ${3:Standard Constructor} + /// + public $1($2) + { + } + + /// + /// ${4:Default Destructor} + /// + public ~$1() + { + } + #endregion +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/csharp-mode/comment b/packages/yasnippet/snippets/csharp-mode/comment new file mode 100644 index 000000000..562689be7 --- /dev/null +++ b/packages/yasnippet/snippets/csharp-mode/comment @@ -0,0 +1,7 @@ +# contributor: Alejandro Espinoza Esparza +# name: /// ... +# key: comment +# -- +/// +/// $1 +/// \ No newline at end of file diff --git a/packages/yasnippet/snippets/csharp-mode/comment.1 b/packages/yasnippet/snippets/csharp-mode/comment.1 new file mode 100644 index 000000000..856189dab --- /dev/null +++ b/packages/yasnippet/snippets/csharp-mode/comment.1 @@ -0,0 +1,5 @@ +# contributor: Alejandro Espinoza Esparza +# name: /// ... +# key: comment +# -- +/// $2 \ No newline at end of file diff --git a/packages/yasnippet/snippets/csharp-mode/comment.2 b/packages/yasnippet/snippets/csharp-mode/comment.2 new file mode 100644 index 000000000..e890f1c31 --- /dev/null +++ b/packages/yasnippet/snippets/csharp-mode/comment.2 @@ -0,0 +1,5 @@ +# contributor: Alejandro Espinoza Esparza +# name: /// ... +# key: comment +# -- +/// $1 \ No newline at end of file diff --git a/packages/yasnippet/snippets/csharp-mode/comment.3 b/packages/yasnippet/snippets/csharp-mode/comment.3 new file mode 100644 index 000000000..13e605732 --- /dev/null +++ b/packages/yasnippet/snippets/csharp-mode/comment.3 @@ -0,0 +1,5 @@ +# contributor: Alejandro Espinoza Esparza +# name: /// ... +# key: comment +# -- +/// $2 \ No newline at end of file diff --git a/packages/yasnippet/snippets/csharp-mode/method b/packages/yasnippet/snippets/csharp-mode/method new file mode 100644 index 000000000..e5ea46576 --- /dev/null +++ b/packages/yasnippet/snippets/csharp-mode/method @@ -0,0 +1,11 @@ +# contributor: Alejandro Espinoza Esparza +# name: public void Method { ... } +# key: method +# -- +/// +/// ${5:Description} +/// ${2:$(if (string= (upcase text) "VOID") "" (format "%s%s%s" "\n/// " text ""))} +${1:public} ${2:void} ${3:MethodName}($4) +{ +$0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/csharp-mode/namespace b/packages/yasnippet/snippets/csharp-mode/namespace new file mode 100644 index 000000000..56c5d991b --- /dev/null +++ b/packages/yasnippet/snippets/csharp-mode/namespace @@ -0,0 +1,8 @@ +# contributor: Alejandro Espinoza Esparza +# name: namespace .. { ... } +# key: namespace +# -- +namespace $1 +{ +$0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/csharp-mode/prop b/packages/yasnippet/snippets/csharp-mode/prop new file mode 100644 index 000000000..c711d23b0 --- /dev/null +++ b/packages/yasnippet/snippets/csharp-mode/prop @@ -0,0 +1,17 @@ +# contributor: Alejandro Espinoza Esparza +# name: property ... ... { ... } +# key: prop +# -- +/// +/// $5 +/// +/// $6 +$1 $2 $3 +{ + get { + return this.$4; + } + set { + this.$4 = value; + } +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/csharp-mode/region b/packages/yasnippet/snippets/csharp-mode/region new file mode 100644 index 000000000..a15573008 --- /dev/null +++ b/packages/yasnippet/snippets/csharp-mode/region @@ -0,0 +1,7 @@ +# contributor: Alejandro Espinoza Esparza +# name: #region ... #endregion +# key: region +# -- +#region $1 +$0 +#endregion \ No newline at end of file diff --git a/packages/yasnippet/snippets/csharp-mode/using b/packages/yasnippet/snippets/csharp-mode/using new file mode 100644 index 000000000..4103995ab --- /dev/null +++ b/packages/yasnippet/snippets/csharp-mode/using @@ -0,0 +1,5 @@ +# contributor: Alejandro Espinoza Esparza +# name: using ...; +# key: using +# -- +using $1; \ No newline at end of file diff --git a/packages/yasnippet/snippets/csharp-mode/using.1 b/packages/yasnippet/snippets/csharp-mode/using.1 new file mode 100644 index 000000000..452b07b8a --- /dev/null +++ b/packages/yasnippet/snippets/csharp-mode/using.1 @@ -0,0 +1,5 @@ +# contributor: Alejandro Espinoza Esparza +# name: using System; +# key: using +# -- +using System; \ No newline at end of file diff --git a/packages/yasnippet/snippets/csharp-mode/using.2 b/packages/yasnippet/snippets/csharp-mode/using.2 new file mode 100644 index 000000000..d3a898077 --- /dev/null +++ b/packages/yasnippet/snippets/csharp-mode/using.2 @@ -0,0 +1,5 @@ +# contributor: Alejandro Espinoza Esparza +# name: using System....; +# key: using +# -- +using System.$1; \ No newline at end of file diff --git a/packages/yasnippet/snippets/css-mode/.yas-parents b/packages/yasnippet/snippets/css-mode/.yas-parents new file mode 100644 index 000000000..eed5b442b --- /dev/null +++ b/packages/yasnippet/snippets/css-mode/.yas-parents @@ -0,0 +1 @@ +text-mode diff --git a/packages/yasnippet/snippets/css-mode/bg b/packages/yasnippet/snippets/css-mode/bg new file mode 100644 index 000000000..89597cb0d --- /dev/null +++ b/packages/yasnippet/snippets/css-mode/bg @@ -0,0 +1,4 @@ +# name: background-color: ... +# key: bg +# -- +background-color: #${1:DDD}; \ No newline at end of file diff --git a/packages/yasnippet/snippets/css-mode/bg.1 b/packages/yasnippet/snippets/css-mode/bg.1 new file mode 100644 index 000000000..f74f6e486 --- /dev/null +++ b/packages/yasnippet/snippets/css-mode/bg.1 @@ -0,0 +1,4 @@ +# name: background-image: ... +# key: bg +# -- +background-image: url($1); \ No newline at end of file diff --git a/packages/yasnippet/snippets/css-mode/bor b/packages/yasnippet/snippets/css-mode/bor new file mode 100644 index 000000000..b2a1bf296 --- /dev/null +++ b/packages/yasnippet/snippets/css-mode/bor @@ -0,0 +1,4 @@ +# name: border size style color +# key: bor +# -- +border: ${1:1px} ${2:solid} #${3:999}; \ No newline at end of file diff --git a/packages/yasnippet/snippets/css-mode/cl b/packages/yasnippet/snippets/css-mode/cl new file mode 100644 index 000000000..fcfd3455f --- /dev/null +++ b/packages/yasnippet/snippets/css-mode/cl @@ -0,0 +1,5 @@ +# contributor: rejeep +# name: clear: ... +# key: cl +# -- +clear: $1; \ No newline at end of file diff --git a/packages/yasnippet/snippets/css-mode/disp.block b/packages/yasnippet/snippets/css-mode/disp.block new file mode 100644 index 000000000..2571ba44a --- /dev/null +++ b/packages/yasnippet/snippets/css-mode/disp.block @@ -0,0 +1,5 @@ +# contributor: rejeep +# name: display: block +# key: disp +# -- +display: block; \ No newline at end of file diff --git a/packages/yasnippet/snippets/css-mode/disp.inline b/packages/yasnippet/snippets/css-mode/disp.inline new file mode 100644 index 000000000..0be30e317 --- /dev/null +++ b/packages/yasnippet/snippets/css-mode/disp.inline @@ -0,0 +1,5 @@ +# contributor: rejeep +# name: display: inline +# key: disp +# -- +display: inline; \ No newline at end of file diff --git a/packages/yasnippet/snippets/css-mode/disp.none b/packages/yasnippet/snippets/css-mode/disp.none new file mode 100644 index 000000000..58c40d0b0 --- /dev/null +++ b/packages/yasnippet/snippets/css-mode/disp.none @@ -0,0 +1,5 @@ +# contributor: rejeep +# name: display: none +# key: disp +# -- +display: none; \ No newline at end of file diff --git a/packages/yasnippet/snippets/css-mode/ff b/packages/yasnippet/snippets/css-mode/ff new file mode 100644 index 000000000..42189086c --- /dev/null +++ b/packages/yasnippet/snippets/css-mode/ff @@ -0,0 +1,5 @@ +# contributor: rejeep +# name: font-family: ... +# key: ff +# -- +font-family: $1; \ No newline at end of file diff --git a/packages/yasnippet/snippets/css-mode/fs b/packages/yasnippet/snippets/css-mode/fs new file mode 100644 index 000000000..98a050a7d --- /dev/null +++ b/packages/yasnippet/snippets/css-mode/fs @@ -0,0 +1,5 @@ +# contributor: rejeep +# name: font-size: ... +# key: fs +# -- +font-size: ${12px}; \ No newline at end of file diff --git a/packages/yasnippet/snippets/css-mode/mar.bottom b/packages/yasnippet/snippets/css-mode/mar.bottom new file mode 100644 index 000000000..6dbe9f839 --- /dev/null +++ b/packages/yasnippet/snippets/css-mode/mar.bottom @@ -0,0 +1,5 @@ +# contributor: rejeep +# name: margin-bottom: ... +# key: mar +# -- +margin-bottom: $1; \ No newline at end of file diff --git a/packages/yasnippet/snippets/css-mode/mar.left b/packages/yasnippet/snippets/css-mode/mar.left new file mode 100644 index 000000000..0ba7b3bca --- /dev/null +++ b/packages/yasnippet/snippets/css-mode/mar.left @@ -0,0 +1,5 @@ +# contributor: rejeep +# name: margin-left: ... +# key: mar +# -- +margin-left: $1; \ No newline at end of file diff --git a/packages/yasnippet/snippets/css-mode/mar.mar b/packages/yasnippet/snippets/css-mode/mar.mar new file mode 100644 index 000000000..e45a33c10 --- /dev/null +++ b/packages/yasnippet/snippets/css-mode/mar.mar @@ -0,0 +1,5 @@ +# contributor: rejeep +# name: margin: ... +# key: mar +# -- +margin: $1; \ No newline at end of file diff --git a/packages/yasnippet/snippets/css-mode/mar.margin b/packages/yasnippet/snippets/css-mode/mar.margin new file mode 100644 index 000000000..0716fc856 --- /dev/null +++ b/packages/yasnippet/snippets/css-mode/mar.margin @@ -0,0 +1,5 @@ +# contributor: rejeep +# name: margin top right bottom left +# key: mar +# -- +margin: ${top} ${right} ${bottom} ${left}; \ No newline at end of file diff --git a/packages/yasnippet/snippets/css-mode/mar.right b/packages/yasnippet/snippets/css-mode/mar.right new file mode 100644 index 000000000..49f05d7c2 --- /dev/null +++ b/packages/yasnippet/snippets/css-mode/mar.right @@ -0,0 +1,5 @@ +# contributor: rejeep +# name: margin-right: ... +# key: mar +# -- +margin-right: $1; \ No newline at end of file diff --git a/packages/yasnippet/snippets/css-mode/mar.top b/packages/yasnippet/snippets/css-mode/mar.top new file mode 100644 index 000000000..168f45818 --- /dev/null +++ b/packages/yasnippet/snippets/css-mode/mar.top @@ -0,0 +1,5 @@ +# contributor: rejeep +# name: margin-top: ... +# key: mar +# -- +margin-top: $1; \ No newline at end of file diff --git a/packages/yasnippet/snippets/css-mode/pad.bottom b/packages/yasnippet/snippets/css-mode/pad.bottom new file mode 100644 index 000000000..3e4c6651d --- /dev/null +++ b/packages/yasnippet/snippets/css-mode/pad.bottom @@ -0,0 +1,5 @@ +# contributor: rejeep +# name: padding-bottom: ... +# key: pad +# -- +padding-bottom: $1; \ No newline at end of file diff --git a/packages/yasnippet/snippets/css-mode/pad.left b/packages/yasnippet/snippets/css-mode/pad.left new file mode 100644 index 000000000..5e49b28a5 --- /dev/null +++ b/packages/yasnippet/snippets/css-mode/pad.left @@ -0,0 +1,5 @@ +# contributor: rejeep +# name: padding-left: ... +# key: pad +# -- +padding-left: $1; \ No newline at end of file diff --git a/packages/yasnippet/snippets/css-mode/pad.pad b/packages/yasnippet/snippets/css-mode/pad.pad new file mode 100644 index 000000000..ce81c36e8 --- /dev/null +++ b/packages/yasnippet/snippets/css-mode/pad.pad @@ -0,0 +1,5 @@ +# contributor: rejeep +# name: padding: ... +# key: pad +# -- +padding: $1; \ No newline at end of file diff --git a/packages/yasnippet/snippets/css-mode/pad.padding b/packages/yasnippet/snippets/css-mode/pad.padding new file mode 100644 index 000000000..0be7890c3 --- /dev/null +++ b/packages/yasnippet/snippets/css-mode/pad.padding @@ -0,0 +1,5 @@ +# contributor: rejeep +# name: padding: top right bottom left +# key: pad +# -- +padding: ${top} ${right} ${bottom} ${left}; \ No newline at end of file diff --git a/packages/yasnippet/snippets/css-mode/pad.right b/packages/yasnippet/snippets/css-mode/pad.right new file mode 100644 index 000000000..a244b9478 --- /dev/null +++ b/packages/yasnippet/snippets/css-mode/pad.right @@ -0,0 +1,5 @@ +# contributor: rejeep +# name: padding-right: ... +# key: pad +# -- +padding-right: $1; \ No newline at end of file diff --git a/packages/yasnippet/snippets/css-mode/pad.top b/packages/yasnippet/snippets/css-mode/pad.top new file mode 100644 index 000000000..d315e46d4 --- /dev/null +++ b/packages/yasnippet/snippets/css-mode/pad.top @@ -0,0 +1,5 @@ +# contributor: rejeep +# name: padding-top: ... +# key: pad +# -- +padding-top: $1; \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/.read_me b/packages/yasnippet/snippets/emacs-lisp-mode/.read_me new file mode 100644 index 000000000..49c8e0077 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/.read_me @@ -0,0 +1,7 @@ +-*- coding: utf-8 -*- +Originally started by Xah Lee (xahlee.org) on 2009-02-22 +Released under GPL 3. + +Feel free to add missing ones or modify existing ones to improve. + +Those starting with “x-” are supposed to be idiom templates. Not sure it's very useful. They might start with “i-” or "id-" in the future. \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/.yas-parents b/packages/yasnippet/snippets/emacs-lisp-mode/.yas-parents new file mode 100644 index 000000000..eed5b442b --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/.yas-parents @@ -0,0 +1 @@ +text-mode diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/add-hook.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/add-hook.yasnippet new file mode 100644 index 000000000..04f1f01ff --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/add-hook.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: add-hook +# key: add-hook +# key: ah +# -- +(add-hook HOOK$0 FUNCTION) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/and.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/and.yasnippet new file mode 100644 index 000000000..cfc7dfca3 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/and.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: and +# key: and +# key: a +# -- +(and $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/append.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/append.yasnippet new file mode 100644 index 000000000..585dfdccc --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/append.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: append +# key: append +# -- +(append $0 ) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/apply.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/apply.yasnippet new file mode 100644 index 000000000..2cfe6957e --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/apply.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: apply +# key: apply +# -- +(apply $0 ) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/aref.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/aref.yasnippet new file mode 100644 index 000000000..0df3b8ea0 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/aref.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: aref +# key: aref +# -- +(aref ARRAY$0 INDEX) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/aset.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/aset.yasnippet new file mode 100644 index 000000000..0813e7eaf --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/aset.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: aset +# key: aset +# -- +(aset ARRAY$0 IDX NEWELT) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/assq.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/assq.yasnippet new file mode 100644 index 000000000..61609c8ff --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/assq.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: assq +# key: assq +# -- +(assq KEY$0 LIST) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/autoload.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/autoload.yasnippet new file mode 100644 index 000000000..20052f556 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/autoload.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: autoload +# key: autoload +# -- +(autoload 'FUNCNAME$0 "FILENAME" &optional "DOCSTRING" INTERACTIVE TYPE) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/backward-char.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/backward-char.yasnippet new file mode 100644 index 000000000..782b35ceb --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/backward-char.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: backward-char +# key: backward-char +# key: bc +# -- +(backward-char $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/beginning-of-line.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/beginning-of-line.yasnippet new file mode 100644 index 000000000..cd7585903 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/beginning-of-line.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: beginning-of-line +# key: beginning-of-line +# key: bol +# -- +(beginning-of-line) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/bounds-of-thing-at-point.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/bounds-of-thing-at-point.yasnippet new file mode 100644 index 000000000..507457c61 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/bounds-of-thing-at-point.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: bounds-of-thing-at-point +# key: bounds-of-thing-at-point +# key: botap +# -- +(bounds-of-thing-at-point '$0) ; symbol, list, sexp, defun, filename, url, email, word, sentence, whitespace, line, page ... \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/buffer-file-name.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/buffer-file-name.yasnippet new file mode 100644 index 000000000..726c5080e --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/buffer-file-name.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: buffer-file-name +# key: buffer-file-name +# key: bfn +# -- +(buffer-file-name) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/buffer-modified-p.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/buffer-modified-p.yasnippet new file mode 100644 index 000000000..87ff31ecc --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/buffer-modified-p.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: buffer-modified-p +# key: buffer-modified-p +# key: bmp +# -- +(buffer-modified-p $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/buffer-substring-no-properties.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/buffer-substring-no-properties.yasnippet new file mode 100644 index 000000000..1b040196b --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/buffer-substring-no-properties.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: buffer-substring-no-properties +# key: buffer-substring-no-properties +# key: bsnp +# -- +(buffer-substring-no-properties START$0 END) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/buffer-substring.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/buffer-substring.yasnippet new file mode 100644 index 000000000..002a4f0c0 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/buffer-substring.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: buffer-substring +# key: buffer-substring +# key: bs +# -- +(buffer-substring START$0 END) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/car.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/car.yasnippet new file mode 100644 index 000000000..5406d9431 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/car.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: car +# key: car +# -- +(car $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/cdr.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/cdr.yasnippet new file mode 100644 index 000000000..0afd31fff --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/cdr.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: cdr +# key: cdr +# -- +(cdr $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/concat.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/concat.yasnippet new file mode 100644 index 000000000..42436b4d5 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/concat.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: concat +# key: concat +# -- +(concat $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/cond.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/cond.yasnippet new file mode 100644 index 000000000..4c40194a8 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/cond.yasnippet @@ -0,0 +1,8 @@ +# contributor: Xah Lee (XahLee.org) +# name: cond +# key: cond +# -- +(cond +(CONDITION$0 BODY) +(CONDITION BODY) +) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/condition-case.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/condition-case.yasnippet new file mode 100644 index 000000000..80d09ad31 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/condition-case.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: condition-case +# key: condition-case +# key: cc +# -- +(condition-case $0 ) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/cons.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/cons.yasnippet new file mode 100644 index 000000000..a0f90ce80 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/cons.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: cons +# key: cons +# -- +(cons $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/consp.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/consp.yasnippet new file mode 100644 index 000000000..f4b3f99e9 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/consp.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: consp +# key: consp +# -- +(consp $0 ) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/copy-directory.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/copy-directory.yasnippet new file mode 100644 index 000000000..4c47d2f8c --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/copy-directory.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: copy-directory +# key: copy-directory +# key: cd +# -- +(copy-directory $0 NEWNAME &optional KEEP-TIME PARENTS) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/copy-file.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/copy-file.yasnippet new file mode 100644 index 000000000..021c60e52 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/copy-file.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: copy-file +# key: copy-file +# key: cf +# -- +(copy-file FILE$0 NEWNAME &optional OK-IF-ALREADY-EXISTS KEEP-TIME PRESERVE-UID-GID) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/current-buffer.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/current-buffer.yasnippet new file mode 100644 index 000000000..59859be11 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/current-buffer.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: current-buffer +# key: current-buffer +# key: cb +# -- +(current-buffer) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/custom-autoload.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/custom-autoload.yasnippet new file mode 100644 index 000000000..7961f9e8f --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/custom-autoload.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: custom-autoload +# key: custom-autoload +# key: ca +# -- +(custom-autoload$0 SYMBOL LOAD &optional NOSET) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/defalias.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/defalias.yasnippet new file mode 100644 index 000000000..56d58553f --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/defalias.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: defalias +# key: defalias +# -- +(defalias 'SYMBOL$0 'DEFINITION &optional DOCSTRING) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/defcustom.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/defcustom.yasnippet new file mode 100644 index 000000000..db709be03 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/defcustom.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: defcustom +# key: defcustom +# -- +(defcustom $0 VALUE "DOC" &optional ARGS) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/define-key.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/define-key.yasnippet new file mode 100644 index 000000000..a04e5d765 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/define-key.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: define-key +# key: define-key +# key: dk +# -- +(define-key KEYMAPNAME$0 (kbd "M-b") 'FUNCNAME) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/defsubst.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/defsubst.yasnippet new file mode 100644 index 000000000..5535af139 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/defsubst.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: defsubst +# key: defsubst +# -- +(defsubst $0 ) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/defun.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/defun.yasnippet new file mode 100644 index 000000000..0f3644b19 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/defun.yasnippet @@ -0,0 +1,12 @@ +# contributor: Xah Lee (XahLee.org) +# name: defun +# key: defun +# key: d +# -- +(defun $1 () + "DOCSTRING" + (interactive) + (let (var1) + (setq var1 some) + $0 + )) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/defvar.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/defvar.yasnippet new file mode 100644 index 000000000..1148472fc --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/defvar.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: defvar +# key: defvar +# -- +(defvar $0 &optional INITVALUE "DOCSTRING") \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/delete-char.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/delete-char.yasnippet new file mode 100644 index 000000000..02585fafb --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/delete-char.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: delete-char +# key: delete-char +# key: dc +# -- +(delete-char $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/delete-directory.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/delete-directory.yasnippet new file mode 100644 index 000000000..5033240fe --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/delete-directory.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: delete-directory +# key: delete-directory +# key: dd +# -- +(delete-directory $0 &optional RECURSIVE) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/delete-file.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/delete-file.yasnippet new file mode 100644 index 000000000..6b47f0d04 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/delete-file.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: delete-file +# key: delete-file +# key: df +# -- +(delete-file $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/delete-region.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/delete-region.yasnippet new file mode 100644 index 000000000..054b40d8b --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/delete-region.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: delete-region +# key: delete-region +# key: dr +# -- +(delete-region $0 ) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/directory-files.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/directory-files.yasnippet new file mode 100644 index 000000000..449e0162e --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/directory-files.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: directory-files +# key: directory-files +# key: df +# -- +(directory-files $0 &optional FULL MATCH NOSORT) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/dolist.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/dolist.yasnippet new file mode 100644 index 000000000..13be2fb31 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/dolist.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: dolist +# key: dolist +# -- +(dolist $0 ) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/end-of-line.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/end-of-line.yasnippet new file mode 100644 index 000000000..dcefc48dd --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/end-of-line.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: end-of-line +# key: end-of-line +# key: eol +# -- +(end-of-line) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/eq.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/eq.yasnippet new file mode 100644 index 000000000..b05f968a1 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/eq.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: eq +# key: eq +# -- +(eq $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/equal.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/equal.yasnippet new file mode 100644 index 000000000..f2dec4739 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/equal.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: equal +# key: equal +# -- +(equal $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/error.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/error.yasnippet new file mode 100644 index 000000000..93314ddca --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/error.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: error +# key: error +# -- +(error "$0" &optional ARGS) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/expand-file-name.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/expand-file-name.yasnippet new file mode 100644 index 000000000..c8b52534e --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/expand-file-name.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: expand-file-name +# key: expand-file-name +# key: efn +# -- +(expand-file-name $0 ) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/f.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/f.yasnippet new file mode 100644 index 000000000..220a1affc --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/f.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: format +# key: format +# -- +(format "$0" &optional OBJECTS) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/fboundp.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/fboundp.yasnippet new file mode 100644 index 000000000..f6e89071a --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/fboundp.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: fboundp +# key: fboundp +# -- +(fboundp '$0 ) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/file-name-directory.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/file-name-directory.yasnippet new file mode 100644 index 000000000..1264a25aa --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/file-name-directory.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: file-name-directory +# key: file-name-directory +# key: fnd +# -- +(file-name-directory $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/file-name-extension.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/file-name-extension.yasnippet new file mode 100644 index 000000000..87886d419 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/file-name-extension.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: file-name-extension +# key: file-name-extension +# key: fne +# -- +(file-name-extension $0 &optional PERIOD) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/file-name-nondirectory.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/file-name-nondirectory.yasnippet new file mode 100644 index 000000000..0a824a5ad --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/file-name-nondirectory.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: file-name-nondirectory +# key: file-name-nondirectory +# key: fnn +# -- +(file-name-nondirectory $0 ) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/file-name-sans-extension.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/file-name-sans-extension.yasnippet new file mode 100644 index 000000000..491c7e4b5 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/file-name-sans-extension.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: file-name-sans-extension +# key: file-name-sans-extension +# key: fnse +# -- +(file-name-sans-extension $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/file-relative-name.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/file-relative-name.yasnippet new file mode 100644 index 000000000..8f773aa60 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/file-relative-name.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: file-relative-name +# key: file-relative-name +# key: frn +# -- +(file-relative-name $0 ) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/find-file.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/find-file.yasnippet new file mode 100644 index 000000000..7a64537ae --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/find-file.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: find-file +# key: find-file +# key: ff +# -- +(find-file $0 ) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/format.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/format.yasnippet new file mode 100644 index 000000000..220a1affc --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/format.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: format +# key: format +# -- +(format "$0" &optional OBJECTS) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/forward-char.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/forward-char.yasnippet new file mode 100644 index 000000000..198cca28b --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/forward-char.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: forward-char +# key: forward-char +# key: fc +# -- +(forward-char $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/forward-line.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/forward-line.yasnippet new file mode 100644 index 000000000..10456d3ad --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/forward-line.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: forward-line +# key: forward-line +# key: fl +# -- +(forward-line $0 ) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/funcall.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/funcall.yasnippet new file mode 100644 index 000000000..4f67029ee --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/funcall.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: funcall +# key: funcall +# -- +(funcall $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/function.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/function.yasnippet new file mode 100644 index 000000000..3ff84fcd9 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/function.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: function +# key: function +# -- +(function $0 ) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/get.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/get.yasnippet new file mode 100644 index 000000000..df20ccee6 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/get.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: get +# key: get +# -- +(get SYMBOL$0 PROPNAME) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/global-set-key.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/global-set-key.yasnippet new file mode 100644 index 000000000..889505324 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/global-set-key.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: global-set-key +# key: global-set-key +# key: gsk +# -- +(global-set-key (kbd "C-$0") 'COMMAND) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/goto-char.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/goto-char.yasnippet new file mode 100644 index 000000000..1caa88e3d --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/goto-char.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: goto-char +# key: goto-char +# key: gc +# -- +(goto-char $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/if.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/if.yasnippet new file mode 100644 index 000000000..db90fe352 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/if.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: if +# key: if +# -- +(if $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/insert-file-contents.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/insert-file-contents.yasnippet new file mode 100644 index 000000000..6189cfaf7 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/insert-file-contents.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: insert-file-contents +# key: insert-file-contents +# key: ifc +# -- +(insert-file-contents $0 &optional VISIT BEG END REPLACE) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/insert.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/insert.yasnippet new file mode 100644 index 000000000..b3de98c17 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/insert.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: insert +# key: insert +# key: i +# -- +(insert $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/interactive.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/interactive.yasnippet new file mode 100644 index 000000000..f63e4899e --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/interactive.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: interactive +# key: interactive +# -- +(interactive) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/kbd.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/kbd.yasnippet new file mode 100644 index 000000000..811ef6b29 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/kbd.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: kbd +# key: kbd +# -- +(kbd "$0") \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/kill-buffer.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/kill-buffer.yasnippet new file mode 100644 index 000000000..615f74de8 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/kill-buffer.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: kill-buffer +# key: kill-buffer +# key: kb +# -- +(kill-buffer $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/lambda.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/lambda.yasnippet new file mode 100644 index 000000000..63ac70aca --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/lambda.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: lambda +# key: lambda +# -- +(lambda ($0) "DOCSTRING" (interactive) BODY) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/length.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/length.yasnippet new file mode 100644 index 000000000..ecd1b6d8e --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/length.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: length +# key: length +# -- +(length $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/let.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/let.yasnippet new file mode 100644 index 000000000..e19825499 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/let.yasnippet @@ -0,0 +1,8 @@ +# contributor: Xah Lee (XahLee.org) +# name: let +# key: let +# key: l +# -- +(let ($1 ) + $0 +) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/line-beginning-position.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/line-beginning-position.yasnippet new file mode 100644 index 000000000..5edd9e334 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/line-beginning-position.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: line-beginning-position +# key: line-beginning-position +# key: lbp +# -- +(line-beginning-position) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/line-end-position.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/line-end-position.yasnippet new file mode 100644 index 000000000..a8fa3d085 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/line-end-position.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: line-end-position +# key: line-end-position +# key: lep +# -- +(line-end-position) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/list.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/list.yasnippet new file mode 100644 index 000000000..b8532a9d0 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/list.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: list +# key: list +# -- +(list $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/looking-at.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/looking-at.yasnippet new file mode 100644 index 000000000..da85f0191 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/looking-at.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: looking-at +# key: looking-at +# key: la +# -- +(looking-at $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/make-directory.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/make-directory.yasnippet new file mode 100644 index 000000000..4f83d946b --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/make-directory.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: make-directory +# key: make-directory +# key: md +# -- +(make-directory $0 &optional PARENTS) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/make-local-variable.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/make-local-variable.yasnippet new file mode 100644 index 000000000..223fa5575 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/make-local-variable.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: make-local-variable +# key: make-local-variable +# key: mlv +# -- +(make-local-variable $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/mapc.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/mapc.yasnippet new file mode 100644 index 000000000..e8b0c5289 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/mapc.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: mapc +# key: mapc +# -- +(mapc '$0 SEQUENCE) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/mapcar.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/mapcar.yasnippet new file mode 100644 index 000000000..1f398ec74 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/mapcar.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: mapcar +# key: mapcar +# -- +(mapcar $0 ) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/match-beginning.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/match-beginning.yasnippet new file mode 100644 index 000000000..840760294 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/match-beginning.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: match-beginning +# key: match-beginning +# key: mb +# -- +(match-beginning N$0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/match-end.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/match-end.yasnippet new file mode 100644 index 000000000..60923a414 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/match-end.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: match-end +# key: match-end +# key: me +# -- +(match-end N$0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/match-string.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/match-string.yasnippet new file mode 100644 index 000000000..83eb5fe28 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/match-string.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: match-string +# key: match-string +# key: ms +# -- +(match-string $0 ) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/memq.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/memq.yasnippet new file mode 100644 index 000000000..513fd2516 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/memq.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: memq +# key: memq +# -- +(memq ELT$0 LIST) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/message.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/message.yasnippet new file mode 100644 index 000000000..38bbab62a --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/message.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: message +# key: message +# key: m +# -- +(message "FORMATSTRING$0" &optional ARGS) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/not.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/not.yasnippet new file mode 100644 index 000000000..80d3694a3 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/not.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: not +# key: not +# key: n +# -- +(not $0 ) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/nth.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/nth.yasnippet new file mode 100644 index 000000000..de81812a6 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/nth.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: nth +# key: nth +# -- +(nth N$0 LIST) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/null.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/null.yasnippet new file mode 100644 index 000000000..6b4010bd9 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/null.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: null +# key: null +# -- +(null $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/number-to-string.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/number-to-string.yasnippet new file mode 100644 index 000000000..c57a93022 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/number-to-string.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: number-to-string +# key: number-to-string +# key: nts +# -- +(number-to-string $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/or.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/or.yasnippet new file mode 100644 index 000000000..86eea3260 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/or.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: or +# key: or +# key: o +# -- +(or $0 ) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/point-max.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/point-max.yasnippet new file mode 100644 index 000000000..5df439d04 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/point-max.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: point-max +# key: point-max +# -- +(point-max) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/point-min.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/point-min.yasnippet new file mode 100644 index 000000000..b5e58f77e --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/point-min.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: point-min +# key: point-min +# key: pm +# -- +(point-min) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/point.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/point.yasnippet new file mode 100644 index 000000000..95b3dabb9 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/point.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: point +# key: point +# key: p +# -- +(point) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/princ.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/princ.yasnippet new file mode 100644 index 000000000..5c5f7dba0 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/princ.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: princ +# key: princ +# -- +(princ $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/print.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/print.yasnippet new file mode 100644 index 000000000..dc156e8c1 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/print.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: print +# key: print +# -- +(print $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/progn.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/progn.yasnippet new file mode 100644 index 000000000..4ae43ed21 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/progn.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: progn +# key: progn +# -- +(progn $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/push.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/push.yasnippet new file mode 100644 index 000000000..080e61549 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/push.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: push +# key: push +# -- +(push $0 ) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/put.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/put.yasnippet new file mode 100644 index 000000000..85f88691c --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/put.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: put +# key: put +# -- +(put $0 PROPNAME VALUE) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/re-search-backward.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/re-search-backward.yasnippet new file mode 100644 index 000000000..c4e82cc09 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/re-search-backward.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: re-search-backward +# key: re-search-backward +# key: rsb +# -- +(re-search-backward REGEXP$0 &optional BOUND NOERROR COUNT) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/re-search-forward.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/re-search-forward.yasnippet new file mode 100644 index 000000000..6e86e334c --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/re-search-forward.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: re-search-forward +# key: re-search-forward +# key: rsf +# -- +(re-search-forward REGEXP$0 &optional BOUND NOERROR COUNT) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/region-active-p.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/region-active-p.yasnippet new file mode 100644 index 000000000..c6891186e --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/region-active-p.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: region-active-p +# key: region-active-p +# key: rap +# -- +(region-active-p) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/region-beginning.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/region-beginning.yasnippet new file mode 100644 index 000000000..b696fdcc9 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/region-beginning.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: region-beginning +# key: region-beginning +# key: rb +# -- +(region-beginning) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/region-end.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/region-end.yasnippet new file mode 100644 index 000000000..9fe0ea8c2 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/region-end.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: region-end +# key: region-end +# key: re +# -- +(region-end) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/rename-file.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/rename-file.yasnippet new file mode 100644 index 000000000..6c47c7ebe --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/rename-file.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: rename-file +# key: rename-file +# key: rf +# -- +(rename-file FILE$0 NEWNAME &optional OK-IF-ALREADY-EXISTS) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/repeat.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/repeat.yasnippet new file mode 100644 index 000000000..a46e63b6d --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/repeat.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: repeat +# key: repeat +# -- +(repeat $0 ) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/replace-regexp-in-string.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/replace-regexp-in-string.yasnippet new file mode 100644 index 000000000..694717b53 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/replace-regexp-in-string.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: replace-regexp-in-string +# key: replace-regexp-in-string +# key: rris +# -- +(replace-regexp-in-string REGEXP$0 REP STRING &optional FIXEDCASE LITERAL SUBEXP START) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/replace-regexp.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/replace-regexp.yasnippet new file mode 100644 index 000000000..96823d622 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/replace-regexp.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: replace-regexp +# key: replace-regexp +# key: rr +# -- +(replace-regexp REGEXP$0 TO-STRING &optional DELIMITED START END) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/require.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/require.yasnippet new file mode 100644 index 000000000..d26ffd67d --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/require.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: require +# key: require +# -- +(require $0 ) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/save-buffer.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/save-buffer.yasnippet new file mode 100644 index 000000000..009e4af9b --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/save-buffer.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: save-buffer +# key: save-buffer +# key: sb +# -- +(save-buffer $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/save-excursion.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/save-excursion.yasnippet new file mode 100644 index 000000000..799d2f070 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/save-excursion.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: save-excursion +# key: save-excursion +# key: se +# -- +(save-excursion $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/search-backward-regexp.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/search-backward-regexp.yasnippet new file mode 100644 index 000000000..299f2df2a --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/search-backward-regexp.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: search-backward-regexp +# key: search-backward-regexp +# key: sbr +# -- +(search-backward-regexp "$0" &optional BOUND NOERROR COUNT) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/search-backward.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/search-backward.yasnippet new file mode 100644 index 000000000..27ab5716e --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/search-backward.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: search-backward +# key: search-backward +# key: sb +# -- +(search-backward "$0" &optional BOUND NOERROR COUNT) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/search-forward-regexp.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/search-forward-regexp.yasnippet new file mode 100644 index 000000000..d7860d69d --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/search-forward-regexp.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: search-forward-regexp +# key: search-forward-regexp +# key: sfr +# -- +(search-forward-regexp "$0" &optional BOUND NOERROR COUNT) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/search-forward.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/search-forward.yasnippet new file mode 100644 index 000000000..09f1216bd --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/search-forward.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: search-forward +# key: search-forward +# key: sf +# -- +(search-forward "$0" &optional BOUND NOERROR COUNT) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/set-buffer.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/set-buffer.yasnippet new file mode 100644 index 000000000..402ab8429 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/set-buffer.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: set-buffer +# key: set-buffer +# key: sb +# -- +(set-buffer $0 ) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/set-file-modes.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/set-file-modes.yasnippet new file mode 100644 index 000000000..b64d5938c --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/set-file-modes.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: set-file-modes +# key: set-file-modes +# key: sfm +# -- +(set-file-modes $0 MODE) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/set-mark.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/set-mark.yasnippet new file mode 100644 index 000000000..fe7a206ff --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/set-mark.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: set-mark +# key: set-mark +# key: sm +# -- +(set-mark $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/set.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/set.yasnippet new file mode 100644 index 000000000..f7e83a46a --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/set.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: set +# key: set +# -- +(set $0 ) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/setq.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/setq.yasnippet new file mode 100644 index 000000000..3a263c697 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/setq.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: setq +# key: setq +# key: s +# -- +(setq $0 ) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/skip-chars-backward.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/skip-chars-backward.yasnippet new file mode 100644 index 000000000..17c33d4f7 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/skip-chars-backward.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: skip-chars-backward +# key: skip-chars-backward +# key: scb +# -- +(skip-chars-backward "$0" &optional LIM) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/skip-chars-forward.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/skip-chars-forward.yasnippet new file mode 100644 index 000000000..7b9398732 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/skip-chars-forward.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: skip-chars-forward +# key: skip-chars-forward +# key: scf +# -- +(skip-chars-forward "$0" &optional LIM) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/split-string.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/split-string.yasnippet new file mode 100644 index 000000000..9e03740ff --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/split-string.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: split-string +# key: split-string +# key: ss +# -- +(split-string $0 &optional SEPARATORS OMIT-NULLS) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/string-match.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/string-match.yasnippet new file mode 100644 index 000000000..f39c69e23 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/string-match.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: string-match +# key: string-match +# key: sm +# -- +(string-match "REGEXP$0" "STRING" &optional START) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/string-to-number.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/string-to-number.yasnippet new file mode 100644 index 000000000..f47c9d478 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/string-to-number.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: string-to-number +# key: string-to-number +# key: stn +# -- +(string-to-number "$0") \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/string.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/string.yasnippet new file mode 100644 index 000000000..07c17f1b5 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/string.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: string +# key: string +# -- +(string $0 ) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/string=.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/string=.yasnippet new file mode 100644 index 000000000..3a458e854 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/string=.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: string= +# key: string= +# -- +(string= $0 ) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/stringp.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/stringp.yasnippet new file mode 100644 index 000000000..432f6e010 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/stringp.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: stringp +# key: stringp +# -- +(stringp $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/substring.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/substring.yasnippet new file mode 100644 index 000000000..eeb0c02db --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/substring.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: substring +# key: substring +# -- +(substring STRING$0 FROM &optional TO) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/thing-at-point.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/thing-at-point.yasnippet new file mode 100644 index 000000000..6b78e03be --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/thing-at-point.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: thing-at-point +# key: thing-at-point +# key: tap +# -- +(thing-at-point '$0) ; symbol, list, sexp, defun, filename, url, email, word, sentence, whitespace, line, page ... \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/unless.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/unless.yasnippet new file mode 100644 index 000000000..bdde0cfa6 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/unless.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: unless +# key: unless +# -- +(unless $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/vector.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/vector.yasnippet new file mode 100644 index 000000000..5aea79abd --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/vector.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: vector +# key: vector +# key: v +# -- +(vector $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/when.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/when.yasnippet new file mode 100644 index 000000000..86d31d9a4 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/when.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: when +# key: when +# -- +(when $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/while.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/while.yasnippet new file mode 100644 index 000000000..1802e1b32 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/while.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: while +# key: while +# -- +(while $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/widget-get.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/widget-get.yasnippet new file mode 100644 index 000000000..f183569f6 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/widget-get.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: widget-get +# key: widget-get +# key: wg +# -- +(widget-get $0 ) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/with-current-buffer.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/with-current-buffer.yasnippet new file mode 100644 index 000000000..1e6a94e33 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/with-current-buffer.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: with-current-buffer +# key: with-current-buffer +# key: wcb +# -- +(with-current-buffer $0 ) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/x-dired.process_marked.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/x-dired.process_marked.yasnippet new file mode 100644 index 000000000..710657c0e --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/x-dired.process_marked.yasnippet @@ -0,0 +1,17 @@ +# contributor: Xah Lee (XahLee.org) +# name: process marked files in dired +# key: x-dired +# -- +;; idiom for processing a list of files in dired's marked files + +;; suppose myProcessFile is your function that takes a file path +;; and do some processing on the file + +(defun dired-myProcessFile () + "apply myProcessFile function to marked files in dired." + (interactive) + (require 'dired) + (mapc 'myProcessFile (dired-get-marked-files)) +) + +;; to use it, type M-x dired-myProcessFile \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/x-file.process.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/x-file.process.yasnippet new file mode 100644 index 000000000..dc60b1716 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/x-file.process.yasnippet @@ -0,0 +1,18 @@ +# contributor: Xah Lee (XahLee.org) +# name: a function that process a file +# key: x-file +# -- +(defun doThisFile (fpath) + "Process the file at path FPATH ..." + (let () + ;; create temp buffer without undo record or font lock. (more efficient) + ;; first space in temp buff name is necessary + (set-buffer (get-buffer-create " myTemp")) + (insert-file-contents fpath nil nil nil t) + + ;; process it ... + ;; (goto-char 0) ; move to begining of file's content (in case it was open) + ;; ... do something here + ;; (write-file fpath) ;; write back to the file + + (kill-buffer " myTemp"))) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/x-file.read-lines.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/x-file.read-lines.yasnippet new file mode 100644 index 000000000..f85fe4e2a --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/x-file.read-lines.yasnippet @@ -0,0 +1,18 @@ +# contributor: Xah Lee (XahLee.org) +# name: read lines of a file +# key: x-file +# -- +(defun read-lines (filePath) + "Return a list of lines in FILEPATH." + (with-temp-buffer + (insert-file-contents filePath) + (split-string + (buffer-string) "\n" t)) ) + +;; process all lines +(mapc + (lambda (aLine) + (message aLine) ; do your stuff here + ) + (read-lines "inputFilePath") +) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/x-find-replace.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/x-find-replace.yasnippet new file mode 100644 index 000000000..e5a1d6c39 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/x-find-replace.yasnippet @@ -0,0 +1,18 @@ +# contributor: Xah Lee (XahLee.org) +# name: find and replace on region +# key: x-find-replace +# -- +(defun replace-html-chars-region (start end) + "Replace “<” to “<” and other chars in HTML. +This works on the current region." + (interactive "r") + (save-restriction + (narrow-to-region start end) + (goto-char (point-min)) + (while (search-forward "&" nil t) (replace-match "&" nil t)) + (goto-char (point-min)) + (while (search-forward "<" nil t) (replace-match "<" nil t)) + (goto-char (point-min)) + (while (search-forward ">" nil t) (replace-match ">" nil t)) + ) + ) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/x-grabstring.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/x-grabstring.yasnippet new file mode 100644 index 000000000..d194f2a11 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/x-grabstring.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: grab buffer substring +# key: x-grabstring +# -- +(setq $0 (buffer-substring-no-properties myStartPos myEndPos)) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/x-grabthing.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/x-grabthing.yasnippet new file mode 100644 index 000000000..d65c1fda8 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/x-grabthing.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: grab word under cursor +# key: x-grabthing +# -- +(setq $0 (thing-at-point 'symbol)) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/x-traverse_dir.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/x-traverse_dir.yasnippet new file mode 100644 index 000000000..df0261d98 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/x-traverse_dir.yasnippet @@ -0,0 +1,7 @@ +# name: traversing a directory +# contributor: Xah Lee (XahLee.org) +# key: x-traverse_dir +# -- +;; apply a function to all files in a dir +(require 'find-lisp) +(mapc 'my-process-file (find-lisp-find-files "~/myweb/" "\\.html$")) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/x-word-or-region.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/x-word-or-region.yasnippet new file mode 100644 index 000000000..b72f8b84c --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/x-word-or-region.yasnippet @@ -0,0 +1,28 @@ +# contributor: Xah Lee (XahLee.org) +# name: Command that works on region or word +# key: x-word-or-region +# -- +;; example of a command that works on current word or text selection +(defun down-case-word-or-region () + "Lower case the current word or text selection." +(interactive) +(let (pos1 pos2 meat) + (if (and transient-mark-mode mark-active) + (setq pos1 (region-beginning) + pos2 (region-end)) + (setq pos1 (car (bounds-of-thing-at-point 'symbol)) + pos2 (cdr (bounds-of-thing-at-point 'symbol)))) + + ; now, pos1 and pos2 are the starting and ending positions + ; of the current word, or current text selection if exists + + ;; put your code here. + $0 + ;; Some example of things you might want to do + (downcase-region pos1 pos2) ; example of a func that takes region as args + (setq meat (buffer-substring-no-properties pos1 pos2)) ; grab the text. + (delete-region pos1 pos2) ; get rid of it + (insert "newText") ; insert your new text + + ) +) \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/y-or-n-p.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/y-or-n-p.yasnippet new file mode 100644 index 000000000..7ebc50305 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/y-or-n-p.yasnippet @@ -0,0 +1,6 @@ +# contributor: Xah Lee (XahLee.org) +# name: y-or-n-p +# key: y-or-n-p +# key: yonp +# -- +(yes-or-no-p "PROMPT$0 ") \ No newline at end of file diff --git a/packages/yasnippet/snippets/emacs-lisp-mode/yes-or-no-p.yasnippet b/packages/yasnippet/snippets/emacs-lisp-mode/yes-or-no-p.yasnippet new file mode 100644 index 000000000..fe85e7787 --- /dev/null +++ b/packages/yasnippet/snippets/emacs-lisp-mode/yes-or-no-p.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee (XahLee.org) +# name: yes-or-no-p +# key: yes-or-no-p +# -- +(yes-or-no-p "PROMPT$0 ") \ No newline at end of file diff --git a/packages/yasnippet/snippets/erlang-mode/.yas-parents b/packages/yasnippet/snippets/erlang-mode/.yas-parents new file mode 100644 index 000000000..eed5b442b --- /dev/null +++ b/packages/yasnippet/snippets/erlang-mode/.yas-parents @@ -0,0 +1 @@ +text-mode diff --git a/packages/yasnippet/snippets/erlang-mode/after b/packages/yasnippet/snippets/erlang-mode/after new file mode 100644 index 000000000..4b2eab209 --- /dev/null +++ b/packages/yasnippet/snippets/erlang-mode/after @@ -0,0 +1,5 @@ +# name: after ... -> +# key: after +# -- +after + $1 -> $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/erlang-mode/begin b/packages/yasnippet/snippets/erlang-mode/begin new file mode 100644 index 000000000..ad9a68bef --- /dev/null +++ b/packages/yasnippet/snippets/erlang-mode/begin @@ -0,0 +1,6 @@ +# name: begin ... end +# key: begin +# -- +begin + $0 +end \ No newline at end of file diff --git a/packages/yasnippet/snippets/erlang-mode/beh b/packages/yasnippet/snippets/erlang-mode/beh new file mode 100644 index 000000000..b7696ff4b --- /dev/null +++ b/packages/yasnippet/snippets/erlang-mode/beh @@ -0,0 +1,5 @@ +# name: -behaviour(...). +# key: beh +# -- +-behaviour(${1:gen_server}). +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/erlang-mode/case b/packages/yasnippet/snippets/erlang-mode/case new file mode 100644 index 000000000..f5326fa4f --- /dev/null +++ b/packages/yasnippet/snippets/erlang-mode/case @@ -0,0 +1,6 @@ +# name: case ... of ... end +# key: case +# -- +case $1 of + $0 +end \ No newline at end of file diff --git a/packages/yasnippet/snippets/erlang-mode/compile b/packages/yasnippet/snippets/erlang-mode/compile new file mode 100644 index 000000000..4622aa2eb --- /dev/null +++ b/packages/yasnippet/snippets/erlang-mode/compile @@ -0,0 +1,5 @@ +# name: -compile(...). +# key: compile +# -- +-compile([${1:export_all}]). +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/erlang-mode/def b/packages/yasnippet/snippets/erlang-mode/def new file mode 100644 index 000000000..bea99c33a --- /dev/null +++ b/packages/yasnippet/snippets/erlang-mode/def @@ -0,0 +1,5 @@ +# name: -define(...,...). +# key: def +# -- +-define($1,$2). +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/erlang-mode/exp b/packages/yasnippet/snippets/erlang-mode/exp new file mode 100644 index 000000000..dcef7896e --- /dev/null +++ b/packages/yasnippet/snippets/erlang-mode/exp @@ -0,0 +1,6 @@ +# name: -export([]). +# contributor: hitesh +# key: exp +# -- +-export([${1:start/0}]). +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/erlang-mode/fun b/packages/yasnippet/snippets/erlang-mode/fun new file mode 100644 index 000000000..1665ef6a9 --- /dev/null +++ b/packages/yasnippet/snippets/erlang-mode/fun @@ -0,0 +1,4 @@ +# name: fun (...) -> ... end +# key: fun +# -- +fun ($1) -> $0 end \ No newline at end of file diff --git a/packages/yasnippet/snippets/erlang-mode/if b/packages/yasnippet/snippets/erlang-mode/if new file mode 100644 index 000000000..dae3cc75f --- /dev/null +++ b/packages/yasnippet/snippets/erlang-mode/if @@ -0,0 +1,7 @@ +# name: if ... -> ... ; true -> ... end +# key: if +# -- +if + $1 -> $2; + true -> $0 +end \ No newline at end of file diff --git a/packages/yasnippet/snippets/erlang-mode/ifdef b/packages/yasnippet/snippets/erlang-mode/ifdef new file mode 100644 index 000000000..feacf74ad --- /dev/null +++ b/packages/yasnippet/snippets/erlang-mode/ifdef @@ -0,0 +1,6 @@ +# name: -ifdef(...). ... -endif. +# key: ifdef +# -- +-ifdef($1). +$0 +-endif. \ No newline at end of file diff --git a/packages/yasnippet/snippets/erlang-mode/ifndef b/packages/yasnippet/snippets/erlang-mode/ifndef new file mode 100644 index 000000000..7c5d931fa --- /dev/null +++ b/packages/yasnippet/snippets/erlang-mode/ifndef @@ -0,0 +1,6 @@ +# name: -ifndef(...). ... -endif. +# key: ifndef +# -- +-ifndef($1). +$0 +-endif. \ No newline at end of file diff --git a/packages/yasnippet/snippets/erlang-mode/imp b/packages/yasnippet/snippets/erlang-mode/imp new file mode 100644 index 000000000..5db8aaf61 --- /dev/null +++ b/packages/yasnippet/snippets/erlang-mode/imp @@ -0,0 +1,6 @@ +# name: -import([]). +# contributor: hitesh +# key: imp +# -- +-import(${1:lists}, [${2:map/2, sum/1}]). +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/erlang-mode/inc b/packages/yasnippet/snippets/erlang-mode/inc new file mode 100644 index 000000000..47f4008dc --- /dev/null +++ b/packages/yasnippet/snippets/erlang-mode/inc @@ -0,0 +1,5 @@ +# name: -include("..."). +# key: inc +# -- +-include("$1"). +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/erlang-mode/inc.lib b/packages/yasnippet/snippets/erlang-mode/inc.lib new file mode 100644 index 000000000..5ca063126 --- /dev/null +++ b/packages/yasnippet/snippets/erlang-mode/inc.lib @@ -0,0 +1,5 @@ +# name: -include_lib("..."). +# key: inc +# -- +-include_lib("$1"). +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/erlang-mode/loop b/packages/yasnippet/snippets/erlang-mode/loop new file mode 100644 index 000000000..86f92a4bd --- /dev/null +++ b/packages/yasnippet/snippets/erlang-mode/loop @@ -0,0 +1,9 @@ +# name: loop(...) -> receive _ -> loop(...) end. +# key: loop +# -- +${1:loop}($2) -> + receive + ${3:_} -> + $1($2) + end. +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/erlang-mode/mod b/packages/yasnippet/snippets/erlang-mode/mod new file mode 100644 index 000000000..8cb747ad5 --- /dev/null +++ b/packages/yasnippet/snippets/erlang-mode/mod @@ -0,0 +1,7 @@ +# name: -module(). +# contributor: hitesh +# key: mod +# -- +-module(${1:`(file-name-nondirectory + (file-name-sans-extension (or (buffer-file-name) (buffer-name))))`}). +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/erlang-mode/rcv b/packages/yasnippet/snippets/erlang-mode/rcv new file mode 100644 index 000000000..f5bdaa285 --- /dev/null +++ b/packages/yasnippet/snippets/erlang-mode/rcv @@ -0,0 +1,6 @@ +# name: receive ... -> ... end +# key: rcv +# -- +receive + $1 -> $0 +end \ No newline at end of file diff --git a/packages/yasnippet/snippets/erlang-mode/rcv.after b/packages/yasnippet/snippets/erlang-mode/rcv.after new file mode 100644 index 000000000..687b78d1c --- /dev/null +++ b/packages/yasnippet/snippets/erlang-mode/rcv.after @@ -0,0 +1,7 @@ +# name: receive after ... -> ... end +# key: rcv +# -- +receive +after + $1 -> $0 +end \ No newline at end of file diff --git a/packages/yasnippet/snippets/erlang-mode/rec b/packages/yasnippet/snippets/erlang-mode/rec new file mode 100644 index 000000000..b3819a64b --- /dev/null +++ b/packages/yasnippet/snippets/erlang-mode/rec @@ -0,0 +1,5 @@ +# name: -record(...,{...}). +# key: rec +# -- +-record($1,{$2}). +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/erlang-mode/try b/packages/yasnippet/snippets/erlang-mode/try new file mode 100644 index 000000000..0ff10a885 --- /dev/null +++ b/packages/yasnippet/snippets/erlang-mode/try @@ -0,0 +1,8 @@ +# name: try ... of ... catch after end +# key: try +# -- +try $1 of + $0 +catch +after +end \ No newline at end of file diff --git a/packages/yasnippet/snippets/erlang-mode/undef b/packages/yasnippet/snippets/erlang-mode/undef new file mode 100644 index 000000000..bd51fe612 --- /dev/null +++ b/packages/yasnippet/snippets/erlang-mode/undef @@ -0,0 +1,5 @@ +# name: -undef(...). +# key: undef +# -- +-undef($1). +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/f90-mode/.yas-parents b/packages/yasnippet/snippets/f90-mode/.yas-parents new file mode 100644 index 000000000..eed5b442b --- /dev/null +++ b/packages/yasnippet/snippets/f90-mode/.yas-parents @@ -0,0 +1 @@ +text-mode diff --git a/packages/yasnippet/snippets/f90-mode/au b/packages/yasnippet/snippets/f90-mode/au new file mode 100644 index 000000000..e402b21c8 --- /dev/null +++ b/packages/yasnippet/snippets/f90-mode/au @@ -0,0 +1,5 @@ +# contributor: Li Zhu +# name: automatic +# key: au +# -- +automatic $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/f90-mode/bd b/packages/yasnippet/snippets/f90-mode/bd new file mode 100644 index 000000000..081b03991 --- /dev/null +++ b/packages/yasnippet/snippets/f90-mode/bd @@ -0,0 +1,5 @@ +# contributor: Li Zhu +# name: block data +# key: bd +# -- +block data $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/f90-mode/c b/packages/yasnippet/snippets/f90-mode/c new file mode 100644 index 000000000..cf28d3635 --- /dev/null +++ b/packages/yasnippet/snippets/f90-mode/c @@ -0,0 +1,5 @@ +# contributor: Li Zhu +# name: continue +# key: c +# -- +continue $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/f90-mode/ch b/packages/yasnippet/snippets/f90-mode/ch new file mode 100644 index 000000000..db43003f7 --- /dev/null +++ b/packages/yasnippet/snippets/f90-mode/ch @@ -0,0 +1,5 @@ +# contributor: Li Zhu +# name: character +# key: ch +# -- +character $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/f90-mode/cx b/packages/yasnippet/snippets/f90-mode/cx new file mode 100644 index 000000000..70e916387 --- /dev/null +++ b/packages/yasnippet/snippets/f90-mode/cx @@ -0,0 +1,5 @@ +# contributor: Li Zhu +# name: complex +# key: cx +# -- +complex $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/f90-mode/dc b/packages/yasnippet/snippets/f90-mode/dc new file mode 100644 index 000000000..df5f0260a --- /dev/null +++ b/packages/yasnippet/snippets/f90-mode/dc @@ -0,0 +1,5 @@ +# contributor: Li Zhu +# name: double complex +# key: dc +# -- +double complex $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/f90-mode/do b/packages/yasnippet/snippets/f90-mode/do new file mode 100644 index 000000000..c3aa1f2ea --- /dev/null +++ b/packages/yasnippet/snippets/f90-mode/do @@ -0,0 +1,7 @@ +# contributor: Li Zhu +# name: do while (...) end do +# key: do +# -- +do while (${1:condition}) + $0 +end do \ No newline at end of file diff --git a/packages/yasnippet/snippets/f90-mode/dp b/packages/yasnippet/snippets/f90-mode/dp new file mode 100644 index 000000000..e705b7c3e --- /dev/null +++ b/packages/yasnippet/snippets/f90-mode/dp @@ -0,0 +1,5 @@ +# contributor: Li Zhu +# name: double precision +# key: dp +# -- +double precision $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/f90-mode/eq b/packages/yasnippet/snippets/f90-mode/eq new file mode 100644 index 000000000..1ace4ce62 --- /dev/null +++ b/packages/yasnippet/snippets/f90-mode/eq @@ -0,0 +1,5 @@ +# contributor: Li Zhu +# name: equivalence +# key: eq +# -- +equivalence $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/f90-mode/ib b/packages/yasnippet/snippets/f90-mode/ib new file mode 100644 index 000000000..3fd8fbd41 --- /dev/null +++ b/packages/yasnippet/snippets/f90-mode/ib @@ -0,0 +1,5 @@ +# contributor: Li Zhu +# name: implicit byte +# key: ib +# -- +implicit byte $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/f90-mode/ic b/packages/yasnippet/snippets/f90-mode/ic new file mode 100644 index 000000000..516d13935 --- /dev/null +++ b/packages/yasnippet/snippets/f90-mode/ic @@ -0,0 +1,5 @@ +# contributor: Li Zhu +# name: implicit complex +# key: ic +# -- +implicit complex $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/f90-mode/ich b/packages/yasnippet/snippets/f90-mode/ich new file mode 100644 index 000000000..f6b1f80c8 --- /dev/null +++ b/packages/yasnippet/snippets/f90-mode/ich @@ -0,0 +1,5 @@ +# contributor: Li Zhu +# name: implicit character +# key: ich +# -- +implicit character $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/f90-mode/if b/packages/yasnippet/snippets/f90-mode/if new file mode 100644 index 000000000..f4a42e182 --- /dev/null +++ b/packages/yasnippet/snippets/f90-mode/if @@ -0,0 +1,7 @@ +# contributor: Li Zhu +# name: if then end if +# key: if +# -- +if ( ${1:condition} ) then + $0 +end if \ No newline at end of file diff --git a/packages/yasnippet/snippets/f90-mode/ii b/packages/yasnippet/snippets/f90-mode/ii new file mode 100644 index 000000000..7317cc35a --- /dev/null +++ b/packages/yasnippet/snippets/f90-mode/ii @@ -0,0 +1,5 @@ +# contributor: Li Zhu +# name: implicit integer +# key: ii +# -- +implicit integer $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/f90-mode/il b/packages/yasnippet/snippets/f90-mode/il new file mode 100644 index 000000000..0ce006e8d --- /dev/null +++ b/packages/yasnippet/snippets/f90-mode/il @@ -0,0 +1,5 @@ +# contributor: Li Zhu +# name: implicit logical +# key: il +# -- +implicit logical $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/f90-mode/in b/packages/yasnippet/snippets/f90-mode/in new file mode 100644 index 000000000..a9d84a1d1 --- /dev/null +++ b/packages/yasnippet/snippets/f90-mode/in @@ -0,0 +1,5 @@ +# contributor: Li Zhu +# name: implicit none +# key: in +# -- +implicit none \ No newline at end of file diff --git a/packages/yasnippet/snippets/f90-mode/inc b/packages/yasnippet/snippets/f90-mode/inc new file mode 100644 index 000000000..cc761bb71 --- /dev/null +++ b/packages/yasnippet/snippets/f90-mode/inc @@ -0,0 +1,5 @@ +# contributor: Li Zhu +# name: include +# key: inc +# -- +include $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/f90-mode/intr b/packages/yasnippet/snippets/f90-mode/intr new file mode 100644 index 000000000..689f20a5c --- /dev/null +++ b/packages/yasnippet/snippets/f90-mode/intr @@ -0,0 +1,5 @@ +# contributor: Li Zhu +# name: intrinsic +# key: intr +# -- +intrinsic $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/f90-mode/ir b/packages/yasnippet/snippets/f90-mode/ir new file mode 100644 index 000000000..77ddea9e3 --- /dev/null +++ b/packages/yasnippet/snippets/f90-mode/ir @@ -0,0 +1,5 @@ +# contributor: Li Zhu +# name: implicit real +# key: ir +# -- +implicit real $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/f90-mode/l b/packages/yasnippet/snippets/f90-mode/l new file mode 100644 index 000000000..c48b11ebe --- /dev/null +++ b/packages/yasnippet/snippets/f90-mode/l @@ -0,0 +1,5 @@ +# contributor: Li Zhu +# name: logical +# key: l +# -- +logical $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/f90-mode/pa b/packages/yasnippet/snippets/f90-mode/pa new file mode 100644 index 000000000..d92f75be9 --- /dev/null +++ b/packages/yasnippet/snippets/f90-mode/pa @@ -0,0 +1,5 @@ +# contributor: Li Zhu +# name: parameter +# key: pa +# -- +parameter $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/f90-mode/pr b/packages/yasnippet/snippets/f90-mode/pr new file mode 100644 index 000000000..f570d5f9d --- /dev/null +++ b/packages/yasnippet/snippets/f90-mode/pr @@ -0,0 +1,7 @@ +# contributor: Li Zhu +# name: program ... end program ... +# key: pr +# -- +program ${1:name} + $0 +end program ${1:name} \ No newline at end of file diff --git a/packages/yasnippet/snippets/f90-mode/re b/packages/yasnippet/snippets/f90-mode/re new file mode 100644 index 000000000..a42e5a9cb --- /dev/null +++ b/packages/yasnippet/snippets/f90-mode/re @@ -0,0 +1,5 @@ +# contributor: Li Zhu +# name: read (*,*) +# key: re +# -- +read (${1:*},${2:*}) $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/f90-mode/st b/packages/yasnippet/snippets/f90-mode/st new file mode 100644 index 000000000..eda6f2ebf --- /dev/null +++ b/packages/yasnippet/snippets/f90-mode/st @@ -0,0 +1,5 @@ +# contributor: Li Zhu +# name: structure +# key: st +# -- +structure $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/f90-mode/su b/packages/yasnippet/snippets/f90-mode/su new file mode 100644 index 000000000..5b3e3cf7b --- /dev/null +++ b/packages/yasnippet/snippets/f90-mode/su @@ -0,0 +1,5 @@ +# contributor: Li Zhu +# name: subroutine +# key: su +# -- +subroutine $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/f90-mode/wr b/packages/yasnippet/snippets/f90-mode/wr new file mode 100644 index 000000000..0c9b4e69b --- /dev/null +++ b/packages/yasnippet/snippets/f90-mode/wr @@ -0,0 +1,5 @@ +# contributor: Li Zhu +# name: write (*,*) +# key: wr +# -- +write (${1:*},${2:*}) $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/.yas-make-groups b/packages/yasnippet/snippets/html-mode/.yas-make-groups new file mode 100644 index 000000000..e69de29bb diff --git a/packages/yasnippet/snippets/html-mode/.yas-parents b/packages/yasnippet/snippets/html-mode/.yas-parents new file mode 100644 index 000000000..eed5b442b --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/.yas-parents @@ -0,0 +1 @@ +text-mode diff --git a/packages/yasnippet/snippets/html-mode/b.yasnippet b/packages/yasnippet/snippets/html-mode/b.yasnippet new file mode 100644 index 000000000..c7873ca2c --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/b.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee xahlee.org +# name: ... +# key: b +# -- +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/body b/packages/yasnippet/snippets/html-mode/body new file mode 100644 index 000000000..d6c5db33a --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/body @@ -0,0 +1,7 @@ +# contributor: Jimmy Wu +# name: ... +# key: body +# -- + + $0 + \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/br b/packages/yasnippet/snippets/html-mode/br new file mode 100644 index 000000000..9305a5073 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/br @@ -0,0 +1,5 @@ +# contributor: Jimmy Wu +# name:
+# key: br +# -- +
\ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/code b/packages/yasnippet/snippets/html-mode/code new file mode 100644 index 000000000..96d47e06c --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/code @@ -0,0 +1,7 @@ +# contributor: Jimmy Wu +# name: ... +# key: code +# -- + + $0 + \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/code.class b/packages/yasnippet/snippets/html-mode/code.class new file mode 100644 index 000000000..2d18af748 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/code.class @@ -0,0 +1,7 @@ +# contributor: Jimmy Wu +# name: ... +# key: code +# -- + + $0 + \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/div b/packages/yasnippet/snippets/html-mode/div new file mode 100644 index 000000000..8b97ed112 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/div @@ -0,0 +1,4 @@ +# name: ... +# key: div +# -- +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/div.class b/packages/yasnippet/snippets/html-mode/div.class new file mode 100644 index 000000000..e1a4b039d --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/div.class @@ -0,0 +1,7 @@ +# contributor: Jimmy Wu +# name:
...
+# key: div +# -- +
+ $0 +
\ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/div.id b/packages/yasnippet/snippets/html-mode/div.id new file mode 100644 index 000000000..8682aa165 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/div.id @@ -0,0 +1,7 @@ +# contributor: Jimmy Wu +# name:
...
+# key: div +# -- +
+ $0 +
\ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/div.id-class b/packages/yasnippet/snippets/html-mode/div.id-class new file mode 100644 index 000000000..452cd9a65 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/div.id-class @@ -0,0 +1,7 @@ +# contributor: Jimmy Wu +# name:
...
+# key: div +# -- +
+ $0 +
\ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/dov b/packages/yasnippet/snippets/html-mode/dov new file mode 100644 index 000000000..d3bdc17c9 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/dov @@ -0,0 +1,12 @@ +# name: ... +# key: dov +# -- +a mirror up here $3 + + + + $0 + + + actually some other shit and $3 + \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/form b/packages/yasnippet/snippets/html-mode/form new file mode 100644 index 000000000..de0626794 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/form @@ -0,0 +1,7 @@ +# contributor: Jimmy Wu +#name :
+# key: form +# -- +
+ $0 +
\ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/head b/packages/yasnippet/snippets/html-mode/head new file mode 100644 index 000000000..c5c0d0e9f --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/head @@ -0,0 +1,7 @@ +# contributor: Jimmy Wu +# name: ... +# key: head +# -- + + $0 + \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/header/h1 b/packages/yasnippet/snippets/html-mode/header/h1 new file mode 100644 index 000000000..4d217641f --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/header/h1 @@ -0,0 +1,5 @@ +# contributor: Jimmy Wu +# name:

...

+# key: h1 +# -- +

$1

\ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/header/h2 b/packages/yasnippet/snippets/html-mode/header/h2 new file mode 100644 index 000000000..1cca1d5c8 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/header/h2 @@ -0,0 +1,5 @@ +# contributor: Jimmy Wu +# name:

...

+# key: h2 +# -- +

$1

\ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/header/h3 b/packages/yasnippet/snippets/html-mode/header/h3 new file mode 100644 index 000000000..8e50a6d2e --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/header/h3 @@ -0,0 +1,5 @@ +# contributor: Jimmy Wu +# name:

...

+# key: h3 +# -- +

$1

\ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/header/h4 b/packages/yasnippet/snippets/html-mode/header/h4 new file mode 100644 index 000000000..08c853e24 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/header/h4 @@ -0,0 +1,5 @@ +# contributor: Jimmy Wu +# name:

...

+# key: h4 +# -- +

$1

\ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/header/h5 b/packages/yasnippet/snippets/html-mode/header/h5 new file mode 100644 index 000000000..951122ec5 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/header/h5 @@ -0,0 +1,5 @@ +# contributor: Jimmy Wu +# name:
...
+# key: h5 +# -- +
$1
\ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/header/h6 b/packages/yasnippet/snippets/html-mode/header/h6 new file mode 100644 index 000000000..f7da2ee01 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/header/h6 @@ -0,0 +1,5 @@ +# contributor: Jimmy Wu +# name:
...
+# key: h6 +# -- +
$1
\ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/hr b/packages/yasnippet/snippets/html-mode/hr new file mode 100644 index 000000000..a6eb0eae8 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/hr @@ -0,0 +1,5 @@ +# contributor: Jimmy Wu +# name:
+# key: hr +# -- +
\ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/href b/packages/yasnippet/snippets/html-mode/href new file mode 100644 index 000000000..b384653f2 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/href @@ -0,0 +1,5 @@ +# contributor: Jimmy Wu +# name: ... +# key: href +# -- +$2 \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/html b/packages/yasnippet/snippets/html-mode/html new file mode 100644 index 000000000..0484de0bb --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/html @@ -0,0 +1,7 @@ +# contributor: Jimmy Wu +# name: ... +# key: html +# -- + + $0 + \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/html.xmlns b/packages/yasnippet/snippets/html-mode/html.xmlns new file mode 100644 index 000000000..1b11f3505 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/html.xmlns @@ -0,0 +1,7 @@ +# contributor: Jimmy Wu +# name: ... +# key: html +# -- + + $0 + \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/i.yasnippet b/packages/yasnippet/snippets/html-mode/i.yasnippet new file mode 100644 index 000000000..ffd051f63 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/i.yasnippet @@ -0,0 +1,5 @@ +# contributor: Xah Lee xahlee.org +# name: ... +# key: i +# -- +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/img b/packages/yasnippet/snippets/html-mode/img new file mode 100644 index 000000000..e726c001d --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/img @@ -0,0 +1,5 @@ +# contributor: Jimmy Wu +# name: ... +# key: img +# -- +$3 \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/input b/packages/yasnippet/snippets/html-mode/input new file mode 100644 index 000000000..2f8c79aa3 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/input @@ -0,0 +1,5 @@ +# contributor: Jimmy Wu +# name: +# key: input +# -- + \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/link.stylesheet b/packages/yasnippet/snippets/html-mode/link.stylesheet new file mode 100644 index 000000000..e10ee8b0c --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/link.stylesheet @@ -0,0 +1,5 @@ +# contributor: Jimmy Wu +# name: +# key: link +# -- + \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/link.stylesheet-ie b/packages/yasnippet/snippets/html-mode/link.stylesheet-ie new file mode 100644 index 000000000..752f9e91a --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/link.stylesheet-ie @@ -0,0 +1,7 @@ +# contributor: Jimmy Wu +# name: +# key: link +# -- + \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/list/dd b/packages/yasnippet/snippets/html-mode/list/dd new file mode 100644 index 000000000..e48a64409 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/list/dd @@ -0,0 +1,5 @@ +# contributor: Rodrigo Setti +# name:
...
+# key: dd +# -- +
$1
\ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/list/dl b/packages/yasnippet/snippets/html-mode/list/dl new file mode 100644 index 000000000..67792ad52 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/list/dl @@ -0,0 +1,7 @@ +# contributor: Rodrigo Setti +# name:
...
+# key: dl +# -- +
+ $0 +
\ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/list/dl.id b/packages/yasnippet/snippets/html-mode/list/dl.id new file mode 100644 index 000000000..b4b92cba0 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/list/dl.id @@ -0,0 +1,7 @@ +# contributor: Rodrigo Setti +# name:
...
+# key: dl +# -- +
+ $0 +
\ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/list/dt b/packages/yasnippet/snippets/html-mode/list/dt new file mode 100644 index 000000000..85d62e428 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/list/dt @@ -0,0 +1,5 @@ +# contributor: Rodrigo Setti +# name:
...
+# key: dt +# -- +
$1
\ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/list/li b/packages/yasnippet/snippets/html-mode/list/li new file mode 100644 index 000000000..fe7a1f11f --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/list/li @@ -0,0 +1,5 @@ +# contributor: Jimmy Wu +# name:
  • ...
  • +# key: li +# -- +
  • $1
  • \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/list/li.class b/packages/yasnippet/snippets/html-mode/list/li.class new file mode 100644 index 000000000..7ff0b1243 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/list/li.class @@ -0,0 +1,5 @@ +# contributor: Jimmy Wu +# name:
  • ...
  • +# key: li +# -- +
  • $2
  • \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/list/ol b/packages/yasnippet/snippets/html-mode/list/ol new file mode 100644 index 000000000..d4b74acdd --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/list/ol @@ -0,0 +1,7 @@ +# contributor: Jimmy Wu +# name:
      ...
    +# key: ol +# -- +
      + $0 +
    \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/list/ol.class b/packages/yasnippet/snippets/html-mode/list/ol.class new file mode 100644 index 000000000..1c037da0e --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/list/ol.class @@ -0,0 +1,7 @@ +# contributor: Jimmy Wu +# name:
      ...
    +# key: ol +# -- +
      + $0 +
    \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/list/ol.id b/packages/yasnippet/snippets/html-mode/list/ol.id new file mode 100644 index 000000000..d20101e10 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/list/ol.id @@ -0,0 +1,7 @@ +# contributor: Jimmy Wu +# name:
      ...
    +# key: ol +# -- +
      + $0 +
    \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/list/ul b/packages/yasnippet/snippets/html-mode/list/ul new file mode 100644 index 000000000..4f0a9ae76 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/list/ul @@ -0,0 +1,7 @@ +# contributor: Jimmy Wu +# name:
      ...
    +# key: ul +# -- +
      + $0 +
    \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/list/ul.class b/packages/yasnippet/snippets/html-mode/list/ul.class new file mode 100644 index 000000000..e11c73629 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/list/ul.class @@ -0,0 +1,7 @@ +# contributor: Jimmy Wu +# name:
      ...
    +# key: ul +# -- +
      + $0 +
    \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/list/ul.id b/packages/yasnippet/snippets/html-mode/list/ul.id new file mode 100644 index 000000000..014f2d036 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/list/ul.id @@ -0,0 +1,7 @@ +# contributor: Jimmy Wu +# name:
      ...
    +# key: ul +# -- +
      + $0 +
    \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/mailto b/packages/yasnippet/snippets/html-mode/mailto new file mode 100644 index 000000000..0f1b9aa52 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/mailto @@ -0,0 +1,5 @@ +# contributor: Jimmy Wu +# name: ... +# key: mailto +# -- +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/meta/doctype b/packages/yasnippet/snippets/html-mode/meta/doctype new file mode 100644 index 000000000..ab3490570 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/meta/doctype @@ -0,0 +1,4 @@ +# name: Doctype HTML 4.01 Strict +# key: doctype +# -- + \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/meta/doctype.xhml1 b/packages/yasnippet/snippets/html-mode/meta/doctype.xhml1 new file mode 100644 index 000000000..3671cf571 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/meta/doctype.xhml1 @@ -0,0 +1,4 @@ +# name: DocType XHTML 1.0 frameset +# key: doctype +# -- + \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/meta/doctype.xhtml1_1 b/packages/yasnippet/snippets/html-mode/meta/doctype.xhtml1_1 new file mode 100644 index 000000000..bb3e709e7 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/meta/doctype.xhtml1_1 @@ -0,0 +1,4 @@ +# name: DocType XHTML 1.1 +# key: doctype +# -- + \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/meta/doctype.xhtml1_strict b/packages/yasnippet/snippets/html-mode/meta/doctype.xhtml1_strict new file mode 100644 index 000000000..4e4c56745 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/meta/doctype.xhtml1_strict @@ -0,0 +1,4 @@ +# name: DocType XHTML 1.0 Strict +# key: doctype +# -- + \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/meta/doctype.xhtml1_transitional b/packages/yasnippet/snippets/html-mode/meta/doctype.xhtml1_transitional new file mode 100644 index 000000000..d1ae7f9be --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/meta/doctype.xhtml1_transitional @@ -0,0 +1,4 @@ +# name: DocType XHTML 1.0 Transitional +# key: doctype +# -- + \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/meta/meta b/packages/yasnippet/snippets/html-mode/meta/meta new file mode 100644 index 000000000..235eb76bc --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/meta/meta @@ -0,0 +1,5 @@ +# contributor: Jimmy Wu +# name: +# key: meta +# -- + \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/meta/meta.http-equiv b/packages/yasnippet/snippets/html-mode/meta/meta.http-equiv new file mode 100644 index 000000000..ef38ed8cd --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/meta/meta.http-equiv @@ -0,0 +1,5 @@ +# contributor: Jimmy Wu +# name: +# key: meta +# -- + \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/p b/packages/yasnippet/snippets/html-mode/p new file mode 100644 index 000000000..69fca09cd --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/p @@ -0,0 +1,5 @@ +# contributor: Jimmy Wu +# name:

    ...

    +# key: p +# -- +

    $1

    \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/pre b/packages/yasnippet/snippets/html-mode/pre new file mode 100644 index 000000000..040b8f577 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/pre @@ -0,0 +1,7 @@ +# contributor: Jimmy Wu +# name:
    ...
    +# key: pre +# -- +
    +  $0
    +
    \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/q.yasnippet b/packages/yasnippet/snippets/html-mode/q.yasnippet new file mode 100644 index 000000000..dbaab0637 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/q.yasnippet @@ -0,0 +1,7 @@ +# contributor: Xah Lee xahlee.org +# name:
    ...
    +# key: q +# -- +
    +$0 +
    \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/quote b/packages/yasnippet/snippets/html-mode/quote new file mode 100644 index 000000000..a5790674a --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/quote @@ -0,0 +1,7 @@ +# contributor: Jimmy Wu +# name:
    ...
    +# key: quote +# -- +
    + $1 +
    \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/script.javascript b/packages/yasnippet/snippets/html-mode/script.javascript new file mode 100644 index 000000000..9b77e43ba --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/script.javascript @@ -0,0 +1,7 @@ +# contributor: Jimmy Wu +#name : +# key: script +# -- + \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/script.javascript-src b/packages/yasnippet/snippets/html-mode/script.javascript-src new file mode 100644 index 000000000..a090e726d --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/script.javascript-src @@ -0,0 +1,5 @@ +# contributor: Jimmy Wu +#name : +# key: script +# -- + \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/span b/packages/yasnippet/snippets/html-mode/span new file mode 100644 index 000000000..14c2ca74a --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/span @@ -0,0 +1,5 @@ +# contributor: Jimmy Wu +# name: ... +# key: span +# -- +$1 \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/span.class b/packages/yasnippet/snippets/html-mode/span.class new file mode 100644 index 000000000..a496aaa92 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/span.class @@ -0,0 +1,5 @@ +# contributor: Jimmy Wu +# name: ... +# key: span +# -- +$2 \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/span.id b/packages/yasnippet/snippets/html-mode/span.id new file mode 100644 index 000000000..0dc1ee1c7 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/span.id @@ -0,0 +1,5 @@ +# contributor: Jimmy Wu +# name: ... +# key: span +# -- +$2 \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/style b/packages/yasnippet/snippets/html-mode/style new file mode 100644 index 000000000..e159a3486 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/style @@ -0,0 +1,7 @@ +# contributor: Jimmy Wu +# name: +# key: style +# -- + \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/table/table b/packages/yasnippet/snippets/html-mode/table/table new file mode 100644 index 000000000..b3a180f98 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/table/table @@ -0,0 +1,7 @@ +# contributor: Jimmy Wu +# name: ...
    +# key: table +# -- + + $0 +
    \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/table/td b/packages/yasnippet/snippets/html-mode/table/td new file mode 100644 index 000000000..a87892e0a --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/table/td @@ -0,0 +1,5 @@ +# contributor: Jimmy Wu +# name: ... +# key: td +# -- +$2 \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/table/th b/packages/yasnippet/snippets/html-mode/table/th new file mode 100644 index 000000000..0a07ac117 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/table/th @@ -0,0 +1,5 @@ +# contributor: Jimmy Wu +# name: ... +# key: th +# -- +$2 \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/table/tr b/packages/yasnippet/snippets/html-mode/table/tr new file mode 100644 index 000000000..15e8fc3b3 --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/table/tr @@ -0,0 +1,7 @@ +# contributor: Jimmy Wu +# name: ... +# key: tr +# -- + + $0 + \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/textarea b/packages/yasnippet/snippets/html-mode/textarea new file mode 100644 index 000000000..650cc519c --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/textarea @@ -0,0 +1,5 @@ +# contributor: Jimmy Wu +# name: +# key: textarea +# -- + \ No newline at end of file diff --git a/packages/yasnippet/snippets/html-mode/title b/packages/yasnippet/snippets/html-mode/title new file mode 100644 index 000000000..d9d0ddbac --- /dev/null +++ b/packages/yasnippet/snippets/html-mode/title @@ -0,0 +1,5 @@ +# contributor: Jimmy Wu +# name: ... +# key: title +# -- +$1 \ No newline at end of file diff --git a/packages/yasnippet/snippets/latex-mode/.yas-parents b/packages/yasnippet/snippets/latex-mode/.yas-parents new file mode 100644 index 000000000..eed5b442b --- /dev/null +++ b/packages/yasnippet/snippets/latex-mode/.yas-parents @@ -0,0 +1 @@ +text-mode diff --git a/packages/yasnippet/snippets/latex-mode/begin b/packages/yasnippet/snippets/latex-mode/begin new file mode 100644 index 000000000..cb0854616 --- /dev/null +++ b/packages/yasnippet/snippets/latex-mode/begin @@ -0,0 +1,8 @@ +# contributor: Rodrigo Setti +# name: \begin{environment} ... \end{environment} +# key: begin +# -- + +\begin{${1:environment}} +$0 +\end{$1} \ No newline at end of file diff --git a/packages/yasnippet/snippets/markdown-mode/+ b/packages/yasnippet/snippets/markdown-mode/+ new file mode 100644 index 000000000..129ce8ea9 --- /dev/null +++ b/packages/yasnippet/snippets/markdown-mode/+ @@ -0,0 +1,6 @@ +# name: Unordered List +# contributor: Peng Deng +# key: + +# -- ++ ${1:Text} ++$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/markdown-mode/- b/packages/yasnippet/snippets/markdown-mode/- new file mode 100644 index 000000000..d652207dd --- /dev/null +++ b/packages/yasnippet/snippets/markdown-mode/- @@ -0,0 +1,6 @@ +# name: Unordered List +# contributor: Peng Deng +# key: - +# -- +- ${1:Text} +-$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/markdown-mode/.yas-parents b/packages/yasnippet/snippets/markdown-mode/.yas-parents new file mode 100644 index 000000000..eed5b442b --- /dev/null +++ b/packages/yasnippet/snippets/markdown-mode/.yas-parents @@ -0,0 +1 @@ +text-mode diff --git a/packages/yasnippet/snippets/markdown-mode/_ b/packages/yasnippet/snippets/markdown-mode/_ new file mode 100644 index 000000000..7dc839af3 --- /dev/null +++ b/packages/yasnippet/snippets/markdown-mode/_ @@ -0,0 +1,5 @@ +# name: Emphasis +# contributor: Peng Deng +# key: _ +# -- +_${1:Text}_ $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/markdown-mode/__ b/packages/yasnippet/snippets/markdown-mode/__ new file mode 100644 index 000000000..c8c14a6ef --- /dev/null +++ b/packages/yasnippet/snippets/markdown-mode/__ @@ -0,0 +1,5 @@ +# name: Strong +# contributor: Peng Deng +# key: __ +# -- +**${1:Text}** $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/markdown-mode/` b/packages/yasnippet/snippets/markdown-mode/` new file mode 100644 index 000000000..d28b42c29 --- /dev/null +++ b/packages/yasnippet/snippets/markdown-mode/` @@ -0,0 +1,5 @@ +# name: Inline Code +# contributor: Peng Deng +# key: ` +# -- +\`${1:Code}\` $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/markdown-mode/h1.1 b/packages/yasnippet/snippets/markdown-mode/h1.1 new file mode 100644 index 000000000..a5f49c4a0 --- /dev/null +++ b/packages/yasnippet/snippets/markdown-mode/h1.1 @@ -0,0 +1,7 @@ +# name: Header 1 (#) +# contributor: Peng Deng +# key: h1 +# -- +# ${1:Header 1} # + +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/markdown-mode/h1.2 b/packages/yasnippet/snippets/markdown-mode/h1.2 new file mode 100644 index 000000000..050963cc6 --- /dev/null +++ b/packages/yasnippet/snippets/markdown-mode/h1.2 @@ -0,0 +1,8 @@ +# name: Header 1 (=) +# contributor: Peng Deng +# key: h1 +# -- +${1:Header 1} +${1:$(make-string (string-width text) ?\=)} + +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/markdown-mode/h2.1 b/packages/yasnippet/snippets/markdown-mode/h2.1 new file mode 100644 index 000000000..c8b3fc1a8 --- /dev/null +++ b/packages/yasnippet/snippets/markdown-mode/h2.1 @@ -0,0 +1,7 @@ +# name: Header 2 (##) +# contributor: Peng Deng +# key: h2 +# -- +## ${1:Header 1} ## + +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/markdown-mode/h2.2 b/packages/yasnippet/snippets/markdown-mode/h2.2 new file mode 100644 index 000000000..d173bbcfe --- /dev/null +++ b/packages/yasnippet/snippets/markdown-mode/h2.2 @@ -0,0 +1,8 @@ +# name: Header 2 (-) +# contributor: Peng Deng +# key: h2 +# -- +${1:Header 2} +${1:$(make-string (string-width text) ?\-)} + +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/markdown-mode/h3 b/packages/yasnippet/snippets/markdown-mode/h3 new file mode 100644 index 000000000..4daca1e55 --- /dev/null +++ b/packages/yasnippet/snippets/markdown-mode/h3 @@ -0,0 +1,7 @@ +# name: Header 3 +# contributor: Peng Deng +# key: h3 +# -- +### ${1:Header 3} ### + +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/markdown-mode/h4 b/packages/yasnippet/snippets/markdown-mode/h4 new file mode 100644 index 000000000..513a1000f --- /dev/null +++ b/packages/yasnippet/snippets/markdown-mode/h4 @@ -0,0 +1,7 @@ +# name: Header 4 +# contributor: Peng Deng +# key: h4 +# -- +#### ${1:Header 4} #### + +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/markdown-mode/h5 b/packages/yasnippet/snippets/markdown-mode/h5 new file mode 100644 index 000000000..51ebc3933 --- /dev/null +++ b/packages/yasnippet/snippets/markdown-mode/h5 @@ -0,0 +1,7 @@ +# name: Header 5 +# contributor: Peng Deng +# key: h5 +# -- +##### ${1:Header 5} ##### + +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/markdown-mode/h6 b/packages/yasnippet/snippets/markdown-mode/h6 new file mode 100644 index 000000000..ebe9ecafe --- /dev/null +++ b/packages/yasnippet/snippets/markdown-mode/h6 @@ -0,0 +1,7 @@ +# name: Header 6 +# contributor: Peng Deng +# key: h6 +# -- +###### ${1:Header 6} ###### + +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/markdown-mode/hr.1 b/packages/yasnippet/snippets/markdown-mode/hr.1 new file mode 100644 index 000000000..3c57bace3 --- /dev/null +++ b/packages/yasnippet/snippets/markdown-mode/hr.1 @@ -0,0 +1,8 @@ +# name: Horizontal Rule (-) +# contributor: Peng Deng +# key: hr +# -- + +---------- + +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/markdown-mode/hr.2 b/packages/yasnippet/snippets/markdown-mode/hr.2 new file mode 100644 index 000000000..9b9545cc2 --- /dev/null +++ b/packages/yasnippet/snippets/markdown-mode/hr.2 @@ -0,0 +1,8 @@ +# name: Horizontal Rule (*) +# contributor: Peng Deng +# key: hr +# -- + +******* + +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/markdown-mode/img b/packages/yasnippet/snippets/markdown-mode/img new file mode 100644 index 000000000..29b26509c --- /dev/null +++ b/packages/yasnippet/snippets/markdown-mode/img @@ -0,0 +1,5 @@ +# name: Image +# contributor: Peng Deng +# key: img +# -- +![${1:Alt Text}](${2:URL} $3) $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/markdown-mode/link b/packages/yasnippet/snippets/markdown-mode/link new file mode 100644 index 000000000..c45ee190a --- /dev/null +++ b/packages/yasnippet/snippets/markdown-mode/link @@ -0,0 +1,5 @@ +# name: Link +# contributor: Peng Deng +# key: link +# -- +[${1:Link Text}](${2:URL} $3) $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/markdown-mode/ol b/packages/yasnippet/snippets/markdown-mode/ol new file mode 100644 index 000000000..ad1cdd85a --- /dev/null +++ b/packages/yasnippet/snippets/markdown-mode/ol @@ -0,0 +1,6 @@ +# name: Ordered List +# contributor: Peng Deng +# key: ol +# -- +${1:1}. ${2:Text} +${1:$(number-to-string (1+ (string-to-number text)))}. $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/markdown-mode/rimg b/packages/yasnippet/snippets/markdown-mode/rimg new file mode 100644 index 000000000..5fedc3a3c --- /dev/null +++ b/packages/yasnippet/snippets/markdown-mode/rimg @@ -0,0 +1,5 @@ +# name: Referenced Image +# contributor: Peng Deng +# key: rimg +# -- +![${1:Alt Text}][$2] $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/markdown-mode/rlb b/packages/yasnippet/snippets/markdown-mode/rlb new file mode 100644 index 000000000..0bb37e97a --- /dev/null +++ b/packages/yasnippet/snippets/markdown-mode/rlb @@ -0,0 +1,6 @@ +# name: Reference Label +# contributor: Peng Deng +# key: rlb +# -- +[${1:Reference}]: ${2:URL} $3 +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/markdown-mode/rlink b/packages/yasnippet/snippets/markdown-mode/rlink new file mode 100644 index 000000000..97f41f0e7 --- /dev/null +++ b/packages/yasnippet/snippets/markdown-mode/rlink @@ -0,0 +1,5 @@ +# name: Reference Link +# contributor: Peng Deng +# key: rlink +# -- +[${1:Link Text}][$2] $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/.yas-make-groups b/packages/yasnippet/snippets/nxml-mode/.yas-make-groups new file mode 100644 index 000000000..e69de29bb diff --git a/packages/yasnippet/snippets/nxml-mode/.yas-parents b/packages/yasnippet/snippets/nxml-mode/.yas-parents new file mode 100644 index 000000000..eed5b442b --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/.yas-parents @@ -0,0 +1 @@ +text-mode diff --git a/packages/yasnippet/snippets/nxml-mode/body b/packages/yasnippet/snippets/nxml-mode/body new file mode 100644 index 000000000..2ed3fcc95 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/body @@ -0,0 +1,7 @@ +# contributor: Anders Bach Nielsen +# name: ... +# key: body +# -- + + $0 + \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/br b/packages/yasnippet/snippets/nxml-mode/br new file mode 100644 index 000000000..621bc6cb9 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/br @@ -0,0 +1,5 @@ +# contributor: Anders Bach Nielsen +# name:
    +# key: br +# -- +
    \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/code b/packages/yasnippet/snippets/nxml-mode/code new file mode 100644 index 000000000..36bd62bc7 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/code @@ -0,0 +1,7 @@ +# contributor: Anders Bach Nielsen +# name: ... +# key: code +# -- + + $0 + \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/div b/packages/yasnippet/snippets/nxml-mode/div new file mode 100644 index 000000000..07c25263c --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/div @@ -0,0 +1,5 @@ +# contributor: Anders Bach Nielsen +# name: ... +# key: div +# -- +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/form b/packages/yasnippet/snippets/nxml-mode/form new file mode 100644 index 000000000..776700622 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/form @@ -0,0 +1,7 @@ +# contributor: Anders Bach Nielsen +#name :
    +# key: form +# -- +
    + $0 +
    \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/head b/packages/yasnippet/snippets/nxml-mode/head new file mode 100644 index 000000000..eb6b96be7 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/head @@ -0,0 +1,7 @@ +# contributor: Anders Bach Nielsen +# name: ... +# key: head +# -- + + $0 + \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/header/h1 b/packages/yasnippet/snippets/nxml-mode/header/h1 new file mode 100644 index 000000000..328fb89d0 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/header/h1 @@ -0,0 +1,5 @@ +# contributor: Anders Bach Nielsen +# name:

    ...

    +# key: h1 +# -- +

    $1

    \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/header/h2 b/packages/yasnippet/snippets/nxml-mode/header/h2 new file mode 100644 index 000000000..32484357e --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/header/h2 @@ -0,0 +1,5 @@ +# contributor: Anders Bach Nielsen +# name:

    ...

    +# key: h2 +# -- +

    $1

    \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/header/h3 b/packages/yasnippet/snippets/nxml-mode/header/h3 new file mode 100644 index 000000000..fe21a7177 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/header/h3 @@ -0,0 +1,5 @@ +# contributor: Anders Bach Nielsen +# name:

    ...

    +# key: h3 +# -- +

    $1

    \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/header/h4 b/packages/yasnippet/snippets/nxml-mode/header/h4 new file mode 100644 index 000000000..bb2c98346 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/header/h4 @@ -0,0 +1,5 @@ +# contributor: Anders Bach Nielsen +# name:

    ...

    +# key: h4 +# -- +

    $1

    \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/header/h5 b/packages/yasnippet/snippets/nxml-mode/header/h5 new file mode 100644 index 000000000..f11e62ca5 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/header/h5 @@ -0,0 +1,5 @@ +# contributor: Anders Bach Nielsen +# name:
    ...
    +# key: h5 +# -- +
    $1
    \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/header/h6 b/packages/yasnippet/snippets/nxml-mode/header/h6 new file mode 100644 index 000000000..46f035a73 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/header/h6 @@ -0,0 +1,5 @@ +# contributor: Anders Bach Nielsen +# name:
    ...
    +# key: h6 +# -- +
    $1
    \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/hr b/packages/yasnippet/snippets/nxml-mode/hr new file mode 100644 index 000000000..b649012f9 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/hr @@ -0,0 +1,5 @@ +# contributor: Anders Bach Nielsen +# name:
    +# key: hr +# -- +
    \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/href b/packages/yasnippet/snippets/nxml-mode/href new file mode 100644 index 000000000..8fea09c31 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/href @@ -0,0 +1,5 @@ +# contributor: Anders Bach Nielsen +# name: ... +# key: href +# -- +$2 \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/html b/packages/yasnippet/snippets/nxml-mode/html new file mode 100644 index 000000000..27a19cab7 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/html @@ -0,0 +1,7 @@ +# contributor: Anders Bach Nielsen +# name: ... +# key: html +# -- + + $0 + \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/img b/packages/yasnippet/snippets/nxml-mode/img new file mode 100644 index 000000000..ec6202768 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/img @@ -0,0 +1,5 @@ +# contributor: Anders Bach Nielsen +# name: ... +# key: img +# -- +$2 \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/input b/packages/yasnippet/snippets/nxml-mode/input new file mode 100644 index 000000000..8745e3306 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/input @@ -0,0 +1,5 @@ +# contributor: Anders Bach Nielsen +# name: +# key: input +# -- + \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/li b/packages/yasnippet/snippets/nxml-mode/li new file mode 100644 index 000000000..dc5e8a4d6 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/li @@ -0,0 +1,5 @@ +# contributor: Anders Bach Nielsen +# name:
  • ...
  • +# key: li +# -- +
  • $1
  • \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/link b/packages/yasnippet/snippets/nxml-mode/link new file mode 100644 index 000000000..4102f5498 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/link @@ -0,0 +1,5 @@ +# contributor: Anders Bach Nielsen +# name: +# key: link +# -- + \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/meta/doctype b/packages/yasnippet/snippets/nxml-mode/meta/doctype new file mode 100644 index 000000000..041cca329 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/meta/doctype @@ -0,0 +1,5 @@ +# contributor: Anders Bach Nielsen +# name: DocType XHTML 1.1 +# key: doctype +# -- + \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/meta/doctype.xhtml1_strict b/packages/yasnippet/snippets/nxml-mode/meta/doctype.xhtml1_strict new file mode 100644 index 000000000..775cb1fa7 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/meta/doctype.xhtml1_strict @@ -0,0 +1,5 @@ +# contributor: Anders Bach Nielsen +# name: DocType XHTML 1.0 Strict +# key: doctype +# -- + \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/meta/doctype.xhtml1_transitional b/packages/yasnippet/snippets/nxml-mode/meta/doctype.xhtml1_transitional new file mode 100644 index 000000000..e09447a70 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/meta/doctype.xhtml1_transitional @@ -0,0 +1,5 @@ +# contributor: Anders Bach Nielsen +# name: DocType XHTML 1.0 Transitional +# key: doctype +# -- + \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/meta/meta b/packages/yasnippet/snippets/nxml-mode/meta/meta new file mode 100644 index 000000000..b94b7c394 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/meta/meta @@ -0,0 +1,5 @@ +# contributor: Anders Bach Nielsen +# name: +# key: meta +# -- + \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/name b/packages/yasnippet/snippets/nxml-mode/name new file mode 100644 index 000000000..754da4ba9 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/name @@ -0,0 +1,5 @@ +# contributor: Anders Bach Nielsen +# name: +# key: name +# -- + \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/ol b/packages/yasnippet/snippets/nxml-mode/ol new file mode 100644 index 000000000..b08a5ad2e --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/ol @@ -0,0 +1,7 @@ +# contributor: Anders Bach Nielsen +# name:
      ...
    +# key: ol +# -- +
      + $0 +
    \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/p b/packages/yasnippet/snippets/nxml-mode/p new file mode 100644 index 000000000..4cb9efe18 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/p @@ -0,0 +1,5 @@ +# contributor: Anders Bach Nielsen +# name:

    ...

    +# key: p +# -- +

    $1

    \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/pre b/packages/yasnippet/snippets/nxml-mode/pre new file mode 100644 index 000000000..97b951942 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/pre @@ -0,0 +1,7 @@ +# contributor: Anders Bach Nielsen +# name:
    ...
    +# key: pre +# -- +
    +  $0
    +
    \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/quote b/packages/yasnippet/snippets/nxml-mode/quote new file mode 100644 index 000000000..81fb5d322 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/quote @@ -0,0 +1,7 @@ +# contributor: Anders Bach Nielsen +# name:
    ...
    +# key: quote +# -- +
    + $1 +
    \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/span b/packages/yasnippet/snippets/nxml-mode/span new file mode 100644 index 000000000..d31a22266 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/span @@ -0,0 +1,5 @@ +# contributor: Anders Bach Nielsen +# name: ... +# key: span +# -- +$1 \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/style b/packages/yasnippet/snippets/nxml-mode/style new file mode 100644 index 000000000..d3b1f872f --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/style @@ -0,0 +1,7 @@ +# contributor: Anders Bach Nielsen +# name: +# key: style +# -- + \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/table b/packages/yasnippet/snippets/nxml-mode/table new file mode 100644 index 000000000..11f8d0c72 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/table @@ -0,0 +1,7 @@ +# contributor: Anders Bach Nielsen +# name: ...
    +# key: table +# -- + + $0 +
    \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/tag.1l b/packages/yasnippet/snippets/nxml-mode/tag.1l new file mode 100644 index 000000000..5a7268e50 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/tag.1l @@ -0,0 +1,5 @@ +# contributor: Anders Bach Nielsen +# name: ... +# key: tag +# -- +<${1:tag}>$2$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/tag.2l b/packages/yasnippet/snippets/nxml-mode/tag.2l new file mode 100644 index 000000000..0b58b0de5 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/tag.2l @@ -0,0 +1,7 @@ +# contributor: Anders Bach Nielsen +# name: \n...\n +# key: tag +# -- +<${1:tag}> + $2 +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/td b/packages/yasnippet/snippets/nxml-mode/td new file mode 100644 index 000000000..23af32142 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/td @@ -0,0 +1,5 @@ +# contributor: Anders Bach Nielsen +# name: ... +# key: td +# -- +$2 \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/th b/packages/yasnippet/snippets/nxml-mode/th new file mode 100644 index 000000000..115882e99 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/th @@ -0,0 +1,5 @@ +# contributor: Anders Bach Nielsen +# name: ... +# key: th +# -- +$2 \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/title b/packages/yasnippet/snippets/nxml-mode/title new file mode 100644 index 000000000..22c9b0186 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/title @@ -0,0 +1,5 @@ +# contributor: Anders Bach Nielsen +# name: ... +# key: title +# -- +$1 \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/tr b/packages/yasnippet/snippets/nxml-mode/tr new file mode 100644 index 000000000..2689e8ccd --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/tr @@ -0,0 +1,7 @@ +# contributor: Anders Bach Nielsen +# name: ... +# key: tr +# -- + + $0 + \ No newline at end of file diff --git a/packages/yasnippet/snippets/nxml-mode/ul b/packages/yasnippet/snippets/nxml-mode/ul new file mode 100644 index 000000000..f6f5fba87 --- /dev/null +++ b/packages/yasnippet/snippets/nxml-mode/ul @@ -0,0 +1,7 @@ +# contributor: Anders Bach Nielsen +# name:
      ...
    +# key: ul +# -- +
      + $0 +
    \ No newline at end of file diff --git a/packages/yasnippet/snippets/objc-mode/.yas-parents b/packages/yasnippet/snippets/objc-mode/.yas-parents new file mode 100644 index 000000000..ce9828bdf --- /dev/null +++ b/packages/yasnippet/snippets/objc-mode/.yas-parents @@ -0,0 +1 @@ +cc-mode diff --git a/packages/yasnippet/snippets/objc-mode/prop b/packages/yasnippet/snippets/objc-mode/prop new file mode 100644 index 000000000..1a74edbf0 --- /dev/null +++ b/packages/yasnippet/snippets/objc-mode/prop @@ -0,0 +1,14 @@ +# name: foo { ... } ; setFoo { ... } +# key: prop +# -- +- (${1:id})${2:foo} +{ + return $2; +} + +- (void)set${2:$(capitalize text)}:($1)aValue +{ + [$2 autorelease]; + $2 = [aValue retain]; +} +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/perl-mode/.yas-parents b/packages/yasnippet/snippets/perl-mode/.yas-parents new file mode 100644 index 000000000..eed5b442b --- /dev/null +++ b/packages/yasnippet/snippets/perl-mode/.yas-parents @@ -0,0 +1 @@ +text-mode diff --git a/packages/yasnippet/snippets/perl-mode/eval b/packages/yasnippet/snippets/perl-mode/eval new file mode 100644 index 000000000..a48401438 --- /dev/null +++ b/packages/yasnippet/snippets/perl-mode/eval @@ -0,0 +1,9 @@ +# name: eval { ... } if ($@) { ... } +# key: eval +# -- +eval { + ${1:# do something risky...} +}; +if (\$@) { + ${2:# handle failure...} +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/perl-mode/for b/packages/yasnippet/snippets/perl-mode/for new file mode 100644 index 000000000..1ba240f5f --- /dev/null +++ b/packages/yasnippet/snippets/perl-mode/for @@ -0,0 +1,6 @@ +# name: for (...) { ... } +# key: for +# -- +for (my \$${1:var} = 0; \$$1 < ${2:expression}; \$$1++) { + ${3:# body...} +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/perl-mode/fore b/packages/yasnippet/snippets/perl-mode/fore new file mode 100644 index 000000000..c3b81d521 --- /dev/null +++ b/packages/yasnippet/snippets/perl-mode/fore @@ -0,0 +1,6 @@ +# name: foreach ... { ... } +# key: fore +# -- +foreach my \$${1:x} (@${2:array}) { + ${3:# body...} +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/perl-mode/if b/packages/yasnippet/snippets/perl-mode/if new file mode 100644 index 000000000..567db9095 --- /dev/null +++ b/packages/yasnippet/snippets/perl-mode/if @@ -0,0 +1,6 @@ +# name: if (...) { ... } +# key: if +# -- +if ($1) { + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/perl-mode/ife b/packages/yasnippet/snippets/perl-mode/ife new file mode 100644 index 000000000..f278f2175 --- /dev/null +++ b/packages/yasnippet/snippets/perl-mode/ife @@ -0,0 +1,8 @@ +# name: if (...) { ... } else { ... } +# key: ife +# -- +if ($1) { + $2 +} else { + $3 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/perl-mode/ifee b/packages/yasnippet/snippets/perl-mode/ifee new file mode 100644 index 000000000..d1bf23721 --- /dev/null +++ b/packages/yasnippet/snippets/perl-mode/ifee @@ -0,0 +1,10 @@ +# name: if, elsif, else ... +# key: ifee +# -- +if ($1) { + ${2:# body...} +} elsif ($3) { + ${4:# elsif...} +} else { + ${5:# else...} +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/perl-mode/sub b/packages/yasnippet/snippets/perl-mode/sub new file mode 100644 index 000000000..05607d60f --- /dev/null +++ b/packages/yasnippet/snippets/perl-mode/sub @@ -0,0 +1,6 @@ +# name: sub ... { ... } +# key: sub +# -- +sub ${1:function_name} { + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/perl-mode/unless b/packages/yasnippet/snippets/perl-mode/unless new file mode 100644 index 000000000..f91a652b6 --- /dev/null +++ b/packages/yasnippet/snippets/perl-mode/unless @@ -0,0 +1,6 @@ +# name: unless (...) { ... } +# key: unless +# -- +unless ($1) { + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/perl-mode/while b/packages/yasnippet/snippets/perl-mode/while new file mode 100644 index 000000000..274453087 --- /dev/null +++ b/packages/yasnippet/snippets/perl-mode/while @@ -0,0 +1,6 @@ +# name: while (...) { ... } +# key: while +# -- +while ($1) { + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/perl-mode/xfore b/packages/yasnippet/snippets/perl-mode/xfore new file mode 100644 index 000000000..018e1406a --- /dev/null +++ b/packages/yasnippet/snippets/perl-mode/xfore @@ -0,0 +1,4 @@ +# name: ... foreach ... +# key: xfore +# -- +${1:expression} foreach @${2:array}; \ No newline at end of file diff --git a/packages/yasnippet/snippets/perl-mode/xif b/packages/yasnippet/snippets/perl-mode/xif new file mode 100644 index 000000000..ca8b563eb --- /dev/null +++ b/packages/yasnippet/snippets/perl-mode/xif @@ -0,0 +1,4 @@ +# name: ... if ... +# key: xif +# -- +${1:expression} if ${2:condition} \ No newline at end of file diff --git a/packages/yasnippet/snippets/perl-mode/xunless b/packages/yasnippet/snippets/perl-mode/xunless new file mode 100644 index 000000000..dbb7d7d15 --- /dev/null +++ b/packages/yasnippet/snippets/perl-mode/xunless @@ -0,0 +1,4 @@ +# name: ... unless ... +# key: xunless +# -- +${1:expression} unless ${2:condition} \ No newline at end of file diff --git a/packages/yasnippet/snippets/perl-mode/xwhile b/packages/yasnippet/snippets/perl-mode/xwhile new file mode 100644 index 000000000..14c63084e --- /dev/null +++ b/packages/yasnippet/snippets/perl-mode/xwhile @@ -0,0 +1,4 @@ +# name: ... while ... +# key: xwhile +# -- +${1:expression} while ${2:condition}; \ No newline at end of file diff --git a/packages/yasnippet/snippets/python-mode/.yas-parents b/packages/yasnippet/snippets/python-mode/.yas-parents new file mode 100644 index 000000000..eed5b442b --- /dev/null +++ b/packages/yasnippet/snippets/python-mode/.yas-parents @@ -0,0 +1 @@ +text-mode diff --git a/packages/yasnippet/snippets/python-mode/__ b/packages/yasnippet/snippets/python-mode/__ new file mode 100644 index 000000000..0253b02ad --- /dev/null +++ b/packages/yasnippet/snippets/python-mode/__ @@ -0,0 +1,4 @@ +# name: __...__ +# key: __ +# -- +__${init}__ \ No newline at end of file diff --git a/packages/yasnippet/snippets/python-mode/class b/packages/yasnippet/snippets/python-mode/class new file mode 100644 index 000000000..69a088e6e --- /dev/null +++ b/packages/yasnippet/snippets/python-mode/class @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# name: class +# contributor: Orestis Markou +# contributor: Nishio Hirokazu +# contributor: Yasser González Fernández +# key: class +# -- +class ${1:ClassName}(${2:object}): + """$3 + """ + + def __init__(self, $4): + """$5 + ${4:$ + (let* ((indent + (concat "\n" (make-string (current-column) 32))) + (args + (mapconcat + '(lambda (x) + (if (not (string= (nth 0 x) "")) + (concat "- " (char-to-string 96) (nth 0 x) + (char-to-string 96) ":"))) + (mapcar + '(lambda (x) + (mapcar + (lambda (x) + (replace-regexp-in-string "[[:blank:]]*$" "" + (replace-regexp-in-string "^[[:blank:]]*" "" x))) x)) + (mapcar '(lambda (x) (split-string x "=")) + (split-string text ","))) + indent))) + (if (string= args "") + (make-string 3 34) + (mapconcat + 'identity + (list "" "Arguments:" args (make-string 3 34)) + indent))) + } + ${4:$ + (mapconcat + '(lambda (x) + (if (not (string= (nth 0 x) "")) + (concat "self._" (nth 0 x) " = " (nth 0 x)))) + (mapcar + '(lambda (x) + (mapcar + '(lambda (x) + (replace-regexp-in-string "[[:blank:]]*$" "" + (replace-regexp-in-string "^[[:blank:]]*" "" x))) + x)) + (mapcar '(lambda (x) (split-string x "=")) + (split-string text ","))) + (concat "\n" (make-string (current-column) 32))) + } + $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/python-mode/def b/packages/yasnippet/snippets/python-mode/def new file mode 100644 index 000000000..ca0ba6697 --- /dev/null +++ b/packages/yasnippet/snippets/python-mode/def @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# name: def +# contributor: Orestis Markou +# contributor: Yasser González Fernández +# key: def +# -- +def ${1:name}($2): + """$3 + ${2:$ + (let* + ((indent + (concat "\n" (make-string (current-column) 32))) + (args + (mapconcat + '(lambda (x) + (if (not (string= (nth 0 x) "")) + (concat "- " (char-to-string 96) (nth 0 x) + (char-to-string 96) ":"))) + (mapcar + '(lambda (x) + (mapcar + '(lambda (x) + (replace-regexp-in-string "[[:blank:]]*$" "" + (replace-regexp-in-string "^[[:blank:]]*" "" x))) + x)) + (mapcar '(lambda (x) (split-string x "=")) + (split-string text ","))) + indent))) + (if (string= args "") + (make-string 3 34) + (mapconcat + 'identity + (list "" "Arguments:" args (make-string 3 34)) + indent))) + } + $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/python-mode/defm b/packages/yasnippet/snippets/python-mode/defm new file mode 100644 index 000000000..a2fb5a064 --- /dev/null +++ b/packages/yasnippet/snippets/python-mode/defm @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# name: defm +# contributor: Yasser Gonz¨¢lez Fern¨¢ndez +# key: defm +# -- +def ${1:name}(self, $2): + """$3 + ${2:$ + (let* ((indent + (concat "\n" (make-string (current-column) 32))) + (args + (mapconcat + '(lambda (x) + (if (not (string= (nth 0 x) "")) + (concat "- " (char-to-string 96) (nth 0 x) + (char-to-string 96) ":"))) + (mapcar + '(lambda (x) + (mapcar + '(lambda (x) + (replace-regexp-in-string "[[:blank:]]*$" "" + (replace-regexp-in-string "^[[:blank:]]*" "" x))) + x)) + (mapcar '(lambda (x) (split-string x "=")) + (split-string text ","))) + indent))) + (if (string= args "") + (make-string 3 34) + (mapconcat + 'identity + (list "" "Arguments:" args (make-string 3 34)) + indent))) + } + $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/python-mode/for b/packages/yasnippet/snippets/python-mode/for new file mode 100644 index 000000000..7c78b5e79 --- /dev/null +++ b/packages/yasnippet/snippets/python-mode/for @@ -0,0 +1,5 @@ +# name: for ... in ... : ... +# key: for +# -- +for ${var} in ${collection}: + $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/python-mode/ifmain b/packages/yasnippet/snippets/python-mode/ifmain new file mode 100644 index 000000000..68ed20beb --- /dev/null +++ b/packages/yasnippet/snippets/python-mode/ifmain @@ -0,0 +1,5 @@ +# name: if __name__ == '__main__': ... +# key: ifmain +# -- +if __name__ == '__main__': + $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/python-mode/prop b/packages/yasnippet/snippets/python-mode/prop new file mode 100644 index 000000000..ec96633e9 --- /dev/null +++ b/packages/yasnippet/snippets/python-mode/prop @@ -0,0 +1,16 @@ +# contributor: Mads D. Kristensen +# name: prop +# key: prop +# -- +def ${1:foo}(): + doc = """${2:Doc string}""" + def fget(self): + return self._$1 + def fset(self, value): + self._$1 = value + def fdel(self): + del self._$1 + return locals() +$1 = property(**$1()) + +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/python-mode/propg b/packages/yasnippet/snippets/python-mode/propg new file mode 100644 index 000000000..e89d4e4c7 --- /dev/null +++ b/packages/yasnippet/snippets/python-mode/propg @@ -0,0 +1,10 @@ +# contributor: Julio Carlos Menendez +# name: _get_foo ... foo=property(...) +# key: propg +# -- +def _get_${1:foo}(self): + return self._$1 + +$1 = property(_get_$1) + +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/python-mode/propsg b/packages/yasnippet/snippets/python-mode/propsg new file mode 100644 index 000000000..876c13988 --- /dev/null +++ b/packages/yasnippet/snippets/python-mode/propsg @@ -0,0 +1,13 @@ +# contributor: Julio Carlos Menendez +# name: _get_foo ... _set_foo ... foo=property(...) +# key: propsg +# -- +def _set_${1:foo}(self, value): + self._$1 = value + +def _get_$1(self): + return self._$1 + +$1 = property(_get_$1, _set_$1) + +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/python-mode/while b/packages/yasnippet/snippets/python-mode/while new file mode 100644 index 000000000..39452bb64 --- /dev/null +++ b/packages/yasnippet/snippets/python-mode/while @@ -0,0 +1,5 @@ +# name: while ... : ... +# key: while +# -- +while ${condition}: + $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/rst-mode/.yas-parents b/packages/yasnippet/snippets/rst-mode/.yas-parents new file mode 100644 index 000000000..eed5b442b --- /dev/null +++ b/packages/yasnippet/snippets/rst-mode/.yas-parents @@ -0,0 +1 @@ +text-mode diff --git a/packages/yasnippet/snippets/rst-mode/chap b/packages/yasnippet/snippets/rst-mode/chap new file mode 100644 index 000000000..593fc0fa9 --- /dev/null +++ b/packages/yasnippet/snippets/rst-mode/chap @@ -0,0 +1,7 @@ +# name: Chapter title +# key: chap +# -- +${1:Chapter} +${1:$(make-string (string-width text) ?\=)} + +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/rst-mode/sec b/packages/yasnippet/snippets/rst-mode/sec new file mode 100644 index 000000000..c5a60bb5d --- /dev/null +++ b/packages/yasnippet/snippets/rst-mode/sec @@ -0,0 +1,7 @@ +# name: Section title +# key: sec +# -- +${1:Section} +${1:$(make-string (string-width text) ?\-)} + +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/rst-mode/tit b/packages/yasnippet/snippets/rst-mode/tit new file mode 100644 index 000000000..46ac6b121 --- /dev/null +++ b/packages/yasnippet/snippets/rst-mode/tit @@ -0,0 +1,8 @@ +# name: Document title +# key: tit +# -- +${1:$(make-string (string-width text) ?\=)} +${1:Title} +${1:$(make-string (string-width text) ?\=)} + +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/.yas-make-groups b/packages/yasnippet/snippets/ruby-mode/.yas-make-groups new file mode 100644 index 000000000..e69de29bb diff --git a/packages/yasnippet/snippets/ruby-mode/.yas-parents b/packages/yasnippet/snippets/ruby-mode/.yas-parents new file mode 100644 index 000000000..eed5b442b --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/.yas-parents @@ -0,0 +1 @@ +text-mode diff --git a/packages/yasnippet/snippets/ruby-mode/collections/all b/packages/yasnippet/snippets/ruby-mode/collections/all new file mode 100644 index 000000000..c1e308982 --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/collections/all @@ -0,0 +1,4 @@ +# name: all? { |...| ... } +# key: all +# -- +all? { |${e}| $0 } \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/collections/any b/packages/yasnippet/snippets/ruby-mode/collections/any new file mode 100644 index 000000000..c2d3a4bd1 --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/collections/any @@ -0,0 +1,4 @@ +# name: any? { |...| ... } +# key: any +# -- +any? { |${e}| $0 } \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/collections/classify b/packages/yasnippet/snippets/ruby-mode/collections/classify new file mode 100644 index 000000000..363746f4f --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/collections/classify @@ -0,0 +1,4 @@ +# name: classify { |...| ... } +# key: classify +# -- +classify { |${e}| $0 } \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/collections/collect b/packages/yasnippet/snippets/ruby-mode/collections/collect new file mode 100644 index 000000000..fb6aefa64 --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/collections/collect @@ -0,0 +1,4 @@ +# name: collect { |...| ... } +# key: collect +# -- +collect { |${e}| $0 } \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/collections/deli b/packages/yasnippet/snippets/ruby-mode/collections/deli new file mode 100644 index 000000000..2fb374925 --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/collections/deli @@ -0,0 +1,4 @@ +# name: delete_if { |...| ... } +# key: deli +# -- +delete_if { |${e} $0 } \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/collections/det b/packages/yasnippet/snippets/ruby-mode/collections/det new file mode 100644 index 000000000..5964efb56 --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/collections/det @@ -0,0 +1,4 @@ +# name: detect { |...| ... } +# key: det +# -- +detect { |${e}| $0 } \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/collections/ea b/packages/yasnippet/snippets/ruby-mode/collections/ea new file mode 100644 index 000000000..9f8cf904e --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/collections/ea @@ -0,0 +1,4 @@ +# name: each { |...| ... } +# key: ea +# -- +each { |${e}| $0 } \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/collections/eac b/packages/yasnippet/snippets/ruby-mode/collections/eac new file mode 100644 index 000000000..9a45e2437 --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/collections/eac @@ -0,0 +1,4 @@ +# name: each_cons(...) { |...| ... } +# key: eac +# -- +each_cons(${1:2}) { |${group}| $0 } \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/collections/eai b/packages/yasnippet/snippets/ruby-mode/collections/eai new file mode 100644 index 000000000..3ad66a729 --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/collections/eai @@ -0,0 +1,4 @@ +# name: each_index { |i| ... } +# key: eai +# -- +each_index { |${i}| $0 } \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/collections/eav b/packages/yasnippet/snippets/ruby-mode/collections/eav new file mode 100644 index 000000000..cb2ebdc97 --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/collections/eav @@ -0,0 +1,4 @@ +# name: each_value { |val| ... } +# key: eav +# -- +each_value { |${val}| $0 } \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/collections/eawi b/packages/yasnippet/snippets/ruby-mode/collections/eawi new file mode 100644 index 000000000..c3b689a21 --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/collections/eawi @@ -0,0 +1,4 @@ +# name: each_with_index { |e, i| ... } +# key: eawi +# -- +each_with_index { |${e}, ${i}| $0 } \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/collections/inject b/packages/yasnippet/snippets/ruby-mode/collections/inject new file mode 100644 index 000000000..71adb00f5 --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/collections/inject @@ -0,0 +1,4 @@ +# name: inject(...) { |...| ... } +# key: inject +# -- +inject(${1:0}) { |${2:injection}, ${3:element}| $0 } \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/collections/reject b/packages/yasnippet/snippets/ruby-mode/collections/reject new file mode 100644 index 000000000..8ba65186a --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/collections/reject @@ -0,0 +1,4 @@ +# name: reject { |...| ... } +# key: reject +# -- +reject { |${1:element}| $0 } \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/collections/select b/packages/yasnippet/snippets/ruby-mode/collections/select new file mode 100644 index 000000000..ce30ac511 --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/collections/select @@ -0,0 +1,4 @@ +# name: select { |...| ... } +# key: select +# -- +select { |${1:element}| $0 } \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/collections/zip b/packages/yasnippet/snippets/ruby-mode/collections/zip new file mode 100644 index 000000000..9db20ed9f --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/collections/zip @@ -0,0 +1,4 @@ +#name : zip(...) { |...| ... } +# key: collectionszip +# -- +zip(${enums}) { |${row}| $0 } \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/control structure/forin b/packages/yasnippet/snippets/ruby-mode/control structure/forin new file mode 100644 index 000000000..c69f8d66a --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/control structure/forin @@ -0,0 +1,6 @@ +# name: for ... in ...; ... end +# key: forin +# -- +for ${1:element} in ${2:collection} + $0 +end \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/control structure/if b/packages/yasnippet/snippets/ruby-mode/control structure/if new file mode 100644 index 000000000..b1ad4fc01 --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/control structure/if @@ -0,0 +1,6 @@ +# name: if ... end +# key: if +# -- +if ${1:condition} + $0 +end \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/control structure/ife b/packages/yasnippet/snippets/ruby-mode/control structure/ife new file mode 100644 index 000000000..946b71c27 --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/control structure/ife @@ -0,0 +1,8 @@ +# name: if ... else ... end +# key: ife +# -- +if ${1:condition} + $2 +else + $3 +end \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/control structure/tim b/packages/yasnippet/snippets/ruby-mode/control structure/tim new file mode 100644 index 000000000..584497469 --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/control structure/tim @@ -0,0 +1,4 @@ +# name: times { |n| ... } +# key: tim +# -- +times { |${n}| $0 } \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/control structure/until b/packages/yasnippet/snippets/ruby-mode/control structure/until new file mode 100644 index 000000000..99d34b5e0 --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/control structure/until @@ -0,0 +1,6 @@ +# name: until ... end +# key: until +# -- +until ${condition} + $0 +end \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/control structure/upt b/packages/yasnippet/snippets/ruby-mode/control structure/upt new file mode 100644 index 000000000..cadc40d49 --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/control structure/upt @@ -0,0 +1,6 @@ +# name: upto(...) { |n| ... } +# key: upt +# -- +upto(${n}) { |${i}| + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/control structure/when b/packages/yasnippet/snippets/ruby-mode/control structure/when new file mode 100644 index 000000000..c11b6a5d3 --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/control structure/when @@ -0,0 +1,6 @@ +# name: when ... end +# key: when +# -- +when ${condition} + $0 +end \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/control structure/while b/packages/yasnippet/snippets/ruby-mode/control structure/while new file mode 100644 index 000000000..920a08a7f --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/control structure/while @@ -0,0 +1,6 @@ +# name: while ... end +# key: while +# -- +while ${condition} + $0 +end \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/definitions/Comp b/packages/yasnippet/snippets/ruby-mode/definitions/Comp new file mode 100644 index 000000000..112ebae2c --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/definitions/Comp @@ -0,0 +1,8 @@ +# name: include Comparable; def <=> ... end +# key: Comp +# -- +include Comparable + +def <=> other + $0 +end \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/definitions/am b/packages/yasnippet/snippets/ruby-mode/definitions/am new file mode 100644 index 000000000..c6b846d1f --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/definitions/am @@ -0,0 +1,4 @@ +# name: alias_method new, old +# key: am +# -- +alias_method :${new_name}, :${old_name} \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/definitions/cla b/packages/yasnippet/snippets/ruby-mode/definitions/cla new file mode 100644 index 000000000..d2c8ff8db --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/definitions/cla @@ -0,0 +1,6 @@ +# name: class << self ... end +# key: cla +# -- +class << ${self} + $0 +end \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/definitions/cls b/packages/yasnippet/snippets/ruby-mode/definitions/cls new file mode 100644 index 000000000..19754a7a4 --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/definitions/cls @@ -0,0 +1,13 @@ +# name: class ... end +# contributor: hitesh +# key: cls +# -- +class ${1:`(let ((fn (capitalize (file-name-nondirectory + (file-name-sans-extension + (or (buffer-file-name) + (buffer-name (current-buffer)))))))) + (cond + ((string-match "_" fn) (replace-match "" nil nil fn)) + (t fn)))`} + $0 +end \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/definitions/mm b/packages/yasnippet/snippets/ruby-mode/definitions/mm new file mode 100644 index 000000000..752b3cecb --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/definitions/mm @@ -0,0 +1,6 @@ +# name: def method_missing ... end +# key: mm +# -- +def method_missing(method, *args) + $0 +end \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/definitions/r b/packages/yasnippet/snippets/ruby-mode/definitions/r new file mode 100644 index 000000000..5f9c093fd --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/definitions/r @@ -0,0 +1,4 @@ +# name: attr_reader ... +# key: r +# -- +attr_reader : \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/definitions/rw b/packages/yasnippet/snippets/ruby-mode/definitions/rw new file mode 100644 index 000000000..ac72bcf7a --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/definitions/rw @@ -0,0 +1,4 @@ +# name: attr_accessor ... +# key: rw +# -- +attr_accessor : \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/definitions/w b/packages/yasnippet/snippets/ruby-mode/definitions/w new file mode 100644 index 000000000..a2f95c88e --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/definitions/w @@ -0,0 +1,4 @@ +# name: attr_writer ... +# key: w +# -- +attr_writer : \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/general/# b/packages/yasnippet/snippets/ruby-mode/general/# new file mode 100644 index 000000000..491ca3912 --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/general/# @@ -0,0 +1,4 @@ +# name: # => +# key: # +# -- +# => \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/general/=b b/packages/yasnippet/snippets/ruby-mode/general/=b new file mode 100644 index 000000000..4334e9b5d --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/general/=b @@ -0,0 +1,6 @@ +# name: =begin rdoc ... =end +# key: =b +# -- +=begin rdoc + $0 +=end \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/general/app b/packages/yasnippet/snippets/ruby-mode/general/app new file mode 100644 index 000000000..6d5f48816 --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/general/app @@ -0,0 +1,6 @@ +# name: if __FILE__ == $PROGRAM_NAME ... end +# key: app +# -- +if __FILE__ == $PROGRAM_NAME + $0 +end \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/general/bm b/packages/yasnippet/snippets/ruby-mode/general/bm new file mode 100644 index 000000000..83907d22a --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/general/bm @@ -0,0 +1,6 @@ +# name: Benchmark.bmbm(...) do ... end +# key: bm +# -- +Benchmark.bmbm(${1:10}) do |x| + $0 +end \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/general/case b/packages/yasnippet/snippets/ruby-mode/general/case new file mode 100644 index 000000000..f7ecb211e --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/general/case @@ -0,0 +1,7 @@ +# name: case ... end +# key: case +# -- +case ${1:object} +when ${2:condition} + $0 +end \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/general/dee b/packages/yasnippet/snippets/ruby-mode/general/dee new file mode 100644 index 000000000..d3bf69531 --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/general/dee @@ -0,0 +1,4 @@ +# name: deep_copy(...) +# key: dee +# -- +Marshal.load(Marshal.dump($0)) \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/general/rb b/packages/yasnippet/snippets/ruby-mode/general/rb new file mode 100644 index 000000000..55a5ac6ad --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/general/rb @@ -0,0 +1,4 @@ +# name: /usr/bin/ruby -wKU +# key: rb +# -- +#!/usr/bin/ruby -wKU \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/general/req b/packages/yasnippet/snippets/ruby-mode/general/req new file mode 100644 index 000000000..464b521f3 --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/general/req @@ -0,0 +1,4 @@ +# name: require "..." +# key: req +# -- +require "$0" \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/general/rreq b/packages/yasnippet/snippets/ruby-mode/general/rreq new file mode 100644 index 000000000..b67664817 --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/general/rreq @@ -0,0 +1,4 @@ +# name: require File.join(File.dirname(__FILE__), ...) +# key: rreq +# -- +require File.join(File.dirname(__FILE__), $0) \ No newline at end of file diff --git a/packages/yasnippet/snippets/ruby-mode/general/y b/packages/yasnippet/snippets/ruby-mode/general/y new file mode 100644 index 000000000..0085c9eea --- /dev/null +++ b/packages/yasnippet/snippets/ruby-mode/general/y @@ -0,0 +1,4 @@ +# name: :yields: arguments (rdoc) +# key: y +# -- +:yields: $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/.yas-parents b/packages/yasnippet/snippets/scala-mode/.yas-parents new file mode 100644 index 000000000..eed5b442b --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/.yas-parents @@ -0,0 +1 @@ +text-mode diff --git a/packages/yasnippet/snippets/scala-mode/act b/packages/yasnippet/snippets/scala-mode/act new file mode 100644 index 000000000..d3fc196bb --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/act @@ -0,0 +1,11 @@ +# Author: Jonas Bonèr +# name: def act = { ..} +# key: act +# -- +def act = { + loop { + react { + $0 + } + } +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/act.arg b/packages/yasnippet/snippets/scala-mode/act.arg new file mode 100644 index 000000000..45369ab80 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/act.arg @@ -0,0 +1,11 @@ +# Author: Jonas Bonèr +# name: def act(arg: T) = { ..} +# key: act +# -- +def act(${1:arg}: ${2:type}) = { + loop { + react { + $0 + } + } +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/actor b/packages/yasnippet/snippets/scala-mode/actor new file mode 100644 index 000000000..eb1ecef09 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/actor @@ -0,0 +1,11 @@ +# Author: Jonas Bonèr +# name: val a = actor { ..} +# key: actor +# -- +val a = actor { + loop { + react { + $0 + } + } +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/ano b/packages/yasnippet/snippets/scala-mode/ano new file mode 100644 index 000000000..6c788129a --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/ano @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: (args) => ... +# key: ano +# -- +($1) => ${2:body} $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/app b/packages/yasnippet/snippets/scala-mode/app new file mode 100644 index 000000000..f177cd195 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/app @@ -0,0 +1,7 @@ +# Author: Anders Bach Nielsen +# name: object name extends Application +# key: app +# -- +object ${1:name} extends Application { + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/arr.new b/packages/yasnippet/snippets/scala-mode/arr.new new file mode 100644 index 000000000..6e17e7334 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/arr.new @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: Array[T](..) +# key: arr +# -- +Array[${1:value}](${2:args}) $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/arr.val-new b/packages/yasnippet/snippets/scala-mode/arr.val-new new file mode 100644 index 000000000..2736b5fe8 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/arr.val-new @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: val a = Array[T](..) +# key: arr +# -- +val ${1:arr} = Array[${2:value}](${3:args}) $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/asof b/packages/yasnippet/snippets/scala-mode/asof new file mode 100644 index 000000000..0736fd6ac --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/asof @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: asInstanceOf[T] +# key: asof +# -- +asInstanceOf[${1:type}] $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/ass b/packages/yasnippet/snippets/scala-mode/ass new file mode 100644 index 000000000..b4640a350 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/ass @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: assert(x === y) +# key: ass +# -- +assert(${1:x} === ${2:y}) $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/ass.true b/packages/yasnippet/snippets/scala-mode/ass.true new file mode 100644 index 000000000..76f822679 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/ass.true @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: assert(true) +# key: ass +# -- +assert(true) $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/at.author b/packages/yasnippet/snippets/scala-mode/at.author new file mode 100644 index 000000000..ba70f63de --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/at.author @@ -0,0 +1,5 @@ +# Author: Anders Bach Nielsen +# name: @author name +# key: at +# -- +@author ${1:name} $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/at.param b/packages/yasnippet/snippets/scala-mode/at.param new file mode 100644 index 000000000..89a5b0bd0 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/at.param @@ -0,0 +1,5 @@ +# Author: Anders Bach Nielsen +# name: @param name description +# key: at +# -- +@param ${1:name} ${2:description} $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/at.return b/packages/yasnippet/snippets/scala-mode/at.return new file mode 100644 index 000000000..a0275165e --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/at.return @@ -0,0 +1,5 @@ +# Author: Anders Bach Nielsen +# name: @return description +# key: at +# -- +@return ${1:description} $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/at.version b/packages/yasnippet/snippets/scala-mode/at.version new file mode 100644 index 000000000..a20270673 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/at.version @@ -0,0 +1,5 @@ +# Author: Anders Bach Nielsen +# name: @version number +# key: at +# -- +@version ${1:0.1} $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/bang b/packages/yasnippet/snippets/scala-mode/bang new file mode 100644 index 000000000..b5c94ad18 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/bang @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: actor ! message +# key: bang +# -- +${1:actor} ! ${2:message} $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/case b/packages/yasnippet/snippets/scala-mode/case new file mode 100644 index 000000000..c09c17a2d --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/case @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: case pattern => +# key: case +# -- +case ${1:pattern} => $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/case.match-all b/packages/yasnippet/snippets/scala-mode/case.match-all new file mode 100644 index 000000000..b481c9f46 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/case.match-all @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: case _ => +# key: case +# -- +case _ => $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/cast b/packages/yasnippet/snippets/scala-mode/cast new file mode 100644 index 000000000..659436d99 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/cast @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: asInstanceOf[T] +# key: cast +# -- +asInstanceOf[${1:type}] $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/cc b/packages/yasnippet/snippets/scala-mode/cc new file mode 100644 index 000000000..cfc727cf5 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/cc @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: case class T(arg: A) +# key: cc +# -- +case class ${1:name}(${2:arg}: ${3:type}) $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/cl b/packages/yasnippet/snippets/scala-mode/cl new file mode 100644 index 000000000..d59740058 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/cl @@ -0,0 +1,7 @@ +# Author: Jonas Bonèr +# name: class T { .. } +# key: cl +# -- +class ${1:name} { + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/cl.abs b/packages/yasnippet/snippets/scala-mode/cl.abs new file mode 100644 index 000000000..9ea9fe216 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/cl.abs @@ -0,0 +1,7 @@ +# Author: Jonas Bonèr +# name: abstract class T { .. } +# key: cl +# -- +abstract class ${1:name} { + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/cl.abs-arg b/packages/yasnippet/snippets/scala-mode/cl.abs-arg new file mode 100644 index 000000000..98cf7605a --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/cl.abs-arg @@ -0,0 +1,7 @@ +# Author: Jonas Bonèr +# name: abstract class T(args) { .. } +# key: cl +# -- +abstract class ${1:name}(${2:args}) { + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/cl.arg b/packages/yasnippet/snippets/scala-mode/cl.arg new file mode 100644 index 000000000..1b9d72996 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/cl.arg @@ -0,0 +1,7 @@ +# Author: Jonas Bonèr +# name: class T(args) { .. } +# key: cl +# -- +class ${1:name}(${2:args}) { + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/clof b/packages/yasnippet/snippets/scala-mode/clof new file mode 100644 index 000000000..63fe1914e --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/clof @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: classOf[T] +# key: clof +# -- +classOf[${1:type}] $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/co b/packages/yasnippet/snippets/scala-mode/co new file mode 100644 index 000000000..3ad6f79a2 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/co @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: case object T +# key: co +# -- +case object ${1:name} $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/cons b/packages/yasnippet/snippets/scala-mode/cons new file mode 100644 index 000000000..601a1a4b0 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/cons @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: element1 :: element2 +# key: cons +# -- +${1:element1} :: ${2:element2} $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/cons.nil b/packages/yasnippet/snippets/scala-mode/cons.nil new file mode 100644 index 000000000..60ac028b0 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/cons.nil @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: element1 :: Nil +# key: cons +# -- +${1:element1} :: Nil $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/def.arg b/packages/yasnippet/snippets/scala-mode/def.arg new file mode 100644 index 000000000..be5403b76 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/def.arg @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: def f(arg: T) = ... +# key: def +# -- +def ${1:name}(${2:args}) = $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/def.arg-body b/packages/yasnippet/snippets/scala-mode/def.arg-body new file mode 100644 index 000000000..8dcbb81b6 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/def.arg-body @@ -0,0 +1,7 @@ +# Author: Jonas Bonèr +# name: def f(arg: T) = {...} +# key: def +# -- +def ${1:name}(${2:args}) = { + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/def.arg-ret b/packages/yasnippet/snippets/scala-mode/def.arg-ret new file mode 100644 index 000000000..4ad27ce42 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/def.arg-ret @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: def f(arg: T): R = ... +# key: def +# -- +def ${1:name}(${2:args}): ${3:Unit} = $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/def.arg-ret-body b/packages/yasnippet/snippets/scala-mode/def.arg-ret-body new file mode 100644 index 000000000..2ffcf4bc6 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/def.arg-ret-body @@ -0,0 +1,7 @@ +# Author: Jonas Bonèr +# name: def f(arg: T): R = {...} +# key: def +# -- +def ${1:name}(${2:args}): ${3:Unit} = { + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/def.body b/packages/yasnippet/snippets/scala-mode/def.body new file mode 100644 index 000000000..c43aea402 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/def.body @@ -0,0 +1,7 @@ +# Author: Jonas Bonèr +# name: def f = {...} +# key: def +# -- +def ${1:name} = { + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/def.ret b/packages/yasnippet/snippets/scala-mode/def.ret new file mode 100644 index 000000000..719dc697d --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/def.ret @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: def f: R = ... +# key: def +# -- +def ${1:name}: ${2:Unit} = $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/def.ret-body b/packages/yasnippet/snippets/scala-mode/def.ret-body new file mode 100644 index 000000000..d8ee4563b --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/def.ret-body @@ -0,0 +1,7 @@ +# Author: Jonas Bonèr +# name: def f: R = {...} +# key: def +# -- +def ${1:name}: ${3:Unit} = { + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/def.simple b/packages/yasnippet/snippets/scala-mode/def.simple new file mode 100644 index 000000000..c956bbf4b --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/def.simple @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: def f = ... +# key: def +# -- +def ${1:name} = $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/doc.class b/packages/yasnippet/snippets/scala-mode/doc.class new file mode 100644 index 000000000..a5c996244 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/doc.class @@ -0,0 +1,9 @@ +# Author: Anders Bach Nielsen +# name: /** cls/trt/obj name */ +# key: doc +# -- +/** + * `(scala-mode-find-clstrtobj-name-doc)` + * ${1:description} + * $0 + */ \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/doc.def b/packages/yasnippet/snippets/scala-mode/doc.def new file mode 100644 index 000000000..4944d8ed9 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/doc.def @@ -0,0 +1,7 @@ +# Author: Anders Bach Nielsen +# name: /** method name */ +# key: doc +# -- +/** + * `(scala-mode-def-and-args-doc)` + */ \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/doc.file b/packages/yasnippet/snippets/scala-mode/doc.file new file mode 100644 index 000000000..5f02a9ee2 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/doc.file @@ -0,0 +1,10 @@ +# Author: Anders Bach Nielsen +# name: /** file name */ +# key: doc +# -- +/** + * `(scala-mode-file-doc)` + * $0 + * @author ${1:name} + * @version ${2:0.1} + */ \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/doc.file-scala b/packages/yasnippet/snippets/scala-mode/doc.file-scala new file mode 100644 index 000000000..6c219196e --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/doc.file-scala @@ -0,0 +1,17 @@ +# Author: Anders Bach Nielsen +# name: /** scala file */ +# key: doc +# -- +/* __ *\ +** ________ ___ / / ___ Scala $3 ** +** / __/ __// _ | / / / _ | (c) 2005-`(format-time-string "%Y")` , LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ +/** + * $0 + * @author ${1:name} + * @version ${2:0.1} + * $Id$ + */ \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/doc.file-scala-api b/packages/yasnippet/snippets/scala-mode/doc.file-scala-api new file mode 100644 index 000000000..bb306de78 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/doc.file-scala-api @@ -0,0 +1,17 @@ +# Author: Anders Bach Nielsen +# name: /** scala api file */ +# key: doc +# -- +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2005-`(format-time-string "%Y")`, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ +/** + * $0 + * @author ${1:name} + * @version ${2:0.1} + * $Id$ + */ \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/doc.scaladoc b/packages/yasnippet/snippets/scala-mode/doc.scaladoc new file mode 100644 index 000000000..3d96279c0 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/doc.scaladoc @@ -0,0 +1,8 @@ +# Author: Anders Bach Nielsen +# name: /** ... */ +# key: doc +# -- +/** + * ${1:description} + * $0 + */ \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/expect b/packages/yasnippet/snippets/scala-mode/expect new file mode 100644 index 000000000..b34b4d960 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/expect @@ -0,0 +1,7 @@ +# Author: Jonas Bonèr +# name: expect(value) { ..} +# key: expect +# -- +expect(${1:reply}) { + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/ext b/packages/yasnippet/snippets/scala-mode/ext new file mode 100644 index 000000000..06ba4768f --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/ext @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: extends T +# key: ext +# -- +extends $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/for.extract b/packages/yasnippet/snippets/scala-mode/for.extract new file mode 100644 index 000000000..bc6666da5 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/for.extract @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: x <- xs +# key: for +# -- +${1:x} <- ${2:xs} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/for.if b/packages/yasnippet/snippets/scala-mode/for.if new file mode 100644 index 000000000..f812c2c0d --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/for.if @@ -0,0 +1,7 @@ +# Author: Jonas Bonèr +# name: for (x <- xs if guard) { ... } +# key: for +# -- +for (${1:x} <- ${2:xs} if ${3:guard}) { + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/for.loop b/packages/yasnippet/snippets/scala-mode/for.loop new file mode 100644 index 000000000..9b538f733 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/for.loop @@ -0,0 +1,7 @@ +# Author: Jonas Bonèr +# name: for (x <- xs) { ... } +# key: for +# -- +for (${1:x} <- ${2:xs}) { + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/for.multi b/packages/yasnippet/snippets/scala-mode/for.multi new file mode 100644 index 000000000..6a1866dd2 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/for.multi @@ -0,0 +1,10 @@ +# Author: Jonas Bonèr +# name: for {x <- xs \ y <- ys} { yield } +# key: for +# -- +for { + ${1:x} <- ${2:xs} + ${3:x} <- ${4:xs} +} { + yield $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/foreach b/packages/yasnippet/snippets/scala-mode/foreach new file mode 100644 index 000000000..7061201d9 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/foreach @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: foreach(x => ..) +# key: foreach +# -- +foreach(${1:x} => ${2:body}) $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/hmap.new b/packages/yasnippet/snippets/scala-mode/hmap.new new file mode 100644 index 000000000..a675336d4 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/hmap.new @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: new HashMap[K, V] +# key: hmap +# -- +new HashMap[${1:key}, ${2:value}] $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/hmap.val-new b/packages/yasnippet/snippets/scala-mode/hmap.val-new new file mode 100644 index 000000000..6f53fc6ff --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/hmap.val-new @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: val m = new HashMap[K, V] +# key: hmap +# -- +val ${1:m} = new HashMap[${2:key}, ${3:value}] $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/hset.new b/packages/yasnippet/snippets/scala-mode/hset.new new file mode 100644 index 000000000..79e43480c --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/hset.new @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: new HashSet[K] +# key: hset +# -- +new HashSet[${1:key}] $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/hset.val-new b/packages/yasnippet/snippets/scala-mode/hset.val-new new file mode 100644 index 000000000..9b9cde20e --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/hset.val-new @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: val m = new HashSet[K] +# key: hset +# -- +val ${1:m} = new HashSet[${2:key}] $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/if b/packages/yasnippet/snippets/scala-mode/if new file mode 100644 index 000000000..d1724ef62 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/if @@ -0,0 +1,7 @@ +# Author: Jonas Bonèr +# name: if (cond) { .. } +# key: if +# -- +if (${1:condition}) { + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/if.else b/packages/yasnippet/snippets/scala-mode/if.else new file mode 100644 index 000000000..f0210cbf0 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/if.else @@ -0,0 +1,9 @@ +# Author: Jonas Bonèr +# name: if (cond) { .. } else { .. } +# key: if +# -- +if (${1:condition}) { + $2 +} else { + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/imp b/packages/yasnippet/snippets/scala-mode/imp new file mode 100644 index 000000000..f5fdee08b --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/imp @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: import .. +# key: imp +# -- +import $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/intercept b/packages/yasnippet/snippets/scala-mode/intercept new file mode 100644 index 000000000..06eed8d67 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/intercept @@ -0,0 +1,7 @@ +# Author: Jonas Bonèr +# name: intercept(classOf[T]) { ..} +# key: intercept +# -- +intercept(classOf[${1:Exception]}) { + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/isof b/packages/yasnippet/snippets/scala-mode/isof new file mode 100644 index 000000000..bfb421fa5 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/isof @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: isInstanceOf[T] +# key: isof +# -- +isInstanceOf[${1:type}] $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/ls.new b/packages/yasnippet/snippets/scala-mode/ls.new new file mode 100644 index 000000000..f231019c4 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/ls.new @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: List(..) +# key: ls +# -- +List(${1:args}, ${2:args}) $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/ls.val-new b/packages/yasnippet/snippets/scala-mode/ls.val-new new file mode 100644 index 000000000..ea660bf7d --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/ls.val-new @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: val l = List(..) +# key: ls +# -- +val ${1:l} = List(${2:args}, ${3:args}) $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/main b/packages/yasnippet/snippets/scala-mode/main new file mode 100644 index 000000000..a9c67e38b --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/main @@ -0,0 +1,7 @@ +# Author: Jonas Bonèr +# name: def main(args: Array[String]) = { ... } +# key: main +# -- +def main(args: Array[String]) = { + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/map b/packages/yasnippet/snippets/scala-mode/map new file mode 100644 index 000000000..43e2a0b42 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/map @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: map(x => ..) +# key: map +# -- +map(${1:x} => ${2:body}) $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/map.new b/packages/yasnippet/snippets/scala-mode/map.new new file mode 100644 index 000000000..6c71fce29 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/map.new @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: Map(key -> value) +# key: map +# -- +Map(${1:key} -> ${2:value}) $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/match b/packages/yasnippet/snippets/scala-mode/match new file mode 100644 index 000000000..44bc725d6 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/match @@ -0,0 +1,7 @@ +# Author: Jonas Bonèr +# name: cc match { .. } +# key: match +# -- +${1:cc} match { + case ${2:pattern} => $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/match.can b/packages/yasnippet/snippets/scala-mode/match.can new file mode 100644 index 000000000..72798c5d5 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/match.can @@ -0,0 +1,12 @@ +# Author: Jonas Bonèr +# name: can match { case Full(res) => .. } +# key: match +# -- +${1:option} match { + case Full(res) => $0 + + case Empty => + + case Failure(msg, _, _) => + +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/match.option b/packages/yasnippet/snippets/scala-mode/match.option new file mode 100644 index 000000000..01186e3ba --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/match.option @@ -0,0 +1,9 @@ +# Author: Jonas Bonèr +# name: option match { case None => .. } +# key: match +# -- +${1:option} match { + case None => $0 + case Some(res) => + +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/mix b/packages/yasnippet/snippets/scala-mode/mix new file mode 100644 index 000000000..bc7810052 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/mix @@ -0,0 +1,7 @@ +# Author: Jonas Bonèr +# name: trait T { .. } +# key: mix +# -- +trait ${1:name} { + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/ob b/packages/yasnippet/snippets/scala-mode/ob new file mode 100644 index 000000000..ec4d3a9a4 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/ob @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: object name extends T +# key: ob +# -- +object ${1:name} extends ${2:type} $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/pac b/packages/yasnippet/snippets/scala-mode/pac new file mode 100644 index 000000000..2c51176e3 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/pac @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: package .. +# key: pac +# -- +package $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/pr.newline b/packages/yasnippet/snippets/scala-mode/pr.newline new file mode 100644 index 000000000..093027a45 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/pr.newline @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: println(..) +# key: pr +# -- +println(${1:obj}) $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/pr.simple b/packages/yasnippet/snippets/scala-mode/pr.simple new file mode 100644 index 000000000..a6241402f --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/pr.simple @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: print(..) +# key: pr +# -- +print(${1:obj}) $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/pr.string b/packages/yasnippet/snippets/scala-mode/pr.string new file mode 100644 index 000000000..130474a62 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/pr.string @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: println("..") +# key: pr +# -- +println("${1:msg}") $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/pr.trace b/packages/yasnippet/snippets/scala-mode/pr.trace new file mode 100644 index 000000000..8ad92b09e --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/pr.trace @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: println("obj: " + obj) +# key: pr +# -- +println("${1:obj}: " + ${1:obj}) $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/pri b/packages/yasnippet/snippets/scala-mode/pri new file mode 100644 index 000000000..12dbd4559 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/pri @@ -0,0 +1,5 @@ +#Author : Jonas Bonèr +#name : private +# key: pri +# -- +private $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/pri.param b/packages/yasnippet/snippets/scala-mode/pri.param new file mode 100644 index 000000000..90ae3ba26 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/pri.param @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: private[this] +# key: pri +# -- +private[${1:this}] $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/pro b/packages/yasnippet/snippets/scala-mode/pro new file mode 100644 index 000000000..d5612b463 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/pro @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: protected +# key: pro +# -- +protected $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/pro.param b/packages/yasnippet/snippets/scala-mode/pro.param new file mode 100644 index 000000000..ae8230592 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/pro.param @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: protected[this] +# key: pro +# -- +protected[${1:this}] $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/suite b/packages/yasnippet/snippets/scala-mode/suite new file mode 100644 index 000000000..942fbad14 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/suite @@ -0,0 +1,9 @@ +# Author: Jonas Bonèr +# name: class T extends Suite { .. } +# key: suite +# -- +import org.scalatest._ + +class ${1:name} extends Suite { + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/test b/packages/yasnippet/snippets/scala-mode/test new file mode 100644 index 000000000..d4819ac43 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/test @@ -0,0 +1,8 @@ +# Author: Jonas Bonèr +# name: @Test def testX = ... +# key: test +# -- +//@Test +def test${1:name} = { + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/throw b/packages/yasnippet/snippets/scala-mode/throw new file mode 100644 index 000000000..e303c25f1 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/throw @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: throw new Exception +# key: throw +# -- +throw new ${1:Exception}(${2:msg}) $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/tr b/packages/yasnippet/snippets/scala-mode/tr new file mode 100644 index 000000000..2381bdc07 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/tr @@ -0,0 +1,7 @@ +# Author: Anders Bach Nielsen +# name: trait T { .. } +# key: tr +# -- +trait ${1:name} { + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/tr.ext b/packages/yasnippet/snippets/scala-mode/tr.ext new file mode 100644 index 000000000..15fb8aa7c --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/tr.ext @@ -0,0 +1,7 @@ +# Author: Anders Bach Nielsen +# name: trait T extends C { .. } +# key: tr +# -- +trait ${1:name} extends ${2:class} { + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/tr.ext-with b/packages/yasnippet/snippets/scala-mode/tr.ext-with new file mode 100644 index 000000000..c971ebbcd --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/tr.ext-with @@ -0,0 +1,7 @@ +# Author: Anders Bach Nielsen +# name: trait T1 extends C with T2 { .. } +# key: tr +# -- +trait ${1:name} extends ${2:class} with ${3:trait} { + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/tr.with b/packages/yasnippet/snippets/scala-mode/tr.with new file mode 100644 index 000000000..732dfb317 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/tr.with @@ -0,0 +1,7 @@ +# Author: Anders Bach Nielsen +# name: trait T1 with T2 { .. } +# key: tr +# -- +trait ${1:name} with ${2:trait} { + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/try b/packages/yasnippet/snippets/scala-mode/try new file mode 100644 index 000000000..0b65a6fe2 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/try @@ -0,0 +1,10 @@ +# Author: Jonas Bonèr +# name: try { .. } catch { case e => ..} +# key: try +# -- +try { + $0 +} catch { + case ${1:e}: ${2:Exception} => + ${1:println(\"ERROR: \" + e) // TODO: handle exception}\n} +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/try.catch-finally b/packages/yasnippet/snippets/scala-mode/try.catch-finally new file mode 100644 index 000000000..e431b9804 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/try.catch-finally @@ -0,0 +1,12 @@ +# Author: Jonas Bonèr +# name: try { .. } catch { case e => ..} finally { ..} +# key: try +# -- +try { + $0 +} catch { + case ${1:e}: ${2:Exception} => + ${1:println(\"ERROR: \" + e) // TODO: handle exception}\n} +} finally { + +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/try.finally b/packages/yasnippet/snippets/scala-mode/try.finally new file mode 100644 index 000000000..6f8d88fd3 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/try.finally @@ -0,0 +1,9 @@ +# Author: Jonas Bonèr +# name: try { .. } finally { .. } +# key: try +# -- +try { + +} finally { + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/tup.arrow b/packages/yasnippet/snippets/scala-mode/tup.arrow new file mode 100644 index 000000000..7b77907d3 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/tup.arrow @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: element1 -> element2 +# key: tup +# -- +${1:element1} -> ${2:element2} $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/tup.paren b/packages/yasnippet/snippets/scala-mode/tup.paren new file mode 100644 index 000000000..ebe94a8ca --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/tup.paren @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: (element1, element2) +# key: tup +# -- +(${1:element1}, ${2:element2}) $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/val b/packages/yasnippet/snippets/scala-mode/val new file mode 100644 index 000000000..b299add84 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/val @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: val name = .. +# key: val +# -- +val ${1:name} = ${2:obj} $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/val.new b/packages/yasnippet/snippets/scala-mode/val.new new file mode 100644 index 000000000..9bd2b7db6 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/val.new @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: val name = new .. +# key: val +# -- +val ${1:name} = new ${2:obj} $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/val.ret b/packages/yasnippet/snippets/scala-mode/val.ret new file mode 100644 index 000000000..4af1192ff --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/val.ret @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: val name: T = .. +# key: val +# -- +val ${1:name}: ${2:T} = ${3:obj} $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/var b/packages/yasnippet/snippets/scala-mode/var new file mode 100644 index 000000000..2c6158bcc --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/var @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: var name = .. +# key: var +# -- +var ${1:name} = ${2:obj} $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/var.new b/packages/yasnippet/snippets/scala-mode/var.new new file mode 100644 index 000000000..5dff6bc65 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/var.new @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: var name = new .. +# key: var +# -- +var ${1:name} = new ${2:obj} $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/var.ret b/packages/yasnippet/snippets/scala-mode/var.ret new file mode 100644 index 000000000..60b3fdc60 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/var.ret @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: var name: T = .. +# key: var +# -- +var ${1:name}: ${2:T} = ${3:obj} $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/whi b/packages/yasnippet/snippets/scala-mode/whi new file mode 100644 index 000000000..233cf1e0c --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/whi @@ -0,0 +1,7 @@ +# Author: Jonas Bonèr +# name: while(cond) { .. } +# key: whi +# -- +while (${1:condition}) { + $0 +} \ No newline at end of file diff --git a/packages/yasnippet/snippets/scala-mode/with b/packages/yasnippet/snippets/scala-mode/with new file mode 100644 index 000000000..aa924af81 --- /dev/null +++ b/packages/yasnippet/snippets/scala-mode/with @@ -0,0 +1,5 @@ +# Author: Jonas Bonèr +# name: with T +# key: with +# -- +with $0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/snippet-mode/.yas-parents b/packages/yasnippet/snippets/snippet-mode/.yas-parents new file mode 100644 index 000000000..eed5b442b --- /dev/null +++ b/packages/yasnippet/snippets/snippet-mode/.yas-parents @@ -0,0 +1 @@ +text-mode diff --git a/packages/yasnippet/snippets/snippet-mode/field b/packages/yasnippet/snippets/snippet-mode/field new file mode 100644 index 000000000..f969a0021 --- /dev/null +++ b/packages/yasnippet/snippets/snippet-mode/field @@ -0,0 +1,6 @@ +# name: ${ ... } field +# contributor: joaotavora +# key: $f +# key: field +# -- +\${${1:${2:n}:}$3${4:\$(${5:lisp-fn})}\}$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/snippet-mode/mirror b/packages/yasnippet/snippets/snippet-mode/mirror new file mode 100644 index 000000000..2d4345000 --- /dev/null +++ b/packages/yasnippet/snippets/snippet-mode/mirror @@ -0,0 +1,6 @@ +# name: ${n:$(...)} mirror +# key: $m +# contributor: joaotavora +# key: mirror +# -- +\${${2:n}:${4:\$(${5:reflection-fn})}\}$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/snippet-mode/vars b/packages/yasnippet/snippets/snippet-mode/vars new file mode 100644 index 000000000..d617002ba --- /dev/null +++ b/packages/yasnippet/snippets/snippet-mode/vars @@ -0,0 +1,12 @@ +# -*- mode: snippet -*- +# name: Snippet header +# contributor: joaotavora +# key: vars +# -- +# name: $1${2: +# key: ${3:trigger-key}}${4: +# keybinding: ${5:keybinding}}${6: +# expand-env: (${7:})} +# contributor: $6 +# -- +$0 \ No newline at end of file diff --git a/packages/yasnippet/snippets/sql-mode/.yas-parents b/packages/yasnippet/snippets/sql-mode/.yas-parents new file mode 100644 index 000000000..eed5b442b --- /dev/null +++ b/packages/yasnippet/snippets/sql-mode/.yas-parents @@ -0,0 +1 @@ +text-mode diff --git a/packages/yasnippet/snippets/sql-mode/column b/packages/yasnippet/snippets/sql-mode/column new file mode 100644 index 000000000..5817296c0 --- /dev/null +++ b/packages/yasnippet/snippets/sql-mode/column @@ -0,0 +1,5 @@ +# contributor: Alejandro Espinoza Esparza +# name: , ColumnName ColumnType NOT NULL... +# key: column +# -- + , ${1:Name} ${2:Type} ${3:NOT NULL} \ No newline at end of file diff --git a/packages/yasnippet/snippets/sql-mode/constraint b/packages/yasnippet/snippets/sql-mode/constraint new file mode 100644 index 000000000..5bb1902cd --- /dev/null +++ b/packages/yasnippet/snippets/sql-mode/constraint @@ -0,0 +1,5 @@ +# contributor: Alejandro Espinoza Esparza +# name: CONSTRAINT [..] PRIMARY KEY ... +# key: constraint +# -- +CONSTRAINT [${1:PK_Name}] PRIMARY KEY ${2:CLUSTERED} ([${3:ColumnName}]) \ No newline at end of file diff --git a/packages/yasnippet/snippets/sql-mode/constraint.1 b/packages/yasnippet/snippets/sql-mode/constraint.1 new file mode 100644 index 000000000..245903ffb --- /dev/null +++ b/packages/yasnippet/snippets/sql-mode/constraint.1 @@ -0,0 +1,5 @@ +# contributor: Alejandro Espinoza Esparza +# name: CONSTRAINT [..] FOREIGN KEY ... +# key: constraint +# -- +CONSTRAINT [${1:FK_Name}] FOREIGN KEY ${2:CLUSTERED} ([${3:ColumnName}]) \ No newline at end of file diff --git a/packages/yasnippet/snippets/sql-mode/create b/packages/yasnippet/snippets/sql-mode/create new file mode 100644 index 000000000..1678ed255 --- /dev/null +++ b/packages/yasnippet/snippets/sql-mode/create @@ -0,0 +1,11 @@ +# contributor: Alejandro Espinoza Esparza +# name: create table ... +# key: create +# -- +CREATE TABLE [${1:dbo}].[${2:TableName}] +( + ${3:Id} ${4:INT IDENTITY(1,1)} ${5:NOT NULL} +$0 + CONSTRAINT [${6:PK_}] PRIMARY KEY ${7:CLUSTERED} ([$3]) +) +GO \ No newline at end of file diff --git a/packages/yasnippet/snippets/sql-mode/create.1 b/packages/yasnippet/snippets/sql-mode/create.1 new file mode 100644 index 000000000..10b30a4da --- /dev/null +++ b/packages/yasnippet/snippets/sql-mode/create.1 @@ -0,0 +1,13 @@ +# contributor: Alejandro Espinoza Esparza +# name: create procedure ... +# key: create +# -- +CREATE PROCEDURE [${1:dbo}].[${2:Name}] +( + $3 $4 = ${5:NULL} ${6:OUTPUT} +) +AS +BEGIN +$0 +END +GO \ No newline at end of file diff --git a/packages/yasnippet/snippets/sql-mode/references b/packages/yasnippet/snippets/sql-mode/references new file mode 100644 index 000000000..ff6d12f33 --- /dev/null +++ b/packages/yasnippet/snippets/sql-mode/references @@ -0,0 +1,5 @@ +# contributor: Alejandro Espinoza Esparza +# name: REFERENCES ... +# key: references +# -- +REFERENCES ${1:TableName}([${2:ColumnName}]) \ No newline at end of file diff --git a/packages/yasnippet/snippets/text-mode/email b/packages/yasnippet/snippets/text-mode/email new file mode 100644 index 000000000..95fad036a --- /dev/null +++ b/packages/yasnippet/snippets/text-mode/email @@ -0,0 +1,4 @@ +# name: (user's email) +# key: email +# -- +`(replace-regexp-in-string "@" "@NOSPAM." user-mail-address)` \ No newline at end of file diff --git a/packages/yasnippet/snippets/text-mode/time b/packages/yasnippet/snippets/text-mode/time new file mode 100644 index 000000000..814ed5f52 --- /dev/null +++ b/packages/yasnippet/snippets/text-mode/time @@ -0,0 +1,4 @@ +# name: (current time) +# key: time +# -- +`(current-time-string)` \ No newline at end of file diff --git a/packages/yasnippet/yasnippet.el b/packages/yasnippet/yasnippet.el new file mode 100644 index 000000000..d932f5b6b --- /dev/null +++ b/packages/yasnippet/yasnippet.el @@ -0,0 +1,4490 @@ +;;; yasnippet.el --- Yet another snippet extension for Emacs. + +;; Copyright (C) 2008-2012 Free Software Foundation, Inc. +;; Authors: pluskid , João Távora +;; Version: 0.8.0 +;; Package-version: 0.8.0 +;; X-URL: http://github.com/capitaomorte/yasnippet +;; Keywords: convenience, emulation +;; URL: http://github.com/capitaomorte/yasnippet +;; EmacsWiki: YaSnippetMode + +;; This program is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: +;; +;; Basic steps to setup: +;; +;; (add-to-list 'load-path +;; "~/path-to-yasnippet") +;; (require 'yasnippet) +;; (yas-global-mode 1) +;; +;; +;; Interesting variables are: +;; +;; `yas-snippet-dirs' +;; +;; 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. +;; +;; The deprecated `yas/root-directory' aliases this variable +;; for backward-compatibility. +;; +;; `yas-extra-modes' +;; +;; A local variable that you can set in a hook to override +;; snippet-lookup based on major mode. It is a a symbol (or +;; list of symbols) that correspond to subdirectories of +;; `yas-snippet-dirs' and is used for deciding which +;; snippets to consider for the active buffer. +;; +;; Deprecated `yas/mode-symbol' aliases this variable for +;; backward-compatibility. +;; +;; Major commands are: +;; +;; M-x yas-expand +;; +;; Try to expand snippets before point. In `yas-minor-mode', +;; this is bound to `yas-trigger-key' which you can customize. +;; +;; M-x yas-load-directory +;; +;; Prompts you for a directory hierarchy of snippets to load. +;; +;; M-x yas-insert-snippet +;; +;; Prompts you for possible snippet expansion if that is +;; possible according to buffer-local and snippet-local +;; expansion conditions. With prefix argument, ignore these +;; conditions. +;; +;; 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. +;; +;; M-x yas-new-snippet +;; +;; Lets you create a new snippet file in the correct +;; subdirectory of `yas-snippet-dirs', according to the +;; active major mode. +;; +;; M-x yas-load-snippet-buffer +;; +;; When editing a snippet, this loads the snippet. This is +;; bound to "C-c C-c" while in the `snippet-mode' editing +;; 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'. +;; +;; M-x yas-describe-tables +;; +;; Lists known snippets in a separate buffer. User is +;; prompted as to whether only the currently active tables +;; are to be displayed, or all the tables for all major +;; modes. +;; +;; The `dropdown-list.el' extension is bundled with YASnippet, you +;; can optionally use it the preferred "prompting method", puting in +;; your .emacs file, for example: +;; +;; (require 'dropdown-list) +;; (setq yas-prompt-functions '(yas-dropdown-prompt +;; yas-ido-prompt +;; yas-completing-prompt)) +;; +;; Also check out the customization group +;; +;; M-x customize-group RET yasnippet RET +;; +;; If you use the customization group to set variables +;; `yas-snippet-dirs' or `yas-global-mode', make sure the path to +;; "yasnippet.el" is present in the `load-path' *before* the +;; `custom-set-variables' is executed in your .emacs file. +;; +;; For more information and detailed usage, refer to the project page: +;; http://github.com/capitaomorte/yasnippet + +;;; Code: + +(require 'cl) +(require 'easymenu) +(require 'help-mode) + + +;;; User customizable variables + +(defgroup yasnippet nil + "Yet Another Snippet extension" + :group 'editing) + +(defvar yas--load-file-name load-file-name + "Store the filename that yasnippet.el was originally loaded from.") + +(defcustom yas-snippet-dirs (remove nil + (list "~/.emacs.d/snippets" + (when yas--load-file-name + (concat (file-name-directory yas--load-file-name) "snippets")))) + "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." + :type '(choice (string :tag "Single directory (string)") + (repeat :args (string) :tag "List of directories (strings)")) + :group 'yasnippet + :require 'yasnippet + :set #'(lambda (symbol new) + (let ((old (and (boundp symbol) + (symbol-value symbol)))) + (set-default symbol new) + (unless (or (not (fboundp 'yas-reload-all)) + (equal old new)) + (yas-reload-all))))) + +(defun yas-snippet-dirs () + "Returns `yas-snippet-dirs' (which see) as a list." + (if (listp yas-snippet-dirs) yas-snippet-dirs (list yas-snippet-dirs))) + +(defvaralias 'yas/root-directory 'yas-snippet-dirs) + +(defcustom yas-prompt-functions '(yas-x-prompt + yas-dropdown-prompt + yas-completing-prompt + yas-ido-prompt + yas-no-prompt) + "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!\")." + :type '(repeat function) + :group 'yasnippet) + +(defcustom yas-indent-line 'auto + "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 indendation +after expansion (the manual per-line \"$>\" indentation still +applies)." + :type '(choice (const :tag "Nothing" nothing) + (const :tag "Fixed" fixed) + (const :tag "Auto" auto)) + :group 'yasnippet) + +(defcustom yas-also-auto-indent-first-line nil + "Non-nil means also auto indent first line according to mode. + +Naturally this is only valid when `yas-indent-line' is `auto'" + :type 'boolean + :group 'yasnippet) + +(defcustom yas-snippet-revival t + "Non-nil means re-activate snippet fields after undo/redo." + :type 'boolean + :group 'yasnippet) + +(defcustom yas-trigger-key "TAB" + "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'." + :type 'string + :group 'yasnippet + :set #'(lambda (symbol key) + (let ((old (and (boundp symbol) + (symbol-value symbol)))) + (set-default symbol key) + ;; On very first loading of this defcustom, + ;; `yas-trigger-key' is *not* loaded. + (if (fboundp 'yas--trigger-key-reload) + (yas--trigger-key-reload old))))) + +(defcustom yas-next-field-key '("TAB" "") + "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 strings." + :type '(choice (string :tag "String") + (repeat :args (string) :tag "List of strings")) + :group 'yasnippet + :set #'(lambda (symbol val) + (set-default symbol val) + (if (fboundp 'yas--init-yas-in-snippet-keymap) + (yas--init-yas-in-snippet-keymap)))) + + +(defcustom 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 strings." + :type '(choice (string :tag "String") + (repeat :args (string) :tag "List of strings")) + :group 'yasnippet + :set #'(lambda (symbol val) + (set-default symbol val) + (if (fboundp 'yas--init-yas-in-snippet-keymap) + (yas--init-yas-in-snippet-keymap)))) + +(defcustom yas-skip-and-clear-key '("C-d" "" "") + "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 strings." + :type '(choice (string :tag "String") + (repeat :args (string) :tag "List of strings")) + :group 'yasnippet + :set #'(lambda (symbol val) + (set-default symbol val) + (if (fboundp 'yas--init-yas-in-snippet-keymap) + (yas--init-yas-in-snippet-keymap)))) + +(defcustom yas-triggers-in-field nil + "If non-nil, `yas-next-field-key' can trigger stacked expansions. + +Otherwise, `yas-next-field-key' just tries to move on to the next +field" + :type 'boolean + :group 'yasnippet) + +(defcustom yas-fallback-behavior 'call-other-command + "How to act when `yas-trigger-key' does *not* expand a snippet. + +- `call-other-command' means try to temporarily disable YASnippet + and call the next command bound to `yas-trigger-key'. + +- 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." + :type '(choice (const :tag "Call previous command" call-other-command) + (const :tag "Do nothing" return-nil)) + :group 'yasnippet) + +(defcustom yas-choose-keys-first nil + "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'." + :type 'boolean + :group 'yasnippet) + +(defcustom yas-choose-tables-first nil + "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'" + :type 'boolean + :group 'yasnippet) + +(defcustom yas-use-menu 'abbreviate + "Display a YASnippet 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." + :type '(choice (const :tag "Full" full) + (const :tag "Abbreviate" abbreviate) + (const :tag "No menu" nil)) + :group 'yasnippet) + +(defcustom yas-trigger-symbol (if (eq window-system 'mac) + (char-to-string ?\x21E5) ;; little ->| sign + " =>") + "The text that will be used in menu to represent the trigger." + :type 'string + :group 'yasnippet) + +(defcustom yas-wrap-around-region nil + "If non-nil, snippet expansion wraps around selected region. + +The wrapping occurs just before the snippet's exit marker. This +can be overriden on a per-snippet basis." + :type 'boolean + :group 'yasnippet) + +(defcustom yas-good-grace t + "If non-nil, don't raise errors in inline elisp evaluation. + +An error string \"[yas] error\" is returned instead." + :type 'boolean + :group 'yasnippet) + +(defcustom yas-visit-from-menu nil + "If non-nil visit snippets's files from menu, instead of expanding them. + +This cafn only work when snippets are loaded from files." + :type 'boolean + :group 'yasnippet) + +(defcustom yas-expand-only-for-last-commands nil + "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. + +Optionallly, 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." + :type '(repeat function) + :group 'yasnippet) + +;; Only two faces, and one of them shouldn't even be used... +;; +(defface yas-field-highlight-face + '((t (:inherit 'region))) + "The face used to highlight the currently active field of a snippet" + :group 'yasnippet) + +(defface yas--field-debug-face + '() + "The face used for debugging some overlays normally hidden" + :group 'yasnippet) + + +;;; User can also customize the next defvars + +(defun yas--define-some-keys (keys keymap definition) + "Bind KEYS to DEFINITION in KEYMAP, read with `read-kbd-macro'." + (let ((keys (or (and (listp keys) keys) + (list keys)))) + (dolist (key keys) + (define-key keymap (read-kbd-macro key) definition)))) + +(defvar yas-keymap + (let ((map (make-sparse-keymap))) + (mapc #'(lambda (binding) + (yas--define-some-keys (car binding) map (cdr binding))) + `((,yas-next-field-key . yas-next-field-or-maybe-expand) + (,yas-prev-field-key . yas-prev-field) + ("C-g" . yas-abort-snippet) + (,yas-skip-and-clear-key . yas-skip-and-clear-or-delete-char))) + map) + "The keymap active while a snippet expansion is in progress.") + +(defvar yas-key-syntaxes (list "w" "w_" "w_." "w_.()" "^ ") + "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.") + +(defvar 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/stackd snippet expansion!") + +(defvar yas-before-expand-snippet-hook + '() + "Hooks to run just before expanding a snippet.") + +(defvar yas-buffer-local-condition + '(if (and (or (fourth (syntax-ppss)) + (fifth (syntax-ppss))) + (eq (symbol-function this-command) 'yas-expand-from-trigger-key)) + '(require-snippet-condition . force-in-comment) + t) + "Snippet expanding condition. + +This variable is a lisp form which is evaluated everytime a +snippet expansion is attemped: + + * 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 onsidered. + + * 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'.") + + +;;; Internal variables + +(defvar yas--version "0.8.0 (beta)") + +(defvar yas--menu-table (make-hash-table) + "A hash table of MAJOR-MODE symbols to menu keymaps.") + +(defvar yas--known-modes + '(ruby-mode rst-mode markdown-mode) + "A list of mode which is well known but not part of emacs.") + +(defvar yas--escaped-characters + '(?\\ ?` ?\" ?' ?$ ?} ?{ ?\( ?\)) + "List of characters which *might* need to be escaped.") + +(defconst yas--field-regexp + "${\\([0-9]+:\\)?\\([^}]*\\)}" + "A regexp to *almost* recognize a field.") + +(defconst yas--multi-dollar-lisp-expression-regexp + "$+[ \t\n]*\\(([^)]*)\\)" + "A regexp to *almost* recognize a \"$(...)\" expression.") + +(defconst yas--backquote-lisp-expression-regexp + "`\\([^`]*\\)`" + "A regexp to recognize a \"`lisp-expression`\" expression." ) + +(defconst yas--transform-mirror-regexp + "${\\(?:\\([0-9]+\\):\\)?$\\([ \t\n]*([^}]*\\)" + "A regexp to *almost* recognize a mirror with a transform.") + +(defconst yas--simple-mirror-regexp + "$\\([0-9]+\\)" + "A regexp to recognize a simple mirror.") + +(defvar yas--snippet-id-seed 0 + "Contains the next id for a snippet.") + +(defun yas--snippet-next-id () + (let ((id yas--snippet-id-seed)) + (incf yas--snippet-id-seed) + id)) + + +;;; Minor mode stuff + +;; XXX: `last-buffer-undo-list' is somehow needed in Carbon Emacs for MacOSX +(defvar last-buffer-undo-list nil) + +(defvar yas--minor-mode-menu nil + "Holds the YASnippet menu") + +(defun yas--init-minor-keymap () + (let ((map (make-sparse-keymap))) + (when yas-use-menu + (easy-menu-define yas--minor-mode-menu + map + "Menu used when `yas-minor-mode' is active." + '("YASnippet" + "----" + ["Expand trigger" yas-expand + :help "Possibly expand tab trigger before point"] + ["Insert at point..." yas-insert-snippet + :help "Prompt for an expandable snippet and expand it at point"] + ["New snippet..." yas-new-snippet + :help "Create a new snippet in an appropriate directory"] + ["Visit snippet file..." yas-visit-snippet-file + :help "Prompt for an expandable snippet and find its file"] + "----" + ("Snippet menu behaviour" + ["Visit snippets" (setq yas-visit-from-menu t) + :help "Visit snippets from the menu" + :active t :style radio :selected yas-visit-from-menu] + ["Expand snippets" (setq yas-visit-from-menu nil) + :help "Expand snippets from the menu" + :active t :style radio :selected (not yas-visit-from-menu)] + "----" + ["Show all known modes" (setq yas-use-menu 'full) + :help "Show one snippet submenu for each loaded table" + :active t :style radio :selected (eq yas-use-menu 'full)] + ["Abbreviate according to current mode" (setq yas-use-menu 'abbreviate) + :help "Show only snippet submenus for the current active modes" + :active t :style radio :selected (eq yas-use-menu 'abbreviate)]) + ("Indenting" + ["Auto" (setq yas-indent-line 'auto) + :help "Indent each line of the snippet with `indent-according-to-mode'" + :active t :style radio :selected (eq yas-indent-line 'auto)] + ["Fixed" (setq yas-indent-line 'fixed) + :help "Indent the snippet to the current column" + :active t :style radio :selected (eq yas-indent-line 'fixed)] + ["None" (setq yas-indent-line 'none) + :help "Don't apply any particular snippet indentation after expansion" + :active t :style radio :selected (not (member yas-indent-line '(fixed auto)))] + "----" + ["Also auto indent first line" (setq yas-also-auto-indent-first-line + (not yas-also-auto-indent-first-line)) + :help "When auto-indenting also, auto indent the first line menu" + :active (eq yas-indent-line 'auto) + :style toggle :selected yas-also-auto-indent-first-line] + ) + ("Prompting method" + ["System X-widget" (setq yas-prompt-functions + (cons 'yas-x-prompt + (remove 'yas-x-prompt + yas-prompt-functions))) + :help "Use your windowing system's (gtk, mac, windows, etc...) default menu" + :active t :style radio :selected (eq (car yas-prompt-functions) + 'yas-x-prompt)] + ["Dropdown-list" (setq yas-prompt-functions + (cons 'yas-dropdown-prompt + (remove 'yas-dropdown-prompt + yas-prompt-functions))) + :help "Use a special dropdown list" + :active t :style radio :selected (eq (car yas-prompt-functions) + 'yas-dropdown-prompt)] + ["Ido" (setq yas-prompt-functions + (cons 'yas-ido-prompt + (remove 'yas-ido-prompt + yas-prompt-functions))) + :help "Use an ido-style minibuffer prompt" + :active t :style radio :selected (eq (car yas-prompt-functions) + 'yas-ido-prompt)] + ["Completing read" (setq yas-prompt-functions + (cons 'yas-completing-prompt + (remove 'yas-completing-prompt + yas-prompt-functions))) + :help "Use a normal minibuffer prompt" + :active t :style radio :selected (eq (car yas-prompt-functions) + 'yas-completing-prompt)] + ) + ("Misc" + ["Wrap region in exit marker" + (setq yas-wrap-around-region + (not yas-wrap-around-region)) + :help "If non-nil automatically wrap the selected text in the $0 snippet exit" + :style toggle :selected yas-wrap-around-region] + ["Allow stacked expansions " + (setq yas-triggers-in-field + (not yas-triggers-in-field)) + :help "If non-nil allow snippets to be triggered inside other snippet fields" + :style toggle :selected yas-triggers-in-field] + ["Revive snippets on undo " + (setq yas-snippet-revival + (not yas-snippet-revival)) + :help "If non-nil allow snippets to become active again after undo" + :style toggle :selected yas-snippet-revival] + ["Good grace " + (setq yas-good-grace + (not yas-good-grace)) + :help "If non-nil don't raise errors in bad embedded eslip in snippets" + :style toggle :selected yas-good-grace] + ) + "----" + ["Load snippets..." yas-load-directory + :help "Load snippets from a specific directory"] + ["Reload everything" yas-reload-all + :help "Cleanup stuff, reload snippets, rebuild menus"] + ["About" yas-about + :help "Display some information about YASsnippet"]))) + + ;; Now for the stuff that has direct keybindings + ;; + (define-key map "\C-c&\C-s" 'yas-insert-snippet) + (define-key map "\C-c&\C-n" 'yas-new-snippet) + (define-key map "\C-c&\C-v" 'yas-visit-snippet-file) + map)) + +(defvar yas-minor-mode-map (yas--init-minor-keymap) + "The keymap used when `yas-minor-mode' is active.") + +(defun yas--trigger-key-reload (&optional unbind-key) + "Rebind `yas-expand' to the new value of `yas-trigger-key'. + +With optional UNBIND-KEY, try to unbind that key from +`yas-minor-mode-map'." + (when (and unbind-key + (stringp unbind-key) + (not (string= unbind-key ""))) + (define-key yas-minor-mode-map (read-kbd-macro unbind-key) nil)) + (when (and yas-trigger-key + (stringp yas-trigger-key) + (not (string= yas-trigger-key ""))) + (define-key yas-minor-mode-map (read-kbd-macro yas-trigger-key) 'yas-expand))) + +(defvar yas--tables (make-hash-table) + "A hash table of mode symbols to `yas--table' objects.") + +(defvar yas--parents (make-hash-table) + "A hash table of mode symbols do lists of direct parent mode symbols. + +This list is populated when reading the \".yas-parents\" files +found when traversing snippet directories with +`yas-load-directory'. + +There might be additionalal parenting information stored in the +`derived-mode-parent' property of some mode symbols, but that is +not recorded here.") + +(defvar yas--direct-keymaps (list) + "Keymap alist supporting direct snippet keybindings. + +This variable is is placed in `emulation-mode-map-alists'. + +Its elements looks like (TABLE-NAME . KEYMAP). They're +instantiated on `yas-reload-all' but KEYMAP is added to only when +loading snippets. `yas--direct-TABLE-NAME' is then a variable set +buffer-locally when entering `yas-minor-mode'. KEYMAP binds all +defined direct keybindings to the command +`yas-expand-from-keymap' which then which snippet to expand.") + +(defun yas-direct-keymaps-reload () + "Force reload the direct keybinding for active snippet tables." + (interactive) + (setq yas--direct-keymaps nil) + (maphash #'(lambda (name table) + (push (cons (intern (format "yas--direct-%s" name)) + (yas--table-direct-keymap table)) + yas--direct-keymaps)) + yas--tables)) + +(defun yas--modes-to-activate () + "Compute list of mode symbols that are active for `yas-expand' +and friends." + (let ((modes-to-activate (list major-mode)) + (mode major-mode)) + (while (setq mode (get mode 'derived-mode-parent)) + (push mode modes-to-activate)) + (dolist (mode (yas-extra-modes)) + (push mode modes-to-activate)) + (remove-duplicates + (append modes-to-activate + (mapcan #'(lambda (mode) + (yas--all-parents mode)) + modes-to-activate))))) + +(defvar yas-minor-mode-hook nil + "Hook run when yas-minor-mode is turned on") + +;;;###autoload +(define-minor-mode yas-minor-mode + "Toggle YASnippet mode. + +When YASnippet mode is enabled, the `yas-trigger-key' key expands +snippets of code depending on the major mode. + +With no argument, this command toggles the mode. +positive prefix argument turns on the mode. +Negative prefix argument turns off the mode. + +You can customize the key through `yas-trigger-key'. + +Key bindings: +\\{yas-minor-mode-map}" + nil + ;; The indicator for the mode line. + " yas" + :group 'yasnippet + (cond (yas-minor-mode + ;; Reload the trigger key + ;; + (yas--trigger-key-reload) + ;; Install the direct keymaps in `emulation-mode-map-alists' + ;; (we use `add-hook' even though it's not technically a hook, + ;; but it works). Then define variables named after modes to + ;; index `yas--direct-keymaps'. + ;; + ;; Also install the post-command-hook. + ;; + (add-hook 'emulation-mode-map-alists 'yas--direct-keymaps) + (add-hook 'post-command-hook 'yas--post-command-handler nil t) + ;; Set the `yas--direct-%s' vars for direct keymap expansion + ;; + (dolist (mode (yas--modes-to-activate)) + (let ((name (intern (format "yas--direct-%s" mode)))) + (set-default name nil) + (set (make-local-variable name) t))) + ;; Perform JIT loads + ;; + (yas--load-pending-jits)) + (t + ;; Uninstall the direct keymaps and the post-command hook + ;; + (remove-hook 'post-command-hook 'yas--post-command-handler t) + (remove-hook 'emulation-mode-map-alists 'yas--direct-keymaps)))) + +(defvar yas--dont-activate '(minibufferp) + "If non-nil don't let `yas-minor-mode-on' active yas for this buffer. + +If a function, then its result is used. + +If a list of functions, then all functions must return nil to +activate yas for this buffer. + +`yas-minor-mode-on' is usually called by `yas-global-mode' so +this effectively lets you define exceptions to the \"global\" +behaviour. Can also be a function of zero arguments.") +(make-variable-buffer-local 'yas--dont-activate) + +(defun yas-minor-mode-on () + "Turn on YASnippet minor mode. + +Do this unless `yas--dont-activate' is truish " + (interactive) + (unless (cond ((functionp yas--dont-activate) + (funcall yas--dont-activate)) + ((consp yas--dont-activate) + (some #'funcall yas--dont-activate)) + (yas--dont-activate)) + ;; Load all snippets definitions unless we still don't have a + ;; root-directory or some snippets have already been loaded. + ;; + (yas-minor-mode 1))) + +;;;###autoload +(define-globalized-minor-mode yas-global-mode yas-minor-mode yas-minor-mode-on + :group 'yasnippet + :require 'yasnippet) + +(defadvice yas-global-mode (before yas--reload-with-jit (arg) activate) + (cond ((and arg + (numberp arg) + (> arg 1)) + ;; explicitly enabling + (yas-reload-all)) + ((not yas-global-mode) + ;; toggling + (yas-reload-all)))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Major mode stuff +;; +(defvar yas--font-lock-keywords + (append '(("^#.*$" . font-lock-comment-face)) + lisp-font-lock-keywords + lisp-font-lock-keywords-1 + lisp-font-lock-keywords-2 + '(("$\\([0-9]+\\)" + (0 font-lock-keyword-face) + (1 font-lock-string-face t)) + ("${\\([0-9]+\\):?" + (0 font-lock-keyword-face) + (1 font-lock-warning-face t)) + ("${" font-lock-keyword-face) + ("$[0-9]+?" font-lock-preprocessor-face) + ("\\(\\$(\\)" 1 font-lock-preprocessor-face) + ("}" + (0 font-lock-keyword-face))))) + +(defun yas--init-major-keymap () + (let ((map (make-sparse-keymap))) + (easy-menu-define nil + map + "Menu used when snippet-mode is active." + (cons "Snippet" + (mapcar #'(lambda (ent) + (when (third ent) + (define-key map (third ent) (second ent))) + (vector (first ent) (second ent) t)) + (list + (list "Load this snippet" 'yas-load-snippet-buffer "\C-c\C-c") + (list "Try out this snippet" 'yas-tryout-snippet "\C-c\C-t"))))) + map)) + +(defvar snippet-mode-map + (yas--init-major-keymap) + "The keymap used when `snippet-mode' is active") + + +(define-derived-mode snippet-mode text-mode "Snippet" + "A mode for editing yasnippets" + (setq font-lock-defaults '(yas--font-lock-keywords)) + (set (make-local-variable 'require-final-newline) nil) + (set (make-local-variable 'comment-start) "#") + (set (make-local-variable 'comment-start-skip) "#+[\t ]*")) + + + +;;; Internal structs for template management + +(defstruct (yas--template (:constructor yas--make-blank-template)) + "A template for a snippet." + key + content + name + condition + expand-env + file + keybinding + uuid + menu-binding-pair + group ;; as dictated by the #group: directive or .yas-make-groups + perm-group ;; as dictated by `yas-define-menu' + table + ) + +(defun yas--populate-template (template &rest args) + "Helper function to populate a template with properties" + (let (p v) + (while args + (aset template + (position (intern (substring (symbol-name (car args)) 1)) + (mapcar #'car (get 'yas--template 'cl-struct-slots))) + (second args)) + (setq args (cddr args))) + template)) + +(defstruct (yas--table (:constructor yas--make-snippet-table (name))) + "A table to store snippets for a particular mode. + +Has the following fields: + +`yas--table-name' + + A symbol name normally corresponding to a major mode, but can + also be a pseudo major-mode to be referenced in + `yas-extra-modes', for example. + +`yas--table-hash' + + A hash table (KEY . NAMEHASH), known as the \"keyhash\". KEY is + a string or a vector, where the former is the snippet's trigger + and the latter means it's a direct keybinding. NAMEHASH is yet + another hash of (NAME . TEMPLATE) where NAME is the snippet's + name and TEMPLATE is a `yas--template' object. + +`yas--table-direct-keymap' + + A keymap for the snippets in this table that have direct + keybindings. This is kept in sync with the keyhash, i.e., all + the elements of the keyhash that are vectors appear here as + bindings to `yas-expand-from-keymap'. + +`yas--table-uuidhash' + + A hash table mapping snippets uuid's to the same `yas--template' + objects. A snippet uuid defaults to the snippet's name. +" + name + (hash (make-hash-table :test 'equal)) + (uuidhash (make-hash-table :test 'equal)) + (parents nil) + (direct-keymap (make-sparse-keymap))) + +(defun yas--get-template-by-uuid (mode uuid) + "Find the snippet template in MODE by its UUID." + (let* ((table (gethash mode yas--tables mode))) + (when table + (gethash uuid (yas--table-uuidhash table))))) + +;; Apropos storing/updating in TABLE, this works in two steps: +;; +;; 1. `yas--remove-template-by-uuid' removes any +;; keyhash-namehash-template mappings from TABLE, grabing the +;; snippet by its uuid. Also removes mappings from TABLE's +;; `yas--table-direct-keymap' (FIXME: and should probably take care +;; of potentially stale menu bindings right?.) +;; +;; 2. `yas--add-template' adds this all over again. +;; +;; Create a new or add to an existing keyhash-namehash mapping. +;; +;; For reference on understanding this, consider three snippet +;; definitions: +;; +;; A: # name: The Foo +;; # key: foo +;; # binding: C-c M-l +;; +;; B: # name: Mrs Foo +;; # key: foo +;; +;; C: # name: The Bar +;; # binding: C-c M-l +;; +;; D: # name: Baz +;; # key: baz +;; +;; keyhash namehashes(3) yas--template structs(4) +;; ----------------------------------------------------- +;; __________ +;; / \ +;; "foo" ---> "The Foo" ---> [yas--template A] | +;; "Mrs Foo" ---> [yas--template B] | +;; | +;; [C-c M-l] ---> "The Foo" -------------------------/ +;; "The Bar" ---> [yas--template C] +;; +;; "baz" ---> "Baz" ---> [yas--template D] +;; +;; Additionally, since uuid defaults to the name, we have a +;; `yas--table-uuidhash' for TABLE +;; +;; uuidhash yas--template structs +;; ------------------------------- +;; "The Foo" ---> [yas--template A] +;; "Mrs Foo" ---> [yas--template B] +;; "The Bar" ---> [yas--template C] +;; "Baz" ---> [yas--template D] +;; +;; FIXME: the more I look at this data-structure the more I think I'm +;; stupid. There has to be an easier way (but beware lots of code +;; depends on this). +;; +(defun yas--remove-template-by-uuid (table uuid) + "Remove from TABLE a template identified by UUID." + (let ((template (gethash uuid (yas--table-uuidhash table)))) + (when template + (let* ((name (yas--template-name template)) + (empty-keys nil)) + ;; Remove the name from each of the targeted namehashes + ;; + (maphash #'(lambda (k v) + (let ((template (gethash name v))) + (when (and template + (eq uuid (yas--template-uuid template))) + (remhash name v) + (when (zerop (hash-table-count v)) + (push k empty-keys))))) + (yas--table-hash table)) + ;; Remove the namehash themselves if they've become empty + ;; + (dolist (key empty-keys) + (when (vectorp key) + (define-key (yas--table-direct-keymap table) key nil)) + (remhash key (yas--table-hash table))) + + ;; Finally, remove the uuid from the uuidhash + ;; + (remhash uuid (yas--table-uuidhash table)))))) + +(defun yas--add-template (table template) + "Store in TABLE the snippet template TEMPLATE. + +KEY can be a string (trigger key) of a vector (direct +keybinding)." + (let ((name (yas--template-name template)) + (key (yas--template-key template)) + (keybinding (yas--template-keybinding template)) + (menu-binding-pair (yas--template-menu-binding-pair-get-create template))) + (dolist (k (remove nil (list key keybinding))) + (puthash name + template + (or (gethash k + (yas--table-hash table)) + (puthash k + (make-hash-table :test 'equal) + (yas--table-hash table)))) + (when (vectorp k) + (define-key (yas--table-direct-keymap table) k 'yas-expand-from-keymap))) + + ;; Update TABLE's `yas--table-uuidhash' + (puthash (yas--template-uuid template) + template + (yas--table-uuidhash table)))) + +(defun yas--update-template (table template) + "Add or update TEMPLATE in TABLE. + +Also takes care of adding and updating to the associated menu." + ;; Remove from table by uuid + ;; + (yas--remove-template-by-uuid table (yas--template-uuid template)) + ;; Add to table again + ;; + (yas--add-template table template) + ;; Take care of the menu + ;; + (when yas-use-menu + (yas--update-template-menu table template))) + +(defun yas--update-template-menu (table template) + "Update every menu-related for TEMPLATE" + (let ((menu-binding-pair (yas--template-menu-binding-pair-get-create template)) + (key (yas--template-key template)) + (keybinding (yas--template-keybinding template))) + ;; The snippet might have changed name or keys, so update + ;; user-visible strings + ;; + (unless (eq (cdr menu-binding-pair) :none) + ;; the menu item name + ;; + (setf (cadar menu-binding-pair) (yas--template-name template)) + ;; the :keys information (also visible to the user) + (setf (getf (cdr (car menu-binding-pair)) :keys) + (or (and keybinding (key-description keybinding)) + (and key (concat key yas-trigger-symbol)))))) + (unless (yas--template-menu-managed-by-yas-define-menu template) + (let ((menu-keymap + (yas--menu-keymap-get-create (yas--table-mode table) + (mapcar #'yas--table-mode + (yas--table-parents table)))) + (group (yas--template-group template))) + ;; Remove from menu keymap + ;; + (assert menu-keymap) + (yas--delete-from-keymap menu-keymap (yas--template-uuid template)) + + ;; Add necessary subgroups as necessary. + ;; + (dolist (subgroup group) + (let ((subgroup-keymap (lookup-key menu-keymap (vector (make-symbol subgroup))))) + (unless (and subgroup-keymap + (keymapp subgroup-keymap)) + (setq subgroup-keymap (make-sparse-keymap)) + (define-key menu-keymap (vector (make-symbol subgroup)) + `(menu-item ,subgroup ,subgroup-keymap))) + (setq menu-keymap subgroup-keymap))) + + ;; Add this entry to the keymap + ;; + (define-key menu-keymap + (vector (make-symbol (yas--template-uuid template))) + (car (yas--template-menu-binding-pair template)))))) + +(defun yas--namehash-templates-alist (namehash) + (let (alist) + (maphash #'(lambda (k v) + (push (cons k v) alist)) + namehash) + alist)) + +(defun yas--fetch (table key) + "Fetch templates in TABLE by KEY. + +Return a list of cons (NAME . TEMPLATE) where NAME is a +string and TEMPLATE is a `yas--template' structure." + (let* ((keyhash (yas--table-hash table)) + (namehash (and keyhash (gethash key keyhash)))) + (when namehash + (yas--filter-templates-by-condition (yas--namehash-templates-alist namehash))))) + + +;;; Filtering/condition logic + +(defun yas--eval-condition (condition) + (condition-case err + (save-excursion + (save-restriction + (save-match-data + (eval condition)))) + (error (progn + (yas--message 1 "Error in condition evaluation: %s" (error-message-string err)) + nil)))) + + +(defun yas--filter-templates-by-condition (templates) + "Filter the templates using the applicable condition. + +TEMPLATES is a list of cons (NAME . TEMPLATE) where NAME is a +string and TEMPLATE is a `yas--template' structure. + +This function implements the rules described in +`yas-buffer-local-condition'. See that variables documentation." + (let ((requirement (yas--require-template-specific-condition-p))) + (if (eq requirement 'always) + templates + (remove-if-not #'(lambda (pair) + (yas--template-can-expand-p + (yas--template-condition (cdr pair)) requirement)) + templates)))) + +(defun yas--require-template-specific-condition-p () + "Decides if this buffer requests/requires snippet-specific +conditions to filter out potential expansions." + (if (eq 'always yas-buffer-local-condition) + 'always + (let ((local-condition (or (and (consp yas-buffer-local-condition) + (yas--eval-condition yas-buffer-local-condition)) + yas-buffer-local-condition))) + (when local-condition + (if (eq local-condition t) + t + (and (consp local-condition) + (eq 'require-snippet-condition (car local-condition)) + (symbolp (cdr local-condition)) + (cdr local-condition))))))) + +(defun yas--template-can-expand-p (condition requirement) + "Evaluates CONDITION and REQUIREMENT and returns a boolean" + (let* ((result (or (null condition) + (yas--eval-condition condition)))) + (cond ((eq requirement t) + result) + (t + (eq requirement result))))) + +(defun yas--all-parents (mode) + "Returns a list of all parent modes of MODE" + (let ((parents (gethash mode yas--parents))) + (append parents + (mapcan #'yas--all-parents parents)))) + +(defun yas--table-templates (table) + (when table + (let ((acc (list))) + (maphash #'(lambda (key namehash) + (maphash #'(lambda (name template) + (push (cons name template) acc)) + namehash)) + (yas--table-hash table)) + (yas--filter-templates-by-condition acc)))) + +(defun yas--current-key () + "Get the key under current position. A key is used to find +the template of a snippet in the current snippet-table." + (let ((start (point)) + (end (point)) + (syntaxes yas-key-syntaxes) + syntax + done + templates) + (while (and (not done) syntaxes) + (setq syntax (car syntaxes)) + (setq syntaxes (cdr syntaxes)) + (save-excursion + (skip-syntax-backward syntax) + (setq start (point))) + (setq templates + (mapcan #'(lambda (table) + (yas--fetch table (buffer-substring-no-properties start end))) + (yas--get-snippet-tables))) + (if templates + (setq done t) + (setq start end))) + (list templates + start + end))) + + +(defun yas--table-all-keys (table) + (when table + (let ((acc)) + (maphash #'(lambda (key namehash) + (when (yas--filter-templates-by-condition (yas--namehash-templates-alist namehash)) + (push key acc))) + (yas--table-hash table)) + acc))) + +(defun yas--table-mode (table) + (intern (yas--table-name table))) + + +;;; Internal functions: + +(defun yas--real-mode? (mode) + "Try to find out if MODE is a real mode. The MODE bound to +a function (like `c-mode') is considered real mode. Other well +known mode like `ruby-mode' which is not part of Emacs might +not bound to a function until it is loaded. So yasnippet keeps +a list of modes like this to help the judgement." + (or (fboundp mode) + (find mode yas--known-modes))) + +(defun yas--eval-lisp (form) + "Evaluate FORM and convert the result to string." + (let ((retval (catch 'yas--exception + (condition-case err + (save-excursion + (save-restriction + (save-match-data + (widen) + (let ((result (eval form))) + (when result + (format "%s" result)))))) + (error (if yas-good-grace + (yas--format "elisp error! %s" (error-message-string err)) + (error (yas--format "elisp error: %s" + (error-message-string err))))))))) + (when (and (consp retval) + (eq 'yas--exception (car retval))) + (error (cdr retval))) + retval)) + +(defun yas--eval-lisp-no-saves (form) + (condition-case err + (eval form) + (error (if yas-good-grace + (yas--format "elisp error! %s" (error-message-string err)) + (error (yas--format "elisp error: %s" + (error-message-string err))))))) + +(defun yas--read-lisp (string &optional nil-on-error) + "Read STRING as a elisp expression and return it. + +In case STRING in an invalid expression and NIL-ON-ERROR is nil, +return an expression that when evaluated will issue an error." + (condition-case err + (read string) + (error (and (not nil-on-error) + `(error (error-message-string ,err)))))) + +(defun yas--read-keybinding (keybinding) + "Read KEYBINDING as a snippet keybinding, return a vector." + (when (and keybinding + (not (string-match "keybinding" keybinding))) + (condition-case err + (let ((res (or (and (string-match "^\\[.*\\]$" keybinding) + (read keybinding)) + (read-kbd-macro keybinding 'need-vector)))) + res) + (error + (yas--message 3 "warning: keybinding \"%s\" invalid since %s." + keybinding (error-message-string err)) + nil)))) + +(defvar yas-extra-modes nil + "If non-nil, also lookup snippets for this/these modes. + +Can be a symbol or a list of symbols. + +This variable probably makes more sense as buffer-local, so +ensure your use `make-local-variable' when you set it.") +(defun yas-extra-modes () + (if (listp yas-extra-modes) yas-extra-modes (list yas-extra-modes))) +(defvaralias 'yas/mode-symbol 'yas-extra-modes) + +(defun yas--table-get-create (mode) + "Get or create the snippet table corresponding to MODE." + (let ((table (gethash mode + yas--tables))) + (unless table + (setq table (yas--make-snippet-table (symbol-name mode))) + (puthash mode table yas--tables) + (push (cons (intern (format "yas--direct-%s" mode)) + (yas--table-direct-keymap table)) + yas--direct-keymaps)) + table)) + +(defun yas--get-snippet-tables () + "Get snippet tables for current buffer. + +Return a list of `yas--table' objects. The list of modes to +consider is returned by `yas--modes-to-activate'" + (remove nil + (mapcar #'(lambda (mode-name) + (gethash mode-name yas--tables)) + (yas--modes-to-activate)))) + +(defun yas--menu-keymap-get-create (mode &optional parents) + "Get or create the menu keymap for MODE and its PARENTS. + +This may very well create a plethora of menu keymaps and arrange +them all in `yas--menu-table'" + (let* ((menu-keymap (or (gethash mode yas--menu-table) + (puthash mode (make-sparse-keymap) yas--menu-table)))) + (mapc #'yas--menu-keymap-get-create parents) + (define-key yas--minor-mode-menu (vector mode) + `(menu-item ,(symbol-name mode) ,menu-keymap + :visible (yas--show-menu-p ',mode))) + menu-keymap)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; Template-related and snippet loading functions + +(defun yas--parse-template (&optional file) + "Parse the template in the current buffer. + +Optional FILE is the absolute file name of the file being +parsed. + +Optional GROUP is the group where the template is to go, +otherwise we attempt to calculate it from FILE. + +Return a snippet-definition, i.e. a list + + (KEY TEMPLATE NAME CONDITION GROUP VARS FILE KEYBINDING UUID) + +If the buffer contains a line of \"# --\" then the contents above +this line are ignored. Directives can set most of these with the syntax: + +# directive-name : directive-value + +Here's a list of currently recognized directives: + + * type + * name + * contributor + * condition + * group + * key + * expand-env + * binding + * uuid" + (goto-char (point-min)) + (let* ((type 'snippet) + (name (and file + (file-name-nondirectory file))) + (key nil) + template + bound + condition + (group (and file + (yas--calculate-group file))) + expand-env + binding + uuid) + (if (re-search-forward "^# --\n" nil t) + (progn (setq template + (buffer-substring-no-properties (point) + (point-max))) + (setq bound (point)) + (goto-char (point-min)) + (while (re-search-forward "^# *\\([^ ]+?\\) *: *\\(.*\\)$" bound t) + (when (string= "uuid" (match-string-no-properties 1)) + (setq uuid (match-string-no-properties 2))) + (when (string= "type" (match-string-no-properties 1)) + (setq type (if (string= "command" (match-string-no-properties 2)) + 'command + 'snippet))) + (when (string= "key" (match-string-no-properties 1)) + (setq key (match-string-no-properties 2))) + (when (string= "name" (match-string-no-properties 1)) + (setq name (match-string-no-properties 2))) + (when (string= "condition" (match-string-no-properties 1)) + (setq condition (yas--read-lisp (match-string-no-properties 2)))) + (when (string= "group" (match-string-no-properties 1)) + (setq group (match-string-no-properties 2))) + (when (string= "expand-env" (match-string-no-properties 1)) + (setq expand-env (yas--read-lisp (match-string-no-properties 2) + 'nil-on-error))) + (when (string= "binding" (match-string-no-properties 1)) + (setq binding (match-string-no-properties 2))))) + (setq template + (buffer-substring-no-properties (point-min) (point-max)))) + (unless (or key binding) + (setq key (and file (file-name-nondirectory file)))) + (when (eq type 'command) + (setq template (yas--read-lisp (concat "(progn" template ")")))) + (when group + (setq group (split-string group "\\."))) + (list key template name condition group expand-env file binding uuid))) + +(defun yas--calculate-group (file) + "Calculate the group for snippet file path FILE." + (let* ((dominating-dir (locate-dominating-file file + ".yas-make-groups")) + (extra-path (and dominating-dir + (replace-regexp-in-string (concat "^" + (expand-file-name dominating-dir)) + "" + (expand-file-name file)))) + (extra-dir (and extra-path + (file-name-directory extra-path))) + (group (and extra-dir + (replace-regexp-in-string "/" + "." + (directory-file-name extra-dir))))) + group)) + +(defun yas--subdirs (directory &optional filep) + "Return subdirs or files of DIRECTORY according to FILEP." + (remove-if (lambda (file) + (or (string-match "^\\." + (file-name-nondirectory file)) + (string-match "^#.*#$" + (file-name-nondirectory file)) + (string-match "~$" + (file-name-nondirectory file)) + (if filep + (file-directory-p file) + (not (file-directory-p file))))) + (directory-files directory t))) + +(defun yas--make-menu-binding (template) + (let ((mode (yas--table-mode (yas--template-table template)))) + `(lambda () (interactive) (yas--expand-or-visit-from-menu ',mode ,(yas--template-uuid template))))) + +(defun yas--expand-or-visit-from-menu (mode uuid) + (let* ((table (yas--table-get-create mode)) + (yas--current-template (and table + (gethash uuid (yas--table-uuidhash table))))) + (when yas--current-template + (if yas-visit-from-menu + (yas--visit-snippet-file-1 yas--current-template) + (let ((where (if (region-active-p) + (cons (region-beginning) (region-end)) + (cons (point) (point))))) + (yas-expand-snippet (yas--template-content yas--current-template) + (car where) + (cdr where) + (yas--template-expand-env yas--current-template))))))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Popping up for keys and templates +;; +(defvar yas--x-pretty-prompt-templates nil + "If non-nil, attempt to prompt for templates like TextMate.") + + +(defun yas--prompt-for-template (templates &optional prompt) + "Interactively choose a template from the list TEMPLATES. + +TEMPLATES is a list of `yas--template'." + (when templates + (setq templates + (sort templates #'(lambda (t1 t2) + (< (length (yas--template-name t1)) + (length (yas--template-name t2)))))) + (if yas--x-pretty-prompt-templates + (yas--x-pretty-prompt-templates "Choose a snippet" templates) + (some #'(lambda (fn) + (funcall fn (or prompt "Choose a snippet: ") + templates + #'yas--template-name)) + yas-prompt-functions)))) + +(defun yas--prompt-for-keys (keys &optional prompt) + "Interactively choose a template key from the list KEYS." + (when keys + (some #'(lambda (fn) + (funcall fn (or prompt "Choose a snippet key: ") keys)) + yas-prompt-functions))) + +(defun yas--prompt-for-table (tables &optional prompt) + (when tables + (some #'(lambda (fn) + (funcall fn (or prompt "Choose a snippet table: ") + tables + #'yas--table-name)) + yas-prompt-functions))) + +(defun yas-x-prompt (prompt choices &optional display-fn) + "Display choices in a x-window prompt." + ;; FIXME: HACK: if we notice that one of the objects in choices is + ;; actually a `yas--template', defer to `yas--x-prompt-pretty-templates' + ;; + ;; This would be better implemented by passing CHOICES as a + ;; strucutred tree rather than a list. Modifications would go as far + ;; up as `yas--all-templates' I think. + ;; + (when (and window-system choices) + (let ((chosen + (let (menu d) ;; d for display + (dolist (c choices) + (setq d (or (and display-fn (funcall display-fn c)) + c)) + (cond ((stringp d) + (push (cons (concat " " d) c) menu)) + ((listp d) + (push (car d) menu)))) + (setq menu (list prompt (push "title" menu))) + (x-popup-menu (if (fboundp 'posn-at-point) + (let ((x-y (posn-x-y (posn-at-point (point))))) + (list (list (+ (car x-y) 10) + (+ (cdr x-y) 20)) + (selected-window))) + t) + menu)))) + (or chosen + (keyboard-quit))))) + +(defun yas--x-pretty-prompt-templates (prompt templates) + "Display TEMPLATES, grouping neatly by table name." + (let ((organized (make-hash-table :test #'equal)) + menu + more-than-one-table + prefix) + (dolist (tl templates) + (puthash (yas--template-table tl) + (cons tl + (gethash (yas--template-table tl) organized)) + organized)) + (setq more-than-one-table (> (hash-table-count organized) 1)) + (setq prefix (if more-than-one-table + " " "")) + (if more-than-one-table + (maphash #'(lambda (table templates) + (push (yas--table-name table) menu) + (dolist (tl templates) + (push (cons (concat prefix (yas--template-name tl)) tl) menu))) organized) + (setq menu (mapcar #'(lambda (tl) (cons (concat prefix (yas--template-name tl)) tl)) templates))) + + (setq menu (nreverse menu)) + (or (x-popup-menu (if (fboundp 'posn-at-point) + (let ((x-y (posn-x-y (posn-at-point (point))))) + (list (list (+ (car x-y) 10) + (+ (cdr x-y) 20)) + (selected-window))) + t) + (list prompt (push "title" menu))) + (keyboard-quit)))) + +(defun yas-ido-prompt (prompt choices &optional display-fn) + (when (and (fboundp 'ido-completing-read) + (or (>= emacs-major-version 24) + ido-mode)) + (yas-completing-prompt prompt choices display-fn #'ido-completing-read))) + +(eval-when-compile (require 'dropdown-list nil t)) +(defun yas-dropdown-prompt (prompt choices &optional display-fn) + (when (featurep 'dropdown-list) + (let (formatted-choices + filtered-choices + d + n) + (dolist (choice choices) + (setq d (or (and display-fn (funcall display-fn choice)) + choice)) + (when (stringp d) + (push d formatted-choices) + (push choice filtered-choices))) + + (setq n (and formatted-choices (dropdown-list formatted-choices))) + (if n + (nth n filtered-choices) + (keyboard-quit))))) + +(defun yas-completing-prompt (prompt choices &optional display-fn completion-fn) + (let (formatted-choices + filtered-choices + chosen + d + (completion-fn (or completion-fn + #'completing-read))) + (dolist (choice choices) + (setq d (or (and display-fn (funcall display-fn choice)) + choice)) + (when (stringp d) + (push d formatted-choices) + (push choice filtered-choices))) + (setq chosen (and formatted-choices + (funcall completion-fn prompt + formatted-choices + nil + 'require-match + nil + nil))) + (let ((position (or (and chosen + (position chosen formatted-choices :test #'string=)) + 0))) + (nth position filtered-choices)))) + +(defun yas-no-prompt (prompt choices &optional display-fn) + (first choices)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Loading snippets from files +;; +(defun yas--load-yas-setup-file (file) + (load file 'noerror)) + +(defun yas-load-directory (top-level-dir &optional use-jit) + "Load snippets in directory hierarchy TOP-LEVEL-DIR. + +Below TOP-LEVEL-DIR each directory should be a mode name. + +Optional USE-JIT use jit-loading of snippets." + (interactive "DSelect the root directory: ") + (unless yas-snippet-dirs + (setq yas-snippet-dirs top-level-dir)) + (dolist (dir (yas--subdirs top-level-dir)) + (let* ((major-mode-and-parents (yas--compute-major-mode-and-parents + (concat dir "/dummy"))) + (mode-sym (car major-mode-and-parents)) + (parents (cdr major-mode-and-parents))) + ;; Attention: The parents and the menus are already defined + ;; here, even if the snippets are later jit-loaded. + ;; + ;; * We need to know the parents at this point since entering a + ;; given mode should jit load for its parents + ;; immediately. This could be reviewed, the parents could be + ;; discovered just-in-time-as well + ;; + ;; * We need to create the menus here to support the `full' + ;; option to `yas-use-menu' (all known snippet menus are shown to the user) + ;; + (yas--define-parents mode-sym parents) + (yas--menu-keymap-get-create mode-sym) + (let ((form `(yas--load-directory-1 ,dir + ',mode-sym + ',parents))) + (if use-jit + (yas--schedule-jit mode-sym form) + (eval form))))) + (when (interactive-p) + (yas--message 3 "Loaded snippets from %s." top-level-dir))) + +(defun yas--load-directory-1 (directory mode-sym parents &optional no-compiled-snippets) + "Recursively load snippet templates from DIRECTORY." + (unless (file-exists-p (concat directory "/" ".yas-skip")) + (if (and (not no-compiled-snippets) + (progn (yas--message 2 "Loading compiled snippets from %s" directory) t) + (load (expand-file-name ".yas-compiled-snippets" directory) 'noerror (<= yas-verbosity 3))) + (yas--message 2 "Loading snippet files from %s" directory) + (yas--load-directory-2 directory mode-sym)))) + +(defun yas--load-directory-2 (directory mode-sym) + ;; Load .yas-setup.el files wherever we find them + ;; + (yas--load-yas-setup-file (expand-file-name ".yas-setup" directory)) + (let* ((default-directory directory) + (snippet-defs nil)) + ;; load the snippet files + ;; + (with-temp-buffer + (dolist (file (yas--subdirs directory 'no-subdirs-just-files)) + (when (file-readable-p file) + (insert-file-contents file nil nil nil t) + (push (yas--parse-template file) + snippet-defs)))) + (when snippet-defs + (yas-define-snippets mode-sym + snippet-defs)) + ;; now recurse to a lower level + ;; + (dolist (subdir (yas--subdirs directory)) + (yas--load-directory-2 subdir + mode-sym)))) + +(defun yas--load-snippet-dirs (&optional nojit) + "Reload the directories listed in `yas-snippet-dirs' or + prompt the user to select one." + (let (errors) + (if yas-snippet-dirs + (dolist (directory (reverse (yas-snippet-dirs))) + (cond ((file-directory-p directory) + (yas-load-directory directory (not nojit)) + (if nojit + (yas--message 3 "Loaded %s" directory) + (yas--message 3 "Prepared just-in-time loading for %s" directory))) + (t + (push (yas--message 0 "Check your `yas-snippet-dirs': %s is not a directory" directory) errors)))) + (call-interactively 'yas-load-directory)) + errors)) + +(defun yas-reload-all (&optional interactive) + "Reload all snippets and rebuild the YASnippet menu. + +When called interactively force immediate reload of all known +snippets under `yas-snippet-dirs', otherwise use just-in-time +loading." + (interactive "p") + (catch 'abort + (let ((errors) + (snippet-editing-buffers + (remove-if-not #'(lambda (buffer) + (with-current-buffer buffer yas--editing-template)) + (buffer-list)))) + ;; Warn if there are buffers visiting snippets, since reloading will break + ;; any on-line editing of those buffers. + ;; + (when snippet-editing-buffers + (if interactive + (if (y-or-n-p "Some buffers editing live snippets, close them and proceed with reload?") + (mapc #'kill-buffer snippet-editing-buffers) + (yas--message 1 "Aborted reload...") + (throw 'abort nil)) + ;; in a non-interactive use, at least set + ;; `yas--editing-template' to nil, make it guess it next time around + (mapc #'(lambda (buffer) (setq yas--editing-template nil)) (buffer-list)))) + + ;; Empty all snippet tables, parenting info and all menu tables + ;; + (setq yas--tables (make-hash-table)) + (setq yas--parents (make-hash-table)) + (setq yas--menu-table (make-hash-table)) + + ;; Cancel all pending 'yas--scheduled-jit-loads' + ;; + (setq yas--scheduled-jit-loads (make-hash-table)) + + ;; Init the `yas-minor-mode-map', taking care not to break the + ;; menu.... + ;; + (setcdr yas-minor-mode-map (cdr (yas--init-minor-keymap))) + + ;; Reload the directories listed in `yas-snippet-dirs' or prompt + ;; the user to select one. + ;; + (setq errors (yas--load-snippet-dirs interactive)) + ;; Reload the direct keybindings + ;; + (yas-direct-keymaps-reload) + ;; Reload the trigger-key (shoudn't be needed, but see issue #237) + ;; + (yas--trigger-key-reload) + + (yas--message 3 "Reloaded everything%s...%s." + (if interactive "" " (snippets will load just-in-time)") + (if errors " (some errors, check *Messages*)" ""))))) + +(defun yas--load-pending-jits () + (when yas-minor-mode + (dolist (mode (yas--modes-to-activate)) + (let ((forms (gethash mode yas--scheduled-jit-loads))) + (dolist (form forms) + (yas--message 3 "Loading for `%s', just-in-time: %s!" mode form) + (eval form)) + (remhash mode yas--scheduled-jit-loads))))) + +;; (when (<= emacs-major-version 22) +;; (add-hook 'after-change-major-mode-hook 'yas--load-pending-jits)) + +(defun yas--quote-string (string) + "Escape and quote STRING. +foo\"bar\\! -> \"foo\\\"bar\\\\!\"" + (concat "\"" + (replace-regexp-in-string "[\\\"]" + "\\\\\\&" + string + t) + "\"")) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; Snippet compilation function + +(defun yas--initialize () + "For backward compatibility, enable `yas-minor-mode' globally" + (yas-global-mode 1)) + +(defun yas-compile-directory (top-level-dir) + "Create .yas-compiled-snippets.el files under subdirs of TOP-LEVEL-DIR. + +This works by stubbing a few functions, then calling +`yas-load-directory'." + (interactive "DTop level snippet directory?") + (flet ((yas--load-yas-setup-file + (file) + (let ((elfile (concat file ".el"))) + (when (file-exists-p elfile) + (insert ";;; .yas-setup.el support file if any:\n;;;\n") + (insert-file-contents elfile) + (end-of-buffer) + ))) + (yas-define-snippets + (mode snippets) + (insert ";;; Snippet definitions:\n;;;\n") + (let ((literal-snippets (list)) + (print-length nil)) + (dolist (snippet snippets) + (let ((key (first snippet)) + (template-content (second snippet)) + (name (third snippet)) + (condition (fourth snippet)) + (group (fifth snippet)) + (expand-env (sixth snippet)) + (file nil) ;; (seventh snippet)) ;; omit on purpose + (binding (eighth snippet)) + (uuid (ninth snippet))) + (push `(,key + ,template-content + ,name + ,condition + ,group + ,expand-env + ,file + ,binding + ,uuid) + literal-snippets))) + (insert (pp-to-string `(yas-define-snippets ',mode ',literal-snippets))) + (insert "\n\n"))) + (yas--load-directory-1 + (dir mode parents &rest ignore) + (let ((output-file (concat (file-name-as-directory dir) ".yas-compiled-snippets.el"))) + (with-temp-file output-file + (insert (format ";;; Compiled snippets and support files for `%s'\n" mode)) + (yas--load-directory-2 dir mode) + (insert (format ";;; Do not edit! File generated at %s\n" (current-time-string))))))) + (yas-load-directory top-level-dir nil))) + +(defun yas-recompile-all () + "Compile every dir in `yas-snippet-dirs'." + (interactive) + (mapc #'yas-compile-directory (yas-snippet-dirs))) + + +;;; JIT loading +;;; + +(defvar yas--scheduled-jit-loads (make-hash-table) + "Alist of mode-symbols to forms to be evaled when `yas-minor-mode' kicks in.") + +(defun yas--schedule-jit (mode form) + (puthash mode + (cons form + (gethash mode yas--scheduled-jit-loads)) + yas--scheduled-jit-loads)) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; Some user level functions +;;; + +(defun yas-about () + (interactive) + (message (concat "yasnippet (version " + yas--version + ") -- pluskid /joaotavora "))) + +(defun yas--define-parents (mode parents) + "Add PARENTS to the list of MODE's parents" + (puthash mode (remove-duplicates + (append parents + (gethash mode yas--parents))) + yas--parents)) + +(defun yas-define-snippets (mode snippets) + "Define SNIPPETS for MODE. + +SNIPPETS is a list of snippet definitions, each taking the +following form + + (KEY TEMPLATE NAME CONDITION GROUP EXPAND-ENV FILE KEYBINDING UUID) + +Within these, only KEY and TEMPLATE are actually mandatory. + +TEMPLATE might be a lisp form or a string, depending on whether +this is a snippet or a snippet-command. + +CONDITION, EXPAND-ENV and KEYBINDING are lisp forms, they have +been `yas--read-lisp'-ed and will eventually be +`yas--eval-lisp'-ed. + +The remaining elements are strings. + +FILE is probably of very little use if you're programatically +defining snippets. + +UUID is the snippets \"unique-id\". Loading a second snippet file +with the same uuid replaced the previous snippet. + +You can use `yas--parse-template' to return such lists based on +the current buffers contents." + (let ((snippet-table (yas--table-get-create mode)) + (template nil)) + (dolist (snippet snippets) + (setq template (yas-define-snippets-1 snippet + snippet-table))) + template)) + +(defun yas-define-snippets-1 (snippet snippet-table) + "Helper for `yas-define-snippets'." + ;; X) Calculate some more defaults on the values returned by + ;; `yas--parse-template'. + ;; + (let* ((file (seventh snippet)) + (key (car snippet)) + (name (or (third snippet) + (and file + (file-name-directory file)))) + (condition (fourth snippet)) + (group (fifth snippet)) + (keybinding (yas--read-keybinding (eighth snippet))) + (uuid (or (ninth snippet) + name)) + (template (or (gethash uuid (yas--table-uuidhash snippet-table)) + (yas--make-blank-template)))) + ;; X) populate the template object + ;; + (yas--populate-template template + :table snippet-table + :key key + :content (second snippet) + :name (or name key) + :group group + :condition condition + :expand-env (sixth snippet) + :file (seventh snippet) + :keybinding keybinding + :uuid uuid) + ;; X) Update this template in the appropriate table. This step + ;; also will take care of adding the key indicators in the + ;; templates menu entry, if any + ;; + (yas--update-template snippet-table template) + ;; X) Return the template + ;; + ;; + template)) + + +;;; Apropos snippet menu: +;; +;; The snippet menu keymaps are store by mode in hash table called +;; `yas--menu-table'. They are linked to the main menu in +;; `yas--menu-keymap-get-create' and are initially created empty, +;; reflecting the table hierarchy. +;; +;; They can be populated in two mutually exclusive ways: (1) by +;; reading `yas--template-group', which in turn is populated by the "# +;; group:" directives of the snippets or the ".yas-make-groups" file +;; or (2) by using a separate `yas-define-menu' call, which declares a +;; menu structure based on snippets uuids. +;; +;; Both situations are handled in `yas--update-template-menu', which +;; uses the predicate `yas--template-menu-managed-by-yas-define-menu' +;; that can tell between the two situations. +;; +;; Note: +;; +;; * if `yas-define-menu' is used it must run before +;; `yas-define-snippets' and the UUIDS must match, otherwise we get +;; duplicate entries. The `yas--template' objects are created in +;; `yas-define-menu', holding nothing but the menu entry, +;; represented by a pair of ((menu-item NAME :keys KEYS) TYPE) and +;; stored in `yas--template-menu-binding-pair'. The (menu-item ...) +;; part is then stored in the menu keymap itself which make the item +;; appear to the user. These limitations could probably be revised. +;; +;; * The `yas--template-perm-group' slot is only used in +;; `yas-describe-tables'. +;; +(defun yas--template-menu-binding-pair-get-create (template &optional type) + "Get TEMPLATE's menu binding or assign it a new one. + +TYPE may be `:stay', signalling this menu binding should be +static in the menu." + (or (yas--template-menu-binding-pair template) + (let ((key (yas--template-key template)) + (keybinding (yas--template-keybinding template))) + (setf (yas--template-menu-binding-pair template) + (cons `(menu-item ,(or (yas--template-name template) + (yas--template-uuid template)) + ,(yas--make-menu-binding template) + :keys ,nil) + type))))) +(defun yas--template-menu-managed-by-yas-define-menu (template) + "Non-nil if TEMPLATE's menu entry was included in a `yas-define-menu' call." + (cdr (yas--template-menu-binding-pair template))) + + +(defun yas--show-menu-p (mode) + (cond ((eq yas-use-menu 'abbreviate) + (find mode + (mapcar #'(lambda (table) + (yas--table-mode table)) + (yas--get-snippet-tables)))) + ((eq yas-use-menu 'full) + t) + ((eq yas-use-menu t) + t))) + +(defun yas--delete-from-keymap (keymap uuid) + "Recursively delete items with UUID from KEYMAP and its submenus." + + ;; XXX: This used to skip any submenus named \"parent mode\" + ;; + ;; First of all, recursively enter submenus, i.e. the tree is + ;; searched depth first so that stale submenus can be found in the + ;; higher passes. + ;; + (mapc #'(lambda (item) + (when (and (listp (cdr item)) + (keymapp (third (cdr item)))) + (yas--delete-from-keymap (third (cdr item)) uuid))) + (rest keymap)) + ;; Set the uuid entry to nil + ;; + (define-key keymap (vector (make-symbol uuid)) nil) + ;; Destructively modify keymap + ;; + (setcdr keymap (delete-if #'(lambda (item) + (or (null (cdr item)) + (and (keymapp (third (cdr item))) + (null (cdr (third (cdr item))))))) + (rest keymap)))) + +(defun yas-define-menu (mode menu &optional omit-items) + "Define a snippet menu for MODE according to MENU, ommitting OMIT-ITEMS. + +MENU is a list, its elements can be: + +- (yas-item UUID) : Creates an entry the snippet identified with + UUID. The menu entry for a snippet thus identified is + permanent, i.e. it will never move (be reordered) in the menu. + +- (yas-separator) : Creates a separator + +- (yas-submenu NAME SUBMENU) : Creates a submenu with NAME, + SUBMENU has the same form as MENU. NAME is also added to the + list of groups of the snippets defined thereafter. + +OMIT-ITEMS is a list of snippet uuid's that will always be +ommited from MODE's menu, even if they're manually loaded. + +This function does nothing if `yas-use-menu' is nil. +" + (when yas-use-menu + (let* ((table (yas--table-get-create mode)) + (hash (yas--table-uuidhash table))) + (yas--define-menu-1 table + (yas--menu-keymap-get-create mode) + menu + hash) + (dolist (uuid omit-items) + (let ((template (or (gethash uuid hash) + (yas--populate-template (puthash uuid + (yas--make-blank-template) + hash) + :table table + :uuid uuid)))) + (setf (yas--template-menu-binding-pair template) (cons nil :none))))))) + +(defun yas--define-menu-1 (table menu-keymap menu uuidhash &optional group-list) + (dolist (e (reverse menu)) + (cond ((eq (first e) 'yas-item) + (let ((template (or (gethash (second e) uuidhash) + (yas--populate-template (puthash (second e) + (yas--make-blank-template) + uuidhash) + :table table + :perm-group group-list + :uuid (second e))))) + (define-key menu-keymap (vector (gensym)) + (car (yas--template-menu-binding-pair-get-create template :stay))))) + ((eq (first e) 'yas-submenu) + (let ((subkeymap (make-sparse-keymap))) + (define-key menu-keymap (vector (gensym)) + `(menu-item ,(second e) ,subkeymap)) + (yas--define-menu-1 table + subkeymap + (third e) + uuidhash + (append group-list (list (second e)))))) + ((eq (first e) 'yas-separator) + (define-key menu-keymap (vector (gensym)) + '(menu-item "----"))) + (t + (yas--message 3 "Don't know anything about menu entry %s" (first e)))))) + +(defun yas--define (mode key template &optional name condition group) + "Define a snippet. Expanding KEY into TEMPLATE. + +NAME is a description to this template. Also update the menu if +`yas-use-menu' is t. CONDITION is the condition attached to +this snippet. If you attach a condition to a snippet, then it +will only be expanded when the condition evaluated to non-nil." + (yas-define-snippets mode + (list (list key template name condition group)))) + +(defun yas-hippie-try-expand (first-time?) + "Integrate with hippie expand. Just put this function in +`hippie-expand-try-functions-list'." + (when yas-minor-mode + (if (not first-time?) + (let ((yas-fallback-behavior 'return-nil)) + (yas-expand)) + (undo 1) + nil))) + + +;;; Apropos condition-cache: +;;; +;;; +;;; +;;; +(defvar yas--condition-cache-timestamp nil) +(defmacro yas-define-condition-cache (func doc &rest body) + "Define a function FUNC with doc DOC and body BODY, BODY is +executed at most once every snippet expansion attempt, to check +expansion conditions. + +It doesn't make any sense to call FUNC programatically." + `(defun ,func () ,(if (and doc + (stringp doc)) + (concat doc +"\n\nFor use in snippets' conditions. Within each +snippet-expansion routine like `yas-expand', computes actual +value for the first time then always returns a cached value.") + (setq body (cons doc body)) + nil) + (let ((timestamp-and-value (get ',func 'yas--condition-cache))) + (if (equal (car timestamp-and-value) yas--condition-cache-timestamp) + (cdr timestamp-and-value) + (let ((new-value (progn + ,@body + ))) + (put ',func 'yas--condition-cache (cons yas--condition-cache-timestamp new-value)) + new-value))))) + +(defalias 'yas-expand 'yas-expand-from-trigger-key) +(defun yas-expand-from-trigger-key (&optional field) + "Expand a snippet before point. + +If no snippet expansion is possible, fall back to the behaviour +defined in `yas-fallback-behavior'. + +Optional argument FIELD is for non-interactive use and is an +object satisfying `yas--field-p' to restrict the expansion to." + (interactive) + (setq yas--condition-cache-timestamp (current-time)) + (let (templates-and-pos) + (unless (and yas-expand-only-for-last-commands + (not (member last-command yas-expand-only-for-last-commands))) + (setq templates-and-pos (if field + (save-restriction + (narrow-to-region (yas--field-start field) + (yas--field-end field)) + (yas--current-key)) + (yas--current-key)))) + (if (and templates-and-pos + (first templates-and-pos)) + (yas--expand-or-prompt-for-template (first templates-and-pos) + (second templates-and-pos) + (third templates-and-pos)) + (yas--fallback 'trigger-key)))) + +(defun yas-expand-from-keymap () + "Directly expand some snippets, searching `yas--direct-keymaps'. + +If expansion fails, execute the previous binding for this key" + (interactive) + (setq yas--condition-cache-timestamp (current-time)) + (let* ((yas--prefix current-prefix-arg) + (vec (subseq (this-command-keys-vector) (if current-prefix-arg + universal-argument-num-events + 0))) + (templates (mapcan #'(lambda (table) + (yas--fetch table vec)) + (yas--get-snippet-tables)))) + (if templates + (yas--expand-or-prompt-for-template templates) + (let ((yas-fallback-behavior 'call-other-command)) + (yas--fallback))))) + +(defun yas--expand-or-prompt-for-template (templates &optional start end) + "Expand one of TEMPLATES from START to END. + +Prompt the user if TEMPLATES has more than one element, else +expand immediately. Common gateway for +`yas-expand-from-trigger-key' and `yas-expand-from-keymap'." + (let ((yas--current-template (or (and (rest templates) ;; more than one + (yas--prompt-for-template (mapcar #'cdr templates))) + (cdar templates)))) + (when yas--current-template + (yas-expand-snippet (yas--template-content yas--current-template) + start + end + (yas--template-expand-env yas--current-template))))) + +(defun yas--fallback (&optional from-trigger-key-p) + "Fallback after expansion has failed. + +Common gateway for `yas-expand-from-trigger-key' and +`yas-expand-from-keymap'." + (cond ((eq yas-fallback-behavior 'return-nil) + ;; return nil + nil) + ((eq yas-fallback-behavior 'call-other-command) + (let* ((yas-minor-mode nil) + (yas--direct-keymaps nil) + (keys-1 (this-command-keys-vector)) + (keys-2 (and yas-trigger-key + from-trigger-key-p + (stringp yas-trigger-key) + (read-kbd-macro yas-trigger-key))) + (command-1 (and keys-1 (key-binding keys-1))) + (command-2 (and keys-2 (key-binding keys-2))) + ;; An (ugly) safety: prevents infinite recursion of + ;; yas-expand* calls. + (command (or (and (symbolp command-1) + (not (string-match "yas-expand" (symbol-name command-1))) + command-1) + (and (symbolp command-2) + command-2)))) + (when (and (commandp command) + (not (string-match "yas-expand" (symbol-name command)))) + (setq this-command command) + (call-interactively command)))) + ((and (listp yas-fallback-behavior) + (cdr yas-fallback-behavior) + (eq 'apply (car yas-fallback-behavior))) + (if (cddr yas-fallback-behavior) + (apply (cadr yas-fallback-behavior) + (cddr yas-fallback-behavior)) + (when (commandp (cadr yas-fallback-behavior)) + (setq this-command (cadr yas-fallback-behavior)) + (call-interactively (cadr yas-fallback-behavior))))) + (t + ;; also return nil if all the other fallbacks have failed + nil))) + + + +;;; Utils for snippet development: + +(defun yas--all-templates (tables) + "Return all snippet tables applicable for the current buffer. + +Honours `yas-choose-tables-first', `yas-choose-keys-first' and +`yas-buffer-local-condition'" + (when yas-choose-tables-first + (setq tables (list (yas--prompt-for-table tables)))) + (mapcar #'cdr + (if yas-choose-keys-first + (let ((key (yas--prompt-for-keys + (mapcan #'yas--table-all-keys tables)))) + (when key + (mapcan #'(lambda (table) + (yas--fetch table key)) + tables))) + (remove-duplicates (mapcan #'yas--table-templates tables) + :test #'equal)))) + +(defun yas-insert-snippet (&optional no-condition) + "Choose a snippet to expand, pop-up a list of choices according +to `yas--prompt-function'. + +With prefix argument NO-CONDITION, bypass filtering of snippets +by condition." + (interactive "P") + (setq yas--condition-cache-timestamp (current-time)) + (let* ((yas-buffer-local-condition (or (and no-condition + 'always) + yas-buffer-local-condition)) + (templates (yas--all-templates (yas--get-snippet-tables))) + (yas--current-template (and templates + (or (and (rest templates) ;; more than one template for same key + (yas--prompt-for-template templates)) + (car templates)))) + (where (if (region-active-p) + (cons (region-beginning) (region-end)) + (cons (point) (point))))) + (if yas--current-template + (yas-expand-snippet (yas--template-content yas--current-template) + (car where) + (cdr where) + (yas--template-expand-env yas--current-template)) + (yas--message 3 "No snippets can be inserted here!")))) + +(defun yas-visit-snippet-file () + "Choose a snippet to edit, selection like `yas-insert-snippet'. + +Only success if selected snippet was loaded from a file. Put the +visited file in `snippet-mode'." + (interactive) + (let* ((yas-buffer-local-condition 'always) + (templates (yas--all-templates (yas--get-snippet-tables))) + (yas-prompt-functions '(yas-ido-prompt yas-completing-prompt)) + (template (and templates + (or (yas--prompt-for-template templates + "Choose a snippet template to edit: ") + (car templates))))) + + (if template + (yas--visit-snippet-file-1 template) + (message "No snippets tables active!")))) + +(defun yas--visit-snippet-file-1 (template) + (let ((file (yas--template-file template))) + (cond ((and file (file-readable-p file)) + (find-file-other-window file) + (snippet-mode) + (set (make-local-variable 'yas--editing-template) template)) + (file + (message "Original file %s no longer exists!" file)) + (t + (switch-to-buffer (format "*%s*"(yas--template-name template))) + (let ((type 'snippet)) + (when (listp (yas--template-content template)) + (insert (format "# type: command\n")) + (setq type 'command)) + (insert (format "# key: %s\n" (yas--template-key template))) + (insert (format "# name: %s\n" (yas--template-name template))) + (when (yas--template-keybinding template) + (insert (format "# binding: %s\n" (yas--template-keybinding template)))) + (when (yas--template-expand-env template) + (insert (format "# expand-env: %s\n" (yas--template-expand-env template)))) + (when (yas--template-condition template) + (insert (format "# condition: %s\n" (yas--template-condition template)))) + (insert "# --\n") + (insert (if (eq type 'command) + (pp-to-string (yas--template-content template)) + (yas--template-content template)))) + (snippet-mode) + (set (make-local-variable 'yas--editing-template) template))))) + +(defun yas--guess-snippet-directories-1 (table) + "Guesses possible snippet subdirectories for TABLE." + (cons (yas--table-name table) + (mapcan #'(lambda (parent) + (yas--guess-snippet-directories-1 + parent)) + (yas--table-parents table)))) + +(defun yas--guess-snippet-directories (&optional table) + "Try to guess suitable directories based on the current active +tables (or optional TABLE). + +Returns a list of elemts (TABLE . DIRS) where TABLE is a +`yas--table' object and DIRS is a list of all possible directories +where snippets of table might exist." + (let ((main-dir (replace-regexp-in-string + "/+$" "" + (or (first (or (yas-snippet-dirs) + (setq yas-snippet-dirs '("~/.emacs.d/snippets"))))))) + (tables (or (and table + (list table)) + (yas--get-snippet-tables)))) + ;; HACK! the snippet table created here is actually registered! + ;; + (unless (or table (gethash major-mode yas--tables)) + (push (yas--table-get-create major-mode) + tables)) + + (mapcar #'(lambda (table) + (cons table + (mapcar #'(lambda (subdir) + (concat main-dir "/" subdir)) + (yas--guess-snippet-directories-1 table)))) + tables))) + +(defun yas--make-directory-maybe (table-and-dirs &optional main-table-string) + "Returns a dir inside TABLE-AND-DIRS, prompts for creation if none exists." + (or (some #'(lambda (dir) (when (file-directory-p dir) dir)) (cdr table-and-dirs)) + (let ((candidate (first (cdr table-and-dirs)))) + (unless (file-writable-p (file-name-directory candidate)) + (error (yas--format "%s is not writable." candidate))) + (if (y-or-n-p (format "Guessed directory (%s) for%s%s table \"%s\" does not exist! Create? " + candidate + (if (gethash (yas--table-mode (car table-and-dirs)) + yas--tables) + "" + " brand new") + (or main-table-string + "") + (yas--table-name (car table-and-dirs)))) + (progn + (make-directory candidate 'also-make-parents) + ;; create the .yas-parents file here... + candidate))))) + +(defun yas-new-snippet (&optional no-template) + "Pops a new buffer for writing a snippet. + +Expands a snippet-writing snippet, unless the optional prefix arg +NO-TEMPLATE is non-nil." + (interactive "P") + (let ((guessed-directories (yas--guess-snippet-directories))) + + (switch-to-buffer "*new snippet*") + (erase-buffer) + (kill-all-local-variables) + (snippet-mode) + (yas-minor-mode 1) + (set (make-local-variable 'yas--guessed-modes) (mapcar #'(lambda (d) + (yas--table-mode (car d))) + guessed-directories)) + (unless no-template (yas-expand-snippet "\ +# -*- mode: snippet -*- +# name: $1 +# key: ${2:${1:$(replace-regexp-in-string \"\\\\\\\\(\\\\\\\\w+\\\\\\\\).*\" \"\\\\\\\\1\" yas-text)}}${3: +# binding: ${4:direct-keybinding}}${5: +# expand-env: ((${6:some-var} ${7:some-value}))}${8: +# type: command} +# -- +$0")))) + +(defun yas--compute-major-mode-and-parents (file) + "Given FILE, find the nearest snippet directory for a given +mode, then return a list (MODE-SYM PARENTS), the mode's symbol and a list +representing one or more of the mode's parents. + +Note that MODE-SYM need not be the symbol of a real major mode, +neither do the elements of PARENTS." + (let* ((file-dir (and file + (directory-file-name (or (some #'(lambda (special) + (locate-dominating-file file special)) + '(".yas-setup.el" + ".yas-make-groups" + ".yas-parents")) + (directory-file-name (file-name-directory file)))))) + (parents-file-name (concat file-dir "/.yas-parents")) + (major-mode-name (and file-dir + (file-name-nondirectory file-dir))) + (major-mode-sym (or (and major-mode-name + (intern major-mode-name)))) + (parents (when (file-readable-p parents-file-name) + (mapcar #'intern + (split-string + (with-temp-buffer + (insert-file-contents parents-file-name) + (buffer-substring-no-properties (point-min) + (point-max)))))))) + (when major-mode-sym + (cons major-mode-sym parents)))) + +(defvar yas--editing-template nil + "Supporting variable for `yas-load-snippet-buffer' and `yas--visit-snippet'") + +(defvar yas--current-template nil + "Holds the current template being expanded into a snippet.") + +(defvar yas--guessed-modes nil + "List of guessed modes supporting `yas-load-snippet-buffer'.") + +(defun yas-load-snippet-buffer (&optional kill) + "Parse and load current buffer's snippet definition. + +With optional prefix argument KILL quit the window and buffer." + (interactive "P") + (cond + ;; We have `yas--editing-template', this buffer's + ;; content comes from a template which is already loaded and + ;; neatly positioned,... + ;; + (yas--editing-template + (yas-define-snippets-1 (yas--parse-template (yas--template-file yas--editing-template)) + (yas--template-table yas--editing-template))) + ;; Try to use `yas--guessed-modes'. If we don't have that use the + ;; value from `yas--compute-major-mode-and-parents' + ;; + (t + (unless yas--guessed-modes + (set (make-local-variable 'yas--guessed-modes) (or (yas--compute-major-mode-and-parents buffer-file-name)))) + (let* ((prompt (if (and (featurep 'ido) + ido-mode) + 'ido-completing-read 'completing-read)) + (table (yas--table-get-create + (intern + (funcall prompt (format "Choose or enter a table (yas guesses %s): " + (if yas--guessed-modes + (first yas--guessed-modes) + "nothing")) + (mapcar #'symbol-name yas--guessed-modes) + nil + nil + nil + nil + (if (first yas--guessed-modes) + (symbol-name (first yas--guessed-modes)))))))) + (set (make-local-variable 'yas--editing-template) + (yas-define-snippets-1 (yas--parse-template buffer-file-name) + table))))) + ;; Now, offer to save this iff: + ;; + ;; 1) `yas-snippet-dirs' is a list and its first element does not + ;; match this template's file (i.e. this is a library snippet, not + ;; a user snippet) OR + ;; + ;; 2) yas--editing-template comes from a file that we cannot write to... + ;; + (when (or (not (yas--template-file yas--editing-template)) + (not (file-writable-p (yas--template-file yas--editing-template))) + (and (listp yas-snippet-dirs) + (second yas-snippet-dirs) + (not (string-match (expand-file-name (first yas-snippet-dirs)) + (yas--template-file yas--editing-template))))) + + (when (y-or-n-p (yas--format "Looks like a library or new snippet. Save to new file? ")) + (let* ((option (first (yas--guess-snippet-directories (yas--template-table yas--editing-template)))) + (chosen (and option + (yas--make-directory-maybe option)))) + (when chosen + (let ((default-file-name (or (and (yas--template-file yas--editing-template) + (file-name-nondirectory (yas--template-file yas--editing-template))) + (yas--template-name yas--editing-template)))) + (write-file (concat chosen "/" + (read-from-minibuffer (format "File name to create in %s? " chosen) + default-file-name))) + (setf (yas--template-file yas--editing-template) buffer-file-name)))))) + (when kill + (quit-window kill)) + (yas--message 3 "Snippet \"%s\" loaded for %s." + (yas--template-name yas--editing-template) + (yas--table-name (yas--template-table yas--editing-template)))) + + +(defun yas-tryout-snippet (&optional debug) + "Test current buffers's snippet template in other buffer." + (interactive "P") + (let* ((major-mode-and-parent (yas--compute-major-mode-and-parents buffer-file-name)) + (parsed (yas--parse-template)) + (test-mode (or (and (car major-mode-and-parent) + (fboundp (car major-mode-and-parent)) + (car major-mode-and-parent)) + (first yas--guessed-modes) + (intern (read-from-minibuffer (yas--format "Please input a mode: "))))) + (yas--current-template + (and parsed + (fboundp test-mode) + (yas--populate-template (yas--make-blank-template) + :table nil ;; no tables for ephemeral snippets + :key (first parsed) + :content (second parsed) + :name (third parsed) + :expand-env (sixth parsed))))) + (cond (yas--current-template + (let ((buffer-name (format "*testing snippet: %s*" (yas--template-name yas--current-template)))) + (kill-buffer (get-buffer-create buffer-name)) + (switch-to-buffer (get-buffer-create buffer-name)) + (setq buffer-undo-list nil) + (condition-case nil (funcall test-mode) (error nil)) + (setq buffer-read-only nil) + (yas-expand-snippet (yas--template-content yas--current-template) + (point-min) + (point-max) + (yas--template-expand-env yas--current-template)) + (when (and debug + (require 'yasnippet-debug nil t)) + (add-hook 'post-command-hook 'yas-debug-snippet-vars nil t)))) + (t + (yas--message 3 "Cannot test snippet for unknown major mode"))))) + +(defun yas--template-fine-group (template) + (car (last (or (yas--template-group template) + (yas--template-perm-group template))))) + +(defun yas-describe-tables (&optional choose) + "Display snippets for each table." + (interactive "P") + (let* ((by-name-hash (and choose + (y-or-n-p "Show by namehash? "))) + (buffer (get-buffer-create "*YASnippet tables*")) + (active-tables (yas--get-snippet-tables)) + (remain-tables (let ((all)) + (maphash #'(lambda (k v) + (unless (find v active-tables) + (push v all))) + yas--tables) + all)) + (table-lists (list active-tables remain-tables)) + (original-buffer (current-buffer)) + (continue t) + (yas--condition-cache-timestamp (current-time))) + (with-current-buffer buffer + (setq buffer-read-only nil) + (erase-buffer) + (cond ((not by-name-hash) + (insert "YASnippet tables: \n") + (while (and table-lists + continue) + (dolist (table (car table-lists)) + (yas--describe-pretty-table table original-buffer)) + (setq table-lists (cdr table-lists)) + (when table-lists + (yas--create-snippet-xrefs) + (display-buffer buffer) + (setq continue (and choose (y-or-n-p "Show also non-active tables? "))))) + (yas--create-snippet-xrefs) + (help-mode) + (goto-char 1)) + (t + (insert "\n\nYASnippet tables by NAMEHASH: \n") + (dolist (table (append active-tables remain-tables)) + (insert (format "\nSnippet table `%s':\n\n" (yas--table-name table))) + (let ((keys)) + (maphash #'(lambda (k v) + (push k keys)) + (yas--table-hash table)) + (dolist (key keys) + (insert (format " key %s maps snippets: %s\n" key + (let ((names)) + (maphash #'(lambda (k v) + (push k names)) + (gethash key (yas--table-hash table))) + names)))))))) + (goto-char 1) + (setq buffer-read-only t)) + (display-buffer buffer))) + +(defun yas--describe-pretty-table (table &optional original-buffer) + (insert (format "\nSnippet table `%s'" + (yas--table-name table))) + (if (yas--table-parents table) + (insert (format " parents: %s\n" + (mapcar #'yas--table-name + (yas--table-parents table)))) + (insert "\n")) + (insert (make-string 100 ?-) "\n") + (insert "group state name key binding\n") + (let ((groups-hash (make-hash-table :test #'equal))) + (maphash #'(lambda (k v) + (let ((group (or (yas--template-fine-group v) + "(top level)"))) + (when (yas--template-name v) + (puthash group + (cons v (gethash group groups-hash)) + groups-hash)))) + (yas--table-uuidhash table)) + (maphash + #'(lambda (group templates) + (setq group (truncate-string-to-width group 25 0 ? "...")) + (insert (make-string 100 ?-) "\n") + (dolist (p templates) + (let ((name (truncate-string-to-width (propertize (format "\\\\snippet `%s'" (yas--template-name p)) + 'yasnippet p) + 50 0 ? "...")) + (group (prog1 group + (setq group (make-string (length group) ? )))) + (condition-string (let ((condition (yas--template-condition p))) + (if (and condition + original-buffer) + (with-current-buffer original-buffer + (if (yas--eval-condition condition) + "(y)" + "(s)")) + "(a)")))) + (insert group " ") + (insert condition-string " ") + (insert name + (if (string-match "\\.\\.\\.$" name) + "'" + " ") + " ") + (insert (truncate-string-to-width (or (yas--template-key p) "") + 15 0 ? "...") " ") + (insert (truncate-string-to-width (key-description (yas--template-keybinding p)) + 15 0 ? "...") " ") + (insert "\n")))) + groups-hash))) + + + +;;; User convenience functions, for using in snippet definitions + +(defvar yas-modified-p nil + "Non-nil if field has been modified by user or transformation.") + +(defvar yas-moving-away-p nil + "Non-nil if user is about to exit field.") + +(defvar yas-text nil + "Contains current field text.") + +(defun yas-substr (str pattern &optional subexp) + "Search PATTERN in STR and return SUBEXPth match. + +If found, the content of subexp group SUBEXP (default 0) is + returned, or else the original STR will be returned." + (let ((grp (or subexp 0))) + (save-match-data + (if (string-match pattern str) + (match-string-no-properties grp str) + str)))) + +(defun yas-choose-value (possibilities) + "Prompt for a string in the list POSSIBILITIES and return it." + (unless (or yas-moving-away-p + yas-modified-p) + (some #'(lambda (fn) + (funcall fn "Choose: " possibilities)) + yas-prompt-functions))) + +(defun yas-key-to-value (alist) + "Prompt for a string in the list POSSIBILITIES and return it." + (unless (or yas-moving-away-p + yas-modified-p) + (let ((key (read-key-sequence ""))) + (when (stringp key) + (or (cdr (find key alist :key #'car :test #'string=)) + key))))) + +(defun yas-throw (text) + "Throw a yas--exception with TEXT as the reason." + (throw 'yas--exception (cons 'yas--exception text))) + +(defun yas-verify-value (possibilities) + "Verify that the current field value is in POSSIBILITIES + +Otherwise throw exception." + (when (and yas-moving-away-p (notany #'(lambda (pos) (string= pos yas-text)) possibilities)) + (yas-throw (yas--format "Field only allows %s" possibilities)))) + +(defun yas-field-value (number) + "Get the string for field with NUMBER. + +Use this in primary and mirror transformations to tget." + (let* ((snippet (car (yas--snippets-at-point))) + (field (and snippet + (yas--snippet-find-field snippet number)))) + (when field + (yas--field-text-for-display field)))) + +(defun yas-text () + "Return `yas-text' if that exists and is non-empty, else nil." + (if (and yas-text + (not (string= "" yas-text))) + yas-text)) + +;; (defun yas-selected-text () +;; "Return `yas-selected-text' if that exists and is non-empty, else nil." +;; (if (and yas-selected-text +;; (not (string= "" yas-selected-text))) +;; yas-selected-text)) + +(defun yas--get-field-once (number &optional transform-fn) + (unless yas-modified-p + (if transform-fn + (funcall transform-fn (yas-field-value number)) + (yas-field-value number)))) + +(defun yas-default-from-field (number) + (unless yas-modified-p + (yas-field-value number))) + +(defun yas-inside-string () + (equal 'font-lock-string-face (get-char-property (1- (point)) 'face))) + +(defun yas-unimplemented (&optional missing-feature) + (if yas--current-template + (if (y-or-n-p (format "This snippet is unimplemented (missing %s) Visit the snippet definition? " + (or missing-feature + "something"))) + (yas--visit-snippet-file-1 yas--current-template)) + (message "No implementation. Missing %s" (or missing-feature "something")))) + + +;;; Snippet expansion and field management + +(defvar yas--active-field-overlay nil + "Overlays the currently active field.") + +(defvar yas--field-protection-overlays nil + "Two overlays protect the current active field ") + +(defconst yas--prefix nil + "A prefix argument for expansion direct from keybindings") + +(defvar yas-selected-text nil + "The selected region deleted on the last snippet expansion.") + +(defvar yas--start-column nil + "The column where the snippet expansion started.") + +(make-variable-buffer-local 'yas--active-field-overlay) +(make-variable-buffer-local 'yas--field-protection-overlays) +(put 'yas--active-field-overlay 'permanent-local t) +(put 'yas--field-protection-overlays 'permanent-local t) + +(defstruct (yas--snippet (:constructor yas--make-snippet ())) + "A snippet. + +..." + (fields '()) + (exit nil) + (id (yas--snippet-next-id) :read-only t) + (control-overlay nil) + active-field + ;; stacked expansion: the `previous-active-field' slot saves the + ;; active field where the child expansion took place + previous-active-field + force-exit) + +(defstruct (yas--field (:constructor yas--make-field (number start end parent-field))) + "A field." + number + start end + parent-field + (mirrors '()) + (transform nil) + (modified-p nil) + next) + +(defstruct (yas--mirror (:constructor yas--make-mirror (start end transform))) + "A mirror." + start end + (transform nil) + parent-field + next) + +(defstruct (yas--exit (:constructor yas--make-exit (marker))) + marker + next) + +(defun yas--apply-transform (field-or-mirror field &optional empty-on-nil-p) + "Calculate transformed string for FIELD-OR-MIRROR from FIELD. + +If there is no transform for ht field, return nil. + +If there is a transform but it returns nil, return the empty +string iff EMPTY-ON-NIL-P is true." + (let* ((yas-text (yas--field-text-for-display field)) + (text yas-text) + (yas-modified-p (yas--field-modified-p field)) + (yas-moving-away-p nil) + (transform (if (yas--mirror-p field-or-mirror) + (yas--mirror-transform field-or-mirror) + (yas--field-transform field-or-mirror))) + (start-point (if (yas--mirror-p field-or-mirror) + (yas--mirror-start field-or-mirror) + (yas--field-start field-or-mirror))) + (transformed (and transform + (save-excursion + (goto-char start-point) + (let ((ret (yas--eval-lisp transform))) + (or ret (and empty-on-nil-p ""))))))) + transformed)) + +(defsubst yas--replace-all (from to &optional text) + "Replace all occurance from FROM to TO. + +With optional string TEXT do it in that string." + (if text + (replace-regexp-in-string (regexp-quote from) to text t t) + (goto-char (point-min)) + (while (search-forward from nil t) + (replace-match to t t text)))) + +(defun yas--snippet-find-field (snippet number) + (find-if #'(lambda (field) + (eq number (yas--field-number field))) + (yas--snippet-fields snippet))) + +(defun yas--snippet-sort-fields (snippet) + "Sort the fields of SNIPPET in navigation order." + (setf (yas--snippet-fields snippet) + (sort (yas--snippet-fields snippet) + #'yas--snippet-field-compare))) + +(defun yas--snippet-field-compare (field1 field2) + "Compare two fields. The field with a number is sorted first. +If they both have a number, compare through the number. If neither +have, compare through the field's start point" + (let ((n1 (yas--field-number field1)) + (n2 (yas--field-number field2))) + (if n1 + (if n2 + (or (zerop n2) (and (not (zerop n1)) + (< n1 n2))) + (not (zerop n1))) + (if n2 + (zerop n2) + (< (yas--field-start field1) + (yas--field-start field2)))))) + +(defun yas--field-probably-deleted-p (snippet field) + "Guess if SNIPPET's FIELD should be skipped." + (and + ;; field must be zero lentgh + ;; + (zerop (- (yas--field-start field) (yas--field-end field))) + ;; skip if: + (or + ;; 1) is a nested field and it's been modified + ;; + (and (yas--field-parent-field field) + (yas--field-modified-p field)) + ;; 2) ends just before the snippet end + ;; + (and (eq field (car (last (yas--snippet-fields snippet)))) + (= (yas--field-start field) (overlay-end (yas--snippet-control-overlay snippet))))) + ;; the field numbered 0, just before the exit marker, should + ;; never be skipped + ;; + (not (zerop (yas--field-number field))))) + +(defun yas--snippets-at-point (&optional all-snippets) + "Return a sorted list of snippets at point, most recently +inserted first." + (sort + (remove nil (remove-duplicates (mapcar #'(lambda (ov) + (overlay-get ov 'yas--snippet)) + (if all-snippets + (overlays-in (point-min) (point-max)) + (nconc (overlays-at (point)) (overlays-at (1- (point)))))))) + #'(lambda (s1 s2) + (<= (yas--snippet-id s2) (yas--snippet-id s1))))) + +(defun yas-next-field-or-maybe-expand () + "Try to expand a snippet at a key before point, otherwise +delegate to `yas-next-field'." + (interactive) + (if yas-triggers-in-field + (let ((yas-fallback-behavior 'return-nil) + (active-field (overlay-get yas--active-field-overlay 'yas--field))) + (when active-field + (unless (yas-expand-from-trigger-key active-field) + (yas-next-field)))) + (yas-next-field))) + +(defun yas-next-field (&optional arg) + "Navigate to next field. If there's none, exit the snippet." + (interactive) + (let* ((arg (or arg + 1)) + (snippet (first (yas--snippets-at-point))) + (active-field (overlay-get yas--active-field-overlay 'yas--field)) + (live-fields (remove-if #'(lambda (field) + (and (not (eq field active-field)) + (yas--field-probably-deleted-p snippet field))) + (yas--snippet-fields snippet))) + (active-field-pos (position active-field live-fields)) + (target-pos (and active-field-pos (+ arg active-field-pos))) + (target-field (and target-pos (nth target-pos live-fields)))) + ;; First check if we're moving out of a field with a transform + ;; + (when (and active-field + (yas--field-transform active-field)) + (let* ((yas-moving-away-p t) + (yas-text (yas--field-text-for-display active-field)) + (text yas-text) + (yas-modified-p (yas--field-modified-p active-field))) + ;; primary field transform: exit call to field-transform + (yas--eval-lisp (yas--field-transform active-field)))) + ;; Now actually move... + (cond ((and target-pos (>= target-pos (length live-fields))) + (yas-exit-snippet snippet)) + (target-field + (yas--move-to-field snippet target-field)) + (t + nil)))) + +(defun yas--place-overlays (snippet field) + "Correctly place overlays for SNIPPET's FIELD" + (yas--make-move-field-protection-overlays snippet field) + (yas--make-move-active-field-overlay snippet field)) + +(defun yas--move-to-field (snippet field) + "Update SNIPPET to move to field FIELD. + +Also create some protection overlays" + (goto-char (yas--field-start field)) + (yas--place-overlays snippet field) + (overlay-put yas--active-field-overlay 'yas--field field) + (let ((number (yas--field-number field))) + ;; check for the special ${0: ...} field + (if (and number (zerop number)) + (progn + (set-mark (yas--field-end field)) + (setf (yas--snippet-force-exit snippet) + (or (yas--field-transform field) + t))) + ;; make this field active + (setf (yas--snippet-active-field snippet) field) + ;; primary field transform: first call to snippet transform + (unless (yas--field-modified-p field) + (if (yas--field-update-display field snippet) + (yas--update-mirrors snippet) + (setf (yas--field-modified-p field) nil)))))) + +(defun yas-prev-field () + "Navigate to prev field. If there's none, exit the snippet." + (interactive) + (yas-next-field -1)) + +(defun yas-abort-snippet (&optional snippet) + (interactive) + (let ((snippet (or snippet + (car (yas--snippets-at-point))))) + (when snippet + (setf (yas--snippet-force-exit snippet) t)))) + +(defun yas-exit-snippet (snippet) + "Goto exit-marker of SNIPPET." + (interactive (list (first (yas--snippets-at-point)))) + (when snippet + (setf (yas--snippet-force-exit snippet) t) + (goto-char (if (yas--snippet-exit snippet) + (yas--exit-marker (yas--snippet-exit snippet)) + (overlay-end (yas--snippet-control-overlay snippet)))))) + +(defun yas-exit-all-snippets () + "Exit all snippets." + (interactive) + (mapc #'(lambda (snippet) + (yas-exit-snippet snippet) + (yas--check-commit-snippet)) + (yas--snippets-at-point 'all-snippets))) + + +;;; Some low level snippet-routines: + +(defmacro yas--inhibit-overlay-hooks (&rest body) + "Run BODY with `yas--inhibit-overlay-hooks' set to t." + (declare (indent 0)) + `(let ((yas--inhibit-overlay-hooks t)) + (progn ,@body))) + +(defvar yas-snippet-beg nil "Beginning position of the last snippet commited.") +(defvar yas-snippet-end nil "End position of the last snippet commited.") + +(defun yas--commit-snippet (snippet) + "Commit SNIPPET, but leave point as it is. This renders the +snippet as ordinary text." + + (let ((control-overlay (yas--snippet-control-overlay snippet))) + ;; + ;; Save the end of the moribund snippet in case we need to revive it + ;; its original expansion. + ;; + (when (and control-overlay + (overlay-buffer control-overlay)) + (setq yas-snippet-beg (overlay-start control-overlay)) + (setq yas-snippet-end (overlay-end control-overlay)) + (delete-overlay control-overlay)) + + (yas--inhibit-overlay-hooks + (when yas--active-field-overlay + (delete-overlay yas--active-field-overlay)) + (when yas--field-protection-overlays + (mapc #'delete-overlay yas--field-protection-overlays))) + + ;; stacked expansion: if the original expansion took place from a + ;; field, make sure we advance it here at least to + ;; `yas-snippet-end'... + ;; + (let ((previous-field (yas--snippet-previous-active-field snippet))) + (when (and yas-snippet-end previous-field) + (yas--advance-end-maybe previous-field yas-snippet-end))) + + ;; Convert all markers to points, + ;; + (yas--markers-to-points snippet) + + ;; Take care of snippet revival + ;; + (if yas-snippet-revival + (push `(apply yas--snippet-revive ,yas-snippet-beg ,yas-snippet-end ,snippet) + buffer-undo-list) + ;; Dismember the snippet... this is useful if we get called + ;; again from `yas--take-care-of-redo'.... + (setf (yas--snippet-fields snippet) nil))) + + (yas--message 3 "Snippet %s exited." (yas--snippet-id snippet))) + +(defun yas--safely-run-hooks (hook-var) + (condition-case error + (run-hooks hook-var) + (error + (yas--message 3 "%s error: %s" hook-var (error-message-string error))))) + + +(defun yas--check-commit-snippet () + "Checks if point exited the currently active field of the +snippet, if so cleans up the whole snippet up." + (let* ((snippets (yas--snippets-at-point 'all-snippets)) + (snippets-left snippets) + (snippet-exit-transform)) + (dolist (snippet snippets) + (let ((active-field (yas--snippet-active-field snippet))) + (setq snippet-exit-transform (yas--snippet-force-exit snippet)) + (cond ((or snippet-exit-transform + (not (and active-field (yas--field-contains-point-p active-field)))) + (setq snippets-left (delete snippet snippets-left)) + (setf (yas--snippet-force-exit snippet) nil) + (yas--commit-snippet snippet)) + ((and active-field + (or (not yas--active-field-overlay) + (not (overlay-buffer yas--active-field-overlay)))) + ;; + ;; stacked expansion: this case is mainly for recent + ;; snippet exits that place us back int the field of + ;; another snippet + ;; + (save-excursion + (yas--move-to-field snippet active-field) + (yas--update-mirrors snippet))) + (t + nil)))) + (unless (or (null snippets) snippets-left) + (if snippet-exit-transform + (yas--eval-lisp-no-saves snippet-exit-transform)) + (yas--safely-run-hooks 'yas-after-exit-snippet-hook)))) + +;; Apropos markers-to-points: +;; +;; This was found useful for performance reasons, so that an +;; excessive number of live markers aren't kept around in the +;; `buffer-undo-list'. However, in `markers-to-points', the +;; set-to-nil markers can't simply be discarded and replaced with +;; fresh ones in `points-to-markers'. The original marker that was +;; just set to nil has to be reused. +;; +;; This shouldn't bring horrible problems with undo/redo, but it +;; you never know +;; +(defun yas--markers-to-points (snippet) + "Convert all markers in SNIPPET to a cons (POINT . MARKER) +where POINT is the original position of the marker and MARKER is +the original marker object with the position set to nil." + (dolist (field (yas--snippet-fields snippet)) + (let ((start (marker-position (yas--field-start field))) + (end (marker-position (yas--field-end field)))) + (set-marker (yas--field-start field) nil) + (set-marker (yas--field-end field) nil) + (setf (yas--field-start field) (cons start (yas--field-start field))) + (setf (yas--field-end field) (cons end (yas--field-end field)))) + (dolist (mirror (yas--field-mirrors field)) + (let ((start (marker-position (yas--mirror-start mirror))) + (end (marker-position (yas--mirror-end mirror)))) + (set-marker (yas--mirror-start mirror) nil) + (set-marker (yas--mirror-end mirror) nil) + (setf (yas--mirror-start mirror) (cons start (yas--mirror-start mirror))) + (setf (yas--mirror-end mirror) (cons end (yas--mirror-end mirror)))))) + (let ((snippet-exit (yas--snippet-exit snippet))) + (when snippet-exit + (let ((exit (marker-position (yas--exit-marker snippet-exit)))) + (set-marker (yas--exit-marker snippet-exit) nil) + (setf (yas--exit-marker snippet-exit) (cons exit (yas--exit-marker snippet-exit))))))) + +(defun yas--points-to-markers (snippet) + "Convert all cons (POINT . MARKER) in SNIPPET to markers. This +is done by setting MARKER to POINT with `set-marker'." + (dolist (field (yas--snippet-fields snippet)) + (setf (yas--field-start field) (set-marker (cdr (yas--field-start field)) + (car (yas--field-start field)))) + (setf (yas--field-end field) (set-marker (cdr (yas--field-end field)) + (car (yas--field-end field)))) + (dolist (mirror (yas--field-mirrors field)) + (setf (yas--mirror-start mirror) (set-marker (cdr (yas--mirror-start mirror)) + (car (yas--mirror-start mirror)))) + (setf (yas--mirror-end mirror) (set-marker (cdr (yas--mirror-end mirror)) + (car (yas--mirror-end mirror)))))) + (let ((snippet-exit (yas--snippet-exit snippet))) + (when snippet-exit + (setf (yas--exit-marker snippet-exit) (set-marker (cdr (yas--exit-marker snippet-exit)) + (car (yas--exit-marker snippet-exit))))))) + +(defun yas--field-contains-point-p (field &optional point) + (let ((point (or point + (point)))) + (and (>= point (yas--field-start field)) + (<= point (yas--field-end field))))) + +(defun yas--field-text-for-display (field) + "Return the propertized display text for field FIELD. " + (buffer-substring (yas--field-start field) (yas--field-end field))) + +(defun yas--undo-in-progress () + "True if some kind of undo is in progress" + (or undo-in-progress + (eq this-command 'undo) + (eq this-command 'redo))) + +(defun yas--make-control-overlay (snippet start end) + "Creates the control overlay that surrounds the snippet and +holds the keymap." + (let ((overlay (make-overlay start + end + nil + nil + t))) + (overlay-put overlay 'keymap yas-keymap) + (overlay-put overlay 'priority 100) + (overlay-put overlay 'yas--snippet snippet) + overlay)) + +(defun yas-skip-and-clear-or-delete-char (&optional field) + "Clears unmodified field if at field start, skips to next tab. + +Otherwise deletes a character normally by calling `delete-char'." + (interactive) + (let ((field (or field + (and yas--active-field-overlay + (overlay-buffer yas--active-field-overlay) + (overlay-get yas--active-field-overlay 'yas--field))))) + (cond ((and field + (not (yas--field-modified-p field)) + (eq (point) (marker-position (yas--field-start field)))) + (yas--skip-and-clear field) + (yas-next-field 1)) + (t + (call-interactively 'delete-char))))) + +(defun yas--skip-and-clear (field) + "Deletes the region of FIELD and sets it modified state to t" + ;; Just before skipping-and-clearing the field, mark its children + ;; fields as modified, too. If the childen have mirrors-in-fields + ;; this prevents them from updating erroneously (we're skipping and + ;; deleting!). + ;; + (yas--mark-this-and-children-modified field) + (delete-region (yas--field-start field) (yas--field-end field))) + +(defun yas--mark-this-and-children-modified (field) + (setf (yas--field-modified-p field) t) + (let ((fom (yas--field-next field))) + (while (and fom + (yas--fom-parent-field fom)) + (when (and (eq (yas--fom-parent-field fom) field) + (yas--field-p fom)) + (yas--mark-this-and-children-modified fom)) + (setq fom (yas--fom-next fom))))) + +(defun yas--make-move-active-field-overlay (snippet field) + "Place the active field overlay in SNIPPET's FIELD. + +Move the overlay, or create it if it does not exit." + (if (and yas--active-field-overlay + (overlay-buffer yas--active-field-overlay)) + (move-overlay yas--active-field-overlay + (yas--field-start field) + (yas--field-end field)) + (setq yas--active-field-overlay + (make-overlay (yas--field-start field) + (yas--field-end field) + nil nil t)) + (overlay-put yas--active-field-overlay 'priority 100) + (overlay-put yas--active-field-overlay 'face 'yas-field-highlight-face) + (overlay-put yas--active-field-overlay 'yas--snippet snippet) + (overlay-put yas--active-field-overlay 'modification-hooks '(yas--on-field-overlay-modification)) + (overlay-put yas--active-field-overlay 'insert-in-front-hooks + '(yas--on-field-overlay-modification)) + (overlay-put yas--active-field-overlay 'insert-behind-hooks + '(yas--on-field-overlay-modification)))) + +(defvar yas--inhibit-overlay-hooks nil + "Bind this temporarity to non-nil to prevent running `yas--on-*-modification'.") + +(defun yas--on-field-overlay-modification (overlay after? beg end &optional length) + "Clears the field and updates mirrors, conditionally. + +Only clears the field if it hasn't been modified and it point it +at field start. This hook doesn't do anything if an undo is in +progress." + (unless (or yas--inhibit-overlay-hooks + (yas--undo-in-progress)) + (let* ((field (overlay-get overlay 'yas--field)) + (number (and field (yas--field-number field))) + (snippet (overlay-get yas--active-field-overlay 'yas--snippet))) + (cond (after? + (yas--advance-end-maybe field (overlay-end overlay)) + (save-excursion + (yas--field-update-display field snippet)) + (yas--update-mirrors snippet)) + (field + (when (and (not after?) + (not (yas--field-modified-p field)) + (eq (point) (if (markerp (yas--field-start field)) + (marker-position (yas--field-start field)) + (yas--field-start field)))) + (yas--skip-and-clear field)) + (setf (yas--field-modified-p field) t)))))) + +;;; Apropos protection overlays: +;; +;; These exist for nasty users who will try to delete parts of the +;; snippet outside the active field. Actual protection happens in +;; `yas--on-protection-overlay-modification'. +;; +;; Currently this signals an error which inhibits the command. For +;; commands that move point (like `kill-line'), point is restored in +;; the `yas--post-command-handler' using a global +;; `yas--protection-violation' variable. +;; +;; Alternatively, I've experimented with an implementation that +;; commits the snippet before actually calling `this-command' +;; interactively, and then signals an eror, which is ignored. but +;; blocks all other million modification hooks. This presented some +;; problems with stacked expansion. +;; +(defun yas--make-move-field-protection-overlays (snippet field) + "Place protection overlays surrounding SNIPPET's FIELD. + +Move the overlays, or create them if they do not exit." + (let ((start (yas--field-start field)) + (end (yas--field-end field))) + ;; First check if the (1+ end) is contained in the buffer, + ;; otherwise we'll have to do a bit of cheating and silently + ;; insert a newline. the `(1+ (buffer-size))' should prevent this + ;; when using stacked expansion + ;; + (when (< (buffer-size) end) + (save-excursion + (yas--inhibit-overlay-hooks + (goto-char (point-max)) + (newline)))) + ;; go on to normal overlay creation/moving + ;; + (cond ((and yas--field-protection-overlays + (every #'overlay-buffer yas--field-protection-overlays)) + (move-overlay (first yas--field-protection-overlays) (1- start) start) + (move-overlay (second yas--field-protection-overlays) end (1+ end))) + (t + (setq yas--field-protection-overlays + (list (make-overlay (1- start) start nil t nil) + (make-overlay end (1+ end) nil t nil))) + (dolist (ov yas--field-protection-overlays) + (overlay-put ov 'face 'yas--field-debug-face) + (overlay-put ov 'yas--snippet snippet) + ;; (overlay-put ov 'evaporate t) + (overlay-put ov 'modification-hooks '(yas--on-protection-overlay-modification))))))) + +(defvar yas--protection-violation nil + "When non-nil, signals attempts to erronesly exit or modify the snippet. + +Functions in the `post-command-hook', for example +`yas--post-command-handler' can check it and reset its value to +nil. The variables value is the point where the violation +originated") + +(defun yas--on-protection-overlay-modification (overlay after? beg end &optional length) + "Signals a snippet violation, then issues error. + +The error should be ignored in `debug-ignored-errors'" + (unless yas--inhibit-overlay-hooks + (cond ((not (or after? + (yas--undo-in-progress))) + (setq yas--protection-violation (point)) + (error "Exit the snippet first!"))))) + +(add-to-list 'debug-ignored-errors "^Exit the snippet first!$") + + +;; Snippet expansion and "stacked" expansion: +;; +;; Stacked expansion is when you try to expand a snippet when already +;; inside a snippet expansion. +;; +;; The parent snippet does not run its fields modification hooks +;; (`yas--on-field-overlay-modification' and +;; `yas--on-protection-overlay-modification') while the child snippet +;; is active. This means, among other things, that the mirrors of the +;; parent snippet are not updated, this only happening when one exits +;; the child snippet. +;; +;; Unfortunately, this also puts some ugly (and not fully-tested) +;; bits of code in `yas-expand-snippet' and +;; `yas--commit-snippet'. I've tried to mark them with "stacked +;; expansion:". +;; +;; This was thought to be safer in in an undo/redo perpective, but +;; maybe the correct implementation is to make the globals +;; `yas--active-field-overlay' and `yas--field-protection-overlays' be +;; snippet-local and be active even while the child snippet is +;; running. This would mean a lot of overlay modification hooks +;; running, but if managed correctly (including overlay priorities) +;; they should account for all situations... +;; +(defun yas-expand-snippet (content &optional start end expand-env) + "Expand snippet CONTENT at current point. + +Text between START and END will be deleted before inserting +template. EXPAND-ENV is are let-style variable to value bindings +considered when expanding the snippet." + (run-hooks 'yas-before-expand-snippet-hook) + + ;; If a region is active, set `yas-selected-text' + (setq yas-selected-text + (when (region-active-p) + (prog1 (buffer-substring-no-properties (region-beginning) + (region-end)) + (unless start (setq start (region-beginning)) + (unless end (setq end (region-end))))))) + + (when start + (goto-char start)) + + ;; + (let ((to-delete (and start end (buffer-substring-no-properties start end))) + (start (or start (point))) + (end (or end (point))) + snippet) + (setq yas--indent-original-column (current-column)) + ;; Delete the region to delete, this *does* get undo-recorded. + ;; + (when (and to-delete + (> end start)) + (delete-region start end)) + + (cond ((listp content) + ;; x) This is a snippet-command + ;; + (yas--eval-lisp-no-saves content)) + (t + ;; x) This is a snippet-snippet :-) + ;; + ;; Narrow the region down to the content, shoosh the + ;; `buffer-undo-list', and create the snippet, the new + ;; snippet updates its mirrors once, so we are left with + ;; some plain text. The undo action for deleting this + ;; plain text will get recorded at the end. + ;; + ;; stacked expansion: also shoosh the overlay modification hooks + (save-restriction + (narrow-to-region start start) + (let ((buffer-undo-list t)) + ;; snippet creation might evaluate users elisp, which + ;; might generate errors, so we have to be ready to catch + ;; them mostly to make the undo information + ;; + (setq yas--start-column (save-restriction (widen) (current-column))) + (yas--inhibit-overlay-hooks + (setq snippet + (if expand-env + (eval `(let* ,expand-env + (insert content) + (yas--snippet-create (point-min) (point-max)))) + (insert content) + (yas--snippet-create (point-min) (point-max))))))) + + ;; stacked-expansion: This checks for stacked expansion, save the + ;; `yas--previous-active-field' and advance its boudary. + ;; + (let ((existing-field (and yas--active-field-overlay + (overlay-buffer yas--active-field-overlay) + (overlay-get yas--active-field-overlay 'yas--field)))) + (when existing-field + (setf (yas--snippet-previous-active-field snippet) existing-field) + (yas--advance-end-maybe existing-field (overlay-end yas--active-field-overlay)))) + + ;; Exit the snippet immediately if no fields + ;; + (unless (yas--snippet-fields snippet) + (yas-exit-snippet snippet)) + + ;; Push two undo actions: the deletion of the inserted contents of + ;; the new snippet (without the "key") followed by an apply of + ;; `yas--take-care-of-redo' on the newly inserted snippet boundaries + ;; + ;; A small exception, if `yas-also-auto-indent-first-line' + ;; is t and `yas--indent' decides to indent the line to a + ;; point before the actual expansion point, undo would be + ;; messed up. We call the early point "newstart"". case, + ;; and attempt to fix undo. + ;; + (let ((newstart (overlay-start (yas--snippet-control-overlay snippet))) + (end (overlay-end (yas--snippet-control-overlay snippet)))) + (when (< newstart start) + (push (cons (make-string (- start newstart) ? ) newstart) buffer-undo-list)) + (push (cons newstart end) buffer-undo-list) + (push `(apply yas--take-care-of-redo ,start ,end ,snippet) + buffer-undo-list)) + ;; Now, schedule a move to the first field + ;; + (let ((first-field (car (yas--snippet-fields snippet)))) + (when first-field + (sit-for 0) ;; fix issue 125 + (yas--move-to-field snippet first-field))) + (yas--message 3 "snippet expanded.") + t)))) + +(defun yas--take-care-of-redo (beg end snippet) + "Commits SNIPPET, which in turn pushes an undo action for +reviving it. + +Meant to exit in the `buffer-undo-list'." + ;; slightly optimize: this action is only needed for snippets with + ;; at least one field + (when (yas--snippet-fields snippet) + (yas--commit-snippet snippet))) + +(defun yas--snippet-revive (beg end snippet) + "Revives the SNIPPET and creates a control overlay from BEG to +END. + +BEG and END are, we hope, the original snippets boudaries. All +the markers/points exiting existing inside SNIPPET should point +to their correct locations *at the time the snippet is revived*. + +After revival, push the `yas--take-care-of-redo' in the +`buffer-undo-list'" + ;; Reconvert all the points to markers + ;; + (yas--points-to-markers snippet) + ;; When at least one editable field existed in the zombie snippet, + ;; try to revive the whole thing... + ;; + (let ((target-field (or (yas--snippet-active-field snippet) + (car (yas--snippet-fields snippet))))) + (when target-field + (setf (yas--snippet-control-overlay snippet) (yas--make-control-overlay snippet beg end)) + (overlay-put (yas--snippet-control-overlay snippet) 'yas--snippet snippet) + + (yas--move-to-field snippet target-field) + + (push `(apply yas--take-care-of-redo ,beg ,end ,snippet) + buffer-undo-list)))) + +(defun yas--snippet-create (begin end) + "Creates a snippet from an template inserted between BEGIN and END. + +Returns the newly created snippet." + (let ((snippet (yas--make-snippet))) + (goto-char begin) + (yas--snippet-parse-create snippet) + + ;; Sort and link each field + (yas--snippet-sort-fields snippet) + + ;; Create keymap overlay for snippet + (setf (yas--snippet-control-overlay snippet) + (yas--make-control-overlay snippet (point-min) (point-max))) + + ;; Move to end + (goto-char (point-max)) + + snippet)) + + +;;; Apropos adjacencies and "fom's": +;; +;; Once the $-constructs bits like "$n" and "${:n" are deleted in the +;; recently expanded snippet, we might actually have many fields, +;; mirrors (and the snippet exit) in the very same position in the +;; buffer. Therefore we need to single-link the +;; fields-or-mirrors-or-exit (which I have abbreviated to "fom") +;; according to their original positions in the buffer. +;; +;; Then we have operation `yas--advance-end-maybe' and +;; `yas--advance-start-maybe', which conditionally push the starts and +;; ends of these foms down the chain. +;; +;; This allows for like the printf with the magic ",": +;; +;; printf ("${1:%s}\\n"${1:$(if (string-match "%" text) "," "\);")} \ +;; $2${1:$(if (string-match "%" text) "\);" "")}$0 +;; +(defun yas--fom-start (fom) + (cond ((yas--field-p fom) + (yas--field-start fom)) + ((yas--mirror-p fom) + (yas--mirror-start fom)) + (t + (yas--exit-marker fom)))) + +(defun yas--fom-end (fom) + (cond ((yas--field-p fom) + (yas--field-end fom)) + ((yas--mirror-p fom) + (yas--mirror-end fom)) + (t + (yas--exit-marker fom)))) + +(defun yas--fom-next (fom) + (cond ((yas--field-p fom) + (yas--field-next fom)) + ((yas--mirror-p fom) + (yas--mirror-next fom)) + (t + (yas--exit-next fom)))) + +(defun yas--fom-parent-field (fom) + (cond ((yas--field-p fom) + (yas--field-parent-field fom)) + ((yas--mirror-p fom) + (yas--mirror-parent-field fom)) + (t + nil))) + +(defun yas--calculate-adjacencies (snippet) + "Calculate adjacencies for fields or mirrors of SNIPPET. + +This is according to their relative positions in the buffer, and +has to be called before the $-constructs are deleted." + (flet ((yas--fom-set-next-fom (fom nextfom) + (cond ((yas--field-p fom) + (setf (yas--field-next fom) nextfom)) + ((yas--mirror-p fom) + (setf (yas--mirror-next fom) nextfom)) + (t + (setf (yas--exit-next fom) nextfom)))) + (yas--compare-fom-begs (fom1 fom2) + (if (= (yas--fom-start fom2) (yas--fom-start fom1)) + (yas--mirror-p fom2) + (>= (yas--fom-start fom2) (yas--fom-start fom1)))) + (yas--link-foms (fom1 fom2) + (yas--fom-set-next-fom fom1 fom2))) + ;; make some yas--field, yas--mirror and yas--exit soup + (let ((soup)) + (when (yas--snippet-exit snippet) + (push (yas--snippet-exit snippet) soup)) + (dolist (field (yas--snippet-fields snippet)) + (push field soup) + (dolist (mirror (yas--field-mirrors field)) + (push mirror soup))) + (setq soup + (sort soup + #'yas--compare-fom-begs)) + (when soup + (reduce #'yas--link-foms soup))))) + +(defun yas--calculate-mirrors-in-fields (snippet mirror) + "Attempt to assign a parent field of SNIPPET to the mirror MIRROR. + +Use the tighest containing field if more than one field contains +the mirror. Intended to be called *before* the dollar-regions are +deleted." + (let ((min (point-min)) + (max (point-max))) + (dolist (field (yas--snippet-fields snippet)) + (when (and (<= (yas--field-start field) (yas--mirror-start mirror)) + (<= (yas--mirror-end mirror) (yas--field-end field)) + (< min (yas--field-start field)) + (< (yas--field-end field) max)) + (setq min (yas--field-start field) + max (yas--field-end field)) + (setf (yas--mirror-parent-field mirror) field))))) + +(defun yas--advance-end-maybe (fom newend) + "Maybe advance FOM's end to NEWEND if it needs it. + +If it does, also: + +* call `yas--advance-start-maybe' on FOM's next fom. + +* in case FOM is field call `yas--advance-end-maybe' on its parent + field + +Also, if FOM is an exit-marker, always call +`yas--advance-start-maybe' on its next fom. This is beacuse +exit-marker have identical start and end markers. + +" + (cond ((and fom (< (yas--fom-end fom) newend)) + (set-marker (yas--fom-end fom) newend) + (yas--advance-start-maybe (yas--fom-next fom) newend) + (yas--advance-end-of-parents-maybe (yas--fom-parent-field fom) newend)) + ((yas--exit-p fom) + (yas--advance-start-maybe (yas--fom-next fom) newend)))) + +(defun yas--advance-start-maybe (fom newstart) + "Maybe advance FOM's start to NEWSTART if it needs it. + +If it does, also call `yas--advance-end-maybe' on FOM." + (when (and fom (< (yas--fom-start fom) newstart)) + (set-marker (yas--fom-start fom) newstart) + (yas--advance-end-maybe fom newstart))) + +(defun yas--advance-end-of-parents-maybe (field newend) + "Like `yas--advance-end-maybe' but for parent fields. + +Only works for fields and doesn't care about the start of the +next FOM. Works its way up recursively for parents of parents." + (when (and field + (< (yas--field-end field) newend)) + (set-marker (yas--field-end field) newend) + (yas--advance-end-of-parents-maybe (yas--field-parent-field field) newend))) + +(defvar yas--dollar-regions nil + "When expanding the snippet the \"parse-create\" functions add + cons cells to this var") + +(defun yas--snippet-parse-create (snippet) + "Parse a recently inserted snippet template, creating all +necessary fields, mirrors and exit points. + +Meant to be called in a narrowed buffer, does various passes" + (let ((parse-start (point))) + ;; Reset the yas--dollar-regions + ;; + (setq yas--dollar-regions nil) + ;; protect escaped quote, backquotes and backslashes + ;; + (yas--protect-escapes nil `(?\\ ?` ?')) + ;; replace all backquoted expressions + ;; + (goto-char parse-start) + (yas--replace-backquotes) + ;; protect escapes again since previous steps might have generated + ;; more characters needing escaping + ;; + (goto-char parse-start) + (yas--protect-escapes) + ;; parse fields with {} + ;; + (goto-char parse-start) + (yas--field-parse-create snippet) + ;; parse simple mirrors and fields + ;; + (goto-char parse-start) + (yas--simple-mirror-parse-create snippet) + ;; parse mirror transforms + ;; + (goto-char parse-start) + (yas--transform-mirror-parse-create snippet) + ;; calculate adjacencies of fields and mirrors + ;; + (yas--calculate-adjacencies snippet) + ;; Delete $-constructs + ;; + (yas--delete-regions yas--dollar-regions) + ;; restore escapes + ;; + (goto-char parse-start) + (yas--restore-escapes) + ;; update mirrors for the first time + ;; + (yas--update-mirrors snippet) + ;; indent the best we can + ;; + (goto-char parse-start) + (yas--indent snippet))) + +(defun yas--indent-according-to-mode (snippet-markers) + "Indent current line according to mode, preserving +SNIPPET-MARKERS." + ;;; Apropos indenting problems.... + ;; + ;; `indent-according-to-mode' uses whatever `indent-line-function' + ;; is available. Some implementations of these functions delete text + ;; before they insert. If there happens to be a marker just after + ;; the text being deleted, the insertion actually happens after the + ;; marker, which misplaces it. + ;; + ;; This would also happen if we had used overlays with the + ;; `front-advance' property set to nil. + ;; + ;; This is why I have these `trouble-markers', they are the ones at + ;; they are the ones at the first non-whitespace char at the line + ;; (i.e. at `yas--real-line-beginning'. After indentation takes place + ;; we should be at the correct to restore them to. All other + ;; non-trouble-markers have been *pushed* and don't need special + ;; attention. + ;; + (goto-char (yas--real-line-beginning)) + (let ((trouble-markers (remove-if-not #'(lambda (marker) + (= marker (point))) + snippet-markers))) + (save-restriction + (widen) + (condition-case err + (indent-according-to-mode) + (error (yas--message 3 "Warning: `yas--indent-according-to-mode' having problems running %s" indent-line-function) + nil))) + (mapc #'(lambda (marker) + (set-marker marker (point))) + trouble-markers))) + +(defvar yas--indent-original-column nil) +(defun yas--indent (snippet) + (let ((snippet-markers (yas--collect-snippet-markers snippet))) + ;; Look for those $> + (save-excursion + (while (re-search-forward "$>" nil t) + (delete-region (match-beginning 0) (match-end 0)) + (when (not (eq yas-indent-line 'auto)) + (yas--indent-according-to-mode snippet-markers)))) + ;; Now do stuff for 'fixed and 'auto + (save-excursion + (cond ((eq yas-indent-line 'fixed) + (while (and (zerop (forward-line)) + (zerop (current-column))) + (indent-to-column yas--indent-original-column))) + ((eq yas-indent-line 'auto) + (let ((end (set-marker (make-marker) (point-max))) + (indent-first-line-p yas-also-auto-indent-first-line)) + (while (and (zerop (if indent-first-line-p + (prog1 + (forward-line 0) + (setq indent-first-line-p nil)) + (forward-line 1))) + (not (eobp)) + (<= (point) end)) + (yas--indent-according-to-mode snippet-markers)))) + (t + nil))))) + +(defun yas--collect-snippet-markers (snippet) + "Make a list of all the markers used by SNIPPET." + (let (markers) + (dolist (field (yas--snippet-fields snippet)) + (push (yas--field-start field) markers) + (push (yas--field-end field) markers) + (dolist (mirror (yas--field-mirrors field)) + (push (yas--mirror-start mirror) markers) + (push (yas--mirror-end mirror) markers))) + (let ((snippet-exit (yas--snippet-exit snippet))) + (when (and snippet-exit + (marker-buffer (yas--exit-marker snippet-exit))) + (push (yas--exit-marker snippet-exit) markers))) + markers)) + +(defun yas--real-line-beginning () + (let ((c (char-after (line-beginning-position))) + (n (line-beginning-position))) + (while (or (eql c ?\ ) + (eql c ?\t)) + (incf n) + (setq c (char-after n))) + n)) + +(defun yas--escape-string (escaped) + (concat "YASESCAPE" (format "%d" escaped) "PROTECTGUARD")) + +(defun yas--protect-escapes (&optional text escaped) + "Protect all escaped characters with their numeric ASCII value. + +With optional string TEXT do it in string instead of buffer." + (let ((changed-text text) + (text-provided-p text)) + (mapc #'(lambda (escaped) + (setq changed-text + (yas--replace-all (concat "\\" (char-to-string escaped)) + (yas--escape-string escaped) + (when text-provided-p changed-text)))) + (or escaped yas--escaped-characters)) + changed-text)) + +(defun yas--restore-escapes (&optional text escaped) + "Restore all escaped characters from their numeric ASCII value. + +With optional string TEXT do it in string instead of the buffer." + (let ((changed-text text) + (text-provided-p text)) + (mapc #'(lambda (escaped) + (setq changed-text + (yas--replace-all (yas--escape-string escaped) + (char-to-string escaped) + (when text-provided-p changed-text)))) + (or escaped yas--escaped-characters)) + changed-text)) + +(defun yas--replace-backquotes () + "Replace all the \"`(lisp-expression)`\"-style expression + with their evaluated value" + (while (re-search-forward yas--backquote-lisp-expression-regexp nil t) + (let ((current-string (match-string 1)) transformed) + (delete-region (match-beginning 0) (match-end 0)) + (setq transformed (yas--eval-lisp (yas--read-lisp (yas--restore-escapes current-string)))) + (goto-char (match-beginning 0)) + (when transformed (insert transformed))))) + +(defun yas--scan-sexps (from count) + (condition-case err + (with-syntax-table (standard-syntax-table) + (scan-sexps from count)) + (error + nil))) + +(defun yas--make-marker (pos) + "Create a marker at POS with `nil' `marker-insertion-type'" + (let ((marker (set-marker (make-marker) pos))) + (set-marker-insertion-type marker nil) + marker)) + +(defun yas--field-parse-create (snippet &optional parent-field) + "Parse most field expressions, except for the simple one \"$n\". + +The following count as a field: + +* \"${n: text}\", for a numbered field with default text, as long as N is not 0; + +* \"${n: text$(expression)}, the same with a lisp expression; + this is caught with the curiously named `yas--multi-dollar-lisp-expression-regexp' + +* the same as above but unnumbered, (no N:) and number is calculated automatically. + +When multiple expressions are found, only the last one counts." + ;; + (save-excursion + (while (re-search-forward yas--field-regexp nil t) + (let* ((real-match-end-0 (yas--scan-sexps (1+ (match-beginning 0)) 1)) + (number (and (match-string-no-properties 1) + (string-to-number (match-string-no-properties 1)))) + (brand-new-field (and real-match-end-0 + ;; break if on "$(" immediately + ;; after the ":", this will be + ;; caught as a mirror with + ;; transform later. + (not (save-match-data + (eq (string-match "$[ \t\n]*(" + (match-string-no-properties 2)) 0))) + ;; allow ${0: some exit text} + ;; (not (and number (zerop number))) + (yas--make-field number + (yas--make-marker (match-beginning 2)) + (yas--make-marker (1- real-match-end-0)) + parent-field)))) + (when brand-new-field + (goto-char real-match-end-0) + (push (cons (1- real-match-end-0) real-match-end-0) + yas--dollar-regions) + (push (cons (match-beginning 0) (match-beginning 2)) + yas--dollar-regions) + (push brand-new-field (yas--snippet-fields snippet)) + (save-excursion + (save-restriction + (narrow-to-region (yas--field-start brand-new-field) (yas--field-end brand-new-field)) + (goto-char (point-min)) + (yas--field-parse-create snippet brand-new-field))))))) + ;; if we entered from a parent field, now search for the + ;; `yas--multi-dollar-lisp-expression-regexp'. THis is used for + ;; primary field transformations + ;; + (when parent-field + (save-excursion + (while (re-search-forward yas--multi-dollar-lisp-expression-regexp nil t) + (let* ((real-match-end-1 (yas--scan-sexps (match-beginning 1) 1))) + ;; commit the primary field transformation if: + ;; + ;; 1. we don't find it in yas--dollar-regions (a subnested + ;; field) might have already caught it. + ;; + ;; 2. we really make sure we have either two '$' or some + ;; text and a '$' after the colon ':'. This is a FIXME: work + ;; my regular expressions and end these ugly hacks. + ;; + (when (and real-match-end-1 + (not (member (cons (match-beginning 0) + real-match-end-1) + yas--dollar-regions)) + (not (eq ?: + (char-before (1- (match-beginning 1)))))) + (let ((lisp-expression-string (buffer-substring-no-properties (match-beginning 1) + real-match-end-1))) + (setf (yas--field-transform parent-field) + (yas--read-lisp (yas--restore-escapes lisp-expression-string)))) + (push (cons (match-beginning 0) real-match-end-1) + yas--dollar-regions))))))) + +(defun yas--transform-mirror-parse-create (snippet) + "Parse the \"${n:$(lisp-expression)}\" mirror transformations." + (while (re-search-forward yas--transform-mirror-regexp nil t) + (let* ((real-match-end-0 (yas--scan-sexps (1+ (match-beginning 0)) 1)) + (number (string-to-number (match-string-no-properties 1))) + (field (and number + (not (zerop number)) + (yas--snippet-find-field snippet number))) + (brand-new-mirror + (and real-match-end-0 + field + (yas--make-mirror (yas--make-marker (match-beginning 0)) + (yas--make-marker (match-beginning 0)) + (yas--read-lisp + (yas--restore-escapes + (buffer-substring-no-properties (match-beginning 2) + (1- real-match-end-0)))))))) + (when brand-new-mirror + (push brand-new-mirror + (yas--field-mirrors field)) + (yas--calculate-mirrors-in-fields snippet brand-new-mirror) + (push (cons (match-beginning 0) real-match-end-0) yas--dollar-regions))))) + +(defun yas--simple-mirror-parse-create (snippet) + "Parse the simple \"$n\" fields/mirrors/exitmarkers." + (while (re-search-forward yas--simple-mirror-regexp nil t) + (let ((number (string-to-number (match-string-no-properties 1)))) + (cond ((zerop number) + + (setf (yas--snippet-exit snippet) + (yas--make-exit (yas--make-marker (match-end 0)))) + (save-excursion + (goto-char (match-beginning 0)) + (when yas-wrap-around-region + (cond (yas-selected-text + (insert yas-selected-text)) + ((and (eq yas-wrap-around-region 'cua) + cua-mode + (get-register ?0)) + (insert (prog1 (get-register ?0) + (set-register ?0 nil)))))) + (push (cons (point) (yas--exit-marker (yas--snippet-exit snippet))) + yas--dollar-regions))) + (t + (let ((field (yas--snippet-find-field snippet number))) + (if field + (let ((brand-new-mirror (yas--make-mirror + (yas--make-marker (match-beginning 0)) + (yas--make-marker (match-beginning 0)) + nil))) + (push brand-new-mirror + (yas--field-mirrors field)) + (yas--calculate-mirrors-in-fields snippet brand-new-mirror)) + (push (yas--make-field number + (yas--make-marker (match-beginning 0)) + (yas--make-marker (match-beginning 0)) + nil) + (yas--snippet-fields snippet)))) + (push (cons (match-beginning 0) (match-end 0)) + yas--dollar-regions)))))) + +(defun yas--delete-regions (regions) + "Sort disjuct REGIONS by start point, then delete from the back." + (mapc #'(lambda (reg) + (delete-region (car reg) (cdr reg))) + (sort regions + #'(lambda (r1 r2) + (>= (car r1) (car r2)))))) + +(defun yas--update-mirrors (snippet) + "Updates all the mirrors of SNIPPET." + (save-excursion + (let* ((fields (copy-list (yas--snippet-fields snippet))) + (field (car fields))) + (while field + (dolist (mirror (yas--field-mirrors field)) + (let ((mirror-parent-field (yas--mirror-parent-field mirror))) + ;; updatte this mirror + ;; + (yas--mirror-update-display mirror field) + ;; for mirrors-in-fields: schedule a possible + ;; parent field for reupdting later on + ;; + (when mirror-parent-field + (add-to-list 'fields mirror-parent-field 'append #'eq)) + ;; `yas--place-overlays' is needed if the active field and + ;; protected overlays have been changed because of insertions + ;; in `yas--mirror-update-display' + ;; + (when (eq field (yas--snippet-active-field snippet)) + (yas--place-overlays snippet field)))) + (setq fields (cdr fields)) + (setq field (car fields)))))) + +(defun yas--mirror-update-display (mirror field) + "Update MIRROR according to FIELD (and mirror transform)." + + (let* ((mirror-parent-field (yas--mirror-parent-field mirror)) + (reflection (and (not (and mirror-parent-field + (yas--field-modified-p mirror-parent-field))) + (or (yas--apply-transform mirror field 'empty-on-nil) + (yas--field-text-for-display field))))) + (when (and reflection + (not (string= reflection (buffer-substring-no-properties (yas--mirror-start mirror) + (yas--mirror-end mirror))))) + (goto-char (yas--mirror-start mirror)) + (yas--inhibit-overlay-hooks + (insert reflection)) + (if (> (yas--mirror-end mirror) (point)) + (delete-region (point) (yas--mirror-end mirror)) + (set-marker (yas--mirror-end mirror) (point)) + (yas--advance-start-maybe (yas--mirror-next mirror) (point)) + ;; super-special advance + (yas--advance-end-of-parents-maybe mirror-parent-field (point)))))) + +(defun yas--field-update-display (field snippet) + "Much like `yas--mirror-update-display', but for fields" + (when (yas--field-transform field) + (let ((transformed (and (not (eq (yas--field-number field) 0)) + (yas--apply-transform field field))) + (point (point))) + (when (and transformed + (not (string= transformed (buffer-substring-no-properties (yas--field-start field) + (yas--field-end field))))) + (setf (yas--field-modified-p field) t) + (goto-char (yas--field-start field)) + (yas--inhibit-overlay-hooks + (insert transformed) + (if (> (yas--field-end field) (point)) + (delete-region (point) (yas--field-end field)) + (set-marker (yas--field-end field) (point)) + (yas--advance-start-maybe (yas--field-next field) (point))) + t))))) + + +;;; Post-command hook: + +(defun yas--post-command-handler () + "Handles various yasnippet conditions after each command." + (cond (yas--protection-violation + (goto-char yas--protection-violation) + (setq yas--protection-violation nil)) + ((eq 'undo this-command) + ;; + ;; After undo revival the correct field is sometimes not + ;; restored correctly, this condition handles that + ;; + (let* ((snippet (car (yas--snippets-at-point))) + (target-field (and snippet + (find-if-not #'(lambda (field) + (yas--field-probably-deleted-p snippet field)) + (remove nil + (cons (yas--snippet-active-field snippet) + (yas--snippet-fields snippet))))))) + (when target-field + (yas--move-to-field snippet target-field)))) + ((not (yas--undo-in-progress)) + ;; When not in an undo, check if we must commit the snippet + ;; (user exited it). + (yas--check-commit-snippet)))) + +;;; Fancy docs: +;; +;; The docstrings for some functions are generated dynamically +;; depending on the context. +;; +(put 'yas-expand 'function-documentation + '(yas--expand-from-trigger-key-doc)) +(defun yas--expand-from-trigger-key-doc () + "A doc synthethizer for `yas--expand-from-trigger-key-doc'." + (let ((fallback-description + (cond ((eq yas-fallback-behavior 'call-other-command) + (let* ((yas-minor-mode nil) + (fallback (key-binding (read-kbd-macro yas-trigger-key)))) + (or (and fallback + (format " call command `%s'." (pp-to-string fallback))) + " do nothing."))) + ((eq yas-fallback-behavior 'return-nil) + ", do nothing.") + (t + ", defer to `yas--fallback-behaviour' :-)")))) + (concat "Expand a snippet before point. If no snippet +expansion is possible," + fallback-description + "\n\nOptional argument FIELD is for non-interactive use and is an +object satisfying `yas--field-p' to restrict the expansion to."))) + +(put 'yas-expand-from-keymap 'function-documentation '(yas--expand-from-keymap-doc)) +(defun yas--expand-from-keymap-doc () + "A doc synthethizer for `yas--expand-from-keymap-doc'." + (add-hook 'temp-buffer-show-hook 'yas--snippet-description-finish-runonce) + (concat "Expand/run snippets from keymaps, possibly falling back to original binding.\n" + (when (eq this-command 'describe-key) + (let* ((vec (this-single-command-keys)) + (templates (mapcan #'(lambda (table) + (yas--fetch table vec)) + (yas--get-snippet-tables))) + (yas--direct-keymaps nil) + (fallback (key-binding vec))) + (concat "In this case, " + (when templates + (concat "these snippets are bound to this key:\n" + (yas--template-pretty-list templates) + "\n\nIf none of these expands, ")) + (or (and fallback + (format "fallback `%s' will be called." (pp-to-string fallback))) + "no fallback keybinding is called.")))))) + +(defun yas--template-pretty-list (templates) + (let ((acc) + (yas-buffer-local-condition 'always)) + (dolist (plate templates) + (setq acc (concat acc "\n*) " + (propertize (concat "\\\\snippet `" (car plate) "'") + 'yasnippet (cdr plate))))) + acc)) + +(define-button-type 'help-snippet-def + :supertype 'help-xref + 'help-function (lambda (template) (yas--visit-snippet-file-1 template)) + 'help-echo (purecopy "mouse-2, RET: find snippets's definition")) + +(defun yas--snippet-description-finish-runonce () + "Final adjustments for the help buffer when snippets are concerned." + (yas--create-snippet-xrefs) + (remove-hook 'temp-buffer-show-hook 'yas--snippet-description-finish-runonce)) + +(defun yas--create-snippet-xrefs () + (save-excursion + (goto-char (point-min)) + (while (search-forward-regexp "\\\\\\\\snippet[ \s\t]+`\\([^']+\\)'" nil t) + (let ((template (get-text-property (match-beginning 1) + 'yasnippet))) + (when template + (help-xref-button 1 'help-snippet-def template) + (kill-region (match-end 1) (match-end 0)) + (kill-region (match-beginning 0) (match-beginning 1))))))) + +(defun yas--expand-uuid (mode-symbol uuid &optional start end expand-env) + "Expand a snippet registered in MODE-SYMBOL's table with UUID. + +Remaining args as in `yas-expand-snippet'." + (let* ((table (gethash mode-symbol yas--tables)) + (yas--current-template (and table + (gethash uuid (yas--table-uuidhash table))))) + (when yas--current-template + (yas-expand-snippet (yas--template-content yas--current-template))))) + +;;; Utils + +(defvar yas-verbosity 4 + "Log level for `yas--message' 4 means trace most anything, 0 means nothing.") + +(defun yas--message (level message &rest args) + (when (> yas-verbosity level) + (message (apply #'yas--format message args)))) + +(defun yas--format (format-control &rest format-args) + (apply #'format (concat "[yas] " format-control) format-args)) + + +;;; Some hacks: +;; +;; The functions +;; +;; `locate-dominating-file' +;; `region-active-p' +;; +;; added for compatibility in emacsen < 23 +(unless (>= emacs-major-version 23) + (unless (fboundp 'region-active-p) + (defun region-active-p () (and transient-mark-mode mark-active))) + + (unless (fboundp 'locate-dominating-file) + (defvar locate-dominating-stop-dir-regexp + "\\`\\(?:[\\/][\\/][^\\/]+[\\/]\\|/\\(?:net\\|afs\\|\\.\\.\\.\\)/\\)\\'" + "Regexp of directory names which stop the search in `locate-dominating-file'. +Any directory whose name matches this regexp will be treated like +a kind of root directory by `locate-dominating-file' which will stop its search +when it bumps into it. +The default regexp prevents fruitless and time-consuming attempts to find +special files in directories in which filenames are interpreted as hostnames, +or mount points potentially requiring authentication as a different user.") + + (defun locate-dominating-file (file name) + "Look up the directory hierarchy from FILE for a file named NAME. +Stop at the first parent directory containing a file NAME, +and return the directory. Return nil if not found." + ;; We used to use the above locate-dominating-files code, but the + ;; directory-files call is very costly, so we're much better off doing + ;; multiple calls using the code in here. + ;; + ;; Represent /home/luser/foo as ~/foo so that we don't try to look for + ;; `name' in /home or in /. + (setq file (abbreviate-file-name file)) + (let ((root nil) + (prev-file file) + ;; `user' is not initialized outside the loop because + ;; `file' may not exist, so we may have to walk up part of the + ;; hierarchy before we find the "initial UUID". + (user nil) + try) + (while (not (or root + (null file) + ;; FIXME: Disabled this heuristic because it is sometimes + ;; inappropriate. + ;; As a heuristic, we stop looking up the hierarchy of + ;; directories as soon as we find a directory belonging + ;; to another user. This should save us from looking in + ;; things like /net and /afs. This assumes that all the + ;; files inside a project belong to the same user. + ;; (let ((prev-user user)) + ;; (setq user (nth 2 (file-attributes file))) + ;; (and prev-user (not (equal user prev-user)))) + (string-match locate-dominating-stop-dir-regexp file))) + (setq try (file-exists-p (expand-file-name name file))) + (cond (try (setq root file)) + ((equal file (setq prev-file file + file (file-name-directory + (directory-file-name file)))) + (setq file nil)))) + root)))) + +;; `c-neutralize-syntax-in-CPP` sometimes fires "End of Buffer" error +;; (when it execute forward-char) and interrupt the after change +;; hook. Thus prevent the insert-behind hook of yasnippet to be +;; invoked. Here's a way to reproduce it: + +;; # open a *new* Emacs. +;; # load yasnippet. +;; # open a *new* .cpp file. +;; # input "inc" and press TAB to expand the snippet. +;; # select the `#include <...>` snippet. +;; # type inside `<>` + +(defadvice c-neutralize-syntax-in-CPP + (around yas--mp/c-neutralize-syntax-in-CPP activate) + "Adviced `c-neutralize-syntax-in-CPP' to properly +handle the end-of-buffer error fired in it by calling +`forward-char' at the end of buffer." + (condition-case err + ad-do-it + (error (message (error-message-string err))))) + +;; disable c-electric-* serial command in YAS fields +(add-hook 'c-mode-common-hook + '(lambda () + (dolist (k '(":" ">" ";" "<" "{" "}")) + (define-key (symbol-value (make-local-variable 'yas-keymap)) + k 'self-insert-command)))) + +;;; Backward compatibility to to yasnippet <= 0.7 +(defvar yas--exported-syms '(;; `defcustom's + ;; + yas-snippet-dirs + yas-prompt-functions + yas-indent-line + yas-also-auto-indent-first-line + yas-snippet-revival + yas-trigger-key + yas-next-field-key + yas-prev-field-key + yas-skip-and-clear-key + yas-triggers-in-field + yas-fallback-behavior + yas-choose-keys-first + yas-choose-tables-first + yas-use-menu + yas-trigger-symbol + yas-wrap-around-region + yas-good-grace + yas-visit-from-menu + yas-expand-only-for-last-commands + yas-field-highlight-face + + ;; these vars can be customized as well + ;; + yas-keymap + yas-verbosity + yas-extra-modes + yas-key-syntaxes + yas-after-exit-snippet-hook + yas-before-expand-snippet-hook + yas-buffer-local-condition + + ;; prompting functions + ;; + yas-x-prompt + yas-ido-prompt + yas-no-prompt + yas-completing-prompt + yas-dropdown-prompt + + ;; interactive functions + ;; + yas-expand + yas-minor-mode + yas-global-mode + yas-direct-keymaps-reload + yas-minor-mode-on + yas-load-directory + yas-reload-all + yas-compile-directory + yas-recompile-all + yas-about + yas-expand-from-trigger-key + yas-expand-from-keymap + yas-insert-snippet + yas-visit-snippet-file + yas-new-snippet + yas-load-snippet-buffer + yas-tryout-snippet + yas-describe-tables + yas-next-field-or-maybe-expand + yas-next-field + yas-prev-field + yas-abort-snippet + yas-exit-snippet + yas-exit-all-snippets + yas-skip-and-clear-or-delete-char + + ;; symbols that I "exported" for use + ;; in snippets and hookage + ;; + yas-expand-snippet + yas-define-snippets + yas-define-menu + yas-snippet-beg + yas-snippet-end + yas-modified-p + yas-moving-away-p + yas-text + yas-substr + yas-choose-value + yas-key-to-value + yas-throw + yas-verify-value + yas-field-value + yas-text + yas-selected-text + yas-default-from-field + yas-inside-string + yas-unimplemented + yas-define-condition-cache + yas-hippie-try-expand + + ;; debug definitions + ;; yas-debug-snippet-vars + ;; yas-exterminate-package + ;; yas-debug-test + + ;; testing definitions + ;; yas-should-expand + ;; yas-should-not-expand + ;; yas-mock-insert + ;; yas-make-file-or-dirs + ;; yas-variables + ;; yas-saving-variables + ;; yas-call-with-snippet-dirs + ;; yas-with-snippet-dirs +)) + +(dolist (sym yas--exported-syms) + (let ((backported (intern (replace-regexp-in-string "^yas-" "yas/" (symbol-name sym))))) + (when (boundp sym) + (make-obsolete-variable backported sym "yasnippet 0.8") + (defvaralias backported sym)) + (when (fboundp sym) + (make-obsolete backported sym "yasnippet 0.8") + (defalias backported sym)))) + + +(provide 'yasnippet) + +;;; yasnippet.el ends here +;; Local Variables: +;; coding: utf-8 +;; End: -- 2.39.2