diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..0ea2107 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "extensions/yasnippet"] + path = extensions/yasnippet + url = https://github.com/capitaomorte/yasnippet.git diff --git a/epy-editing.el b/epy-editing.el index fe70bd6..b8a2b09 100644 --- a/epy-editing.el +++ b/epy-editing.el @@ -1,4 +1,4 @@ -;; ibuffer by default +0;95;c;; ibuffer by default (global-set-key (kbd "C-x C-b") 'ibuffer) ;; Ido mode with fuzzy matching @@ -25,14 +25,12 @@ (defun epy-django-snippets () "Load django snippets" (interactive) - (yas/load-directory (concat epy-install-dir "snippets/django")) - ) + (add-to-list 'yas-snippet-dirs (concat epy-install-dir "snippets/django"))) - -(yas/initialize) -(yas/load-directory (concat epy-install-dir "extensions/yasnippet/snippets")) -(setq yas/prompt-functions '(yas/dropdown-prompt yas/ido-prompt yas/x-prompt)) -(setq yas/wrap-around-region 'cua) +(yas-global-mode 1) +(add-to-list 'yas-snippet-dirs (concat epy-install-dir "extensions/yasnippet/snippets")) +(setq yas-prompt-functions '(yas-dropdown-prompt yas-ido-prompt yas-x-prompt)) +(setq yas-wrap-around-region 'cua) ;; Eproject project management with emacs ;; (require 'eproject) diff --git a/epy-init.el b/epy-init.el index cbf8b3f..1bf92b3 100644 --- a/epy-init.el +++ b/epy-init.el @@ -11,6 +11,7 @@ (add-to-list 'load-path epy-install-dir) (require 'epy-setup) (require 'epy-python) +(load-file (concat epy-install-dir "epy-completion.el")) (require 'epy-completion) (require 'epy-editing) (require 'epy-nose) diff --git a/extensions/yasnippet b/extensions/yasnippet new file mode 160000 index 0000000..be2f815 --- /dev/null +++ b/extensions/yasnippet @@ -0,0 +1 @@ +Subproject commit be2f815c43deb74e0f809ed47debc4aa2e67ea1e diff --git a/extensions/yasnippet/README b/extensions/yasnippet/README deleted file mode 100644 index e716140..0000000 --- a/extensions/yasnippet/README +++ /dev/null @@ -1,8 +0,0 @@ -YASnippet re-design and re-writing of my original extension -smart-snippet. The goal is ease of use and full features. - -For detailed document, you can either download the document -release of YASnippet or view it directly online: - -http://pluskid.lifegoo.com/upload/project/yasnippet/doc/index.html - diff --git a/extensions/yasnippet/Rakefile b/extensions/yasnippet/Rakefile deleted file mode 100644 index 7625d13..0000000 --- a/extensions/yasnippet/Rakefile +++ /dev/null @@ -1,79 +0,0 @@ -# -*- Ruby -*- - -require 'fileutils' - -def find_version - File.read("yasnippet.el") =~ /;; Package-version: *([0-9.]+[a-z]?) *$/ - $version = $1 -end -find_version -FileUtils.mkdir_p('pkg') - -desc "generate bundle file for classic snippets." -task :bundle do - sh 'emacs --batch -l yasnippet.el --eval "(yas/compile-bundle)"' - sh "tar czf pkg/yasnippet-bundle-#{$version}.el.tgz yasnippet-bundle.el" -end - -desc "generate bundle file for textmate snippets." -task :textmate_bundle do - sh 'emacs --batch -l yasnippet.el --eval "(yas/compile-textmate-bundle)"' - sh "tar czf pkg/yasnippet-textmate-bundle-#{$version}.el.tgz yasnippet-textmate-bundle.el" -end - -desc "convert some textmate bundles to yasnippets" -task :convert_bundles do - sh 'for bundle in html ruby rails; do ./extras/textmate_import.rb -d extras/bundles/$bundle-bundle -o extras/imported/$bundle-mode -q ; done' -end - -desc "create a release package" -task :package do - release_dir = "pkg/yasnippet-#{$version}" - FileUtils.mkdir_p(release_dir) - files = ['extras', 'snippets', 'yasnippet.el', 'dropdown-list.el'] - FileUtils.cp_r files, release_dir - FileUtils.rm_r Dir[release_dir + "/**/.svn"] - FileUtils.cd 'pkg' - sh "tar cjf yasnippet-#{$version}.tar.bz2 yasnippet-#{$version}" - FileUtils.cd ".." -end - -desc "create a release package and upload it to google code" -task :release => [:bundle, :package, 'doc:archive'] do - sh "googlecode_upload.py -s \"YASnippet Release #{$version}\"" + - " -p yasnippet -l \"Featured,Type-Package,OpSys-All\"" + - " pkg/yasnippet-#{$version}.tar.bz2" - sh "googlecode_upload.py -s \"YASnippet Bundle #{$version}\"" + - " -p yasnippet -l \"Featured,Type-Package,OpSys-All\"" + - " pkg/yasnippet-bundle-#{$version}.el.tgz" - sh "googlecode_upload.py -s \"YASnippet Document #{$version}\"" + - " -p yasnippet -l \"Featured,Type-Docs,OpSys-All\"" + - " pkg/yasnippet-doc-#{$version}.tar.bz2" - FileUtils.cp "yasnippet-bundle.el", "pkg/yasnippet-bundle-#{$version}.el" - sh "echo for ELPA | mutt -a pkg/yasnippet-bundle-#{$version}.el -s " + - "'YASnippet bundle v#{$version}' elpa@tromey.com" -end - -rule '.html' => '.rst' do |t| - sh "doc/compile-doc.py #{t.source} > #{t.name}" -end -desc "Generate document" -task :doc => FileList['doc/*.rst'].ext('html') - -namespace :doc do - task :archive do - release_dir = "pkg/yasnippet-#{$version}" - FileUtils.mkdir_p(release_dir) - sh "tar cjf pkg/yasnippet-doc-#{$version}.tar.bz2 " + - "--exclude=doc/.svn --exclude=doc/images/.svn doc/*.html doc/images" - end -end - -desc "Compile yasnippet.el into yasnippet.elc" - -rule '.elc' => '.el' do |t| - sh "emacs --batch -L . --eval \"(byte-compile-file \\\"#{t.source}\\\")\"" -end -task :compile => FileList["yasnippet.el", "dropdown-list.el"].ext('elc') - -task :default => :doc diff --git a/extensions/yasnippet/doc/changelog.html b/extensions/yasnippet/doc/changelog.html deleted file mode 100644 index 7a0f2c3..0000000 --- a/extensions/yasnippet/doc/changelog.html +++ /dev/null @@ -1,381 +0,0 @@ - - - - - - -ChangeLog - - - -
-
-
-
- -
-
-
-
-

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

-
-

0.6.1c / 2009-08-13

-
    -
  • Fixed issues 99, 98, 93, -90, 91, 88, 87. Thanks everybody.
  • -
  • More compliant customization group Issue94, (thanks -wyuenho).
  • -
  • Added workaround for issue 97 in the FAQ
  • -
  • Small updates to documentation.
  • -
-
-
-

0.6.1b / 2009-08-29

-
    -
  • Much more powerful menu. See The YASnippet menu.
  • -
  • New ways to organize snippets. See Organizing snippets.
  • -
  • Added yas/also-auto-indent-first-line customization variable.
  • -
  • Renamed directive # env: to # expand-env:
  • -
  • Rewrote much of the documentation.
  • -
  • Added TextMate import tool textmate-import.rb to to svn -repository (see "extras/")
  • -
  • Added experimental bundle of textmate snippets -yasnippet-textmate-bundle.el
  • -
  • Fixed Issue 74 (thanks -rmartin.k...@gmail.com)
  • -
  • Fixed Issues 80 through 84 (thanks -Moritz Bunkus)
  • -
  • Fixed many more issues...
  • -
-
-
-

0.6.0c / 2009-07-27

-
    -
  • Now byte compiles correctly with no warnings.
  • -
  • Fixed Issue 68 with -mouse-clicking alternatives in ido-mode.
  • -
  • Added yas/also-auto-indent-first-line customization variable.
  • -
-
-
-

0.6.0b / 2009-07-25

-
    -
  • Nested placeholders of the type <div${1: id="${2:someid}"}> $0.
  • -
  • More robust undo/redo support.
  • -
  • Stacked snippet expansion (snippet in snippet).
  • -
  • Transformation on a primary field with syntax ${1:default$(transform)}
  • -
  • Validations on field exit through the yas/verify-value -primary field transformation.
  • -
  • Wrapping the region in the exit marker $0 of the snippet. Use -yas/wrap-around-region.
  • -
  • Auto-indentation. Use yas/indent-line set to 'auto
  • -
  • Easier definition of snippets. Use yas/find-snippets or -yas/visit-snippet-file. In the new snippet-mode use -yas/load-snippet-buffer and yas/tryout-snippet.
  • -
  • Customization group yasnippet.
  • -
  • Overriding customization variables in snippets. Use the env: -let-form template keyword.
  • -
  • Fixed Issue 60
  • -
  • Fixed Issue 65
  • -
  • Fixed Issue 56
  • -
-
-
-

0.5.10 / 2009-02-11

-
    -
  • Added grouping support so that the snippets in the menu can be -groupped together.
  • -
  • Make the bundle ELPA -compatible.
  • -
-
-
-

0.5.9 / 2009-01-21

-
    -
  • Fixed the bug of disabling the auto-indenting of cc-mode.
  • -
-
-
-

0.5.8 / 2009-01-15

-
    -
  • Added a key property in snippet definition for snippet names -that are not valid path name.
  • -
  • Fixed some bugs of indenting (Issue 44, Issue -46).
  • -
  • Fixed Issue 45 by -providing a proper default value for yas/buffer-local-condition.
  • -
  • Added helper function yas/substr for convenient mirror -transformation.
  • -
  • Make variable yas/registered-snippet properly initialized.
  • -
  • Fixed the overlay error when overlay becomes empty (Issue 49 and -Issue 48). This -bug has occurred and been fixed earlier, and should not have -happened if we have proper regression test.
  • -
  • Added a workaround for c-electric- serial commands (Issue 27).
  • -
-
-
-

0.5.7 / 2008-12-03

-
    -
  • Fixed Issue 28 of -properly clean up snippet (by joaotavora).
  • -
  • Added a new section "Field-level undo functionality" to correct -Issue 33 -(by joaotavora).
  • -
  • Added some snippets from users for sql, erlang, scala, html, xml, latex, etc.
  • -
  • Fixed Issue 16 by adding -$> support. Here's the doc for $> indenting.
  • -
-
-
-

0.5.6 / 2008-08-07

-
    -
  • Added a buffer local variable yas/dont-activate to turn off -yas/minor-mode in some major modes. See Issue 29.
  • -
  • Make the environment of elisp evaluation more friendly to -(current-column).
  • -
  • Fixed the regular expression bug in python-mode snippets.
  • -
  • Use filename or full key extension for snippet name if no name -property is defined.
  • -
-
-
-

0.5.5 / 2008-05-29

-
    -
  • Tweak yas/extra-mode-hooks so that it can be more easily -customized.
  • -
  • Add an entry in FAQ about why TAB key doesn't work in some -modes.
  • -
-
-
-

0.5.4 / 2008-05-15

-
    -
  • Added ox-mode-hook and python-mode-hook to -yas/extra-mode-hooks to fix the problem YASnippet is not enabled -in those modes.
  • -
-
-
-

0.5.3 / 2008-05-07

-
    -
  • Fix indent of python-mode snippets.
  • -
  • Fix a bug of dropdown-list: conflicts with color-theme (Issue 23). Thanks -Mike.
  • -
  • Fix a bug of condition system.
  • -
-
-
-

0.5.2 / 2008-04-20

-
    -
  • Fix a bug for comparing string to symbol using string= (which -will fire an error).
  • -
-
-
-

0.5.1 / 2008-04-14

-
    -
  • Use a beautiful css style in the document.
  • -
-
-
-

0.5.0 / 2008-04-10

-
    -
  • Integrate with hippie-expand. Just add yas/hippie-try-expand to -hippie-expand-try-functions-list.
  • -
  • If you set yas/fall-back-behavior to 'return-nil, YASnippet -will return nil when it can't find a snippet to expand.
  • -
  • Defect fix: the condition of a snippet was evaluated twice in -earlier version.
  • -
  • Deleting snippet (using C-w or C-k) won't cause serious -problem now.
  • -
  • Several complex snippet for python-mode from Yasser included in the -distribution.
  • -
-
-
-

0.4.5 / 2008-04-07

-
    -
  • Merge the latest dropdown-list.el.
  • -
  • Add snippets for f90-mode from Li Zhu.
  • -
  • Bug fix: l-safe-expr-p: Lisp nesting exceeds max-lisp-eval-depth -error when several (more than two) snippets overlaps. Thanks -sunwaybupt@newsmth for reporting this bug.
  • -
-
-
-

0.4.4 / 2008-03-24

-
    -
  • Bug fix: dropdown-list.el doesn't recognize [return] properly.
  • -
-
-
-

0.4.3 / 2008-03-23

-
    -
  • Bug fix: failed to recognize user customized yas/trigger-key.
  • -
-
-
-

0.4.2 / 2008-03-22

-
    -
  • Make a separate document package for release. Also make document -available online.
  • -
-
-
-

0.4.1 / 2008-03-21

-
    -
  • Make sure yas/minor-mode's key bindings always take priority to -other minor modes.
  • -
-
-
-

0.4.0 / 2008-03-20

-
    -
  • Document refinement and released with YASnippet. Most of the Online -wiki document will be deprecated soon.
  • -
  • Powerful condition system added to yasnippet!
  • -
  • Incorporate dropdown-list.el and make it default way for -selecting multiple candidates. Thanks to Jaeyoun Chung.
  • -
  • yas/before-expand-snippet-hook
  • -
-
-
-

0.3.2 / 2008-03-19

-
    -
  • Enhancement: A better way to define minor-mode. Thanks to Kentaro -Kuribayashi. See this thread -for more details.
  • -
-
-
-

0.3.1 / 2008-03-17

-
    -
  • Bug fix: Emacs get confused when a field is deleted. See issue 10.
  • -
-
-
-

0.3.0 / 2008-03-16

-
    -
  • Add a yas/after-exit-snippet-hook so that you can do something like -indent-region or fill-region after finish the snippet.
  • -
  • Use minor-mode instead of global-set-key to bind the trigger -key. Now the trigger key and fall-back behavior can be more -flexible. Not constrained to <tab>. Thanks to Trey Jackson. See -this thread -for more details.
  • -
  • Now user can customize the popup function for selecting multiple -candidate for the same snippet key.
  • -
  • Support dropdown-list.el to be a better way to select multiple -candidate when in text mode.
  • -
-
-
-

0.2.3 / 2008-03-15

-
    -
  • Bug in non-window (-nw) mode when there's multiple candidate to -expand. See issue 7.
  • -
  • Allow expanding another snippet as long as not currently inside a -field.
  • -
-
-
-

0.2.2 / 2008-03-13

-
    -
  • Added customized face for fields and mirrors. Better in dark -background. And users can customize it.
  • -
-
-
-

0.2.1 / 2008-03-10

-
    -
  • Fix the insert-behind problem under both Emacs 22 and Emacs 23.
  • -
-
-
-

0.2.0 / 2008-03-10

-
    -
  • Use big keymap overlay to detect insert-behind event manually to -avoid sometimes missed hook calls. See issue 3 for more -details.
  • -
  • Support parent snippet table. Now you can set (for example) -cc-mode as common mode for c++-mode, c-mode and -java-mode. They'll share snippets defined for cc-mode.
  • -
-
-
-

0.1.1 / 2008-03-08

-
    -
  • Add a rake task to upload to google code.
  • -
  • Use elisp compile-bundle function instead of python scrip
  • -
-
-
-

0.1.0 / 2008-03-07

-
    -
  • Embedded elisp support.
  • -
  • Fields navigation support.
  • -
  • Mirror of fields support.
  • -
  • Menu-bar support.
  • -
  • Multiple snippets with same name support.
  • -
  • Popup menu for multiple snippet with same name support.
  • -
  • Transformation of fields support.
  • -
  • Load directory support.
  • -
  • Compile bundle support.
  • -
-
-
-
-
-
-
-
- - -
- - diff --git a/extensions/yasnippet/doc/changelog.rst b/extensions/yasnippet/doc/changelog.rst deleted file mode 100644 index 3896fce..0000000 --- a/extensions/yasnippet/doc/changelog.rst +++ /dev/null @@ -1,319 +0,0 @@ -========= -ChangeLog -========= - -.. _Organizing Snippets: snippet-organization.html -.. _Expanding Snippets: snippet-expansion.html -.. _Writing Snippets: snippet-development.html -.. _The YASnippet Menu: snippet-menu.html - -0.6.1c / 2009-08-13 -=================== - -* Fixed `issues `_ 99, 98, 93, - 90, 91, 88, 87. Thanks everybody. -* More compliant customization group `Issue94 - `_, (thanks - wyuenho). -* Added workaround for issue 97 in the FAQ -* Small updates to documentation. - -0.6.1b / 2009-08-29 -=================== - -* Much more powerful menu. See `The YASnippet menu`_. -* New ways to organize snippets. See `Organizing snippets`_. -* Added ``yas/also-auto-indent-first-line`` customization variable. -* Renamed directive ``# env:`` to ``# expand-env:`` -* Rewrote much of the documentation. -* Added TextMate import tool ``textmate-import.rb`` to to svn - repository (see "extras/") -* Added *experimental* bundle of textmate snippets - ``yasnippet-textmate-bundle.el`` -* Fixed `Issue 74 - `_ (thanks - rmartin.k...@gmail.com) -* Fixed `Issues 80 through 84 - `_ (thanks - Moritz Bunkus) -* Fixed many more issues... - - -0.6.0c / 2009-07-27 -=================== - -* Now byte compiles correctly with no warnings. -* Fixed `Issue 68 - `_ with - mouse-clicking alternatives in ``ido-mode``. -* Added ``yas/also-auto-indent-first-line`` customization variable. - - -0.6.0b / 2009-07-25 -=================== - -* Nested placeholders of the type `` $0``. - -* More robust undo/redo support. - -* Stacked snippet expansion (*snippet in snippet*). - -* Transformation on a primary field with syntax ``${1:default$(transform)}`` - -* Validations on field exit through the ``yas/verify-value`` - primary field transformation. - -* Wrapping the region in the exit marker ``$0`` of the snippet. Use - ``yas/wrap-around-region``. - -* Auto-indentation. Use ``yas/indent-line`` set to ``'auto`` - -* Easier definition of snippets. Use ``yas/find-snippets`` or - ``yas/visit-snippet-file``. In the new ``snippet-mode`` use - ``yas/load-snippet-buffer`` and ``yas/tryout-snippet``. - -* Customization group ``yasnippet``. - -* Overriding customization variables in snippets. Use the ``env: - let-form`` template keyword. - -* Fixed `Issue 60 - `_ -* Fixed `Issue 65 - `_ -* Fixed `Issue 56 - `_ - -0.5.10 / 2009-02-11 -=================== - -* Added *grouping* support so that the snippets in the menu can be - groupped together. -* Make the bundle `ELPA `_ - compatible. - -0.5.9 / 2009-01-21 -================== - -* Fixed the bug of disabling the auto-indenting of ``cc-mode``. - -0.5.8 / 2009-01-15 -================== - -* Added a ``key`` property in snippet definition for snippet names - that are not valid path name. -* Fixed some bugs of indenting (`Issue 44 - `_, `Issue - 46 `_). -* Fixed `Issue 45 - `_ by - providing a proper default value for ``yas/buffer-local-condition``. -* Added helper function ``yas/substr`` for convenient mirror - transformation. -* Make variable ``yas/registered-snippet`` properly initialized. -* Fixed the overlay error when overlay becomes empty (`Issue 49 - `_ and - `Issue 48 - `_). This - bug has occurred and been fixed earlier, and should not have - happened if we have proper regression test. -* Added a workaround for ``c-electric-`` serial commands (`Issue 27 - `_). - -0.5.7 / 2008-12-03 -================== - -* Fixed `Issue 28 - `_ of - properly clean up snippet (by joaotavora). -* Added a new section "Field-level undo functionality" to correct - `Issue 33 `_ - (by joaotavora). -* Added some snippets from users for sql, erlang, scala, html, xml, latex, etc. -* Fixed `Issue 16 - `_ by adding - ``$>`` support. Here's the `doc for $> indenting - `_. - -0.5.6 / 2008-08-07 -================== - -* Added a buffer local variable ``yas/dont-activate`` to turn off - ``yas/minor-mode`` in some major modes. See `Issue 29 - `_. -* Make the environment of elisp evaluation more friendly to - ``(current-column)``. -* Fixed the regular expression bug in python-mode snippets. -* Use filename or full key extension for snippet name if no ``name`` - property is defined. - -0.5.5 / 2008-05-29 -================== - -* Tweak ``yas/extra-mode-hooks`` so that it can be more easily - customized. -* Add an entry in FAQ about why ``TAB`` key doesn't work in some - modes. - -0.5.4 / 2008-05-15 -================== - -* Added ``ox-mode-hook`` and ``python-mode-hook`` to - ``yas/extra-mode-hooks`` to fix the problem YASnippet is not enabled - in those modes. - -0.5.3 / 2008-05-07 -================== - -* Fix indent of python-mode snippets. -* Fix a bug of dropdown-list: conflicts with color-theme (`Issue 23 - `_). Thanks - Mike. -* Fix a bug of condition system. - -0.5.2 / 2008-04-20 -================== - -* Fix a bug for comparing string to symbol using ``string=`` (which - will fire an error). - -0.5.1 / 2008-04-14 -================== - -* Use a beautiful css style in the document. - -0.5.0 / 2008-04-10 -================== - -* Integrate with hippie-expand. Just add ``yas/hippie-try-expand`` to - ``hippie-expand-try-functions-list``. -* If you set ``yas/fall-back-behavior`` to ``'return-nil``, YASnippet - will return nil when it can't find a snippet to expand. -* Defect fix: the condition of a snippet was evaluated twice in - earlier version. -* Deleting snippet (using ``C-w`` or ``C-k``) won't cause serious - problem now. -* Several complex snippet for python-mode from Yasser included in the - distribution. - -0.4.5 / 2008-04-07 -================== - -* Merge the latest dropdown-list.el. -* Add snippets for f90-mode from Li Zhu. -* Bug fix: l-safe-expr-p: Lisp nesting exceeds ``max-lisp-eval-depth`` - error when several (more than two) snippets overlaps. Thanks - sunwaybupt@newsmth for reporting this bug. - -0.4.4 / 2008-03-24 -================== - -* Bug fix: dropdown-list.el doesn't recognize [return] properly. - -0.4.3 / 2008-03-23 -================== - -* Bug fix: failed to recognize user customized yas/trigger-key. - -0.4.2 / 2008-03-22 -================== - -* Make a separate document package for release. Also make document - available online. - -0.4.1 / 2008-03-21 -================== - -* Make sure ``yas/minor-mode``'s key bindings always take priority to - other minor modes. - -0.4.0 / 2008-03-20 -================== - -* Document refinement and released with YASnippet. Most of the Online - wiki document will be deprecated soon. -* Powerful condition system added to yasnippet! -* Incorporate ``dropdown-list.el`` and make it default way for - selecting multiple candidates. Thanks to `Jaeyoun Chung - `_. -* yas/before-expand-snippet-hook - -0.3.2 / 2008-03-19 -================== - -* Enhancement: A better way to define minor-mode. Thanks to Kentaro - Kuribayashi. See `this thread - `_ - for more details. - -0.3.1 / 2008-03-17 -================== - -* Bug fix: Emacs get confused when a field is deleted. See `issue 10 - `_. - -0.3.0 / 2008-03-16 -================== - -* Add a ``yas/after-exit-snippet-hook`` so that you can do something like - ``indent-region`` or ``fill-region`` after finish the snippet. -* Use minor-mode instead of ``global-set-key`` to bind the trigger - key. Now the trigger key and fall-back behavior can be more - flexible. Not constrained to ````. Thanks to Trey Jackson. See - this `thread - `_ - for more details. -* Now user can customize the popup function for selecting multiple - candidate for the same snippet key. -* Support ``dropdown-list.el`` to be a better way to select multiple - candidate when in text mode. - -0.2.3 / 2008-03-15 -================== - -* Bug in non-window (-nw) mode when there's multiple candidate to - expand. See `issue 7 - `_. -* Allow expanding another snippet as long as not currently inside a - field. - -0.2.2 / 2008-03-13 -================== - -* Added customized face for fields and mirrors. Better in dark - background. And users can customize it. - -0.2.1 / 2008-03-10 -================== - -* Fix the insert-behind problem under both Emacs 22 and Emacs 23. - -0.2.0 / 2008-03-10 -================== - -* Use big keymap overlay to detect ``insert-behind`` event manually to - avoid sometimes missed hook calls. See `issue 3 - `_ for more - details. -* Support parent snippet table. Now you can set (for example) - ``cc-mode`` as common mode for ``c++-mode``, ``c-mode`` and - ``java-mode``. They'll share snippets defined for ``cc-mode``. - -0.1.1 / 2008-03-08 -================== - -* Add a rake task to upload to google code. -* Use elisp compile-bundle function instead of python scrip - -0.1.0 / 2008-03-07 -================== - -* Embedded elisp support. -* Fields navigation support. -* Mirror of fields support. -* Menu-bar support. -* Multiple snippets with same name support. -* Popup menu for multiple snippet with same name support. -* Transformation of fields support. -* Load directory support. -* Compile bundle support. diff --git a/extensions/yasnippet/doc/compile-doc.py b/extensions/yasnippet/doc/compile-doc.py deleted file mode 100755 index 2d325e7..0000000 --- a/extensions/yasnippet/doc/compile-doc.py +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/python -# Compile document to HTML use docutils. - -# ======================================== -# Pygments syntax highlighting -# ======================================== -from pygments.formatters import HtmlFormatter - -# Set to True if you want inline CSS styles instead of classes -INLINESTYLES = True - -from pygments.formatters import HtmlFormatter - -# The default formatter -DEFAULT = HtmlFormatter(noclasses=INLINESTYLES) - -# Add name -> formatter pairs for every variant you want to use -VARIANTS = { - # 'linenos': HtmlFormatter(noclasses=INLINESTYLES, linenos=True), -} - -from docutils import nodes -from docutils.parsers.rst import directives - -from pygments import highlight -from pygments.lexers import get_lexer_by_name, TextLexer - -def pygments_directive(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - try: - lexer = get_lexer_by_name(arguments[0]) - except ValueError: - # no lexer found - use the text one instead of an exception - lexer = TextLexer() - # take an arbitrary option if more than one is given - formatter = options and VARIANTS[options.keys()[0]] or DEFAULT - parsed = highlight(u'\n'.join(content), lexer, formatter) - return [nodes.raw('', parsed, format='html')] - -pygments_directive.arguments = (1, 0, 1) -pygments_directive.content = 1 -pygments_directive.options = dict([(key, directives.flag) for key in VARIANTS]) - -directives.register_directive('sourcecode', pygments_directive) - -# ================= -# Youtube embedding -# ================= - -from docutils import nodes -from docutils.parsers.rst import directives - -CODE = """\ - - - %(extra)s - -""" - -PARAM = """\n """ - -def youtube(name, args, options, content, lineno, - contentOffset, blockText, state, stateMachine): - """ Restructured text extension for inserting youtube embedded videos """ - if len(content) == 0: - return - string_vars = { - 'yid': content[0], - 'width': 425, - 'height': 344, - 'align': "right", - 'extra': '' - } - extra_args = content[1:] # Because content[0] is ID - extra_args = [ea.strip().split("=") for ea in extra_args] # key=value - extra_args = [ea for ea in extra_args if len(ea) == 2] # drop bad lines - extra_args = dict(extra_args) - if 'width' in extra_args: - string_vars['width'] = extra_args.pop('width') - if 'align' in extra_args: - string_vars['align'] = extra_args.pop('align') - if 'height' in extra_args: - string_vars['height'] = extra_args.pop('height') - if extra_args: - params = [PARAM % (key, extra_args[key]) for key in extra_args] - string_vars['extra'] = "".join(params) - return [nodes.raw('', CODE % (string_vars), format='html')] -youtube.content = True -directives.register_directive('youtube', youtube) - - -# ======================================== -# Command line processing -# ======================================== -from docutils.core import publish_cmdline, default_description - -description = ('Generates (X)HTML documents from standalone reStructuredText ' - 'sources. ' + default_description) -overrides = {'stylesheet_path' : 'styles.css', - 'embed_stylesheet' : False, - 'template' : 'doc/template.txt'} - -publish_cmdline(writer_name='html', - description=description, - settings_overrides=overrides) diff --git a/extensions/yasnippet/doc/define_snippet.html b/extensions/yasnippet/doc/define_snippet.html deleted file mode 100644 index 984d3db..0000000 --- a/extensions/yasnippet/doc/define_snippet.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - -Moved - - - - -
-
-
-
- -
-
-
-
-

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

-

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

-
-
-
-
-
-
- - -
- - diff --git a/extensions/yasnippet/doc/define_snippet.rst b/extensions/yasnippet/doc/define_snippet.rst deleted file mode 100644 index 9e312c3..0000000 --- a/extensions/yasnippet/doc/define_snippet.rst +++ /dev/null @@ -1,9 +0,0 @@ -===== -Moved -===== - -.. meta:: - :http-equiv=Refresh: 3; URL=index.html - -This page has been moved. Click `here `_ if your browser -does not automatically redirect you diff --git a/extensions/yasnippet/doc/faq.html b/extensions/yasnippet/doc/faq.html deleted file mode 100644 index b3ef304..0000000 --- a/extensions/yasnippet/doc/faq.html +++ /dev/null @@ -1,189 +0,0 @@ - - - - - - -Frequently Asked Questions - - - -
-
-
-
- -
-
-
-
-

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

-
-

Why is there an extra newline?

-

If you have a newline at the end of the snippet definition file, then -YASnippet will add a newline when you expanding a snippet. Please -don't add a newline at the end if you don't want it when you saving -the snippet file.

-

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

-
-
-

Why doesn't TAB expand a snippet?

-

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

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

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

-

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

-

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

-

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

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

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

-

As an alternative, you can also try

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

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

-

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

-

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

-
-
-

Why doesn't TAB navigation work with flyspell

-

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

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

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

-
-
-

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

-

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

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

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

-
-
-

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

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

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

-

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

-
#key: <
-#name: <...></...>
-# --
-<${1:div}>$0</$1>
-
-
-
-
-
-
-
-
- - -
- - diff --git a/extensions/yasnippet/doc/faq.rst b/extensions/yasnippet/doc/faq.rst deleted file mode 100644 index ad1fa72..0000000 --- a/extensions/yasnippet/doc/faq.rst +++ /dev/null @@ -1,150 +0,0 @@ -============================ - Frequently Asked Questions -============================ - -Why is there an extra newline? -============================== - -If you have a newline at the end of the snippet definition file, then -YASnippet will add a newline when you expanding a snippet. Please -don't add a newline at the end if you don't want it when you saving -the snippet file. - -Note some editors will automatically add a newline for you. In Emacs, -if you set ``require-final-newline`` to ``t``, it will add the final -newline for you automatically. - -Why doesn't TAB expand a snippet? -================================= - -First check the mode line to see if there's ``yas``. If not, then try -``M-x yas/minor-mode`` to manually turn on the minor mode and try to -expand the snippet again. If it works, then, you can add the following -code to your ``.emacs`` *before* loading YASnippet: - -.. sourcecode:: lisp - - (add-hook 'the-major-mode-hook 'yas/minor-mode-on) - -where ``the-major-mode`` is the major mode in which ``yas/minor-mode`` -isn't enabled by default. - -From YASnippet 0.6 you can also use the command ``M-x -yas/global-mode`` to turn on YASnippet automatically for *all* major -modes. - -If ``yas/minor-mode`` is on but the snippet still not expanded. Then -try to see what command is bound to the ``TAB`` key: press ``C-h k`` -and then press ``TAB``. Emacs will show you the result. - -You'll see a buffer prompted by Emacs saying that ``TAB runs the -command ...``. Alternatively, you might see `` runs the command -...``, note the difference between ``TAB`` and ```` where the -latter has priority. If you see ```` bound to a command other -than ``yas/expand``, (e.g. in ``org-mode``) you can try the following -code to work around: - -.. sourcecode:: lisp - - (add-hook 'org-mode-hook - (let ((original-command (lookup-key org-mode-map [tab]))) - `(lambda () - (setq yas/fallback-behavior - '(apply ,original-command)) - (local-set-key [tab] 'yas/expand)))) - -replace ``org-mode-hook`` and ``org-mode-map`` with the major mode -hook you are dealing with (Use ``C-h m`` to see what major mode you -are in). - -As an alternative, you can also try - -.. sourcecode:: lisp - - (defun yas/advise-indent-function (function-symbol) - (eval `(defadvice ,function-symbol (around yas/try-expand-first activate) - ,(format - "Try to expand a snippet before point, then call `%s' as usual" - function-symbol) - (let ((yas/fallback-behavior nil)) - (unless (and (interactive-p) - (yas/expand)) - ad-do-it))))) - - (yas/advise-indent-function 'ruby-indent-line) - -To *advise* the modes indentation function bound to TAB, (in this case -``ruby-indent-line``) to first try to run ``yas/expand``. - -If the output of ``C-h k RET `` tells you that ```` is -indeed bound to ``yas/expand`` but YASnippet still doesn't work, check -your configuration and you may also ask for help on the `discussion -group `_. See this -particular `thread -`_ for -quite some solutions and alternatives. - -Don't forget to attach the information on what command is bound to TAB -as well as the mode information (Can be obtained by ``C-h m``). - -Why doesn't TAB navigation work with flyspell -============================================= - -A workaround is to inhibit flyspell overlays while the snippet is active: - -.. sourcecode:: lisp - - (add-hook 'flyspell-incorrect-hook - #'(lambda (dummy1 dummy2 dymmy3) - (and yas/active-field-overlay - (overlay-buffer yas/active-field-overlay)))) - -This is apparently related to overlay priorities. For some reason, the -``keymap`` property of flyspell's overlays always takes priority over -the same property in yasnippet's overlays, even if one sets the -latter's ``priority`` property to something big. If you know -emacs-lisp and can solve this problem, drop a line in the `discussion -group`_. - -How do I turn off the minor mode where in some buffers -====================================================== - -The best way, since version 0.6.1c, is to set the default value of the -variable ``yas/dont-activate`` to a lambda function like so: - -.. sourcecode:: lisp - - (set-default 'yas/dont-activate - #'(lambda () - (and yas/root-directory - (null (yas/get-snippet-tables))))) - -This is also the default value starting for that version. It skips the -minor mode in buffers where it is not applicable (no snippet tables), -but only once you have setup your yas/root-directory. - - -How do I define an abbrev key containing characters not supported by the filesystem? -==================================================================================== - -**Note**: This question applies if you're still defining snippets - whose key *is* the filename. This is behavior stil provided by - version 0.6 for backward compatibilty, but is somewhat deprecated... - -For example, you want to define a snippet by the key ``<`` which is -not a valid character for filename on Windows. This means you can't -use the filename as a trigger key in this case. - -You should rather use the ``# key:`` directive to specify the key of -the defined snippet explicitly and name your snippet with an arbitrary -valid filename, ``lt.yasnippet`` for example, using ``<`` for the -``# key:`` directive: - -.. sourcecode:: text - - #key: < - #name: <...> - # -- - <${1:div}>$0 - -.. _discussion group: http://groups.google.com/group/smart-snippet diff --git a/extensions/yasnippet/doc/html4css1.css b/extensions/yasnippet/doc/html4css1.css deleted file mode 100644 index bf10767..0000000 --- a/extensions/yasnippet/doc/html4css1.css +++ /dev/null @@ -1,279 +0,0 @@ -/* -:Author: David Goodger -:Contact: goodger@users.sourceforge.net -:Date: $Date: 2005-12-18 01:56:14 +0100 (Sun, 18 Dec 2005) $ -:Revision: $Revision: 4224 $ -:Copyright: This stylesheet has been placed in the public domain. - -Default cascading style sheet for the HTML output of Docutils. - -See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to -customize this style sheet. -*/ - -/* used to remove borders from tables and images */ -.borderless, table.borderless td, table.borderless th { - border: 0 } - -table.borderless td, table.borderless th { - /* Override padding for "table.docutils td" with "! important". - The right padding separates the table cells. */ - padding: 0 0.5em 0 0 ! important } - -.first { - /* Override more specific margin styles with "! important". */ - margin-top: 0 ! important } - -.last, .with-subtitle { - margin-bottom: 0 ! important } - -.hidden { - display: none } - -a.toc-backref { - text-decoration: none ; - color: black } - -blockquote.epigraph { - margin: 2em 5em ; } - -dl.docutils dd { - margin-bottom: 0.5em } - -/* Uncomment (and remove this text!) to get bold-faced definition list terms -dl.docutils dt { - font-weight: bold } -*/ - -div.abstract { - margin: 2em 5em } - -div.abstract p.topic-title { - font-weight: bold ; - text-align: center } - -div.admonition, div.attention, div.caution, div.danger, div.error, -div.hint, div.important, div.note, div.tip, div.warning { - margin: 2em ; - border: medium outset ; - padding: 1em } - -div.admonition p.admonition-title, div.hint p.admonition-title, -div.important p.admonition-title, div.note p.admonition-title, -div.tip p.admonition-title { - font-weight: bold ; - font-family: sans-serif } - -div.attention p.admonition-title, div.caution p.admonition-title, -div.danger p.admonition-title, div.error p.admonition-title, -div.warning p.admonition-title { - color: red ; - font-weight: bold ; - font-family: sans-serif } - -/* Uncomment (and remove this text!) to get reduced vertical space in - compound paragraphs. -div.compound .compound-first, div.compound .compound-middle { - margin-bottom: 0.5em } - -div.compound .compound-last, div.compound .compound-middle { - margin-top: 0.5em } -*/ - -div.dedication { - margin: 2em 5em ; - text-align: center ; - font-style: italic } - -div.dedication p.topic-title { - font-weight: bold ; - font-style: normal } - -div.figure { - margin-left: 2em ; - margin-right: 2em } - -div.footer, div.header { - clear: both; - font-size: smaller } - -div.line-block { - display: block ; - margin-top: 1em ; - margin-bottom: 1em } - -div.line-block div.line-block { - margin-top: 0 ; - margin-bottom: 0 ; - margin-left: 1.5em } - -div.sidebar { - margin-left: 1em ; - border: medium outset ; - padding: 1em ; - background-color: #ffffee ; - width: 40% ; - float: right ; - clear: right } - -div.sidebar p.rubric { - font-family: sans-serif ; - font-size: medium } - -div.system-messages { - margin: 5em } - -div.system-messages h1 { - color: red } - -div.system-message { - border: medium outset ; - padding: 1em } - -div.system-message p.system-message-title { - color: red ; - font-weight: bold } - -div.topic { - margin: 2em } - -h1.section-subtitle, h2.section-subtitle, h3.section-subtitle, -h4.section-subtitle, h5.section-subtitle, h6.section-subtitle { - margin-top: 0.4em } - -h1.title { - text-align: center } - -h2.subtitle { - text-align: center } - -hr.docutils { - width: 75% } - -img.align-left { - clear: left } - -img.align-right { - clear: right } - -ol.simple, ul.simple { - margin-bottom: 1em } - -ol.arabic { - list-style: decimal } - -ol.loweralpha { - list-style: lower-alpha } - -ol.upperalpha { - list-style: upper-alpha } - -ol.lowerroman { - list-style: lower-roman } - -ol.upperroman { - list-style: upper-roman } - -p.attribution { - text-align: right ; - margin-left: 50% } - -p.caption { - font-style: italic } - -p.credits { - font-style: italic ; - font-size: smaller } - -p.label { - white-space: nowrap } - -p.rubric { - font-weight: bold ; - font-size: larger ; - color: maroon ; - text-align: center } - -p.sidebar-title { - font-family: sans-serif ; - font-weight: bold ; - font-size: larger } - -p.sidebar-subtitle { - font-family: sans-serif ; - font-weight: bold } - -p.topic-title { - font-weight: bold } - -pre.address { - margin-bottom: 0 ; - margin-top: 0 ; - font-family: serif ; - font-size: 100% } - -pre.literal-block, pre.doctest-block { - margin-left: 2em ; - margin-right: 2em ; - background-color: #eeeeee } - -span.classifier { - font-family: sans-serif ; - font-style: oblique } - -span.classifier-delimiter { - font-family: sans-serif ; - font-weight: bold } - -span.interpreted { - font-family: sans-serif } - -span.option { - white-space: nowrap } - -span.pre { - white-space: pre } - -span.problematic { - color: red } - -span.section-subtitle { - /* font-size relative to parent (h1..h6 element) */ - font-size: 80% } - -table.citation { - border-left: solid 1px gray; - margin-left: 1px } - -table.docinfo { - margin: 2em 4em } - -table.docutils { - margin-top: 0.5em ; - margin-bottom: 0.5em } - -table.footnote { - border-left: solid 1px black; - margin-left: 1px } - -table.docutils td, table.docutils th, -table.docinfo td, table.docinfo th { - padding-left: 0.5em ; - padding-right: 0.5em ; - vertical-align: top } - -table.docutils th.field-name, table.docinfo th.docinfo-name { - font-weight: bold ; - text-align: left ; - white-space: nowrap ; - padding-left: 0 } - -h1 tt.docutils, h2 tt.docutils, h3 tt.docutils, -h4 tt.docutils, h5 tt.docutils, h6 tt.docutils { - font-size: 100% } - -tt.docutils { - background-color: #eeeeee } - -ul.auto-toc { - list-style-type: none } diff --git a/extensions/yasnippet/doc/images/bg-content-left.png b/extensions/yasnippet/doc/images/bg-content-left.png deleted file mode 100644 index a64b346..0000000 Binary files a/extensions/yasnippet/doc/images/bg-content-left.png and /dev/null differ diff --git a/extensions/yasnippet/doc/images/bg-content-right.png b/extensions/yasnippet/doc/images/bg-content-right.png deleted file mode 100644 index f07ebb5..0000000 Binary files a/extensions/yasnippet/doc/images/bg-content-right.png and /dev/null differ diff --git a/extensions/yasnippet/doc/images/bg-content.png b/extensions/yasnippet/doc/images/bg-content.png deleted file mode 100644 index d55828e..0000000 Binary files a/extensions/yasnippet/doc/images/bg-content.png and /dev/null differ diff --git a/extensions/yasnippet/doc/images/bg-navigation-item-hover.png b/extensions/yasnippet/doc/images/bg-navigation-item-hover.png deleted file mode 100644 index c783d71..0000000 Binary files a/extensions/yasnippet/doc/images/bg-navigation-item-hover.png and /dev/null differ diff --git a/extensions/yasnippet/doc/images/bg-navigation-item.png b/extensions/yasnippet/doc/images/bg-navigation-item.png deleted file mode 100644 index d2452ac..0000000 Binary files a/extensions/yasnippet/doc/images/bg-navigation-item.png and /dev/null differ diff --git a/extensions/yasnippet/doc/images/bg-navigation.png b/extensions/yasnippet/doc/images/bg-navigation.png deleted file mode 100644 index 18b9559..0000000 Binary files a/extensions/yasnippet/doc/images/bg-navigation.png and /dev/null differ diff --git a/extensions/yasnippet/doc/images/body.png b/extensions/yasnippet/doc/images/body.png deleted file mode 100644 index b361e7b..0000000 Binary files a/extensions/yasnippet/doc/images/body.png and /dev/null differ diff --git a/extensions/yasnippet/doc/images/customization-group.png b/extensions/yasnippet/doc/images/customization-group.png deleted file mode 100644 index b10827f..0000000 Binary files a/extensions/yasnippet/doc/images/customization-group.png and /dev/null differ diff --git a/extensions/yasnippet/doc/images/dropdown-menu.png b/extensions/yasnippet/doc/images/dropdown-menu.png deleted file mode 100644 index 57d482e..0000000 Binary files a/extensions/yasnippet/doc/images/dropdown-menu.png and /dev/null differ diff --git a/extensions/yasnippet/doc/images/external.png b/extensions/yasnippet/doc/images/external.png deleted file mode 100644 index 419c06f..0000000 Binary files a/extensions/yasnippet/doc/images/external.png and /dev/null differ diff --git a/extensions/yasnippet/doc/images/ido-menu.png b/extensions/yasnippet/doc/images/ido-menu.png deleted file mode 100644 index df392c5..0000000 Binary files a/extensions/yasnippet/doc/images/ido-menu.png and /dev/null differ diff --git a/extensions/yasnippet/doc/images/menu-1.png b/extensions/yasnippet/doc/images/menu-1.png deleted file mode 100644 index d2e6a51..0000000 Binary files a/extensions/yasnippet/doc/images/menu-1.png and /dev/null differ diff --git a/extensions/yasnippet/doc/images/menu-2.png b/extensions/yasnippet/doc/images/menu-2.png deleted file mode 100644 index abb8a72..0000000 Binary files a/extensions/yasnippet/doc/images/menu-2.png and /dev/null differ diff --git a/extensions/yasnippet/doc/images/menu-groups.png b/extensions/yasnippet/doc/images/menu-groups.png deleted file mode 100644 index fcedda8..0000000 Binary files a/extensions/yasnippet/doc/images/menu-groups.png and /dev/null differ diff --git a/extensions/yasnippet/doc/images/menu-parent.png b/extensions/yasnippet/doc/images/menu-parent.png deleted file mode 100644 index f0fa10c..0000000 Binary files a/extensions/yasnippet/doc/images/menu-parent.png and /dev/null differ diff --git a/extensions/yasnippet/doc/images/minor-mode-indicator.png b/extensions/yasnippet/doc/images/minor-mode-indicator.png deleted file mode 100644 index 3743455..0000000 Binary files a/extensions/yasnippet/doc/images/minor-mode-indicator.png and /dev/null differ diff --git a/extensions/yasnippet/doc/images/x-menu.png b/extensions/yasnippet/doc/images/x-menu.png deleted file mode 100644 index 3bc9a15..0000000 Binary files a/extensions/yasnippet/doc/images/x-menu.png and /dev/null differ diff --git a/extensions/yasnippet/doc/index.html b/extensions/yasnippet/doc/index.html deleted file mode 100644 index 4f02a7e..0000000 --- a/extensions/yasnippet/doc/index.html +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - -Yet Another Snippet extension - - - -
-
-
-
- -
-
-
-
-

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

- -

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

-

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

-
-

Video Demo

- - - - -

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

-
-
-

Installation

-

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

-
-

Install with yasnippet-bundle.el

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

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

-

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

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

The youtube video -demonstrates this quick installation.

-
-
-

Normal Install

-

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

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

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

-
-
-
-

How to use YASnippet

-

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

-

Hence this section has been split into separate documents:

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

Describes how YASnippet chooses snippets for expansion at point.

-

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

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

Bugs, Contribution and Support

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

Thank you very much for using YASnippet!

- -
-
-
-
-
-
-
- - -
- - diff --git a/extensions/yasnippet/doc/index.rst b/extensions/yasnippet/doc/index.rst deleted file mode 100644 index 7415186..0000000 --- a/extensions/yasnippet/doc/index.rst +++ /dev/null @@ -1,133 +0,0 @@ -============================= -Yet Another Snippet extension -============================= - -.. _Organizing Snippets: snippet-organization.html -.. _Expanding Snippets: snippet-expansion.html -.. _Writing Snippets: snippet-development.html -.. _The YASnippet Menu: snippet-menu.html - -.. contents:: - -**YASnippet** is a template system for Emacs. It allows you to type an -abbreviation and automatically expand it into function -templates. Bundled language templates includes: C, C++, C#, Perl, -Python, Ruby, SQL, LaTeX, HTML, CSS and more. - -The snippet syntax is inspired from TextMate's syntax, you can even -`import `_ -import most TextMate templates. YASnippet is a re-write of the -extension `smart-snippet`_. Both are original creations of `pluskid -`_. - -.. _smart-snippet: http://code.google.com/p/smart-snippet/ - -Video Demo -========== - -.. youtube:: 76Ygeg9miao - :align: right - -Watch the `demo at YouTube -`_ (download a higher -resolution version: `yasnippet.avi -`_). - -Installation -============ - -There are two archives you can download. To quickly tryout YASnippet, -download the simpler "bundle" version. If you plan to modify the -bundled templates and/or build your own, download the "normal" -package. - -Install with ``yasnippet-bundle.el`` ------------------------------------- - -1. Download the latest ``yasnippet-bundle-x.y.z.el.tgz`` and unpack it. -2. You'll get a file named ``yasnippet-bundle.el``, put it under - ``~/.emacs.d/plugins/`` (create the directory if not exists). -3. Open the file in Emacs, and type ``Alt+x eval-buffer``. - -That's it. Now open any one of your language file, you'll see a menu -YASnippet. you can pull the menu to insert a template. Or, you can -type the a *trigger key* then press ``TAB`` to expand it. - -To have Emacs load YASnippet automatically when it starts, put the -following in your ``~/.emacs`` file: - - .. sourcecode:: common-lisp - - (add-to-list 'load-path - "~/.emacs.d/plugins") - (require 'yasnippet-bundle) - -The `youtube video `_ -demonstrates this quick installation. - -Normal Install --------------- - -To install YASnippet as a normal emacs package, download and unpack -the latest ``yasnippet-x.y.z.tar.bz2``. You'll get a directory named -``yasnippet-x.y.z``, which you can put it in your -``~/.emacs.d/plugins`` and add the following in your ``.emacs`` file: - - .. sourcecode:: common-lisp - - (add-to-list 'load-path - "~/.emacs.d/plugins/yasnippet-x.y.z") - (require 'yasnippet) ;; not yasnippet-bundle - (yas/initialize) - (yas/load-directory "~/.emacs.d/plugins/yasnippet-x.y.z/snippets") - -Please refer to the documentation for full customization, or use the -customization group. - -How to use YASnippet -==================== - -Since version 0.6, YASnippet contains more functionality. You don't -need to know all of it to use it successfully, but you it can improve -your snippeting experience. - -Hence this section has been split into separate documents: - -1. `Organizing Snippets`_ - - Describes ways to organize your snippets in the hard disk (or not - organize them at all and just use ``yasnippet-bundle.el``. - -2. `Expanding Snippets`_ - - Describes how YASnippet chooses snippets for expansion at point. - - Maybe, you'll want some snippets to be expanded in a particular - mode, or only under certain conditions, or be prompted using - ``ido``, etc... - -3. `Writing Snippets`_ - - Describes the YASnippet definition syntax, which is very close (but - not equivalent) to Textmate's. Includes a section about converting - TextMate snippets. - -4. `The YASnippet menu`_ - - Explains how to use the YASnippet menu to explore, learn and modify - snippets. - -Bugs, Contribution and Support -============================== - -* If you find a bug, please report it at `Issue List - `_. -* If you have problem using YASnippet, or have some new ideas, - including snippets, please post to the `discussion group`_. - -.. _discussion group: http://groups.google.com/group/smart-snippet -.. _wish list: http://code.google.com/p/yasnippet/wiki/WishList - -Thank you very much for using YASnippet! - -.. LocalWords: YASnippet SQL LaTeX CSS yasnippet el eval html ido RET wiki diff --git a/extensions/yasnippet/doc/snippet-development.html b/extensions/yasnippet/doc/snippet-development.html deleted file mode 100644 index 6b55b4c..0000000 --- a/extensions/yasnippet/doc/snippet-development.html +++ /dev/null @@ -1,623 +0,0 @@ - - - - - - -Writing snippets - - - -
-
-
-
- -
-
-
-
-

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

- -
-

Snippet development

-
-

Quickly finding snippets

-

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

-
    -
  • M-x yas/new-snippet

    -

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

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

    -

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

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

    -

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

    -
  • -
-

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

-
-
-

Using the snippet-mode major mode

-

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

-

Two commands are defined in this mode:

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

    -
    -

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

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

    -
    -

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

    -
    -
  • -
-

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

-
-
-
-

File content

-

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

-

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

-

Here's a typical example:

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

Here's a list of currently supported directives:

-
-

# key: snippet abbrev

-

This is the probably the most important directive, it's the -abbreviation you type to expand a snippet just before hitting -yas/trigger-key.

-

If you don't specify this it will default to the name of the file the -snippet is being loaded from, unless YASnippet is ignoring file names -as triggers (see yas/ignore-filenames-as-triggers in Organizing -snippets), in which case this snippet -will not be expandable through the key mechanism.

-

Sometimes the key of a snippet is non-ASCII or not valid filename -(e.g. contains /). One can then define the key property which -will overwrite the filename as the key to expand the snippet.

-
-
-

# name: snippet name

-

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

-

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

-
-
-

# condition: snippet condition

-

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

-

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

-
-
-

# group: snippet menu grouping

-

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

-

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

-

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

-
-
-

# expand-env: expand environment

-

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

-

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

-

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

-
# name : ASCII home
-# expand-env: ((yas/indent-line 'fixed) (yas/wrap-around-region 'nil))
-# --
-                welcome to my
-            X      humble
-           / \      home,
-          /   \      $0
-         /     \
-        /-------\
-        |       |
-        |  +-+  |
-        |  | |  |
-        +--+-+--+
-
-
-
-

# binding: direct keybinding

-

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

-

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

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

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

-

To override the keymap choice based on the major mode name. Use a cons -cell where the first element specifies the name of the keymap where -you want to record the keybinding.

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

Note: this feature is still experimental, it might go away, be -changed in future release, and should be used with caution: It is easy -to override important keybindings for many basic modes and it is hard -to undefine them. For the moment, the variable -yas/active-keybindings can tell you what snippet keybindings are -active and the function yas/kill-snippet-keybindings will attempt -to undefine all the keybindings.

-
-
-

# contributor: snippet author

-

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

-
-
-
-

Template syntax

-

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

-
-

Plain Text

-

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

-
-
-

Embedded Emacs-lisp code

-

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

-

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

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

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

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

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

-
-
-

Tab stop fields

-

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

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

Placeholder fields

-

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

-
${N:default value}
-
-

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

-
-
-

Mirrors

-

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

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

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

-

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

-
-
-

Mirrors with transformations

-

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

-
- (${1:id})${2:foo}
-{
-    return $2;
-}
-
-- (void)set${2:$(capitalize text)}:($1)aValue
-{
-    [$2 autorelease];
-    $2 = [aValue retain];
-}
-$0
-
-

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

-

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

-
=====
-Title
-=====
-
-

is a valid title but

-
===
-Title
-===
-
-

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

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

Fields with transformations

-

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

-

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

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

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

-

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

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

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

-
-
-

Choosing fields value from a list and other tricks

-

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

-

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

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

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

-

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

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

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

-
-
-

Nested placeholder fields

-

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

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

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

-

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

-
-
-
-

Customizable variables

-
-

yas/trigger-key

-

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

-

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

-

Default value is "TAB".

-
-
-

yas/next-field-key

-

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

-

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

-

Can also be a list of keys.

-

Default value is "TAB".

-
-
-

yas/prev-field-key

-

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

-

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

-

Can also be a list of keys.

-

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

-
-
-

yas/skip-and-clear-key

-

The key to clear the currently active field.

-

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

-

Can also be a list of keys.

-

Default value is "C-d".

-
-
-

yas/good-grace

-

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

-
-
-

yas/indent-line

-

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

-

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

-

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

-

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

-

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

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

yas/wrap-around-region

-

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

-

Because on most systems starting to type deletes the currently region, -this works mostly with the yas/insert-snippet command.

-

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

-
-
-

yas/triggers-in-field

-

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

-
-
-

yas/snippet-revival

-

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

-
-
-

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

-

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

-
-
-
-

Importing TextMate snippets

-

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

-
- -
-

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

-

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

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

Then invoke textmate_import.rb like this:

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

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

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

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

-

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

-

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

- - - -
-
-
-
-
-
-
- - -
- - diff --git a/extensions/yasnippet/doc/snippet-development.rst b/extensions/yasnippet/doc/snippet-development.rst deleted file mode 100644 index cf14e11..0000000 --- a/extensions/yasnippet/doc/snippet-development.rst +++ /dev/null @@ -1,660 +0,0 @@ -================ -Writing snippets -================ - -.. _Organizing Snippets: snippet-organization.html -.. _Expanding Snippets: snippet-expansion.html -.. _Writing Snippets: snippet-development.html -.. _The YASnippet Menu: snippet-menu.html - -.. contents:: - -Snippet development -=================== - -Quickly finding snippets ------------------------- - -There are some ways you can quickly find a snippet file: - -* ``M-x yas/new-snippet`` - - Prompts you for a snippet name, then tries to guess a suitable - directory to store it, prompting you for creation if it does not - exist. Finally, places you in a new buffer set to ``snippet-mode`` - so you can write your snippet. - -* ``M-x yas/find-snippets`` - - Lets you find the snippet file in the directory the snippet was - loaded from (if it exists) like ``find-file-other-window``. The - directory searching logic is similar to ``M-x yas/new-snippet``. - -* ``M-x yas/visit-snippet-file`` - - Prompts you for possible snippet expansions like - ``yas/insert-snippet``, but instead of expanding it, takes you - directly to the snippet definition's file, if it exists. - -Once you find this file it will be set to ``snippet-mode`` (see ahead) -and you can start editing your snippet. - - -Using the ``snippet-mode`` major mode -------------------------------------- - -There is a major mode ``snippet-mode`` to edit snippets. You can set -the buffer to this mode with ``M-x snippet-mode``. It provides -reasonably useful syntax highlighting. - -Two commands are defined in this mode: - -* ``M-x yas/load-snippet-buffer`` - - When editing a snippet, this loads the snippet into the correct - mode and menu. Bound to ``C-c C-c`` by default while in - ``snippet-mode``. - -* ``M-x yas/tryout-snippet`` - - When editing a snippet, this opens a new empty buffer, sets it to - the appropriate major mode and inserts the snippet there, so you - can see what it looks like. This is bound to ``C-c C-t`` while in - ``snippet-mode``. - -There are also *snippets for writing snippets*: ``vars``, ``$f`` and -``$m`` :-). - -File content -============ - -A file defining a snippet generally contains the template to be -expanded. - -Optionally, if the file contains a line of ``# --``, the lines above -it count as comments, some of which can be *directives* (or meta -data). Snippet directives look like ``# property: value`` and tweak -certain snippets properties described below. If no ``# --`` is found, -the whole file is considered the snippet template. - -Here's a typical example: - -.. sourcecode:: text - - #contributor : pluskid - #name : __...__ - # -- - __${init}__ - -Here's a list of currently supported directives: - -``# key:`` snippet abbrev --------------------------- - -This is the probably the most important directive, it's the -abbreviation you type to expand a snippet just before hitting -``yas/trigger-key``. - -If you don't specify this it will default to the name of the file the -snippet is being loaded from, unless YASnippet is ignoring file names -as triggers (see ``yas/ignore-filenames-as-triggers`` in `Organizing -snippets`_), in which case this snippet -will not be expandable through the key mechanism. - -Sometimes the key of a snippet is non-ASCII or not valid filename -(e.g. contains ``/``). One can then define the ``key`` property which -will overwrite the filename as the key to expand the snippet. - -``# name:`` snippet name ------------------------- - -This is a one-line description of the snippet. It will be displayed in -the menu. It's a good idea to select a descriptive name for a -snippet -- especially distinguishable among similar snippets. - -If you omit this name it will default to the file name the snippet was -loaded from. - -``# condition:`` snippet condition ----------------------------------- -This is a piece of Emacs-lisp code. If a snippet has a condition, then it -will only be expanded when the condition code evaluate to some non-nil -value. - -See also ``yas/buffer-local-condition`` in `Expanding snippets`_ - - -``# group:`` snippet menu grouping ----------------------------------- - -When expanding/visiting snippets from the menu-bar menu, snippets for a -given mode can be grouped into sub-menus . This is useful if one has -too many snippets for a mode which will make the menu too -long. - -The ``# group:`` property only affect menu construction (See `the -YASnippet menu`_) and the same effect can be achieved by grouping -snippets into sub-directories and using the ``.yas-make-groups`` -special file (for this see `Organizing Snippets`_ - - -Refer to the bundled snippets for ``ruby-mode`` for examples on the -``# group:`` directive. Group can also be nested, e.g. ``control -structure.loops`` tells that the snippet is under the ``loops`` group -which is under the ``control structure`` group. - -``# expand-env:`` expand environment ------------------------------------- - -This is another piece of Emacs-lisp code in the form of a ``let`` -*varlist form*, i.e. a list of lists assigning values to variables. It -can be used to override variable values while the snippet is being -expanded. - -Interesting variables to override are ``yas/wrap-around-region`` and -``yas/indent-line`` (see `Expanding Snippets`_). - -As an example, you might normally have ``yas/indent-line`` set to -``'auto`` and ``yas/wrap-around-region`` set to ``t``, but for this -particularly brilliant piece of ASCII art these values would mess up -your hard work. You can then use: - -.. sourcecode:: text - - # name : ASCII home - # expand-env: ((yas/indent-line 'fixed) (yas/wrap-around-region 'nil)) - # -- - welcome to my - X humble - / \ home, - / \ $0 - / \ - /-------\ - | | - | +-+ | - | | | | - +--+-+--+ - -``# binding:`` direct keybinding ---------------------------------- - -You can use this directive to expand a snippet directly from a normal -Emacs keybinding. The keybinding will be registered in the Emacs -keymap named after the major mode the snippet is active -for. - -Additionally a variable ``yas/prefix`` is set to to the prefix -argument you normally use for a command. This allows for small -variations on the same snippet, for example in this "html-mode" -snippet. - -.. sourcecode:: text - - #name :

...

- #binding: "C-c C-c C-m" - # -- -

`(when yas/prefix "\n")`$0`(when yas/prefix "\n")`

- -This binding will be recorded in the keymap ``html-mode-map``. To -expand a paragraph tag newlines, just press "C-u C-c C-c -C-m". Omitting the "C-u" will expand the paragraph tag without -newlines. - -To override the keymap choice based on the major mode name. Use a cons -cell where the first element specifies the name of the keymap where -you want to record the keybinding. - -.. sourcecode:: text - - #name :

...

- #binding: (rinari-minor-mode-map . "C-c C-c C-m") - # -- -

`(when yas/prefix "\n")`$0`(when yas/prefix "\n")`

- -**Note**: this feature is still **experimental**, it might go away, be -changed in future release, and should be used with caution: It is easy -to override important keybindings for many basic modes and it is hard -to undefine them. For the moment, the variable -``yas/active-keybindings`` can tell you what snippet keybindings are -active and the function ``yas/kill-snippet-keybindings`` will attempt -to undefine all the keybindings. - -``# contributor:`` snippet author ---------------------------------------------------- - -This is optional and has no effect whatsoever on snippet -functionality, but it looks nice. - - -Template syntax -=============== - -The syntax of the snippet template is simple but powerful, very -similar to TextMate's. - -Plain Text ----------- - -Arbitrary text can be included as the content of a template. They are -usually interpreted as plain text, except ``$`` and `````. You need to -use ``\`` to escape them: ``\$`` and ``\```. The ``\`` itself may also -needed to be escaped as ``\\`` sometimes. - -Embedded Emacs-lisp code ------------------------- - -Emacs-Lisp code can be embedded inside the template, written inside -back-quotes (`````). The lisp forms are evaluated when the snippet is -being expanded. The evaluation is done in the same buffer as the -snippet being expanded. - -Here's an example for ``c-mode`` to calculate the header file guard -dynamically: - -.. sourcecode:: text - - #ifndef ${1:_`(upcase (file-name-nondirectory (file-name-sans-extension (buffer-file-name))))`_H_} - #define $1 - - $0 - - #endif /* $1 */ - -From version 0.6, snippets expansions are run with some special -Emacs-lisp variables bound. One of this is ``yas/selected-text``. You -can therefore define a snippet like: - -.. sourcecode:: text - - for ($1;$2;$3) { - `yas/selected-text`$0 - } - -to "wrap" the selected region inside your recently inserted -snippet. Alternatively, you can also customize the variable -``yas/wrap-around-region`` to ``t`` which will do this automatically. - -Tab stop fields ---------------- - -Tab stops are fields that you can navigate back and forth by ``TAB`` -and ``S-TAB``. They are written by ``$`` followed with a -number. ``$0`` has the special meaning of the *exit point* of a -snippet. That is the last place to go when you've traveled all the -fields. Here's a typical example: - -.. sourcecode:: text - - - $0 - - -Placeholder fields ------------------- - -Tab stops can have default values -- a.k.a placeholders. The syntax is -like this: - -.. sourcecode:: text - - ${N:default value} - -They acts as the default value for a tab stop. But when you firstly -type at a tab stop, the default value will be replaced by your -typing. The number can be omitted if you don't want to create -`mirrors`_ or `transformations`_ for this field. - -.. _mirrors: - -Mirrors -------- - -We refer the tab stops with placeholders as a *field*. A field can have -mirrors. Its mirrors will get updated when you change the text of a -field. Here's an example: - -.. sourcecode:: text - - \begin{${1:enumerate}} - $0 - \end{$1} - -When you type ``"document"`` at ``${1:enumerate}``, the word -``"document"`` will also be inserted at ``\end{$1}``. The best -explanation is to see the screencast(`YouTube -`_ or `avi video -`_). - -The tab stops with the same number to the field act as its mirrors. If -none of the tab stops has an initial value, the first one is selected -as the field and others mirrors. - -.. _transformations: - -Mirrors with transformations ----------------------------- - -If the value of an ``${n:``-construct starts with and contains ``$(``, -then it is interpreted as a mirror for field ``n`` with a -transformation. The mirror's text content is calculated according to -this transformation, which is Emacs-lisp code that gets evaluated in -an environment where the variable ``text`` (or ``yas/text``) is bound -to the text content (string) contained in the field ``n``.Here's an -example for Objective-C: - -.. sourcecode:: text - - - (${1:id})${2:foo} - { - return $2; - } - - - (void)set${2:$(capitalize text)}:($1)aValue - { - [$2 autorelease]; - $2 = [aValue retain]; - } - $0 - -Look at ``${2:$(capitalize text)}``, it is a mirror with -transformation instead of a field. The actual field is at the first -line: ``${2:foo}``. When you type text in ``${2:foo}``, the -transformation will be evaluated and the result will be placed there -as the transformed text. So in this example, if you type "baz" in the -field, the transformed text will be "Baz". This example is also -available in the screencast. - -Another example is for ``rst-mode``. In reStructuredText, the document -title can be some text surrounded by "===" below and above. The "===" -should be at least as long as the text. So - -.. sourcecode:: text - - ===== - Title - ===== - -is a valid title but - -.. sourcecode:: text - - === - Title - === - -is not. Here's an snippet for rst title: - -.. sourcecode:: text - - ${1:$(make-string (string-width text) ?\=)} - ${1:Title} - ${1:$(make-string (string-width text) ?\=)} - - $0 - -Fields with transformations ---------------------------- - -From version 0.6 on, you can also have lisp transformation inside -fields. These work mostly mirror transformations but are evaluated -when you first enter the field, after each change you make to the -field and also just before you exit the field. - -The syntax is also a tiny bit different, so that the parser can -distinguish between fields and mirrors. In the following example - -.. sourcecode:: text - - #define "${1:mydefine$(upcase yas/text)}" - -``mydefine`` gets automatically upcased to ``MYDEFINE`` once you enter -the field. As you type text, it gets filtered through the -transformation every time. - -Note that to tell this kind of expression from a mirror with a -transformation, YASnippet needs extra text between the ``:`` and the -transformation's ``$``. If you don't want this extra-text, you can use -two ``$``'s instead. - -.. sourcecode:: text - - #define "${1:$$(upcase yas/text)}" - -Please note that as soon as a transformation takes place, it changes -the value of the field and sets it its internal modification state to -``true``. As a consequence, the auto-deletion behaviour of normal -fields does not take place. This is by design. - -Choosing fields value from a list and other tricks --------------------------------------------------- - -As mentioned, the field transformation is invoked just after you enter -the field, and with some useful variables bound, notably -``yas/field-modified-p`` and ``yas/moving-away-p``. Because of this -feature you can place a transformation in the primary field that lets -you select default values for it. - -The ``yas/choose-value`` does this work for you. For example: - -.. sourcecode:: text - -
- $0 -
- -See the definition of ``yas/choose-value`` to see how it was written -using the two variables. - -Here's another use, for LaTeX-mode, which calls reftex-label just as -you enter snippet field 2. This one makes use of ``yas/modified-p`` -directly. - -.. sourcecode:: text - - \section{${1:"Titel der Tour"}}% - \index{$1}% - \label{{2:"waiting for reftex-label call..."$(unless yas/modified-p (reftex-label nil 'dont- - insert))}}% - -The function ``yas/verify-value`` has another neat trick, and makes -use of ``yas/moving-away-p``. Try it and see! Also, check out this -`thread -`_ - -Nested placeholder fields -------------------------- - -From version 0.6 on, you can also have nested placeholders of the type: - -.. sourcecode:: text - - $0 - -This allows you to choose if you want to give this ``div`` an ``id`` -attribute. If you tab forward after expanding it will let you change -"some_id" to whatever you like. Alternatively, you can just press -``C-d`` (which executes ``yas/skip-and-clear-or-delete-char``) and go -straight to the exit marker. - -By the way, ``C-d`` will only clear the field if you cursor is at the -beginning of the field *and* it hasn't been changed yet. Otherwise, it -performs the normal Emacs ``delete-char`` command. - -Customizable variables -====================== - -``yas/trigger-key`` -------------------- - -The key bound to ``yas/expand`` when function ``yas/minor-mode`` is -active. - -Value is a string that is converted to the internal Emacs key -representation using ``read-kbd-macro``. - -Default value is ``"TAB"``. - -``yas/next-field-key`` ----------------------- - -The key to navigate to next field when a snippet is active. - -Value is a string that is converted to the internal Emacs key -representation using ``read-kbd-macro``. - -Can also be a list of keys. - -Default value is ``"TAB"``. - -``yas/prev-field-key`` ----------------------- - -The key to navigate to previous field when a snippet is active. - -Value is a string that is converted to the internal Emacs key -representation using ``read-kbd-macro``. - -Can also be a list of keys. - -Default value is ``("" ")"``. - -``yas/skip-and-clear-key`` --------------------------- - -The key to clear the currently active field. - -Value is a string that is converted to the internal Emacs key -representation using ``read-kbd-macro``. - -Can also be a list of keys. - -Default value is ``"C-d"``. - -``yas/good-grace`` ------------------- - -If non-nil, don't raise errors in inline Emacs-lisp evaluation inside -snippet definitions. An error string "[yas] error" is returned instead. - -``yas/indent-line`` -------------------- - -The variable ``yas/indent-line`` controls the indenting. It is bound -to ``'auto`` by default, which causes your snippet to be indented -according to the mode of the buffer it was inserted in. - -Another variable ``yas/also-auto-indent-first-line``, when non-nil -does exactly that :-). - -To use the hard-coded indentation in your snippet template, set this -variable to ``fixed``. - -To control indentation on a per-snippet basis, see also the directive -``# expand-env:`` in `Writing Snippets`_. - -For backward compatibility with earlier versions of YASnippet, you can -also place a ``$>`` in your snippet, an ``(indent-according-to-mode)`` -will be executed there to indent the line. This only takes effect when -``yas/indent-line`` is set to something other than ``'auto``. - -.. sourcecode:: text - - for (${int i = 0}; ${i < 10}; ${++i}) - {$> - $0$> - }$> - -``yas/wrap-around-region`` --------------------------- - -If non-nil, YASnippet will try to expand the snippet's exit marker -around the currently selected region. When this variable is set to t, -this has the same effect has using the ```yas/selected-text``` inline -evaluation. - -Because on most systems starting to type deletes the currently -selected region, this works mostly for snippets with direct -keybindings or with the ``yas/insert-snippet`` command. - -However, when the value is of this variable is ``cua`` YASnippet will -additionally look-up any recently selected that you deleted by starting -typing. This allows you select a region, type a snippet key (deleting -the region), then press ``yas/trigger-key`` to see the deleted region -spring back to life inside your new snippet. - -``yas/triggers-in-field`` --------------------------- - -If non-nil, ``yas/next-field-key`` can trigger stacked expansions, -that is a snippet expansion inside another snippet -expansion. Otherwise, ``yas/next-field-key`` just tries to move on to -the next field. - -``yas/snippet-revival`` ------------------------ - -Non-nil means re-activate snippet fields after undo/redo. - -``yas/after-exit-snippet-hook`` and ``yas/before-expand-snippet-hook`` ----------------------------------------------------------------------- - -These hooks are called, respectively, before the insertion of a -snippet and after exiting the snippet. If you find any strange but -functional use for them, that's probably a design flaw in YASnippet, -so let us know. - -Importing TextMate snippets -=========================== - -There are a couple of tools that take TextMate's ".tmSnippet" xml -files and create YASnippet definitions: - - * `a python script by Jeff Wheeler - `_ - - * a `ruby tool - `_ - , ``textmate_import.rb`` adapted from `Rob Christie's - `_, - which I have uploaded to the repository. - -In this section, i'll shortly cover the **second** option. - -Download the ``textmate_import.rb`` tool and the TextMate -bundle you're interested in. - -.. sourcecode:: text - - $ curl -O http://yasnippet.googlecode.com/svn/trunk/extras/textmate_import.rb - $ svn export http://svn.textmate.org/trunk/Bundles/HTML.tmbundle/ - - -Then invoke ``textmate_import.rb`` like this: - -.. sourcecode:: text - - $ ./textmate_import.rb -d HTML.tmbundle/Snippets/ -o html-mode -g HTML.tmbundle/info.plist - -You should end up with a ``html-mode`` subdir containing snippets -exported from textmate. - -.. sourcecode:: text - - $ tree html-mode # to view dir contents, if you have 'tree' installed - -The ``-g`` is optional but helps the tool figure out the grouping. -According to `Organizing Snippets`_, don't forget to touch -``.yas-make-groups`` and ``.yas-ignore-filename-triggers`` inside the -``html-mode`` dir. - -Also try ``textmate_import.rb --help`` for a list of options. - -Please note that snippet importation is not yet perfect. You'll -probably have some adjustments to some/many snippets. Please -contribute these adjustments to the google group or, better yet, patch -the ``textmate_import.rb`` to automatically perform them and submit -that. - -.. LocalWords: html YASnippet yas sourcecode pluskid init filenames filename -.. LocalWords: env varlist keybinding keymap rinari ifndef upcase endif -.. LocalWords: nondirectory autorelease aValue inline diff --git a/extensions/yasnippet/doc/snippet-expansion.html b/extensions/yasnippet/doc/snippet-expansion.html deleted file mode 100644 index 2f0256c..0000000 --- a/extensions/yasnippet/doc/snippet-expansion.html +++ /dev/null @@ -1,432 +0,0 @@ - - - - - - -Expanding snippets - - - -
-
-
-
- -
-
-
-
-

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

- -
-

Triggering expansion

-

You can use YASnippet to expand snippets in different ways:

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

Trigger key

-

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

-

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

-

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

-images/minor-mode-indicator.png -

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

-

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

-

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

-
-

Fallback bahaviour

-

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

-

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

-

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

-
-
-
-

Insert at point

-

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

-

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

-

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

-
-
-

Snippet keybinding

-

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

-
- -
-

Expanding with hippie-expand

-

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

-
-
-

Expanding from emacs-lisp code

-

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

-

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

-
(yas/expand-snippet template)
-
-

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

-
-
-
-

Controlling expansion

-
-

Eligible snippets

-

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

-

In particular, the following things matter:

-
    -
  • Currently loaded snippets tables

    -

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

    -
  • -
  • Major mode of the current buffer

    -

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

    -
  • -
  • Parent tables

    -

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

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

    -

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

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

    -

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

    -
  • -
-
-
-

The condition system

-

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

-

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

-

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

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

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

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

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

-
-
-

Multiples snippet with the same key

-

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

-

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

-

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

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

Currently there are some alternatives solution with YASnippet.

-images/x-menu.png -
-

Use the X window system

-

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

-
    -
  • It usually looks beautiful. E.g. when you compile Emacs with gtk -support, this menu will be rendered with your gtk theme.
  • -
  • Emacs have little control over it. E.g. you can't use C-n, -C-p to navigate.
  • -
  • This function can't be used when in a terminal.
  • -
-images/ido-menu.png -
-
-

Minibuffer prompting

-

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

-images/dropdown-menu.png -
-
-

Use dropdown-menu.el

-

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

-

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

-
-
-

Roll your own

-

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

-
-
-
-
-

Customizable Variables

-
-

yas/prompt-functions

-

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

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

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

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

yas/fallback-behavior

-

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

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

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

-

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

-
-
-

yas/choose-keys-first

-

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

-

Otherwise prompts for all possible snippet names.

-

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

-
-
-

yas/choose-tables-first

-

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

-

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

-

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

-
-
-

yas/key-syntaxes

-

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

-

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

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

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

-
-
-
-
-
-
-
-
- - -
- - diff --git a/extensions/yasnippet/doc/snippet-expansion.rst b/extensions/yasnippet/doc/snippet-expansion.rst deleted file mode 100644 index c251173..0000000 --- a/extensions/yasnippet/doc/snippet-expansion.rst +++ /dev/null @@ -1,406 +0,0 @@ -================== -Expanding snippets -================== - -.. _Organizing Snippets: snippet-organization.html -.. _Expanding Snippets: snippet-expansion.html -.. _Writing Snippets: snippet-development.html -.. _The YASnippet Menu: snippet-menu.html - -.. contents:: - - -Triggering expansion -==================== - -You can use YASnippet to expand snippets in different ways: - -* By typing an abbrev, the snippet *trigger key*, and then pressing - the key defined in ``yas/trigger-key`` (which defaults to - "TAB"). This works in buffers where the minor mode - ``yas/minor-mode`` is active; - -* By invoking the command ``yas/insert-snippet`` (either by typing - ``M-x yas/insert-snippet`` or its keybinding). This does *not* - require ``yas/minor-mode`` to be active. - -* By using the keybinding associated with an active snippet. This also - requires ``yas/minor-mode`` to be active; - -* By expanding directly from the "YASnippet" menu in the menu-bar - -* By using hippie-expand - -* Expanding from emacs-lisp code - -Trigger key ------------ - -When ``yas/minor-mode`` is enabled, the keybinding taken from -``yas/trigger-key`` will take effect. - -``yas/trigger-key`` invokes ``yas/expand``, which tries to expand a -*snippet abbrev* (also known as *snippet key*) before point. - -The default key is ``"TAB"``, however, you can freely set it to some -other key. - -.. image:: images/minor-mode-indicator.png - :align: left - -To enable the YASnippet minor mode in all buffers globally use the -command ``yas/global-mode``. - -When you use ``yas/global-mode`` you can also selectively disable -YASnippet in some buffers by setting the buffer-local variable -``yas/dont-active`` in the buffer's mode hook. - -Trouble when using or understanding the ``yas/trigger-key`` is easily -the most controversial issue in YASsnippet. See the `FAQ `_. - -Fallback bahaviour -~~~~~~~~~~~~~~~~~~ - -``yas/fallback-behaviour`` is a customization variable bound to -``'call-other-command`` by default. If ``yas/expand`` failed to find -any suitable snippet to expand, it will disable the minor mode -temporarily and find if there's any other command bound the -``yas/trigger-key``. - -If found, the command will be called. Usually this works very well -- -when there's a snippet, expand it, otherwise, call whatever command -originally bind to the trigger key. - -However, you can change this behavior by customizing the -``yas/fallback-behavior`` variable. If you set this variable to -``'return-nil``, it will return ``nil`` instead of trying to call the -*original* command when no snippet is found. - -Insert at point ---------------- - -The command ``M-x yas/insert-snippet`` lets you insert snippets at -point *for you current major mode*. It prompts you for the snippet -key first, and then for a snippet template if more than one template -exists for the same key. - -The list presented contains the snippets that can be inserted at -point, according to the condition system. If you want to see all -applicable snippets for the major mode, prefix this command with -``C-u``. - -The prompting methods used are again controlled by -``yas/prompt-functions``. - -Snippet keybinding ------------------- - -See the section of the ``# binding:`` directive in `Writing -Snippets`_. - - -Expanding from the menu ------------------------ - -See `the YASnippet Menu`_. - -Expanding with ``hippie-expand`` ----------------------------------- - -To integrate with ``hippie-expand``, just put -``yas/hippie-try-expand`` in -``hippie-expand-try-functions-list``. This probably makes more sense -when placed at the top of the list, but it can be put anywhere you -prefer. - -Expanding from emacs-lisp code ------------------------------- - -Sometimes you might want to expand a snippet directly from you own -elisp code. You should call ``yas/expand-snippet`` instead of -``yas/expand`` in this case. - -As with expanding from the menubar, the condition system and multiple -candidates doesn't affect expansion. In fact, expanding from the -YASnippet menu has the same effect of evaluating the follow code: - -.. sourcecode:: common-lisp - - (yas/expand-snippet template) - -See the internal documentation on ``yas/expand-snippet`` for more -information. - -Controlling expansion -===================== - -Eligible snippets ------------------ - -YASnippet does quite a bit of filtering to find out which snippets are -eligible for expanding at the current cursor position. - -In particular, the following things matter: - -* Currently loaded snippets tables - - These are loaded from a directory hierarchy in your file system. See - `Organizing Snippets`_. They are named after major modes like - ``html-mode``, ``ruby-mode``, etc... - -* Major mode of the current buffer - - If the currrent major mode matches one of the loaded snippet tables, - then all that table's snippets are considered for expansion. Use - ``M-x describe-variable RET major-mode RET`` to find out which major - mode you are in currently. - -* Parent tables - - Snippet tables defined as the parent of some other eligible table - are also considered. This works recursively, i.e. parents of parents - of eligible tables are also considered. - -* Buffer-local ``yas/mode-symbol`` variable - - This can be used to consider snippet tables whose name does not - correspond to a major mode. If you set this variable to a name , - like ``rinari-minor-mode``, you can have some snippets expand only - in that minor mode. Naturally, you want to set this conditionally, - i.e. only when entering that minor mode, so using a hook is a good - idea. - -.. sourcecode:: common-lisp - - ;; When entering rinari-minor-mode, consider also the snippets in the - ;; snippet table "rails-mode" - (add-hook 'rinari-minor-mode-hook - #'(lambda () - (setq yas/mode-symbol 'rails-mode))) - -* Buffer-local ``yas/buffer-local-condition`` variable - - This variable provides finer grained control over what snippets can - be expanded in the current buffer. The default value won't let you - expand snippets inside comments or string literals for example. See - `The condition system`_ for more info. - -The condition system --------------------- - -Consider this scenario: you are an old Emacs hacker. You like the -abbrev-way and set ``yas/trigger-key`` to ``"SPC"``. However, -you don't want ``if`` to be expanded as a snippet when you are typing -in a comment block or a string (e.g. in ``python-mode``). - -If you use the ``# condition :`` directive (see `Writing Snippets`_) -you could just specify the condition for ``if`` to be ``(not -(python-in-string/comment))``. But how about ``while``, ``for``, -etc. ? Writing the same condition for all the snippets is just -boring. So has a buffer local variable -``yas/buffer-local-condition``. You can set this variable to ``(not -(python-in-string/comment))`` in ``python-mode-hook``. - -Then, what if you really want some particular snippet to expand even -inside a comment? This is also possible! But let's stop telling the -story and look at the rules: - -* If ``yas/buffer-local-condition`` evaluate to nil, no snippets will - be considered for expansion. - -* If it evaluates to the a *cons cell* where the ``car`` is the symbol - ``require-snippet-condition`` and the ``cdr`` is a symbol (let's - call it ``requirement``), then: - - * Snippets having no ``# condition:`` directive won't be considered; - - * Snippets with conditions that evaluate to nil (or produce an - error) won't be considered; - - * If the snippet has a condition that evaluates to non-nil (let's - call it ``result``): - - * If ``requirement`` is ``t``, the snippet is ready to be - expanded; - - * If ``requirement`` is ``eq`` to ``result``, the snippet is ready - to be expanded; - - * Otherwise the snippet won't be considered. - -* If it evaluates to the symbol ``always``, all snippets are - considered for expansion, regardless of any conditions. - -* If it evaluate to ``t`` or some other non-nil value: - - * If the snippet has no condition, or has a condition that evaluate - to non-nil, it is ready to be expanded. - - * Otherwise, it won't be considered. - -In the mentioned scenario, set ``yas/buffer-local-condition`` like -this - -.. sourcecode:: common-lisp - - (add-hook 'python-mode-hook - '(lambda () - (setq yas/buffer-local-condition - '(if (python-in-string/comment) - '(require-snippet-condition . force-in-comment) - t)))) - -... and specify the condition for a snippet that you're going to -expand in comment to be evaluated to the symbol -``force-in-comment``. Then it can be expanded as you expected, while -other snippets like ``if`` still can't expanded in comment. - -Multiples snippet with the same key ------------------------------------ - -The rules outlined `above `_ can return more than -one snippet to be expanded at point. - -When there are multiple candidates, YASnippet will let you select -one. The UI for selecting multiple candidate can be customized through -``yas/prompt-functions`` , which defines your preferred methods of -being prompted for snippets. - -You can customize it with ``M-x customize-variable RET -yas/prompt-functions RET``. Alternatively you can put in your -emacs-file: - -.. sourcecode:: common-lisp - - (setq yas/prompt-functions '(yas/x-prompt yas/dropdown-prompt)) - -Currently there are some alternatives solution with YASnippet. - -.. image:: images/x-menu.png - :align: right - -Use the X window system -~~~~~~~~~~~~~~~~~~~~~~~ - -The function ``yas/x-prompt`` can be used to show a popup menu for you -to select. This menu will be part of you native window system widget, -which means: - -* It usually looks beautiful. E.g. when you compile Emacs with gtk - support, this menu will be rendered with your gtk theme. -* Emacs have little control over it. E.g. you can't use ``C-n``, - ``C-p`` to navigate. -* This function can't be used when in a terminal. - -.. image:: images/ido-menu.png - :align: right - -Minibuffer prompting -~~~~~~~~~~~~~~~~~~~~ - -You can use functions ``yas/completing-prompt`` for the classic emacs -completion method or ``yas/ido-prompt`` for a much nicer looking -method. The best way is to try it. This works in a terminal. - -.. image:: images/dropdown-menu.png - :align: right - -Use ``dropdown-menu.el`` -~~~~~~~~~~~~~~~~~~~~~~~~ - -The function ``yas/dropdown-prompt`` can also be placed in the -``yas/prompt-functions`` list. - -This works in both window system and terminal and is customizable, you -can use ``C-n``, ``C-p`` to navigate, ``q`` to quit and even press -``6`` as a shortcut to select the 6th candidate. - -Roll your own -~~~~~~~~~~~~~ - -See below for the documentation on variable ``yas/prompt-functions`` - -Customizable Variables -====================== - -``yas/prompt-functions`` ------------------------- - -You can write a function and add it to the ``yas/prompt-functions`` -list. These functions are called with the following arguments: - -* PROMPT: A string to prompt the user; - -* CHOICES: A list of strings or objects; - -* optional DISPLAY-FN : A function. When applied to each of the - objects in CHOICES it will return a string; - -The return value of any function you put here should be one of -the objects in CHOICES, properly formatted with DISPLAY-FN (if -that is passed). - -* To signal that your particular style of prompting is unavailable at - the moment, you can also have the function return nil. - -* To signal that the user quit the prompting process, you can signal - ``quit`` with ``(signal 'quit "user quit!")`` - -``yas/fallback-behavior`` -------------------------- - -How to act when ``yas/expand`` does *not* expand a snippet. - -``call-other-command`` means try to temporarily disable YASnippet and - call the next command bound to ``yas/trigger-key``. - -``return-nil`` means return nil. (i.e. do nothing) - -An entry (apply COMMAND . ARGS) means interactively call COMMAND, if -ARGS is non-nil, call COMMAND non-interactively with ARGS as -arguments. - -``yas/choose-keys-first`` -------------------------- - -If non-nil, prompt for snippet key first, then for template. - -Otherwise prompts for all possible snippet names. - -This affects ``yas/insert-snippet`` and ``yas/visit-snippet-file``. - -``yas/choose-tables-first`` ---------------------------- - -If non-nil, and multiple eligible snippet tables, prompts user for -tables first. - -Otherwise, user chooses between the merging together of all -eligible tables. - -This affects ``yas/insert-snippet``, ``yas/visit-snippet-file`` - -``yas/key-syntaxes`` --------------------- - -The default searching strategy is quite powerful. For example, in -``c-mode``, ``bar``, ``foo_bar``, ``"#foo_bar"`` can all be recognized -as a snippet key. Furthermore, the searching is in that order. In -other words, if ``bar`` is found to be a key to some *valid* snippet, -then that snippet is expanded and replaces the ``bar``. Snippets -pointed to by ``foo_bar`` and ``"#foobar`` won't be considered. - -However, this strategy can also be customized easily from the -``yas/key-syntaxes`` variable. It is a list of syntax rules, the -default value is ``("w" "w_" "w_." "^ ")``. Which means search the -following thing until found one: - -* a word. -* a symbol. In lisp, ``-`` and ``?`` can all be part of a symbol. -* a sequence of characters of either word, symbol or punctuation. -* a sequence of characters of non-whitespace characters. - -But you'd better keep the default value unless you want to understand -how Emacs's syntax rules work... - - diff --git a/extensions/yasnippet/doc/snippet-menu.html b/extensions/yasnippet/doc/snippet-menu.html deleted file mode 100644 index ad9811b..0000000 --- a/extensions/yasnippet/doc/snippet-menu.html +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - -YASnippet menu - - - -
-
-
-
- -
-
-
-
-

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

- -

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

-

In this menu, you can find

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

Loading snippets from menu

-

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

-

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

-
-
-

Snippet menu behavior

-

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

-

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

-

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

-

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

-

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

-

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

-
-
-

Controlling indenting

-

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

-
-
-

Prompting method

-

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

-
-
-

Misc

-

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

-
-
-
-
-
-
-
- - -
- - diff --git a/extensions/yasnippet/doc/snippet-menu.rst b/extensions/yasnippet/doc/snippet-menu.rst deleted file mode 100644 index a40c5a8..0000000 --- a/extensions/yasnippet/doc/snippet-menu.rst +++ /dev/null @@ -1,85 +0,0 @@ -============== -YASnippet menu -============== - -.. contents:: - -When ``yas/minor-mode`` is active, YASnippet will setup a menu just -after the "Buffers" menu in the menubar. - -In this menu, you can find - -* The currently loaded snippet definitions, organized by major mode, - and optional grouping. - -* A rundown of the most common commands, (followed by their - keybindings) including commands to load directories and reload all - snippet definitions. - -* A series of submenus for customizing and exploring YASnippet - behavior. - -.. image:: images/menu-1.png - :align: right - -Loading snippets from menu --------------------------- - -Invoking "Load snippets..." from the menu invokes -``yas/load-directory`` and prompts you for a snippet directory -hierarchy to load. - -Also useful is the "Reload all" options which uncondionally reloads -all the snippets directories defined in ``yas/root-directory`` and -rebuilds the menus. - -Snippet menu behavior ---------------------- - -YASnippet will list in this section all the loaded snippet definitions -organized by snippet table name. - -You can use this section to explore currently loaded snippets. If you -click on one of them, the default behavior is to expand it, -unconditionally, inside the current buffer. - -You can however, customize variable ``yas/visit-from-menu`` to be -``t`` which will take you to the snippet definition file when you -select it from the menu. - -If you want the menu show only snippet tables whose name corresponds -to a "real" major mode. You do this by setting ``yas/use-menu`` to -``'real-modes``. - -Finally, to have the menu show only the tables for the currently -active mode, set ``yas/use-menu`` to ``abbreviate``. - -These customizations can also be found in the menu itself, under the -"Snippet menu behavior" submenu. - - -Controlling indenting ---------------------- - -The "Indenting" submenu contains options to control the values of -``yas/indent-line`` and ``yas/also-auto-indent-first-line``. See -`Writing snippets `_ . - -Prompting method ----------------- - -The "Prompting method" submenu contains options to control the value -of ``yas/prompt-functions``. See `Expanding snippets `_ . - -Misc ----- - -The "Misc" submenu contains options to control the values of more -variables. - - - - - - - diff --git a/extensions/yasnippet/doc/snippet-organization.html b/extensions/yasnippet/doc/snippet-organization.html deleted file mode 100644 index efb3a2e..0000000 --- a/extensions/yasnippet/doc/snippet-organization.html +++ /dev/null @@ -1,292 +0,0 @@ - - - - - - -Organizing snippets - - - -
-
-
-
- -
-
-
-
-

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

- -
-

Loading snippets

-

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

-

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

-

Once these directories are in place reference them in the variable -yas/root-directory and load them with yas/load-directory:

-
;; Develop and keep personal snippets under ~/emacs.d/mysnippets
-(setq yas/root-directory "~/emacs.d/mysnippets")
-
-;; Load the snippets
-(yas/load-directory yas/root-directory)
-
-

The point in using yas/root-directory (as opposed to calling -yas/load-directory directly) is considering "~/emacs.d/mysnippets" -for snippet development, so you can use commands like -yas/new-snippet and others described in section Writing -Snippets.

-

You can make this variable a list and store more items into it:

-
;; Develop in ~/emacs.d/mysnippets, but also
-;; try out snippets in ~/Downloads/interesting-snippets
-(setq yas/root-directory '("~/emacs.d/mysnippets"
-                           "~/Downloads/interesting-snippets"))
-
-;; Map `yas/load-directory' to every element
-(mapc 'yas/load-directory yas/root-directory)
-
-

In this last example, the all the directories are loaded and their -snippets considered for expansion. However development still happens -in the first element, "~/emacs.d/mysnippets".

-
-
-

Organizing snippets

-

Once you've setup yas/root-directory , you can store snippets -inside sub-directories of these directories.

-

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

-

The name corresponds to the Emacs mode where you want expansion to -take place. For example, snippets for c-mode are put in the -c-mode sub-directory. You can also skip snippet storage altogether -and use the bundle (see YASnippet bundle).

-
-

Nested organization

-

Here is an excerpt of a directory hierarchy containing snippets -for some modes:

-
$ tree
-.
-`-- text-mode
-    |-- cc-mode
-    |   |-- c-mode
-    |   |   `-- printf
-    |   |-- for
-    |   |-- java-mode
-    |   |   `-- println
-    |   `-- while
-    |-- email
-    |-- perl-mode
-    |   |-- cperl-mode
-    |   `-- for
-    `-- time
-
-

A parent directory acts as a parent table of any of its -sub-directories. This is one of the ways different Emacs major modes -can share snippet definitions. As you can see above, c-mode and -java-mode share the same parent cc-mode and its while -snipepts, while all modes are share the time snippet from -text-mode.

-

This can be also used to as an alias -- cperl-mode is an empty -directory whose parent is perl-mode.

-images/menu-parent.png -
-
-

The .yas-parents file

-

An alternate (and preferred) way of setting up parent tables consists -of placing a plain text file .yas-parents inside one of the -sub-directories. By doing this, you avoid complex directory -nesting. In the .yas-parents file you just write -whitespace-separated names of modes. This allows more flexibility and -readability of your snippet hierarchy.

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

The .yas-make-groups file

-images/menu-groups.png -

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

-

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

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

Using plain file names

-

Normally, file names act as the snippet expansion abbreviation (also -known as the snippet key or snippet trigger, see Expanding -Snippets).

-

However, if you customize the variable -yas/ignore-filenames-as-triggers to be true or place an empty -file .yas-ignore-filename-triggers you can use much more -descriptive file names. This is useful if many snippets within a mode -share the same trigger key.

-
$ tree rails-mode/
-rails-mode/
-|-- .yas-make-groups
-|-- .yas-ignore-filename-triggers
-|-- Insert ERb's <% __ %> or <%= __ %>.yasnippet
-|-- asserts
-|   |-- assert(var = assigns(%3Avar)).yasnippet
-|   |-- assert_difference.yasnippet
-|   |-- assert_no_difference.yasnippet
-|   |-- assert_redirected_to (nested path plural).yasnippet
-|   |-- assert_redirected_to (nested path).yasnippet
-|   |-- assert_redirected_to (path plural).yasnippet
-|   |-- assert_redirected_to (path).yasnippet
-|   |-- assert_rjs.yasnippet
-|   `-- assert_select.yasnippet
-
-
-
-
-

YASnippet bundle

-

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

-

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

-

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

-

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

-

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

-

See the internal documentation for these functions

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

Customizable variables

-
-

yas/root-directory

-

Root directory that stores the snippets for each major mode.

-

If you set this from your .emacs, can also be a list of strings, -for multiple root directories. If you make this a list, the first -element is always the user-created snippets directory. Other -directories are used for bulk reloading of all snippets using -yas/reload-all

-
-
-

yas/ignore-filenames-as-triggers

-

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

-

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

- - - -
-
-
-
-
-
-
-
- - -
- - diff --git a/extensions/yasnippet/doc/snippet-organization.rst b/extensions/yasnippet/doc/snippet-organization.rst deleted file mode 100644 index dc7018c..0000000 --- a/extensions/yasnippet/doc/snippet-organization.rst +++ /dev/null @@ -1,253 +0,0 @@ -=================== -Organizing snippets -=================== - -.. _Organizing Snippets: snippet-organization.html -.. _Expanding Snippets: snippet-expansion.html -.. _Writing Snippets: snippet-development.html -.. _The YASnippet Menu: snippet-menu.html - -.. contents:: - -Loading snippets -================ - -Snippet definitions are stored in files in the filesystem. Unless you -use the simpler `bundle version `_), these -are arranged so that YASnippet can load them into *snippet -tables*. The triggering mechanisms (see `Expanding snippets`_) will -look up these snippet tables and (hopefully) expand the snippet you -intended. - -The non-bundle version of YASnippet, once unpacked, comes with a full -directory of snippets, which you can copy somewhere and use. You can -also create or download more directories. - -Once these directories are in place reference them in the variable -``yas/root-directory`` and load them with ``yas/load-directory``: - -.. sourcecode:: common-lisp - - ;; Develop and keep personal snippets under ~/emacs.d/mysnippets - (setq yas/root-directory "~/emacs.d/mysnippets") - - ;; Load the snippets - (yas/load-directory yas/root-directory) - -The point in using ``yas/root-directory`` (as opposed to calling -``yas/load-directory`` directly) is considering "~/emacs.d/mysnippets" -for snippet development, so you can use commands like -``yas/new-snippet`` and others described in section `Writing -Snippets`_. - -You can make this variable a list and store more items into it: - -.. sourcecode:: common-lisp - - ;; Develop in ~/emacs.d/mysnippets, but also - ;; try out snippets in ~/Downloads/interesting-snippets - (setq yas/root-directory '("~/emacs.d/mysnippets" - "~/Downloads/interesting-snippets")) - - ;; Map `yas/load-directory' to every element - (mapc 'yas/load-directory yas/root-directory) - -In this last example, the all the directories are loaded and their -snippets considered for expansion. However development still happens -in the first element, "~/emacs.d/mysnippets". - -Organizing snippets -=================== - -Once you've setup ``yas/root-directory`` , you can store snippets -inside sub-directories of these directories. - -Snippet definitions are put in plain text files. They are arranged by -sub-directories, and the snippet tables are named after these directories. - -The name corresponds to the Emacs mode where you want expansion to -take place. For example, snippets for ``c-mode`` are put in the -``c-mode`` sub-directory. You can also skip snippet storage altogether -and use the bundle (see `YASnippet bundle`_). - -Nested organization -------------------- - -Here is an excerpt of a directory hierarchy containing snippets -for some modes: - -.. sourcecode:: text - - $ tree - . - `-- text-mode - |-- cc-mode - | |-- c-mode - | | `-- printf - | |-- for - | |-- java-mode - | | `-- println - | `-- while - |-- email - |-- perl-mode - | |-- cperl-mode - | `-- for - `-- time - -A parent directory acts as a *parent table* of any of its -sub-directories. This is one of the ways different Emacs major modes -can share snippet definitions. As you can see above, ``c-mode`` and -``java-mode`` share the same parent ``cc-mode`` and its ``while`` -snipepts, while all modes are share the ``time`` snippet from -``text-mode``. - -This can be also used to as an *alias* -- ``cperl-mode`` is an empty -directory whose parent is ``perl-mode``. - -.. image:: images/menu-parent.png - :align: right - -The ``.yas-parents`` file ------------------------------- - -An alternate (and preferred) way of setting up parent tables consists -of placing a plain text file ``.yas-parents`` inside one of the -sub-directories. By doing this, you avoid complex directory -nesting. In the ``.yas-parents`` file you just write -whitespace-separated names of modes. This allows more flexibility and -readability of your snippet hierarchy. - -.. sourcecode:: text - - $ tree - . - |-- c-mode - | |-- .yas-parents # contains "cc-mode text-mode" - | `-- printf - |-- cc-mode - | |-- for - | `-- while - |-- java-mode - | |-- .yas-parents # contains "cc-mode text-mode" - | `-- println - `-- text-mode - |-- email - `-- time - -The ``.yas-make-groups`` file ------------------------------ - -.. image:: images/menu-groups.png - :align: right - -If you place an empty plain text file ``.yas-make-groups`` inside one -of the mode directories, the names of these sub-directories are -considered groups of snippets and `The YASnippet Menu`_ is organized -much more cleanly, as you can see in the image. - -Another alternative way to achieve this is to place a ``# group:`` -directive inside the snippet definition. See `Writing Snippets`_. - -.. sourcecode:: text - - $ tree ruby-mode/ - ruby-mode/ - |-- .yas-make-groups - |-- collections - | |-- each - | `-- ... - |-- control structure - | |-- forin - | `-- ... - |-- definitions - | `-- ... - `-- general - `-- ... - - -Using plain file names ----------------------- - -Normally, file names act as the snippet expansion *abbreviation* (also -known as the *snippet key* or *snippet trigger*, see `Expanding -Snippets`_). - -However, if you customize the variable -``yas/ignore-filenames-as-triggers`` to be true *or* place an empty -file ``.yas-ignore-filename-triggers`` you can use much more -descriptive file names. This is useful if many snippets within a mode -share the same trigger key. - -.. sourcecode:: text - - $ tree rails-mode/ - rails-mode/ - |-- .yas-make-groups - |-- .yas-ignore-filename-triggers - |-- Insert ERb's <% __ %> or <%= __ %>.yasnippet - |-- asserts - | |-- assert(var = assigns(%3Avar)).yasnippet - | |-- assert_difference.yasnippet - | |-- assert_no_difference.yasnippet - | |-- assert_redirected_to (nested path plural).yasnippet - | |-- assert_redirected_to (nested path).yasnippet - | |-- assert_redirected_to (path plural).yasnippet - | |-- assert_redirected_to (path).yasnippet - | |-- assert_rjs.yasnippet - | `-- assert_select.yasnippet - - -YASnippet bundle -================ - -The most convenient way to define snippets for YASnippet is to put -them in a directory arranged by the mode and use -``yas/load-directory`` to load them. - -However, this might slow down the Emacs start-up speed if you have many -snippets. You can use ``yas/define-snippets`` to define a bunch of -snippets for a particular mode in an Emacs-lisp file. - -Since this is hard to maintain, there's a better way: define your -snippets in directory and then call ``M-x yas/compile-bundle`` to -compile it into a bundle file when you modified your snippets. - -The release bundle of YASnippet is produced by -``yas/compile-bundle``. The bundle uses ``yas/define-snippets`` to -define snippets. This avoids the IO and parsing overhead when loading -snippets. - -Further more, the generated bundle is a stand-alone file not depending -on ``yasnippet.el``. The released bundles of YASnippet are all -generated this way. - -See the internal documentation for these functions - -* ``M-x describe-function RET yas/define-snippets RET`` -* ``M-x describe-function RET yas/compile-bundle RET``. - -Customizable variables -====================== - -``yas/root-directory`` ----------------------- - -Root directory that stores the snippets for each major mode. - -If you set this from your .emacs, can also be a list of strings, -for multiple root directories. If you make this a list, the first -element is always the user-created snippets directory. Other -directories are used for bulk reloading of all snippets using -``yas/reload-all`` - -``yas/ignore-filenames-as-triggers`` ------------------------------------- - -If non-nil, don't derive tab triggers from filenames. - -This means a snippet without a ``# key:`` directive wont have a tab -trigger. - -.. LocalWords: html YASnippet filesystem yas sourcecode setq mapc printf perl -.. LocalWords: println cperl forin filenames filename ERb's yasnippet Avar el -.. LocalWords: rjs RET diff --git a/extensions/yasnippet/doc/styles.css b/extensions/yasnippet/doc/styles.css deleted file mode 100644 index e0afa09..0000000 --- a/extensions/yasnippet/doc/styles.css +++ /dev/null @@ -1,142 +0,0 @@ -/* Base stylesheet from Docutils distribution */ -@import url(html4css1.css); - -/* Theme stylesheet */ -body { - background: #EDF5FA; - margin: 0; - padding: 0; -} -.clear-block { - display: block; -} -#header-region { - background: #D2E6F3 url(images/bg-navigation.png) repeat-x scroll 50% 100%;; - min-height: 1em; -} -#wrapper { - background: #EDF5FA url(images/body.png) repeat-x scroll 50% 0pt; -} -#container { - margin: 0pt auto; - padding: 0pt 20px; -} -#header { - height: 80px; -} -#sidebar-left { - float: left; - margin: 60px 0pt 5em; - position: relative; - width: 210px; - z-index: 2; -} -#center #squeeze { - background: #FFFFFF url(images/bg-content.png) repeat-x scroll 50% 0pt; - position: relative; -} -#center .right-corner { - background: transparent url(images/bg-content-right.png) no-repeat scroll 100% 0pt; - left: 10px; - position: relative; -} -#center .left-corner { - background: transparent url(images/bg-content-left.png) no-repeat scroll 0pt 0pt; - left: -10px; - margin-left: -10px; - min-height: 400px; - padding: 60px 25px 5em 35px; - position: relative; -} -ul.primary-links { - float: right; - margin: 0px; - padding: 0px; - position: relative; - z-index: 4; -} -ul.primary-links li { - list-style-type: none; - float: left; - margin: 0px; - font-size: 0.8em; - padding: 0px; -} -ul.primary-links li a { - background: transparent url(images/bg-navigation-item.png) no-repeat scroll 50% 0pt; - color: #FFFFFF; - display: block; - margin: 0pt 1em; - padding: 0.75em 0pt 0pt; -} -ul.primary-links li a:hover { - background: transparent url(images/bg-navigation-item-hover.png) no-repeat scroll 50% 0pt; -} -#logo-floater { - position: absolute; - color: #FFFFFF; - height: 80px; - font-weight: normal; - text-shadow: #1659AC 0px 1px 3px; -} -#logo-floater h1 { - margin-top: 25px; - margin-left: 10px; - font-family: Georgia, Serif; -} - -/* Contents stylesheet */ -body { - font-family: Georgia, Serif; -} -#contents { - margin-right: 0; - width: 340px; - overflow: hidden; - float: right; -} -#contents p.topic-title { - margin: 0 0 0 18px; -} -#contents ul.simple { - margin: 5px 0 5px 5px; - padding: 2px 0 8px 30px; - border-left: 1px solid #E0E5FB; -} -a { - color: #027AC6; - text-decoration: none; -} -a:hover { - color: #0062A0; - text-decoration: underline; -} -a.toc-backref:hover { - color: #000000; -} -a.external { - padding-right: 13px; - background: transparent url(images/external.png) no-repeat scroll right center; -} - -tt.docutils { - background-color: #EAFFEA; - font-family: Monaco, Consolas, Courier New, Monospace; -} - -div.highlight { - margin: 5px 40px 5px 15px; - overflow: auto; - padding: 0; - background: #F7F7F7; - border: 1px solid #E0E5FB; -} -div.highlight pre { - margin: 8px 15px 8px 15px; - font-family: Monaco, Consolas, Courier New, Monospace; - font-size: 0.9em; - line-height: 1.2em; -} -img { - margin: 8px; -} \ No newline at end of file diff --git a/extensions/yasnippet/doc/template.txt b/extensions/yasnippet/doc/template.txt deleted file mode 100644 index e01d73d..0000000 --- a/extensions/yasnippet/doc/template.txt +++ /dev/null @@ -1,67 +0,0 @@ -%(head_prefix)s -%(head)s -%(stylesheet)s -%(body_prefix)s -
-
-
- -
-
-
-
-

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

- %(body)s -
-
-
-
-
-
- - -%(body_suffix)s diff --git a/extensions/yasnippet/dropdown-list.el b/extensions/yasnippet/dropdown-list.el deleted file mode 100644 index 7b451d5..0000000 --- a/extensions/yasnippet/dropdown-list.el +++ /dev/null @@ -1,251 +0,0 @@ -;;; dropdown-list.el --- Drop-down menu interface -;; -;; Filename: dropdown-list.el -;; Description: Drop-down menu interface -;; Author: Jaeyoun Chung [jay.chung@gmail.com] -;; Maintainer: -;; Copyright (C) 2008 Jaeyoun Chung -;; 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, 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; see the file COPYING. If not, write to -;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth -;; Floor, Boston, MA 02110-1301, USA. -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;;; 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 \ No newline at end of file diff --git a/extensions/yasnippet/extras/imported/html-mode/.yas-setup.el b/extensions/yasnippet/extras/imported/html-mode/.yas-setup.el deleted file mode 100644 index 37aeaea..0000000 --- a/extensions/yasnippet/extras/imported/html-mode/.yas-setup.el +++ /dev/null @@ -1,680 +0,0 @@ -;; .yas-setup.el for html-mode - -(defvar yas/html-default-tag "p") - -(defvar yas/html-xhtml-attr "") - -(defvar yas/html-just-like-tm nil - "Html-mode snippets behave as close to TextMate as possible.") - -(defun yas/html-remove-preceding-word () - (interactive) - (let (word-begin - word-end - (line-beginning-position (line-beginning-position)) - (orig-point (point)) - retval) - (save-excursion - (when (and (forward-word -1) - (setq word-begin (point)) - (forward-word 1) - (setq word-end (point)) - (< word-begin orig-point) - (>= word-end orig-point) - (<= (line-beginning-position) word-begin) - ;; (not (string-match "^[\s\t]+$" " ")) - ) - (setq retval - (cons - (buffer-substring-no-properties word-begin orig-point) - (buffer-substring-no-properties word-end orig-point))) - (delete-region word-begin word-end) - retval)))) - - -(defun yas/html-first-word (string) - (replace-regexp-in-string "\\\W.*" "" string)) - -(defun yas/html-insert-tag-pair-snippet () - (let* ((tag-and-suffix (or (and yas/selected-text - (cons yas/selected-text nil)) - (yas/html-remove-preceding-word))) - (tag (car tag-and-suffix)) - (suffix (or (cdr tag-and-suffix) "")) - (single-no-arg "\\(br\\|hr\\)") - (single "\\(img\\|meta\\|link\\|input\\|base\\|area\\|col\\|frame\\|param\\)")) - (cond ((null tag) - (yas/expand-snippet (format "<${1:%s}>%s%s" - (or yas/html-default-tag - "p") - (if yas/html-just-like-tm "$2" "$0") - suffix))) - ((string-match single-no-arg tag) - (insert (format "<%s%s/>%s" tag yas/html-xhtml-attr suffix))) - ((string-match single tag) - (yas/expand-snippet (format "<%s $1%s/>%s" tag yas/html-xhtml-attr suffix))) - (t - (yas/expand-snippet (format "<%s>%s%s" - tag - (if yas/html-just-like-tm "$1" "$0") - (replace-regexp-in-string "\\\W.*" "" tag) - suffix)))))) - -(defun yas/html-wrap-each-line-in-openclose-tag () - (let* ((mirror "${1:$(yas/html-first-word yas/text)}") - (yas/html-wrap-newline (when (string-match "\n" yas/selected-text) "\n")) - (template (concat (format "<${1:%s}>" (or yas/html-default-tag "p")) - yas/selected-text - ""))) - (setq template (replace-regexp-in-string "\n" (concat "\n<$1>") template)) - (yas/expand-snippet template))) - -(defun yas/html-toggle-wrap (string wrap) - (or (and string - (string-match (format "<%s>\\(.*\\)" wrap wrap) - string) - (match-string 1 string)) - (concat "" string ""))) - -(defun yas/html-between-tag-pair-p () - (save-excursion - (backward-word) - (looking-at "\\\w+>"))) - -(defun yas/html-id-from-string (string) - (replace-regexp-in-string " " "_" (downcase string))) - -(defun yas/html-tidy () - (interactive) - (let ((start (or (and mark-active - (region-beginning)) - (point-min))) - (end (or (and mark-active - (region-end)) - (point-max))) - (orig (point)) - (orig-line (count-screen-lines (window-start) (line-beginning-position)))) - (shell-command-on-region start end "tidy" (current-buffer) t (get-buffer-create "*tidy errors*") t) - (goto-char (min (point-max) orig)) - (recenter (1- orig-line)))) - -(defun yas/html-tag-description () - (interactive) - (let* ((tag-at-point (sgml-beginning-of-tag)) - (fragment (and tag-at-point - (aget yas/html-tag-description-urls (upcase tag-at-point))))) - (if fragment - (browse-url (concat "http://www.w3.org/TR/html4/index/" - fragment)) - (if tag-at-point - (message "No documentation for " tag-at-point) - (message "Not on a HTML tag."))))) - -(defvar yas/html-tag-description-urls - '(("A" . "../struct/links.html#edef-A") - ("ABBR" . "../struct/text.html#edef-ABBR") - ("ACRONYM" . "../struct/text.html#edef-ACRONYM") - ("ADDRESS" . "../struct/global.html#edef-ADDRESS") - ("APPLET" . "../struct/objects.html#edef-APPLET") - ("AREA" . "../struct/objects.html#edef-AREA") - ("B" . "../present/graphics.html#edef-B") - ("BASE" . "../struct/links.html#edef-BASE") - ("BASEFONT" . "../present/graphics.html#edef-BASEFONT") - ("BDO" . "../struct/dirlang.html#edef-BDO") - ("BIG" . "../present/graphics.html#edef-BIG") - ("BLOCKQUOTE" . "../struct/text.html#edef-BLOCKQUOTE") - ("BODY" . "../struct/global.html#edef-BODY") - ("BR" . "../struct/text.html#edef-BR") - ("BUTTON" . "../interact/forms.html#edef-BUTTON") - ("CAPTION" . "../struct/tables.html#edef-CAPTION") - ("CENTER" . "../present/graphics.html#edef-CENTER") - ("CITE" . "../struct/text.html#edef-CITE") - ("CODE" . "../struct/text.html#edef-CODE") - ("COL" . "../struct/tables.html#edef-COL") - ("COLGROUP" . "../struct/tables.html#edef-COLGROUP") - ("DD" . "../struct/lists.html#edef-DD") - ("DEL" . "../struct/text.html#edef-del") - ("DFN" . "../struct/text.html#edef-DFN") - ("DIR" . "../struct/lists.html#edef-DIR") - ("DIV" . "../struct/global.html#edef-DIV") - ("DL" . "../struct/lists.html#edef-DL") - ("DT" . "../struct/lists.html#edef-DT") - ("EM" . "../struct/text.html#edef-EM") - ("FIELDSET" . "../interact/forms.html#edef-FIELDSET") - ("FONT" . "../present/graphics.html#edef-FONT") - ("FORM" . "../interact/forms.html#edef-FORM") - ("FRAME" . "../present/frames.html#edef-FRAME") - ("FRAMESET" . "../present/frames.html#edef-FRAMESET") - ("H1" . "../struct/global.html#edef-H1") - ("H2" . "../struct/global.html#edef-H2") - ("H3" . "../struct/global.html#edef-H3") - ("H4" . "../struct/global.html#edef-H4") - ("H5" . "../struct/global.html#edef-H5") - ("H6" . "../struct/global.html#edef-H6") - ("HEAD" . "../struct/global.html#edef-HEAD") - ("HR" . "../present/graphics.html#edef-HR") - ("HTML" . "../struct/global.html#edef-HTML") - ("I" . "../present/graphics.html#edef-I") - ("IFRAME" . "../present/frames.html#edef-IFRAME") - ("IMG" . "../struct/objects.html#edef-IMG") - ("INPUT" . "../interact/forms.html#edef-INPUT") - ("INS" . "../struct/text.html#edef-ins") - ("ISINDEX" . "../interact/forms.html#edef-ISINDEX") - ("KBD" . "../struct/text.html#edef-KBD") - ("LABEL" . "../interact/forms.html#edef-LABEL") - ("LEGEND" . "../interact/forms.html#edef-LEGEND") - ("LI" . "../struct/lists.html#edef-LI") - ("LINK" . "../struct/links.html#edef-LINK") - ("MAP" . "../struct/objects.html#edef-MAP") - ("MENU" . "../struct/lists.html#edef-MENU") - ("META" . "../struct/global.html#edef-META") - ("NOFRAMES" . "../present/frames.html#edef-NOFRAMES") - ("NOSCRIPT" . "../interact/scripts.html#edef-NOSCRIPT") - ("OBJECT" . "../struct/objects.html#edef-OBJECT") - ("OL" . "../struct/lists.html#edef-OL") - ("OPTGROUP" . "../interact/forms.html#edef-OPTGROUP") - ("OPTION" . "../interact/forms.html#edef-OPTION") - ("P" . "../struct/text.html#edef-P") - ("PARAM" . "../struct/objects.html#edef-PARAM") - ("PRE" . "../struct/text.html#edef-PRE") - ("Q" . "../struct/text.html#edef-Q") - ("S" . "../present/graphics.html#edef-S") - ("SAMP" . "../struct/text.html#edef-SAMP") - ("SCRIPT" . "../interact/scripts.html#edef-SCRIPT") - ("SELECT" . "../interact/forms.html#edef-SELECT") - ("SMALL" . "../present/graphics.html#edef-SMALL") - ("SPAN" . "../struct/global.html#edef-SPAN") - ("STRIKE" . "../present/graphics.html#edef-STRIKE") - ("STRONG" . "../struct/text.html#edef-STRONG") - ("STYLE" . "../present/styles.html#edef-STYLE") - ("SUB" . "../struct/text.html#edef-SUB") - ("SUP" . "../struct/text.html#edef-SUP") - ("TABLE" . "../struct/tables.html#edef-TABLE") - ("TBODY" . "../struct/tables.html#edef-TBODY") - ("TD" . "../struct/tables.html#edef-TD") - ("TEXTAREA" . "../interact/forms.html#edef-TEXTAREA") - ("TFOOT" . "../struct/tables.html#edef-TFOOT") - ("TH" . "../struct/tables.html#edef-TH") - ("THEAD" . "../struct/tables.html#edef-THEAD") - ("TITLE" . "../struct/global.html#edef-TITLE") - ("TR" . "../struct/tables.html#edef-TR") - ("TT" . "../present/graphics.html#edef-TT") - ("U" . "../present/graphics.html#edef-U") - ("UL" . "../struct/lists.html#edef-UL") - ("VAR" . "../struct/text.html#edef-VAR"))) - -;; -;; -;; Substitutions for: content -;; # as in Snippets/Emphasize.yasnippet -;; ${TM_SELECTED_TEXT/\A(.*)<\/em>\z|.*/(?1:$1:$0<\/em>)/m} =yyas> `(yas/html-toggle-wrap yas/selected-text "em")` -;; ${TM_SELECTED_TEXT/\A(.*)<\/strong>\z|.*/(?1:$1:$0<\/strong>)/m} =yyas> `(yas/html-toggle-wrap yas/selected-text "strong")` -;; ${1/\s.*//} =yyas> ${1:$(replace-regexp-in-string "^[\s\t\n]*" "" yas/text)} -;; ${1/[[:alpha:]]+|( )/(?1:_:\L$0)/g} =yyas> ${1:$(replace-regexp-in-string " " "_" (downcase yas/text))} -;; ${TM_XHTML} =yyas> `yas/html-xhtml-attr` - - -;; # as in Commands/Preview in All Active Browsers.yasnippet -;; 970EE6B4-A091-11D9-A5A2-000D93C8BE28 =yyas> (browse-url-of-buffer) -;; 637CEA2B-578C-429C-BB74-30E8D42BFA22 =yyas> (yas/html-tag-description) -;; 2ED44A32-C353-447F-BAE4-E3522DB6944D =yyas> (yas/html-insert-tag-pair-snippet) -;; 991E7EBD-F3F5-469A-BA01-DC30E04AD472 =yyas> (yas/html-wrap-each-line-in-openclose-tag) - -;; Substitutions for: binding -;; -;; # as in Snippets/Strong.yasnippet -;; @b =yyas> s-b -;; -;; # as in Snippets/Emphasize.yasnippet -;; @i =yyas> s-i -;; -;; # as in Snippets/Wrap Selection In Tag.yasnippet -;; ^W =yyas> C-c M-w -;; -;; # as in Commands/Insert Tag Pair.yasnippet -;; ^< =yyas> C-< -;; -;; # as in Commands/Documentation for Tag.yasnippet -;; ^h =yyas> C-c M-h -;; -;; # as in Commands/Wrap Each Selected Line in OpenClose Tag.yasnippet -;; ^@W =yyas> C-c M-W -;; -;; # as in Snippets/XHTML   NonBreakingSpace.yasnippet -;; ~ =yyas> (yas/unknown) -;; -;; # as in Commands/Insert Entity.yasnippet -;; @& =yyas> (yas/unknown) -;; -;; # as in Commands/Refresh All Active Browsers.yasnippet -;; @r =yyas> (yas/unknown) -;; -;; # as in Commands/Persistent Include.yasnippet -;; ^@i =yyas> (yas/unknown) -;; -;; # as in Commands/CodeCompletion HTML Tags.yasnippet -;; ~ =yyas> (yas/unknown) -;; -;; # as in Commands/Update Includes.yasnippet -;; ^@u =yyas> (yas/unknown) -;; -;; # as in Macros/Delete whitespace between tags.yasnippet -;; ^~ =yyas> (yas/unknown) -;; -;; # as in Commands/Tidy.yasnippet -;; ^H =yyas> (yas/unknown) -;; -;; -;; --**-- -;; Automatically generated code, do not edit this part -;; -;; Translated menu -;; -(yas/define-menu 'html-mode - '(;; Documentation for Tag - (yas/item "637CEA2B-578C-429C-BB74-30E8D42BFA22") - ;; Ignoring Validate Syntax (W3C) - (yas/ignore-item "3F26240E-6E4A-11D9-B411-000D93589AF6") - - ;; Open Document in Running Browser(s) - (yas/item "970EE6B4-A091-11D9-A5A2-000D93C8BE28") - ;; Ignoring Refresh Running Browser(s) - (yas/ignore-item "B8651C6E-A05E-11D9-86AC-000D93C8BE28") - - (yas/submenu "Entities" - (;; Ignoring Convert Character / Selection to Entities - (yas/ignore-item "3DD8406C-A116-11D9-A5A2-000D93C8BE28") - ;; Ignoring Convert Character / Selection to Entities Excl. Tags - (yas/ignore-item "43C9E8AE-3E53-4B82-A1AF-56697BB3EF09") - ;; Ignoring Decode Entities in Line / Selection - (yas/ignore-item "C183920D-A126-11D9-A5A2-000D93C8BE28") - - ;; Non-Breaking Space - (yas/item "73B40BAE-A295-11D9-87F7-000D93C8BE28") - ;; → - (yas/item "C70BB693-0954-4440-AEB4-F2ADD6D923F0") - ;; ← - (yas/item "C0418A4A-7E42-4D49-8F86-6E339296CB84") - ;; ⇤ - (yas/item "7F102705-27D8-4029-BF61-2F042FB61E06") - ;; ⌅ - (yas/item "7062316B-4236-4793-AD35-05E4A6577393") - ;; ⌃ - (yas/item "B4987DA5-9C2F-4D2D-AC14-678115079205") - ;; ⌦ - (yas/item "44E448B6-37CE-4BFE-8611-C5113593B74B") - ;; ↩ - (yas/item "9B216475-D73D-4518-851F-CACD0066A909") - ;; ⇥ - (yas/item "ADC78A82-40C2-4AAC-8968-93AF0ED98DF0") - ;; ⌫ - (yas/item "38E50882-27AF-4246-A039-355C3E1A699E") - ;; ⌘ - (yas/item "7214ACD1-93D9-4D3F-A428-8A7302E0A35E") - ;; ↓ - (yas/item "35654B4E-2D76-4CD3-8FBB-2DA1F314BA19") - ;; → - (yas/item "AC15621A-8A16-40DD-A671-EA4C37637215") - ;; ↑ - (yas/item "0E2F4A47-EADE-4A05-931E-FC874FA28FC3") - ;; ⇧ - (yas/item "1B8D58B9-D9DB-484C-AACD-5D5DF5385308") - ;; ⎋ - (yas/item "D7CC7C7C-CD01-4357-AF91-AEFFD914DF98") - ;; ⌥ - (yas/item "980A8D39-CA8B-4EC2-9739-DC36A262F28E") - (yas/separator) - ;; Ignoring Insert Entity… - (yas/ignore-item "89E5CC0A-3EFF-4DEF-A299-2E9651DE6529"))) - (yas/submenu "URL Escapes" - (;; Ignoring URL Escape Line / Selection - (yas/ignore-item "6B024865-6095-4CE3-8EDD-DC6F2230C2FF") - ;; Ignoring URL Unescape Line / Selection - (yas/ignore-item "2C4C9673-B166-432A-8938-75A5CA622481"))) - ;; Ignoring Encrypt Line / Selection (ROT 13) - (yas/ignore-item "9B13543F-8356-443C-B6E7-D9259B604927") - - ;; Ignoring CodeCompletion HTML Attributes - (yas/ignore-item "CBD82CF3-74E9-4E7A-B3F6-9348754EB5AA") - ;; Insert Open/Close Tag (With Current Word) - (yas/item "2ED44A32-C353-447F-BAE4-E3522DB6944D") - ;; Ignoring Insert Close Tag - (yas/ignore-item "0658019F-3635-462E-AAC2-74E4FE508A9B") - (yas/submenu "Insert DocType" - (;; HTML — 4.01 Strict - (yas/item "944F1410-188C-4D70-8340-CECAA56FC7F2") - ;; HTML — 4.01 Transitional - (yas/item "B2AAEE56-42D8-42C3-8F67-865473F50E8D") - (yas/separator) - ;; XHTML — 1.0 Frameset - (yas/item "9ED6ABBE-A802-11D9-BFC8-000D93C8BE28") - ;; XHTML — 1.0 Strict - (yas/item "C8B83564-A802-11D9-BFC8-000D93C8BE28") - ;; XHTML — 1.0 Transitional - (yas/item "7D8C2F74-A802-11D9-BFC8-000D93C8BE28") - ;; XHTML — 1.1 - (yas/item "5CE8FC6E-A802-11D9-BFC8-000D93C8BE28"))) - (yas/submenu "Insert Tag" - (;; Ignoring CodeCompletion HTML Tags - (yas/ignore-item "3463E85F-F500-49A0-8631-D78ED85F9D60") - - ;; Base - (yas/item "4462A6B8-A08A-11D9-A5A2-000D93C8BE28") - ;; Body - (yas/item "4905D47B-A08B-11D9-A5A2-000D93C8BE28") - ;; Br - (yas/item "3E008E42-A5C9-11D9-9BCD-000D93C8BE28") - ;; Div - (yas/item "576036C0-A60E-11D9-ABD6-000D93C8BE28") - ;; Embed QT Movie - (yas/item "42F15753-9B6D-4DD8-984C-807B94363277") - ;; Fieldset - (yas/item "9BD2BE01-A854-4D55-B584-725D04C075C0") - ;; Form - (yas/item "232C2E8B-A08E-11D9-A5A2-000D93C8BE28") - ;; Head - (yas/item "9CF008C4-A086-11D9-A5A2-000D93C8BE28") - ;; Heading - (yas/item "65BA66DC-A07F-11D9-A5A2-000D93C8BE28") - ;; Input - (yas/item "44180979-A08E-11D9-A5A2-000D93C8BE28") - ;; Input with Label - (yas/item "D8DCCC81-749A-4E2A-B4BC-D109D5799CAA") - ;; Link - (yas/item "77BFD0C0-A08A-11D9-A5A2-000D93C8BE28") - ;; Mail Anchor - (yas/item "81DA4C74-A530-11D9-9BCD-000D93C8BE28") - ;; Meta - (yas/item "DA99AC44-A083-11D9-A5A2-000D93C8BE28") - ;; Option - (yas/item "5820372E-A093-4F38-B25C-B0CCC50A0FC4") - ;; Script - (yas/item "6592050A-A087-11D9-A5A2-000D93C8BE28") - ;; Script With External Source - (yas/item "7D676C4C-A087-11D9-A5A2-000D93C8BE28") - ;; Select Box - (yas/item "26023CFF-C73F-4EF5-9803-E4DBA2CBEADD") - ;; Style - (yas/item "3C518074-A088-11D9-A5A2-000D93C8BE28") - ;; Table - (yas/item "57176082-A12F-11D9-A5A2-000D93C8BE28") - ;; Text Area - (yas/item "AAC9D7B8-A12C-11D9-A5A2-000D93C8BE28") - ;; Title - (yas/item "B62ECABE-A086-11D9-A5A2-000D93C8BE28"))) - - (yas/submenu "Includes" - (;; Ignoring Add Persistent Include - (yas/ignore-item "0D814247-7A00-46EE-A2A4-45FBBF4B1181") - ;; Ignoring Update Document - (yas/ignore-item "4400BCE9-20E3-426E-B1D7-2C0BCA53BCF8") - ;; Ignoring Help: Persistent Includes - (yas/ignore-item "9AFDEB2C-D9F0-423E-8211-EBB089F51F0C"))) - (yas/submenu "Format" - (;; Strong - (yas/item "4117D930-B6FA-4022-97E7-ECCAF4E70F63") - ;; Emphasize - (yas/item "EBB98620-3292-4621-BA38-D8A9A65D9551"))) - (yas/submenu "Conditional Comments" - (;; IE Conditional Comment: Internet Explorer - (yas/item "0ED6DA73-F38F-4A65-B18F-3379D2BA9387") - ;; IE Conditional Comment: Internet Explorer 5.0 only - (yas/item "3A517A94-001E-464D-8184-1FE56D0D0D70") - ;; IE Conditional Comment: Internet Explorer 5.5 only - (yas/item "E3F8984E-7269-4981-9D30-967AB56A6ACE") - ;; IE Conditional Comment: Internet Explorer 5.x - (yas/item "F3512848-7889-45DA-993B-0547976C8E6D") - ;; IE Conditional Comment: Internet Explorer 6 and below - (yas/item "32BBB9AB-8732-4F91-A587-354941A27B69") - ;; IE Conditional Comment: Internet Explorer 6 only - (yas/item "48DF7485-52EA-49B3-88AF-3A41F933F325") - ;; IE Conditional Comment: Internet Explorer 7 and above - (yas/item "CBC24AF4-88E0-498B-BE50-934B9CF29EC7") - ;; IE Conditional Comment: NOT Internet Explorer - (yas/item "F00170EE-4A82-413F-A88B-85293E69A88B"))) - - ;; Wrap Selection in Open/Close Tag - (yas/item "BC8B8AE2-5F16-11D9-B9C3-000D93589AF6") - ;; Wrap Each Selected Line in Open/Close Tag - (yas/item "991E7EBD-F3F5-469A-BA01-DC30E04AD472") - ;; Wrap in - (yas/item "912906A0-9A29-434B-AE98-E9DFDE6E48B4") - (yas/separator) - ;; Ignoring Strip HTML Tags from Document / Selection - (yas/ignore-item "20D760B5-A127-11D9-A5A2-000D93C8BE28") - ;; Ignoring Tidy - (yas/ignore-item "45F92B81-6F0E-11D9-A1E4-000D9332809C")) - '("7B7E945E-A112-11D9-A5A2-000D93C8BE28" - "3C44EABE-8D6F-4B1B-AB91-F419FAD1A0AD" - "4400BCE9-20E3-426E-B1D7-2C0BCA53BCF8" - "3463E85F-F500-49A0-8631-D78ED85F9D60" - "CBD82CF3-74E9-4E7A-B3F6-9348754EB5AA" - "9B13543F-8356-443C-B6E7-D9259B604927" - "0D814247-7A00-46EE-A2A4-45FBBF4B1181" - "9AFDEB2C-D9F0-423E-8211-EBB089F51F0C" - "C8B717C2-6B33-11D9-BB47-000D93589AF6" - "CD6D2CC6-6B33-11D9-BDFD-000D93589AF6" - "B23D6E15-6B33-11D9-86C1-000D93589AF6" - "7B7E945E-A112-11D9-A5A2-000D93C8BE28" - "45F92B81-6F0E-11D9-A1E4-000D9332809C" - "3DD8406C-A116-11D9-A5A2-000D93C8BE28" - "3F26240E-6E4A-11D9-B411-000D93589AF6" - "43C9E8AE-3E53-4B82-A1AF-56697BB3EF09" - "89E5CC0A-3EFF-4DEF-A299-2E9651DE6529" - "2C4C9673-B166-432A-8938-75A5CA622481" - "6B024865-6095-4CE3-8EDD-DC6F2230C2FF" - "0658019F-3635-462E-AAC2-74E4FE508A9B" - "20D760B5-A127-11D9-A5A2-000D93C8BE28" - "B8651C6E-A05E-11D9-86AC-000D93C8BE28" - "C183920D-A126-11D9-A5A2-000D93C8BE28" - "CDE8EFD6-9DE2-4E8C-BB6A-52E8CCD2E977" - "E6F19171-F664-4B4F-92DA-3E15E6CAD35C" - "EBEE6B51-29C7-4362-818F-A190CACD5296" - "26068A55-4C84-409D-BA00-162B55AF6961" - "65D38039-6B0A-48E9-9E49-43832ECC4107" - "04332FA8-8157-46C4-9854-8C190FFD96C6")) - -;; Unknown substitutions -;; -;; Substitutions for: content -;; -;; # as in Templates/XHTML 1.1/info.yasnippet -;; CDE8EFD6-9DE2-4E8C-BB6A-52E8CCD2E977 =yyas> (yas/unknown) -;; -;; # as in Snippets/IE Conditional Comment Internet Explorer 5_0 only.yasnippet -;; `(or (yas/selected-text) " IE Conditional Comment: Internet Explorer 5.0 only ")` =yyas> (yas/unknown) -;; -;; # as in Snippets/IE Conditional Comment Internet Explorer.yasnippet -;; `(or (yas/selected-text) " IE Conditional Comment: Internet Explorer ")` =yyas> (yas/unknown) -;; -;; # as in Commands/CodeCompletion HTML Tags.yasnippet -;; 3463E85F-F500-49A0-8631-D78ED85F9D60 =yyas> (yas/unknown) -;; -;; # as in Snippets/Emphasize.yasnippet -;; `(yas/html-toggle-wrap yas/selected-text "em")` =yyas> (yas/unknown) -;; -;; # as in Templates/HTML 4.0 Transitional/info.yasnippet -;; E6F19171-F664-4B4F-92DA-3E15E6CAD35C =yyas> (yas/unknown) -;; -;; # as in Commands/Insert Entity.yasnippet -;; 89E5CC0A-3EFF-4DEF-A299-2E9651DE6529 =yyas> (yas/unknown) -;; -;; # as in Commands/Convert to HTML Entities.yasnippet -;; 3DD8406C-A116-11D9-A5A2-000D93C8BE28 =yyas> (yas/unknown) -;; -;; # as in Snippets/XHTML body.yasnippet -;; ${TM_FILENAME/(.*)\..*/\L$1/} =yyas> (yas/unknown) -;; -;; # as in Snippets/XHTML form.yasnippet -;; ${TM_FILENAME/(.*?)\..*/$1_submit/} =yyas> (yas/unknown) -;; -;; # as in Commands/Persistent Include.yasnippet -;; 0D814247-7A00-46EE-A2A4-45FBBF4B1181 =yyas> (yas/unknown) -;; -;; # as in Commands/Refresh All Active Browsers.yasnippet -;; B8651C6E-A05E-11D9-86AC-000D93C8BE28 =yyas> (yas/unknown) -;; -;; # as in Snippets/Strong.yasnippet -;; `(yas/html-toggle-wrap yas/selected-text "strong")` =yyas> (yas/unknown) -;; -;; # as in Snippets/IE Conditional Comment Internet Explorer 5_5 only.yasnippet -;; `(or (yas/selected-text) " IE Conditional Comment: Internet Explorer 5.5 only ")` =yyas> (yas/unknown) -;; -;; # as in Commands/Insert Close Tag.yasnippet -;; 0658019F-3635-462E-AAC2-74E4FE508A9B =yyas> (yas/unknown) -;; -;; # as in Commands/Decode Numeric URL Escapes in Line Selection.yasnippet -;; 2C4C9673-B166-432A-8938-75A5CA622481 =yyas> (yas/unknown) -;; -;; # as in Commands/Convert to named entities excl tags.yasnippet -;; 43C9E8AE-3E53-4B82-A1AF-56697BB3EF09 =yyas> (yas/unknown) -;; -;; # as in DragCommands/CSS Link.yasnippet -;; C8B717C2-6B33-11D9-BB47-000D93589AF6 =yyas> (yas/unknown) -;; -;; # as in Commands/About Persistent Includes.yasnippet -;; 9AFDEB2C-D9F0-423E-8211-EBB089F51F0C =yyas> (yas/unknown) -;; -;; # as in Snippets/XHTML link.yasnippet -;; `yas/html-xhtml-attr` =yyas> (yas/unknown) -;; -;; # as in Templates/HTML 4.0 Strict/info.yasnippet -;; 04332FA8-8157-46C4-9854-8C190FFD96C6 =yyas> (yas/unknown) -;; -;; # as in Macros/Delete whitespace between tags.yasnippet -;; 7B7E945E-A112-11D9-A5A2-000D93C8BE28 =yyas> (yas/unknown) -;; -;; # as in DragCommands/Anchor Tag.yasnippet -;; B23D6E15-6B33-11D9-86C1-000D93589AF6 =yyas> (yas/unknown) -;; -;; # as in Templates/XHTML 1.0 Transitional/info.yasnippet -;; 65D38039-6B0A-48E9-9E49-43832ECC4107 =yyas> (yas/unknown) -;; -;; # as in Commands/Strip HTML tags.yasnippet -;; 20D760B5-A127-11D9-A5A2-000D93C8BE28 =yyas> (yas/unknown) -;; -;; # as in Commands/Tidy.yasnippet -;; 45F92B81-6F0E-11D9-A1E4-000D9332809C =yyas> (yas/unknown) -;; -;; # as in Snippets/XHTML title.yasnippet -;; ${TM_FILENAME/((.+)\..*)?/(?2:$2:Page Title)/} =yyas> (yas/unknown) -;; -;; # as in Commands/Encrypt Line Selection (ROT 13).yasnippet -;; 9B13543F-8356-443C-B6E7-D9259B604927 =yyas> (yas/unknown) -;; -;; # as in Templates/XHTML 1.0 Strict/info.yasnippet -;; EBEE6B51-29C7-4362-818F-A190CACD5296 =yyas> (yas/unknown) -;; -;; # as in Commands/Convert Line Selection to URL Escapes.yasnippet -;; 6B024865-6095-4CE3-8EDD-DC6F2230C2FF =yyas> (yas/unknown) -;; -;; # as in Commands/W3C validation.yasnippet -;; 3F26240E-6E4A-11D9-B411-000D93589AF6 =yyas> (yas/unknown) -;; -;; # as in Commands/CodeCompletion HTML Attributes.yasnippet -;; CBD82CF3-74E9-4E7A-B3F6-9348754EB5AA =yyas> (yas/unknown) -;; -;; # as in Commands/Update Includes.yasnippet -;; 4400BCE9-20E3-426E-B1D7-2C0BCA53BCF8 =yyas> (yas/unknown) -;; -;; # as in Snippets/IE Conditional Comment Internet Explorer 6 and below.yasnippet -;; `(or (yas/selected-text) " IE Conditional Comment: Internet Explorer 6 and below ")` =yyas> (yas/unknown) -;; -;; # as in Snippets/IE Conditional Comment Internet Explorer 5_x.yasnippet -;; `(or (yas/selected-text) " IE Conditional Comment: Internet Explorer 5.x ")` =yyas> (yas/unknown) -;; -;; # as in DragCommands/Image Tag.yasnippet -;; CD6D2CC6-6B33-11D9-BDFD-000D93589AF6 =yyas> (yas/unknown) -;; -;; # as in Snippets/XHTML h1.yasnippet -;; `yas/selected-text` =yyas> (yas/unknown) -;; -;; # as in Snippets/IE Conditional Comment NOT Internet Explorer.yasnippet -;; `(or (yas/selected-text) " IE Conditional Comment: NOT Internet Explorer ")` =yyas> (yas/unknown) -;; -;; # as in Templates/XHTML 1.0 Frameset/info.yasnippet -;; 26068A55-4C84-409D-BA00-162B55AF6961 =yyas> (yas/unknown) -;; -;; # as in Commands/Decode HTML Entities.yasnippet -;; C183920D-A126-11D9-A5A2-000D93C8BE28 =yyas> (yas/unknown) -;; -;; # as in Snippets/IE Conditional Comment Internet Explorer 6 only.yasnippet -;; `(or (yas/selected-text) " IE Conditional Comment: Internet Explorer 6 only ")` =yyas> (yas/unknown) -;; -;; # as in Snippets/IE Conditional Comment Internet Explorer 7+.yasnippet -;; `(or (yas/selected-text) " IE Conditional Comment: Internet Explorer 7 and above ")` =yyas> (yas/unknown) -;; -;; - -;; Substitutions for: condition -;; -;; # as in Snippets/XHTML head.yasnippet -;; text.html - text.html source =yyas> (yas/unknown) -;; -;; # as in Commands/CodeCompletion HTML Attributes.yasnippet -;; text.html punctuation.definition.tag -source, text.html meta.tag -entity.other.attribute-name -source =yyas> (yas/unknown) -;; -;; # as in Snippets/Smart returnindent for tag pairs.yasnippet -;; meta.scope.between-tag-pair =yyas> (yas/unknown) -;; -;; # as in Commands/CodeCompletion HTML Tags.yasnippet -;; text.html -entity.other.attribute-name -string.quoted, invalid.illegal.incomplete.html =yyas> (yas/unknown) -;; -;; # as in Snippets/Wrap Selection In Tag.yasnippet -;; text.html, =yyas> (yas/unknown) -;; -;; # as in Commands/Refresh All Active Browsers.yasnippet -;; text.html, source.css =yyas> (yas/unknown) -;; -;; # as in Templates/HTML 4.0 Strict/info.yasnippet -;; text.html =yyas> (yas/unknown) -;; -;; # as in Commands/Documentation for Tag.yasnippet -;; text.html, text.html entity.name.tag =yyas> (yas/unknown) -;; -;; # as in Snippets/XHTML title.yasnippet -;; text.html - text.blog =yyas> (yas/unknown) -;; -;; # as in Snippets/Wrap in =.yasnippet -;; text.html string =yyas> (yas/unknown) -;; -;; - -;; Substitutions for: binding -;; -;; # as in Commands/W3C validation.yasnippet -;; ^V =yyas> (yas/unknown) -;; -;; # as in Snippets/Smart returnindent for tag pairs.yasnippet -;; =yyas> (yas/unknown) -;; -;; # as in Snippets/XHTML   NonBreakingSpace.yasnippet -;; ~ =yyas> (yas/unknown) -;; -;; # as in Commands/Insert Close Tag.yasnippet -;; ~@. =yyas> (yas/unknown) -;; -;; # as in Snippets/XHTML br.yasnippet -;; ^ =yyas> (yas/unknown) -;; -;; # as in Commands/Decode HTML Entities.yasnippet -;; @& =yyas> (yas/unknown) -;; -;; # as in Commands/Refresh All Active Browsers.yasnippet -;; @r =yyas> (yas/unknown) -;; -;; # as in Commands/CodeCompletion HTML Attributes.yasnippet -;; ~ =yyas> (yas/unknown) -;; -;; # as in Commands/Update Includes.yasnippet -;; ^@u =yyas> (yas/unknown) -;; -;; # as in Macros/Delete whitespace between tags.yasnippet -;; ^~ =yyas> (yas/unknown) -;; -;; # as in Commands/Tidy.yasnippet -;; ^H =yyas> (yas/unknown) -;; -;; - -;; .yas-setup.el for html-mode ends here diff --git a/extensions/yasnippet/extras/imported/rails-mode/.yas-setup.el b/extensions/yasnippet/extras/imported/rails-mode/.yas-setup.el deleted file mode 100644 index 3702d95..0000000 --- a/extensions/yasnippet/extras/imported/rails-mode/.yas-setup.el +++ /dev/null @@ -1,1174 +0,0 @@ -;; .yas-setup.el for rails-mode -(defvar yas/rails-root-cache nil) - -(add-to-list 'auto-mode-alist '("\\.erb$" . yas/rails-erb-mode)) - -(define-derived-mode yas/rails-erb-mode - nxml-mode "eRB" - "Embedded Ruby Mode, very thin layer over `nxml-mode'." - (add-to-list (make-local-variable 'yas/extra-modes) 'html-mode) - (rng-set-vacuous-schema) - (message "hey erb mode")) - -(defvar yas/rails-erb-font-lock-keywords - '(("\\(<%=\\)\\(.*+\\)\\(%>\\)" - (1 font-lock-function-name-face) - (2 font-lock-string-face) - (3 font-lock-function-name-face)) - ("\\(<%\\)\\(.*+\\)\\(%>\\)" - (1 font-lock-variable-name-face) - (2 font-lock-string-face) - (3 font-lock-variable-name-face))) - "(Crummy) font lock highlighting for ERB constructs.." - ) -(font-lock-add-keywords 'yas/rails-erb-mode yas/rails-erb-font-lock-keywords) - -;; stolen from rinari-mode's rinari-root -(defun yas/rails-root (&optional dir) - (or dir (setq dir default-directory)) - (or (and (featurep 'rinari) (rinari-root dir)) - yas/rails-root-cache - (if (file-exists-p (expand-file-name - "environment.rb" (expand-file-name "config" dir))) - (set (make-local-variable 'yas/rails-root-cache) dir) - (let ((new-dir (expand-file-name (file-name-as-directory "..") dir))) - ;; regexp to match windows roots, tramp roots, or regular posix roots - (unless (string-match "\\(^[[:alpha:]]:/$\\|^/[^\/]+:\\|^/$\\)" dir) - (yas/rails-root new-dir)))))) - -;; stolen from rinari-mode's rinari-extract-partial -(defun yas/rails-extract-partial (begin end partial-name) - (interactive "r\nsName your partial: ") - (let* ((path (buffer-file-name)) ending) - (if (string-match "view" path) - (let ((ending (and (string-match ".+?\\(\\.[^/]*\\)$" path) - (match-string 1 path))) - (partial-name - (replace-regexp-in-string "[[:space:]]+" "_" partial-name))) - (kill-region begin end) - (if (string-match "\\(.+\\)/\\(.+\\)" partial-name) - (let ((default-directory (expand-file-name (match-string 1 partial-name) - (expand-file-name "..")))) - (find-file (concat "_" (match-string 2 partial-name) ending))) - (find-file (concat "_" partial-name ending))) - (yank) (pop-to-buffer nil) - (insert (concat "<%= render :partial => '" partial-name "' %>\n"))) - (message "not in a view")))) -;;; -;;; The TextMate "intelligent" migration snippet -;; -(defvar yas/rails-intelligent-migration-snippet-bits - '((:rename_column . ((:up . "rename_column :${1:table_name}, :${2:column_name}, :${3:new_column_name}$0") - (:down . "rename_column :$1, :$3, :$2" ))) - - (:rename_column_continue . ((:up . "rename_column :${1:table_name}, :${2:column_name}, :${3:new_column_name}\nmncc$0") - (:down . "rename_column :$1, :$3, :$2" ))) - - (:rename_table . ((:up . "rename_table :${1:old_table_name}, :${2:new_table_name}$0") - (:down . "rename_table :$2, :$1" ))) - - (:rename_table_continue . ((:up . "rename_table :${1:old_table_name}, :${2:new_table_name}\nmntc$0") - (:down . "rename_table :$2, :$1" ))) - - (:add_remove_column . ((:up . "add_column :${1:table_name}, :${2:column_name}, :${3:string}$0") - (:down . "remove_column :$1, :$2" ))) - - (:add_remove_column_continue . ((:up . "add_column :${1:table_name}, :${2:column_name}, :${3:string}\nmarcc$0") - (:down . "remove_column :$1, :$2" ))) - - (:remove_add_column . ((:up . "remove_column :${1:table_name}, :${2:column_name}$0") - (:down . "add_column :$1, :$2, :$3{string}" ))) - - (:create_drop_table . ((:up . "create_table :${1:table_name}, :force . true do |t|\nt.$0\nt.timestamps\nend") - (:down . "drop_table :$1" ))) - - (:change_change_table . ((:up . "change_table :${1:table_name} do |t|\nt.$0\nend") - (:down . "change_table :$1 do |t|\nend" ))) - - (:add_remove_index . ((:up . "add_index :${1:table_name}, :${2:column_name}$0") - (:down . "remove_index :$1, :$2" ))) - - (:add_remove_unique_index . ((:up . "add_index :${1:table_name}, ${2:[:${3:column_name}${4:, :${5:column_name}}]}, :unique . true$0") - (:down . "remove_index :$1, :column . $2" ))) - - (:add_remove_named_index . ((:up . "add_index :${1:table_name}, [:${2:column_name}${3:, :${4:column_name}}], :name . \"${5:index_name}\"${6:, :unique . true}$0") - (:down . "remove_index :$1, :name . :$5" ))))) - - -(defun yas/rails-intelligent-migration-snippet (type) - (let* ((start (point)) - (end (save-excursion - (search-forward-regexp "^\s*def\sself\.down" nil 'noerror))) - (up (aget (aget yas/rails-intelligent-migration-snippet-bits type) :up)) - (down (aget (aget yas/rails-intelligent-migration-snippet-bits type) :down)) - (snippet - (and up down start end (concat up - (buffer-substring-no-properties start end) - "\n" down)))) - (when snippet - (delete-region start end) - (yas/expand-snippet snippet)))) - -(yas/define-condition-cache - yas/rails-intelligent-migration-snippet-condition-p - "Non-nil if an \"intelligent\" migration snippet should be expanded" - (and (yas/rails-migration-p) - (not (yas/rails-in-create-table-p)) - (not (yas/rails-in-change-table-p)) - (yas/rails-in-ruby-block-like "self\.up"))) - -(defun yas/rails-in-ruby-block-like (regexp) - (save-excursion - (ruby-accurate-end-of-block) - (ruby-backward-sexp) - (search-forward-regexp regexp (line-end-position) t))) - -;;; conditions -(yas/define-condition-cache - yas/rails-in-create-table-p - "Non-nil if point is inside a 'create_table' method call." - (yas/rails-in-ruby-block-like "create_table")) - -(yas/define-condition-cache - yas/rails-in-change-table-p - "Non-nil if point is inside a 'change_table' method call." - (yas/rails-in-ruby-block-like "change_table")) - -(yas/define-condition-cache - yas/rails-model-p - "Non-nil if the current buffer is a rails model." - (and (yas/rails-root) - (string-match "app/models/$" default-directory))) - -(yas/define-condition-cache - yas/rails-view-p - "Non-nil if the current buffer is a rails view." - (and (yas/rails-root) - (string-match "app/views/" default-directory))) - -(yas/define-condition-cache - yas/rails-controller-p -"Non-nil if the current buffer is a rails controller." - (and (yas/rails-root) - (string-match "app/controllers/$" default-directory))) - -(yas/define-condition-cache - yas/rails-migration-p - "Non-nil if the current buffer is a rails migration." - (and (yas/rails-root) - (string-match "db/migrate/" default-directory))) - -(defun yas/rails-activate-maybe () - (when (and yas/minor-mode - (yas/rails-root)) - (add-to-list (make-local-variable 'yas/extra-modes) 'rails-mode))) - -(defadvice cd (after yas/rails-on-cd-activate activate) - "Add `rails-mode' to `yas/extra-modes' so that rails snippets -are recognized. Stolen from `rinari-mode' more or`' less." - (setq yas/rails-root-cache nil) - (yas/rails-activate-maybe)) - -(add-hook 'yas/minor-mode-hook 'yas/rails-activate-maybe) -;; Substitutions for: content -;; -;; # as in Macros/Remove 3A Add Column.yasnippet -;; 809BCA42-5C49-4B08-B3C4-BB773036C086 =yyas> (yas/unknown) -;; -;; # as in Macros/Add 3A Remove Named Index.yasnippet -;; A7F692C1-778A-48B8-945E-573568BA0403 =yyas> (yas/unknown) -;; -;; # as in Commands/Go To Unit Test.yasnippet -;; BDBB15A4-2824-4BEC-93A5-7475F9C46A39 =yyas> (yas/rails-find 'unit-test) -;; -;; # as in Commands/Go To File on This Line.yasnippet -;; 09BB96F2-75FD-48A7-8314-B5B56B09B477 =yyas> (ffap) -;; -;; # as in Commands/Test Uncommitted.yasnippet -;; 212C3047-D9B1-11DC-94E9-00112475D960 =yyas> (yas/unknown) -;; -;; # as in Commands/Redo Last Migration.yasnippet -;; CFDA9F62-D071-4E0F-AD10-66AE0729FFCF =yyas> (yas/rails-compile "rake") -;; -;; # as in Commands/Autocomplete Foreign Key Fixture Reference.yasnippet -;; 0BCF0EE2-35EE-4959-A771-E74D55271D5A =yyas> (yas/unknown) -;; -;; # as in Commands/Autocomplete Foreign Key Fixture Reference (habtm).yasnippet -;; 275C0B86-F735-49B6-8A22-218A8F4CC2E0 =yyas> (yas/unknown) -;; -;; # as in Macros/Change Change Table.yasnippet -;; 20FC02C5-32A3-4F20-B163-FF75C9FDFABF =yyas> (yas/unknown) -;; -;; # as in Commands/Rake Migrate.yasnippet -;; 985F56D4-82ED-4C45-8250-2ECCFC71957E =yyas> (yas/unknown) -;; -;; # as in Commands/DB Schema Import.yasnippet -;; 6DEF923E-2347-46EC-AFBE-183D08E63DC1 =yyas> (yas/unknown) -;; -;; # as in Commands/Load Fixtures (Test DB).yasnippet -;; F758BFD1-00CA-4742-BE71-032580080F5C =yyas> (yas/unknown) -;; -;; # as in Commands/Generate Quick Migration.yasnippet -;; D696FA2C-785A-4B73-A2F6-F750904DD7C2 =yyas> (yas/unknown) -;; -;; # as in Macros/Remove 3A Add Timestamps.yasnippet -;; E885A3E8-8020-4AC3-A25E-510B26F114B2 =yyas> (yas/unknown) -;; -;; # as in Macros/Add 3A Remove Several Columns (marcc).yasnippet -;; 27A6C58A-896B-4956-BA81-D671A2EF9C7D =yyas> (yas/rails-intelligent-migration-snippet :add_remove_column_continue) -;; -;; # as in Macros/Add 3A Remove Column.yasnippet -;; 18C76913-061C-4D65-866D-67AA3724AFEF =yyas> (yas/rails-intelligent-migration-snippet :add_remove_column) -;; -;; # as in Commands/Go To View.yasnippet -;; EE862691-A624-4797-90CF-EDD39EFB2D8E =yyas> (yas/rails-find 'view) -;; -;; # as in Commands/Test Plugins.yasnippet -;; 0D966168-D9B1-11DC-94E9-00112475D960 =yyas> (yas/unknown) -;; -;; # as in Macros/Change Column.yasnippet -;; 42DE1441-D1B7-4998-BAF9-16B1EC7E210C =yyas> (yas/unknown) -;; -;; # as in Commands/Make Selection in to Partial.yasnippet -;; 1DD8A214-1C97-45BA-ADEE-8F888DDE8570 =yyas> (call-interactively 'yas/rails-extract-partial) -;; -;; # as in Commands/Go To Functional Test.yasnippet -;; DFE393BE-0764-49FE-B464-6350A50921E6 =yyas> (yas/rails-find 'functional-test) -;; -;; # as in Commands/Test Recent.yasnippet -;; 190401C2-D9B1-11DC-94E9-00112475D960 =yyas> (yas/unknown) -;; -;; # as in Commands/Test All.yasnippet -;; DC549A45-D9B0-11DC-94E9-00112475D960 =yyas> (yas/unknown) -;; -;; # as in Macros/Rename Column.yasnippet -;; AC50762C-DE40-4EB9-9A22-2F6AF2EA4EA3 =yyas> (yas/unknown) -;; -;; # as in Macros/Create 3A Drop Table.yasnippet -;; 25F8F5D8-2BD1-45D8-8B2A-9F2EA4F73AA2 =yyas> (yas/unknown) -;; -;; # as in Macros/Add 3A Remove Unique Index.yasnippet -;; 33057A79-677B-4DFB-99D4-1492778BDDC6 =yyas> (yas/unknown) -;; -;; # as in Macros/Add 3A Remove Timestamps.yasnippet -;; 221969A1-A5EA-4A8E-8817-C74EBED63901 =yyas> (yas/unknown) -;; -;; # as in Commands/Go To Helper.yasnippet -;; 51C9C27A-D931-49F9-B6D8-C0E7ABEC992D =yyas> (yas/unknown) -;; -;; # as in Commands/DB Schema Dump.yasnippet -;; 310C901C-EF32-4E88-938A-804ABBF8C428 =yyas> (yas/unknown) -;; -;; # as in Commands/Test Functionals.yasnippet -;; F4EA552D-D9B0-11DC-94E9-00112475D960 =yyas> (yas/unknown) -;; -;; # as in Commands/Migrate to Previous Version.yasnippet -;; 9A1AE6BA-8350-4AB7-B5BD-969A7E64CF29 =yyas> (yas/unknown) -;; -;; # as in Commands/Go To Model.yasnippet -;; C7151BF3-7068-4344-9B09-86F3BF4A9C63 =yyas> (yas/rails-find 'model) -;; -;; # as in Macros/Drop 3A Create Table.yasnippet -;; A2135370-67A1-488D-B43C-B4F221127C2F =yyas> (yas/unknown) -;; -;; # as in Macros/Change Column Default.yasnippet -;; A219EBB8-004A-4012-B5B2-232C9A5C94F8 =yyas> (yas/unknown) -;; -;; # as in Macros/Add 3A Remove Index.yasnippet -;; 95F83E1D-5B03-424F-8BEC-8AF66C8939BC =yyas> (yas/unknown) -;; -;; # as in Commands/Load Fixtures.yasnippet -;; 5EEA0C71-B34B-4408-953B-F47AAD343CCC =yyas> (yas/unknown) -;; -;; # as in Commands/Documentation for Word.yasnippet -;; 32F30207-D827-46D9-889A-451C35269D52 =yyas> (yas/unknown) -;; -;; # as in Commands/Clone Development DB to Test DB.yasnippet -;; 6F2AB859-46E3-4FF5-A9A7-E9A813AB5DE1 =yyas> (yas/unknown) -;; -;; # as in Macros/Rename 3A Rename Several Columns.yasnippet -;; F03162DE-9DB6-417B-9DD7-52D9F11EA736 =yyas> (yas/unknown) -;; -;; # as in Commands/Go To Stylesheet.yasnippet -;; B207BBD4-D6AA-41E9-9530-27210F2D7B66 =yyas> (yas/unknown) -;; -;; # as in Commands/Go To Javascript.yasnippet -;; B078346F-61D8-4E75-9427-80720FBC67F7 =yyas> (yas/unknown) -;; -;; # as in Commands/Rake Migrate to Version.yasnippet -;; 07C696F8-79F5-4E0B-9EE9-03B693A54ABB =yyas> (yas/unknown) -;; -;; # as in Commands/Go To Alternate File.yasnippet -;; 9453F0B3-B946-445F-BDB0-B01DE70732FC =yyas> (yas/rails-find 'alternate) -;; -;; # as in Commands/View demo help.yasnippet -;; 964436B8-E578-11DC-8177-00112475D960 =yyas> (yas/unknown) -;; -;; # as in Commands/Go to Fixture.yasnippet -;; 638D94A4-BDFC-4FE9-8909-9934F3FD2899 =yyas> (yas/unknown) -;; -;; # as in Macros/Rename Table.yasnippet -;; FD8CC811-2AD3-480F-B975-DF959DC96C67 =yyas> (yas/unknown) -;; -;; # as in Macros/Rename 3A Rename Several Columns (mncc).yasnippet -;; 04A86178-71B1-430A-A06D-DFF7C9A338B5 =yyas> (yas/unknown) -;; -;; # as in Commands/Generate.yasnippet -;; 4904EDC7-5ED3-4132-AAB2-C2AD87C97EFE =yyas> (yas/unknown) -;; -;; # as in Commands/Test Integration.yasnippet -;; 04A30A4D-D9B1-11DC-94E9-00112475D960 =yyas> (yas/unknown) -;; -;; # as in Commands/Show DB Schema.yasnippet -;; 1970AE74-3949-40B3-B263-727AA3FF167A =yyas> (yas/unknown) -;; -;; # as in Macros/Add 3A Remove Several Columns.yasnippet -;; 7BC860E6-7561-4E6E-983B-507D7A6F6228 =yyas> (yas/unknown) -;; -;; # as in Commands/Install Bundled Plugin.yasnippet -;; 46ECE243-0448-4A64-A223-27CC21E7704D =yyas> (yas/unknown) -;; -;; # as in Commands/Go To File.yasnippet -;; 0CCC8443-40F3-4BAB-9440-D737562B5F45 =yyas> (yas/rails-find 'file) -;; -;; # as in Commands/Test Units.yasnippet -;; 2C60CBA1-D9B1-11DC-94E9-00112475D960 =yyas> (yas/unknown) -;; -;; # as in Snippets/returning do 7Cvariable7C E280A6 end.yasnippet -;; ${2/(^(?\s*[a-z_][a-zA-Z0-9_]*\s*)(,\g)*,?\s*$)|.*/(?1: |)/} =yyas> ${2:$(and (yas/text) " |")} -;; ${2/(^(?\s*[a-z_][a-zA-Z0-9_]*\s*)(,\g)*,?\s*$)|.*/(?1:|)/} =yyas> ${2:$(and (yas/text) "|")} -;; -;; # as in Snippets/form_for label.yasnippet -;; ${1/[[:alpha:]]+|(_)/(?1: :\u$0)/g} =yyas> ${1:$(capitalize (replace-regexp-in-string "_" " " yas/text))} -;; -;; # as in Snippets/has_one (ho).yasnippet -;; ${1/[[:alpha:]]+|(_)/(?1::\u$0)/g} =yyas> ${1:$(replace-regexp-in-string "_" "" (capitalize yas/text))} -;; -;; # as in Snippets/Create sweeper class.yasnippet -;; ${1/./\l$0/} =yyas> ${1:$(and (yas/text) (concat (downcase (substring yas/text 0 1)) (substring yas/text 1)))} -;; -;; # as in Snippets/image_submit_tag.yasnippet -;; ${1/^(\w+)(\.\w*)?$/$1/} =yyas> ${1:$(file-name-sans-extension yas-text)} -;; -;; # as in Snippets/respond_to (html).yasnippet -;; $TM_SELECTED_TEXT =yyas> `yas/selected-text` -;; -;; # as in Snippets/find_in_batches.yasnippet -;; ${TM_CURRENT_WORD/(\w+)\./\L$1/g} =yyas> `(downcase (replace-regexp-in-string "\\..*$" "" (current-word)))` -;; - -;; Substitutions for: condition - -;; text.html.ruby, source.ruby.rails.embedded.html, meta.rails.helper, meta.rails.unit_test, source.js, source.css, source.yaml, meta.rails.controller, meta.rails.functional_test, text.haml =yyas> (yas/unknown) -;; text.html.ruby, source.ruby.rails.embedded.html, meta.rails.helper, meta.rails.functional_test, source.js, source.css, source.yaml, meta.rails.model, meta.rails.unit_test, text.haml =yyas> (yas/unknown) -;; text.html.ruby, source.ruby.rails.embedded.html, meta.rails.controller, meta.rails.model, meta.rails.unit_test, meta.rails.functional_test, text.haml =yyas> t -;; meta.rails.controller, meta.rails.helper, meta.rails.model, meta.rails.unit_test, meta.rails.functional_test =yyas> (yas/unknown) -;; text.html.ruby, source.ruby.rails.embedded.html, meta.rails.controller, meta.rails.helper, text.haml =yyas> (yas/unknown) -;; meta.rails.controller, meta.rails.helper, meta.rails.model, meta.rails.functional_test, source.yaml =yyas> t -;; meta.rails.controller, meta.rails.helper, meta.rails.model, source.yaml, meta.rails.unit_test =yyas> t -;; meta.rails.migration - meta.rails.migration.create_table - meta.rails.migration.change_table =yyas> (yas/rails-intelligent-migration-snippet-condition-p) -;; meta.rails.migration.create_table, meta.rails.migration.change_table =yyas> (or (yas/rails-in-create-table-p) (yas/rails-in-change-table-p)) -;; meta.rails.controller, meta.rails.mailer, source.js, source.css =yyas> (yas/unknown) -;; meta.rails.migration.create_table =yyas> (yas/rails-in-create-table-p) -;; meta.rails.functional_test =yyas> (yas/rails-in-functional-test-p) -;; text.html.ruby, text.haml =yyas> (yas/rails-view-p) -;; meta.rails.controller =yyas> (yas/rails-in-controller-p) -;; meta.rails.routes =yyas> (yas/rails-in-routes-p) -;; text.html.ruby =yyas> (yas/unknown) - - -;; Substitutions for: binding -;; -;; # as in Snippets/rails session.yasnippet -;; ^j =yyas> C-c M-j -;; -;; # as in Commands/Autocomplete Foreign Key Fixture Reference (habtm).yasnippet -;; ~$ =yyas> (yas/unknown) -;; -;; # as in Commands/Go To View.yasnippet -;; ~$@ =yyas> C-M-s-down -;; -;; # as in Commands/Generate Quick Migration.yasnippet -;; ^M =yyas> (yas/unknown) -;; -;; # as in Commands/Go To File on This Line.yasnippet -;; ~@ =yyas> (yas/unknown) -;; -;; # as in Commands/Show DB Schema.yasnippet -;; ^@S =yyas> C-c M-s -;; -;; # as in Snippets/rails params.yasnippet -;; ^p =yyas> C-c M-p -;; -;; # as in Commands/Go To File.yasnippet -;; 0CCC8443-40F3-4BAB-9440-D737562B5F45 =yyas> M-s-up -;; # as in Commands/Go To Alternate File.yasnippet -;; 9453F0B3-B946-445F-BDB0-B01DE70732FC =yyas> M-s-down -;; -;; # as in Commands/Autocomplete Foreign Key Fixture Reference.yasnippet -;; ~ =yyas> (yas/unknown) -;; -;; # as in Commands/Test Units.yasnippet -;; ^\ =yyas> C-c M-\ -;; -;; # as in Commands/Rake Migrate.yasnippet -;; ^| =yyas> C-c M-| -;; -;; # as in Snippets/respond_to (html).yasnippet -;; @H =yyas> C-c M-h -;; -;; # as in Commands/Make Selection in to Partial.yasnippet -;; ^H =yyas> C-c M-m -;; -;; # as in Commands/View demo help.yasnippet -;; ^h =yyas> (yas/unknown) -;; -;; -;; -;; --**-- -;; Automatically generated code, do not edit this part -;; -;; Translated menu -;; -(yas/define-menu 'rails-mode - '((yas/submenu "Go To" - (;; Alternate File - (yas/item "0CCC8443-40F3-4BAB-9440-D737562B5F45") - ;; File on Current Line - (yas/item "09BB96F2-75FD-48A7-8314-B5B56B09B477") - (yas/separator) - ;; Go to Model - (yas/item "C7151BF3-7068-4344-9B09-86F3BF4A9C63") - ;; Go to Controller - (yas/item "9453F0B3-B946-445F-BDB0-B01DE70732FC") - ;; Go to View - (yas/item "EE862691-A624-4797-90CF-EDD39EFB2D8E") - ;; Go to Functional Test - (yas/item "DFE393BE-0764-49FE-B464-6350A50921E6") - ;; Ignoring Go to Helper - (yas/ignore-item "51C9C27A-D931-49F9-B6D8-C0E7ABEC992D") - ;; Ignoring Go to Javascript - (yas/ignore-item "B078346F-61D8-4E75-9427-80720FBC67F7") - ;; Ignoring Go to Stylesheet - (yas/ignore-item "B207BBD4-D6AA-41E9-9530-27210F2D7B66") - ;; Go to Unit Test - (yas/item "BDBB15A4-2824-4BEC-93A5-7475F9C46A39") - ;; Ignoring Go to Fixture - (yas/ignore-item "638D94A4-BDFC-4FE9-8909-9934F3FD2899"))) - (yas/submenu "Run Tests" - (;; Ignoring Test All - (yas/ignore-item "DC549A45-D9B0-11DC-94E9-00112475D960") - ;; Ignoring Test Functionals - (yas/ignore-item "F4EA552D-D9B0-11DC-94E9-00112475D960") - ;; Ignoring Test Integration - (yas/ignore-item "04A30A4D-D9B1-11DC-94E9-00112475D960") - ;; Ignoring Test Plugins - (yas/ignore-item "0D966168-D9B1-11DC-94E9-00112475D960") - ;; Ignoring Test Recent - (yas/ignore-item "190401C2-D9B1-11DC-94E9-00112475D960") - ;; Ignoring Test Uncommitted - (yas/ignore-item "212C3047-D9B1-11DC-94E9-00112475D960") - ;; Ignoring Test Units - (yas/ignore-item "2C60CBA1-D9B1-11DC-94E9-00112475D960"))) - - ;; Ignoring Call Generate Script - (yas/ignore-item "4904EDC7-5ED3-4132-AAB2-C2AD87C97EFE") - ;; Ignoring Install Plugin - (yas/ignore-item "46ECE243-0448-4A64-A223-27CC21E7704D") - (yas/submenu "Database" - (;; Ignoring Migrate to Current - (yas/ignore-item "985F56D4-82ED-4C45-8250-2ECCFC71957E") - ;; Ignoring Migrate to Version ... - (yas/ignore-item "07C696F8-79F5-4E0B-9EE9-03B693A54ABB") - ;; Ignoring Migrate to Previous Version - (yas/ignore-item "9A1AE6BA-8350-4AB7-B5BD-969A7E64CF29") - ;; Redo Last Migration - (yas/item "CFDA9F62-D071-4E0F-AD10-66AE0729FFCF") - (yas/separator) - ;; Ignoring Load Fixtures (Development DB) - (yas/ignore-item "5EEA0C71-B34B-4408-953B-F47AAD343CCC") - ;; Ignoring Load Fixtures (Test DB) - (yas/ignore-item "F758BFD1-00CA-4742-BE71-032580080F5C") - - ;; Ignoring Load schema.rb to DB - (yas/ignore-item "6DEF923E-2347-46EC-AFBE-183D08E63DC1") - ;; Ignoring Dump DB to schema.rb - (yas/ignore-item "310C901C-EF32-4E88-938A-804ABBF8C428") - ;; Ignoring Clone Development DB to Test DB - (yas/ignore-item "6F2AB859-46E3-4FF5-A9A7-E9A813AB5DE1"))) - - ;; params[…] - (yas/item "AC8EDA3E-875B-11D9-897C-000393CBCE2E") - ;; session[…] - (yas/item "7B02ABF8-8763-11D9-897C-000393CBCE2E") - (yas/submenu "Logger" - (;; logger.debug - (yas/item "D975E5C1-42C2-40F1-8960-0DA533B18113") - ;; logger.info - (yas/item "36E2A3EE-E9CC-4B7F-A4CF-AFAF970B8699") - ;; logger.warn - (yas/item "38D5CA05-E219-4399-A244-609AF40B1D0B") - ;; logger.error - (yas/item "7053B86A-9B81-4154-AB3C-61B8035C5D33") - ;; logger.fatal - (yas/item "35E95C81-22F7-4C40-8297-ED21086DDA81") - ;; RAILS_DEFAULT_LOGGER.debug - (yas/item "7B15B396-1F41-4529-9253-32761E94448C"))) - (yas/separator) - (yas/submenu "Models" - (;; Ignoring Show DB Schema for Current Class - (yas/ignore-item "1970AE74-3949-40B3-B263-727AA3FF167A") - - (yas/submenu "Callbacks" - (;; before_validation - (yas/item "A1776279-5396-4FE9-9218-8BF2C88C5271") - ;; before_validation_on_create - (yas/item "E2CE2E3B-8A61-4866-9AF5-A12F44CF7233") - ;; before_validation_on_update - (yas/item "86CFB156-E72B-440F-9C7D-08A3375C3ADB") - ;; after_validation - (yas/item "44FBD811-70A9-462B-AC56-F975ADAD62AF") - ;; after_validation_on_create - (yas/item "BA0DE6C7-EAD3-42C9-8ABB-2B9A5F2FE225") - ;; after_validation_on_update - (yas/item "BCB25D36-2D3F-41E9-B2CF-37D6E883E8D1") - ;; before_save - (yas/item "523BE8A6-0845-493D-A9B6-532F73D21950") - ;; after_save - (yas/item "4D1787E3-1583-4CF3-8D99-CC45D7C35EED") - ;; before_create - (yas/item "D64D8863-DCB6-4397-B5B0-073E0AE04167") - ;; after_create - (yas/item "279D1981-B055-4693-B9AF-5B571A62A6AE") - ;; before_destroy - (yas/item "3F4B502B-5F68-4687-88E9-6EF3BDF9677D") - ;; after_update - (yas/item "0C9EA1A1-66C5-4E1C-9C30-E1FFE8EC6EAE") - ;; before_update - (yas/item "1C20EEBE-B4BA-48C8-9B33-7B5BB00D958C") - ;; after_destroy - (yas/item "A2F3E8C1-4216-4890-8491-2F8C7534ED03"))) - (yas/submenu "Associations" - (;; belongs_to - (yas/item "B8F08BD7-6160-482C-8A3D-CBC6BD2079A4") - ;; has_and_belongs_to_many - (yas/item "2AC3AC1F-743B-4A33-863C-C37885073806") - ;; has_one - (yas/item "BD2E4045-54E6-450E-B31B-5E1865CFFBC9") - ;; has_many - (yas/item "F396B7BD-8255-48B1-904A-06E7D7CC2741") - ;; has_many :dependent => :destroy - (yas/item "3E3AF538-171B-4108-AB92-827AD7E24C77") - ;; has_many (through) - (yas/item "9D58B6C9-BA52-48B3-B639-D5CB894AF810") - ;; has_many :dependent => :destroy - (yas/item "3E3AF538-171B-4108-AB92-827AD7E24C77"))) - (yas/submenu "Scopes" - (;; named_scope - (yas/item "1CB65A0D-4FEC-4438-9B4F-8B0BD13FB875") - ;; named_scope lambda - (yas/item "4E286CB4-069E-474C-A970-95216FE7DE95"))) - (yas/submenu "Finders" - (;; find(id) - (yas/item "59CD3A41-8164-4FB4-B462-D7ACE86BCDBF") - ;; find(:all) - (yas/item "A017AB39-A875-40DC-8ACF-7E3551057CA0") - ;; find(:first) - (yas/item "FE430ECD-5D40-4D95-A73B-F064C73992DE"))) - (yas/submenu "Validations" - (;; validates_acceptance_of - (yas/item "89198999-7E6D-4D97-A20E-45263E1CA993") - ;; validates_acceptance_of if - (yas/item "A2477223-AD5A-4723-8052-943CE9BA634D") - ;; validates_associated - (yas/item "47944705-F605-4ED4-B4C0-9E823EE25138") - ;; validates_associated if - (yas/item "85E9264C-5414-4FA0-AC07-F305A798ED46") - ;; validates_confirmation_of - (yas/item "B5893618-D07C-48F1-8867-736D0AAFF0E7") - ;; validates_confirmation_of if - (yas/item "1354726C-DA64-4CA6-A099-26626A865D8D") - ;; validates_exclusion_of - (yas/item "4CC98A56-B60B-4A89-80E0-400C5314A050") - ;; validates_exclusion_of if - (yas/item "869AB0B7-12DD-440A-905A-BFB1E0E16E1C") - ;; validates_inclusion_of - (yas/item "4611F02E-E9BF-11DC-8518-00112475D960") - ;; validates_inclusion_of if - (yas/item "47FF50AF-E9BF-11DC-8518-00112475D960") - ;; validates_format_of - (yas/item "EB47FBA1-AFB3-42F9-94A4-552D3175C17A") - ;; validates_format_of if - (yas/item "14BF0586-F2E8-4AB3-BB4B-E49099384403") - ;; validates_length_of - (yas/item "5CE8838A-BF2C-497E-B87A-E90C3BC482E0") - ;; validates_length_of if - (yas/item "EC511A43-D3B7-11DC-BA49-00112475D960") - ;; validates_numericality_of - (yas/item "B21BA16D-7C04-4912-8488-425CDCC332A8") - ;; validates_numericality_of if - (yas/item "CF506019-E964-4172-A3DA-475AE3B65558") - ;; validates_presence_of - (yas/item "5DAC28A7-33C8-4DA7-9E85-56618D6BEC9F") - ;; validates_presence_of if - (yas/item "F5CBBE16-F5CC-4EDA-8BC6-30281BD7D854") - ;; validates_uniqueness_of - (yas/item "F8316545-9AE4-4C7F-87ED-A2C00E6637FA") - ;; validates_uniqueness_of if - (yas/item "43680344-0818-42BF-95B4-58CD2D76545B"))))) - (yas/submenu "Controllers" - (;; Create controller class - (yas/item "4B3F798E-E3B6-48C8-8C2F-CB8631011638") - ;; flash[…] - (yas/item "D864896E-8763-11D9-897C-000393CBCE2E") - (yas/submenu "respond_to" - (;; respond_to (html) - (yas/item "3BDD0D52-443E-4F5F-AE09-ABCC2ABE9A42") - ;; respond_to - (yas/item "B41D3164-EA53-4DDC-850E-27B82B24061F") - ;; wants.format - (yas/item "3F26FDB4-ACF9-4856-9312-6A4D78DC8564"))) - (yas/submenu "redirect_to" - (;; redirect_to (path) - (yas/item "A909C4C3-8EFE-4E39-9D96-BA8F0ABE6085") - ;; redirect_to (path plural) - (yas/item "AFE06B67-CE98-42A6-93D1-8EC8E3B9F83C") - ;; redirect_to (nested path) - (yas/item "9D7228B3-A6ED-4598-B096-032B3600864F") - ;; redirect_to (nested path plural) - (yas/item "EF527A27-D1D4-4FD8-BD23-71397881C29A") - ;; redirect_to (action) - (yas/item "F2F3167C-73B9-11D9-B752-000D932CD5BA") - ;; redirect_to (action, id) - (yas/item "2233B484-73BA-11D9-B752-000D932CD5BA") - ;; redirect_to (controller) - (yas/item "053490FE-73BA-11D9-B752-000D932CD5BA") - ;; redirect_to (controller, action) - (yas/item "0C137FBF-73BA-11D9-B752-000D932CD5BA") - ;; redirect_to (controller, action, id) - (yas/item "18D3C1C3-73BA-11D9-B752-000D932CD5BA"))) - (yas/submenu "render" - (;; render (action) - (yas/item "7B03D38B-7580-41AC-BC2B-3766AB074A43") - ;; render (action, layout) - (yas/item "053F1D6A-B413-43FF-B697-E3120FD0489F") - ;; render (file) - (yas/item "7D43B0EA-2C3C-499B-9346-A8E48CBF29CD") - ;; render (file, use_full_path) - (yas/item "2A8FBE48-E196-4019-AE76-BF3ED4B54F47") - ;; render (inline) - (yas/item "64E93A71-6E62-48D9-9694-123080AE6723") - ;; render (inline, locals) - (yas/item "1E5DE984-510C-4992-8AD5-C5FA6D7F2A88") - ;; render (inline, type) - (yas/item "A8AF8B90-94E8-42E1-8057-DDBA57809F6A") - ;; render (layout) - (yas/item "3F83272F-62D5-4BCB-BAA3-806083078829") - ;; render (nothing) - (yas/item "AC8A995F-0034-433C-905D-E5C1F29D6EFF") - ;; render (nothing, status) - (yas/item "724A68C1-A727-46FF-AF59-288E26B09629") - ;; render (partial) - (yas/item "498168A5-5AF8-4F59-8A2D-B517FAB98CDB") - ;; render (partial, collection) - (yas/item "046FB1B6-9C65-4702-91EC-4AA9878CD949") - ;; render (partial, locals) - (yas/item "6F41AFFD-B3A7-42D0-8A84-D6086C118D92") - ;; render (partial, object) - (yas/item "BFAAC8DA-A043-4684-967B-B3E5DAE08C62") - ;; render (partial, status) - (yas/item "CBB06A4E-3A82-45F3-91AA-259F02314B9D") - ;; render (text) - (yas/item "67C5082F-5011-434A-8EAA-6B8D3600935F") - ;; render (text, layout) - (yas/item "A3B09AFE-40B5-4623-8B85-E9F369ECE22D") - ;; render (text, layout => true) - (yas/item "97C0992D-715F-4322-A3E0-DD4D2B7E2FC2") - ;; render (text, status) - (yas/item "4F636977-F7A6-4BF5-B09B-7F087683C3B9") - ;; render (update) - (yas/item "ECB10C0B-E8B7-4606-ABF5-4A2A26E5AB1A"))) - (yas/submenu "REST methods" - (;; def create - resource - (yas/item "54F61419-001F-4B71-83AC-8DC633694AF0"))) - (yas/separator) - ;; verify — render - (yas/item "9ECBF20C-003E-41D9-A881-4BAC0656F9DC") - ;; verify — redirect - (yas/item "7BBD3F57-57A5-4CD0-8E79-B931021FC110"))) - (yas/submenu "ERb Templates" - (;; Create Partial From Selection - (yas/item "1DD8A214-1C97-45BA-ADEE-8F888DDE8570") - (yas/separator) - ;; form_for - (yas/item "7D99041D-C3B7-4940-AE64-6B1758CDB47C") - ;; form_for with errors - (yas/item "15BDD7B6-5C15-4684-93C7-A05E3D2221AC") - (yas/submenu "form_for f. drop-down list" - (;; f.label (ffl) - (yas/item "402C251E-595B-4A58-8EB9-41989040F280") - ;; f.text_field (fftf) - (yas/item "CC1BCD1C-2479-4335-B511-17B880316A75") - ;; f.text_area (ffta) - (yas/item "06498926-F84D-466C-8736-B8A0AC586A94") - ;; f.check_box (ffcb) - (yas/item "F579F9E7-E072-4BCC-BFF9-C8C5BAE7FFA5") - ;; f.radio_box (ffrb) - (yas/item "A95358D2-C68A-4894-8C36-062C9F45848A") - ;; f.password_field (ffpf) - (yas/item "42289456-C8D1-498C-AE30-5206544B349F") - ;; f.hidden_field (ffhf) - (yas/item "5DBA8F72-DD6C-4CBF-83FD-76301E159BA9") - ;; f.file_field (ffff) - (yas/item "79BC2303-3D9D-4E21-AF85-73B388B7B56D") - ;; f.submit (ffs) - (yas/item "C315EC5D-A7F3-49CB-9795-21B78BB42FF4"))) - (yas/submenu "form_for helpers" - (;; form_for label - (yas/item "B31822D9-2048-4D16-B2AF-00E0B4E5C368") - ;; form_for text_field - (yas/item "F46EE8EE-239C-46D7-980B-3F861B7D9111") - ;; form_for text_area - (yas/item "4C898FA8-D09C-4B28-BE42-14BB4EA4E2B1") - ;; form_for check_box - (yas/item "F0DB6886-4FFE-45BA-907F-44326AD8142D") - ;; form_for radio_box - (yas/item "D4282CE1-4171-4B13-9220-3F2718BC2505") - ;; form_for password_field - (yas/item "3379FB35-C664-4255-96C6-6E4B91F12759") - ;; form_for hidden_field - (yas/item "99FEFD9B-5A07-46E3-950D-5C474E42B695") - ;; form_for file_field - (yas/item "C8BA285D-E12E-4AB8-A941-514C963E8226") - ;; form_for submit - (yas/item "3000E569-4E19-4566-B08E-A3FFFAAC9075"))) - (yas/separator) - ;; form_tag - (yas/item "F0F6DACA-6A0B-11D9-BDC2-000D932CD5BA") - ;; submit_tag - (yas/item "D0E29200-E910-11DC-A399-00112475D960") - ;; image_submit_tag - (yas/item "9FB9848E-EA5A-11DC-9DE5-00112475D960") - (yas/submenu "link_to" - (;; link_to (path) - (yas/item "326B57A7-B4A9-447B-A3D2-0EA74158E1E1") - ;; link_to (path plural) - (yas/item "6BA737F0-63D1-4D82-9381-4331E18B12C5") - ;; link_to (nested path) - (yas/item "750DEEF9-18A0-40FC-8E54-574CE5EE5565") - ;; link_to (nested path plural) - (yas/item "866AAD87-E458-4F2D-9E7C-3CE73EFC047B") - ;; link_to (action) - (yas/item "9E2B42FE-7BC8-11D9-906A-000D932CD5BA") - ;; link_to (action, id) - (yas/item "B4F952F4-7BC8-11D9-906A-000D932CD5BA") - ;; link_to (controller) - (yas/item "74590E16-7BCB-11D9-906A-000D932CD5BA") - ;; link_to (controller, action) - (yas/item "C11C0BF5-7BC8-11D9-906A-000D932CD5BA") - ;; link_to (controller, action, id) - (yas/item "D21BE958-7BC8-11D9-906A-000D932CD5BA") - ;; link_to model - (yas/item "E5E08AA0-4EDD-4583-BF07-5D6C49E98410"))) - ;; end (ERB) - (yas/item "AC385ABF-96CD-4FCB-80AD-BF37D6EE79D2") - (yas/separator) - ;; map(&:sym_proc) - (yas/item "EC605540-C431-4FD0-AD91-D913118DACA7") - (yas/separator) - ;; for loop in rhtml - (yas/item "F7744F07-306C-4951-AB5A-3D69BA5516B7"))) - (yas/submenu "Layouts" - (;; javascript_include_tag - (yas/item "FEF49C86-9386-405E-A191-684D1C963E3A") - ;; stylesheet_link_tag - (yas/item "980C7667-9D60-49FF-AF74-A7B19B379F45"))) - (yas/submenu "RJS" - (;; page.replace (id, partial) - (yas/item "273E5E76-8D13-4476-9C38-8AF87432CB96") - ;; page.hide (*ids) - (yas/item "390A447F-0FA3-4F01-A10C-4F35675E0A43") - ;; page.replace_html (id, partial) - (yas/item "8B914165-9C66-4FA3-9AD6-1DA41B25F8F1") - ;; page.insert_html (position, id, partial) - (yas/item "62BEA590-F4EF-4001-B661-764EDFB92811") - ;; page.visual_effect (effect, id) - (yas/item "CFDC27A3-58CF-4198-8F93-36360978F0D0") - ;; page.show (*ids) - (yas/item "5ACBF49D-B5A5-495C-89D8-18AA740D9D02") - ;; page.toggle (*ids) - (yas/item "028DA0A4-B310-4BEF-8643-2A22993C21C7"))) - (yas/submenu "Migrations" - (;; Ignoring Quick Migration - (yas/ignore-item "D696FA2C-785A-4B73-A2F6-F750904DD7C2") - - (yas/submenu "Columns" - (;; Add / Remove Column - (yas/item "18C76913-061C-4D65-866D-67AA3724AFEF") - ;; Ignoring Add / Remove Several Columns - (yas/ignore-item "7BC860E6-7561-4E6E-983B-507D7A6F6228") - ;; Add / Remove Several Columns (marcc) - (yas/item "27A6C58A-896B-4956-BA81-D671A2EF9C7D") - ;; Ignoring Rename / Rename Column - (yas/ignore-item "AC50762C-DE40-4EB9-9A22-2F6AF2EA4EA3") - ;; Ignoring Rename / Rename Several Columns - (yas/ignore-item "F03162DE-9DB6-417B-9DD7-52D9F11EA736") - ;; Ignoring Rename / Rename Several Columns (mncc) - (yas/ignore-item "04A86178-71B1-430A-A06D-DFF7C9A338B5") - ;; Remove / Add Column - (yas/item "16A705EB-10DC-42B5-9FF2-377E206421DC"))) - (yas/submenu "Tables" - (;; Ignoring Create / Drop Table - (yas/ignore-item "25F8F5D8-2BD1-45D8-8B2A-9F2EA4F73AA2") - ;; Ignoring Rename / Rename Table - (yas/ignore-item "FD8CC811-2AD3-480F-B975-DF959DC96C67") - ;; Drop / Create Table - (yas/item "20375601-B13F-4314-B8E4-362706566636") - ;; Ignoring Change / Change Table - (yas/ignore-item "20FC02C5-32A3-4F20-B163-FF75C9FDFABF") - - (yas/submenu "Create columns t. drop-down list" - (;; t.string (tcs) - (yas/item "B757F7E5-E4BD-11DC-A11A-00112475D960") - ;; t.text (tct) - (yas/item "FFE7B820-E4BD-11DC-A11A-00112475D960") - ;; t.integer (tci) - (yas/item "0E63B7D5-E4BE-11DC-A11A-00112475D960") - ;; t.float (tcf) - (yas/item "1BDC463A-E4BE-11DC-A11A-00112475D960") - ;; t.decimal (tcd) - (yas/item "26C09807-E4BE-11DC-A11A-00112475D960") - ;; t.datetime (tcdt) - (yas/item "3458B140-E4BE-11DC-A11A-00112475D960") - ;; t.timestamp (tcts) - (yas/item "49643690-E4BE-11DC-A11A-00112475D960") - ;; t.time (tcti) - (yas/item "537BDD48-E4BE-11DC-A11A-00112475D960") - ;; t.date (tcda) - (yas/item "61CF5B32-E4BE-11DC-A11A-00112475D960") - ;; t.boolean (tcb) - (yas/item "6BE6F315-E4BE-11DC-A11A-00112475D960") - ;; t.binary (tcbi) - (yas/item "7CE57C6C-E4BE-11DC-A11A-00112475D960") - ;; t.timestamps (tctss) - (yas/item "950B0BF2-E4BE-11DC-A11A-00112475D960") - ;; t.lock_version (tcl) - (yas/item "A677FFD4-E4BE-11DC-A11A-00112475D960") - ;; t.references (tcr) - (yas/item "B6D9225C-E4BE-11DC-A11A-00112475D960"))) - (yas/submenu "Create columns helpers" - (;; Table column string - (yas/item "377BF814-D52D-11DC-BD8E-00112475D960") - ;; Table column text - (yas/item "6A9D4C30-D52D-11DC-BD8E-00112475D960") - ;; Table column integer - (yas/item "729D559E-D52D-11DC-BD8E-00112475D960") - ;; Table column float - (yas/item "8AF989C4-D52E-11DC-BD8E-00112475D960") - ;; Table column decimal - (yas/item "93A16768-D52E-11DC-BD8E-00112475D960") - ;; Table column datetime - (yas/item "D6CBCA96-D52F-11DC-BD8E-00112475D960") - ;; Table column timestamp - (yas/item "4600CE20-D532-11DC-BD8E-00112475D960") - ;; Table column time - (yas/item "4F5DDD37-D532-11DC-BD8E-00112475D960") - ;; Table column date - (yas/item "56276686-D532-11DC-BD8E-00112475D960") - ;; Table column boolean - (yas/item "967093B4-D532-11DC-BD8E-00112475D960") - ;; Table column binary - (yas/item "5E9B8B0E-D532-11DC-BD8E-00112475D960") - ;; Table column timestamps - (yas/item "E0C8FDC4-D532-11DC-BD8E-00112475D960") - ;; Table column lock_version - (yas/item "FC2523C1-D532-11DC-BD8E-00112475D960") - ;; Table column(s) references - (yas/item "EDA6568B-D533-11DC-BD8E-00112475D960"))) - ;; Create Column in Table - (yas/item "7592CA99-75D7-48B6-9133-00B9F148FF43") - ;; Create Several Columns in Table - (yas/item "67FD2F8F-5F25-45F2-A451-2F39977A9EDE") - (yas/submenu "Change columns t. drop-down list" - (;; t.rename (tre) - (yas/item "9D4E30E2-4A61-4941-B9F3-BEE97552747A"))) - (yas/submenu "Change columns helpers" - (;; Table column(s) rename - (yas/item "DF30226E-1111-448A-B669-7CA34EE83909"))))) - (yas/submenu "Indexes" - (;; Ignoring Add / Remove Index - (yas/ignore-item "95F83E1D-5B03-424F-8BEC-8AF66C8939BC") - ;; Ignoring Add / Remove Named Index - (yas/ignore-item "A7F692C1-778A-48B8-945E-573568BA0403") - ;; Ignoring Add / Remove Unique Index - (yas/ignore-item "33057A79-677B-4DFB-99D4-1492778BDDC6"))))) - (yas/submenu "Routes" - (;; map.named_route - (yas/item "91C543BF-7BD8-4E3A-B493-AE572C5472A0") - ;; map.resources - (yas/item "0FF86C46-0E01-4D03-8232-72CA5BD55706") - ;; map.resource - (yas/item "2183A9A9-17ED-4A4F-ABB6-668EDDD3A6E4") - ;; map.with_options - (yas/item "BD4B90F7-2187-4E75-BFFB-77BE67CB8DAE") - ;; map.catch_all - (yas/item "F3606586-F905-4A91-92CA-82319239221D"))) - (yas/submenu "ActiveSupport" - (;; cattr_accessor - (yas/item "F57522B2-9F5F-4DF9-AE46-9478AF019C63") - ;; mattr_accessor - (yas/item "B25B7560-FACB-4A9E-A226-B71C796BD1F3") - ;; returning do |variable| … end - (yas/item "D2783155-23F3-4B90-A317-5BD139471193"))) - (yas/separator) - (yas/submenu "Fixtures" - (;; $LABEL - (yas/item "786980D8-FA69-4542-85A3-5E48CFAA6814") - ;; <%= Fixtures.identify(:symbol) %> - (yas/item "9671EB7A-89D6-4C23-914F-88CBEE0D177A") - (yas/separator) - ;; Ignoring Autocomplete Foreign Key Fixture Reference - (yas/ignore-item "0BCF0EE2-35EE-4959-A771-E74D55271D5A") - ;; Ignoring Autocomplete Foreign Key Fixture Reference (habtm) - (yas/ignore-item "275C0B86-F735-49B6-8A22-218A8F4CC2E0"))) - (yas/submenu "Unit Tests" - (;; assert_difference - (yas/item "30BEA6FB-301C-4460-93EC-FA3404688962") - ;; assert_no_difference - (yas/item "5C6F4462-70E6-40B4-B3F2-F371656E7784") - (yas/separator))) - (yas/submenu "Functional Tests" - (;; Create functional test class - (yas/item "F60D0630-CBF5-4283-9D20-FA46C787A88D") - ;; def test_should_get_action - (yas/item "1C491A76-751F-44EF-8DFB-0A585C7EEFF6") - ;; def test_should_post_action - (yas/item "8B9CD068-4338-4039-AA06-D839A6C7A9FF") - (yas/separator) - ;; assert_response - (yas/item "2BD82DCB-1F19-4C8F-BC70-C0BBB06A2138") - ;; assert_redirected_to - (yas/item "CD60F800-850D-47CF-BE32-3DE665DD5C68") - ;; assert_redirected_to (path) - (yas/item "D33EDCE7-F8AF-48D4-AA7A-852BBF03E31D") - ;; assert_redirected_to (path plural) - (yas/item "0249637E-0720-46DA-A8FD-E176A2CC458B") - ;; assert_redirected_to (nested path) - (yas/item "97021C0D-EB65-4046-B688-01F09B3B1615") - ;; assert_redirected_to (nested path plural) - (yas/item "4C92C020-7337-4D6E-91EE-7ABF2BFC7F41") - (yas/separator) - ;; assert_select - (yas/item "DBE14FE8-B415-4DBC-A316-F8DA63FE9FD7") - (yas/separator) - ;; assert_rjs - (yas/item "E0F281EC-5311-41F8-ADD9-2E2D059DA651") - (yas/separator) - ;; assert(var = assigns(:var)) - (yas/item "FE9C4B4E-860D-49F0-AAF7-5582B98F5F54"))) - (yas/submenu "Ajax Tests" - (;; xhr post - (yas/item "62C3838B-0790-4FC2-8425-F273A57F5D33") - ;; xhr get - (yas/item "78FCF992-D01B-404F-BC54-5EE7B91F999A") - ;; xhr delete - (yas/item "F1BE0C3D-7203-43E9-BEFB-D1A99CDD31C1") - ;; xhr put - (yas/item "C12C98A5-74E5-4E70-9ADB-8783455D6539"))) - (yas/separator) - ;; Ignoring View demo help - (yas/ignore-item "964436B8-E578-11DC-8177-00112475D960")) - '("A2135370-67A1-488D-B43C-B4F221127C2F" - "809BCA42-5C49-4B08-B3C4-BB773036C086" - "1970AE74-3949-40B3-B263-727AA3FF167A" - "638D94A4-BDFC-4FE9-8909-9934F3FD2899" - "F758BFD1-00CA-4742-BE71-032580080F5C" - "6F2AB859-46E3-4FF5-A9A7-E9A813AB5DE1" - "07C696F8-79F5-4E0B-9EE9-03B693A54ABB" - "D696FA2C-785A-4B73-A2F6-F750904DD7C2" - "DC549A45-D9B0-11DC-94E9-00112475D960" - "964436B8-E578-11DC-8177-00112475D960" - "5EEA0C71-B34B-4408-953B-F47AAD343CCC" - "0BCF0EE2-35EE-4959-A771-E74D55271D5A" - "0D966168-D9B1-11DC-94E9-00112475D960" - "190401C2-D9B1-11DC-94E9-00112475D960" - "212C3047-D9B1-11DC-94E9-00112475D960" - "F4EA552D-D9B0-11DC-94E9-00112475D960" - "04A30A4D-D9B1-11DC-94E9-00112475D960" - "275C0B86-F735-49B6-8A22-218A8F4CC2E0" - "2C60CBA1-D9B1-11DC-94E9-00112475D960" - "9A1AE6BA-8350-4AB7-B5BD-969A7E64CF29" - "B207BBD4-D6AA-41E9-9530-27210F2D7B66" - "B078346F-61D8-4E75-9427-80720FBC67F7" - "6DEF923E-2347-46EC-AFBE-183D08E63DC1" - "4904EDC7-5ED3-4132-AAB2-C2AD87C97EFE" - "46ECE243-0448-4A64-A223-27CC21E7704D" - "310C901C-EF32-4E88-938A-804ABBF8C428" - "51C9C27A-D931-49F9-B6D8-C0E7ABEC992D" - "985F56D4-82ED-4C45-8250-2ECCFC71957E" - "25F8F5D8-2BD1-45D8-8B2A-9F2EA4F73AA2" - "04A86178-71B1-430A-A06D-DFF7C9A338B5" - "FD8CC811-2AD3-480F-B975-DF959DC96C67" - "AC50762C-DE40-4EB9-9A22-2F6AF2EA4EA3" - "95F83E1D-5B03-424F-8BEC-8AF66C8939BC" - "33057A79-677B-4DFB-99D4-1492778BDDC6" - "A7F692C1-778A-48B8-945E-573568BA0403" - "20FC02C5-32A3-4F20-B163-FF75C9FDFABF" - "A2135370-67A1-488D-B43C-B4F221127C2F" - "7BC860E6-7561-4E6E-983B-507D7A6F6228" - "F03162DE-9DB6-417B-9DD7-52D9F11EA736" - "809BCA42-5C49-4B08-B3C4-BB773036C086")) - -;; Unknown substitutions -;; -;; Substitutions for: content -;; -;; # as in Macros/Remove 3A Add Column.yasnippet -;; 809BCA42-5C49-4B08-B3C4-BB773036C086 =yyas> (yas/unknown) -;; -;; # as in Macros/Add 3A Remove Named Index.yasnippet -;; A7F692C1-778A-48B8-945E-573568BA0403 =yyas> (yas/unknown) -;; -;; # as in Commands/Autocomplete Foreign Key Fixture Reference (habtm).yasnippet -;; 275C0B86-F735-49B6-8A22-218A8F4CC2E0 =yyas> (yas/unknown) -;; -;; # as in Commands/Test Uncommitted.yasnippet -;; 212C3047-D9B1-11DC-94E9-00112475D960 =yyas> (yas/unknown) -;; -;; # as in Commands/Autocomplete Foreign Key Fixture Reference.yasnippet -;; 0BCF0EE2-35EE-4959-A771-E74D55271D5A =yyas> (yas/unknown) -;; -;; # as in Macros/Change Change Table.yasnippet -;; 20FC02C5-32A3-4F20-B163-FF75C9FDFABF =yyas> (yas/unknown) -;; -;; # as in Commands/Rake Migrate.yasnippet -;; 985F56D4-82ED-4C45-8250-2ECCFC71957E =yyas> (yas/unknown) -;; -;; # as in Commands/DB Schema Import.yasnippet -;; 6DEF923E-2347-46EC-AFBE-183D08E63DC1 =yyas> (yas/unknown) -;; -;; # as in Commands/Generate Quick Migration.yasnippet -;; D696FA2C-785A-4B73-A2F6-F750904DD7C2 =yyas> (yas/unknown) -;; -;; # as in Commands/Load Fixtures (Test DB).yasnippet -;; F758BFD1-00CA-4742-BE71-032580080F5C =yyas> (yas/unknown) -;; -;; # as in Commands/Test Plugins.yasnippet -;; 0D966168-D9B1-11DC-94E9-00112475D960 =yyas> (yas/unknown) -;; -;; # as in Commands/Test Recent.yasnippet -;; 190401C2-D9B1-11DC-94E9-00112475D960 =yyas> (yas/unknown) -;; -;; # as in Commands/Test All.yasnippet -;; DC549A45-D9B0-11DC-94E9-00112475D960 =yyas> (yas/unknown) -;; -;; # as in Macros/Add 3A Remove Unique Index.yasnippet -;; 33057A79-677B-4DFB-99D4-1492778BDDC6 =yyas> (yas/unknown) -;; -;; # as in Macros/Rename Column.yasnippet -;; AC50762C-DE40-4EB9-9A22-2F6AF2EA4EA3 =yyas> (yas/unknown) -;; -;; # as in Macros/Create 3A Drop Table.yasnippet -;; 25F8F5D8-2BD1-45D8-8B2A-9F2EA4F73AA2 =yyas> (yas/unknown) -;; -;; # as in Commands/Go To Helper.yasnippet -;; 51C9C27A-D931-49F9-B6D8-C0E7ABEC992D =yyas> (yas/unknown) -;; -;; # as in Commands/DB Schema Dump.yasnippet -;; 310C901C-EF32-4E88-938A-804ABBF8C428 =yyas> (yas/unknown) -;; -;; # as in Commands/Migrate to Previous Version.yasnippet -;; 9A1AE6BA-8350-4AB7-B5BD-969A7E64CF29 =yyas> (yas/unknown) -;; -;; # as in Commands/Test Functionals.yasnippet -;; F4EA552D-D9B0-11DC-94E9-00112475D960 =yyas> (yas/unknown) -;; -;; # as in Macros/Drop 3A Create Table.yasnippet -;; A2135370-67A1-488D-B43C-B4F221127C2F =yyas> (yas/unknown) -;; -;; # as in Macros/Add 3A Remove Index.yasnippet -;; 95F83E1D-5B03-424F-8BEC-8AF66C8939BC =yyas> (yas/unknown) -;; -;; # as in Commands/Load Fixtures.yasnippet -;; 5EEA0C71-B34B-4408-953B-F47AAD343CCC =yyas> (yas/unknown) -;; -;; # as in Commands/Clone Development DB to Test DB.yasnippet -;; 6F2AB859-46E3-4FF5-A9A7-E9A813AB5DE1 =yyas> (yas/unknown) -;; -;; # as in Macros/Rename 3A Rename Several Columns.yasnippet -;; F03162DE-9DB6-417B-9DD7-52D9F11EA736 =yyas> (yas/unknown) -;; -;; # as in Commands/Go To Javascript.yasnippet -;; B078346F-61D8-4E75-9427-80720FBC67F7 =yyas> (yas/unknown) -;; -;; # as in Commands/Go To Stylesheet.yasnippet -;; B207BBD4-D6AA-41E9-9530-27210F2D7B66 =yyas> (yas/unknown) -;; -;; # as in Commands/Rake Migrate to Version.yasnippet -;; 07C696F8-79F5-4E0B-9EE9-03B693A54ABB =yyas> (yas/unknown) -;; -;; # as in Commands/View demo help.yasnippet -;; 964436B8-E578-11DC-8177-00112475D960 =yyas> (yas/unknown) -;; -;; # as in Commands/Go to Fixture.yasnippet -;; 638D94A4-BDFC-4FE9-8909-9934F3FD2899 =yyas> (yas/unknown) -;; -;; # as in Macros/Rename Table.yasnippet -;; FD8CC811-2AD3-480F-B975-DF959DC96C67 =yyas> (yas/unknown) -;; -;; # as in Macros/Rename 3A Rename Several Columns (mncc).yasnippet -;; 04A86178-71B1-430A-A06D-DFF7C9A338B5 =yyas> (yas/unknown) -;; -;; # as in Commands/Generate.yasnippet -;; 4904EDC7-5ED3-4132-AAB2-C2AD87C97EFE =yyas> (yas/unknown) -;; -;; # as in Commands/Test Integration.yasnippet -;; 04A30A4D-D9B1-11DC-94E9-00112475D960 =yyas> (yas/unknown) -;; -;; # as in Commands/Show DB Schema.yasnippet -;; 1970AE74-3949-40B3-B263-727AA3FF167A =yyas> (yas/unknown) -;; -;; # as in Snippets/respond_to (html).yasnippet -;; `yas/selected-text` =yyas> (yas/unknown) -;; -;; # as in Macros/Add 3A Remove Several Columns.yasnippet -;; 7BC860E6-7561-4E6E-983B-507D7A6F6228 =yyas> (yas/unknown) -;; -;; # as in Commands/Install Bundled Plugin.yasnippet -;; 46ECE243-0448-4A64-A223-27CC21E7704D =yyas> (yas/unknown) -;; -;; # as in Commands/Test Units.yasnippet -;; 2C60CBA1-D9B1-11DC-94E9-00112475D960 =yyas> (yas/unknown) -;; -;; - -;; Substitutions for: condition -;; -;; # as in Commands/Rake Migrate.yasnippet -;; =yyas> (yas/unknown) -;; -;; # as in Snippets/stylesheet_link_tag.yasnippet -;; text.html.ruby =yyas> (yas/unknown) -;; -;; - -;; Substitutions for: binding -;; -;; # as in Commands/Autocomplete Foreign Key Fixture Reference (habtm).yasnippet -;; ~$ =yyas> (yas/unknown) -;; -;; # as in Commands/Generate Quick Migration.yasnippet -;; ^M =yyas> (yas/unknown) -;; -;; # as in Commands/Go To File on This Line.yasnippet -;; ~@ =yyas> (yas/unknown) -;; -;; # as in Commands/Autocomplete Foreign Key Fixture Reference.yasnippet -;; ~ =yyas> (yas/unknown) -;; -;; # as in Commands/View demo help.yasnippet -;; ^h =yyas> (yas/unknown) -;; -;; - -;; .yas-setup.el for rails-mode ends here diff --git a/extensions/yasnippet/extras/imported/ruby-mode/.yas-setup.el b/extensions/yasnippet/extras/imported/ruby-mode/.yas-setup.el deleted file mode 100644 index 96d8541..0000000 --- a/extensions/yasnippet/extras/imported/ruby-mode/.yas-setup.el +++ /dev/null @@ -1,1019 +0,0 @@ -;; .yas-setup.el for ruby-mode -;; -*- coding: utf-8 -*- -;; -(defvar yas/ruby-snippet-open-paren " " - "The open parenthesis used in ruby-mode snippets. Normally blank but could be (") -(defvar yas/ruby-snippet-close-paren " " - "The close parenthesis used in ruby-mode snippets. Normally blank but could be )") -(defvar yas/ruby-shebang-args " -wKU" - "Arguments for the ruby shebang line.") - -(defun yas/ruby-infer-class-name () - "Infer the class name from the buffer. Thanks to hitesh " - (if buffer-file-name - (let ((fn (capitalize (file-name-nondirectory - (file-name-sans-extension - (buffer-file-name)))))) - (cond - ((string-match "_" fn) (replace-match "" nil nil fn)) - (t fn))) - "SomeClass")) - -(defun yas/ruby-chomp (x) - "Chomp string X, return nil if X became empty" - (let ((len (length x)) - (start 0) - (end (1- (length x)))) - (unless (zerop len) - (while (and (< start len) - (memq (aref x start) - '(? ?\t ?\n))) - (setq start (1+ start))) - (while (and (> end start) - (memq (aref x end) - '(? ?\t ?\n))) - (setq end (1- end))) - (unless (<= end start) - (substring x start (1+ end)))))) - -(defvar yas/ruby-block-start-regexp "\\(^\\|[\s\t\n^]\\)\\(do\\)[\s\t\n]\\(|.*|\\)?") - -(defun yas/ruby-toggle-single-multi-line-block () - "Toggle \"do .. end\" blocks into \"{ .. }\" blocks back and forth." - ;; - ;; TODO: Some code to be refactored here. - ;; - ;; FIXME: correctly detect statements in { .. } block, split-string(";") is no good - ;; - (interactive) - (let* ((do-block-bounds (save-excursion - (when (or (save-excursion (beginning-of-line) - (looking-at yas/ruby-block-start-regexp)) - (save-excursion (ruby-beginning-of-block) - (looking-at yas/ruby-block-start-regexp))) - (cons (match-beginning 1) - (progn (goto-char (match-beginning 1)) - (ruby-end-of-block) (point)))))) - (brace-block-bounds (condition-case nil - (let ((syntax-info (syntax-ppss))) - (if (fourth syntax-info) - (goto-char (ninth syntax-info))) - (while (progn (up-list -1) (not (eq (char-after) ?{)))) - (cons (point) - (progn (forward-sexp) (point)))) - (error nil))) - (block-region) - (statements)) - (if (and do-block-bounds brace-block-bounds) - (if (< (car do-block-bounds) (car brace-block-bounds)) - (setq do-block-bounds nil) - (setq brace-block-bounds nil))) - (cond (do-block-bounds - (goto-char (car do-block-bounds)) - (setq block-region (buffer-substring-no-properties (+ 2 (car do-block-bounds)) (cdr do-block-bounds))) - (delete-region (car do-block-bounds) (+ 3 (cdr do-block-bounds))) - (insert "{") - (when (string-match "\\(|.*|\\).*" block-region) - (insert " " (match-string 1 block-region)) - (setq block-region (substring block-region (match-end 1)))) - (setq statements (remove nil (mapcar #'yas/ruby-chomp - (split-string block-region "\n")))) - (mapc #'(lambda (string) - (insert " " string) - (if (member (aref string (1- (length string))) '(?; - ?|)) - (insert " ") - (insert ";"))) - statements) - (when statements (delete-backward-char 1)) - (save-excursion - (insert " }"))) - (brace-block-bounds - ;; (message "found a brace block") - (goto-char (car brace-block-bounds)) - (setq block-region (buffer-substring (1+ (car brace-block-bounds)) (1- (cdr brace-block-bounds)))) - (delete-region (car brace-block-bounds) (cdr brace-block-bounds)) - (insert "do") - (when (string-match "\\(|.*|\\).*" block-region) - (insert " " (match-string 1 block-region)) - (setq block-region (substring block-region (match-end 1)))) - (setq statements (remove nil (mapcar #'yas/ruby-chomp - (split-string block-region ";")))) - (mapc #'(lambda (string) - (insert "\n" string) - (indent-according-to-mode)) - statements) - (unless statements (insert "\n") (indent-according-to-mode)) - (save-excursion - (insert "\nend") - (indent-according-to-mode))) - (t - (message "No enclosing block found."))))) - -(defvar yas/ruby-require-regexps - '(("abbrev" . ("abbrev")) - ("base64" . ("Base64")) - ("benchmark" . ("Benchmark")) - ("bigdecimal" . ("BigDecimal")) - ("bigdecimal/math" . ("BigMath")) - ("cgi" . ("CGI")) - ("complex" . ("Complex")) - ("csv" . ("CSV")) - ("curses" . ("Curses")) - ("date" . ("Date(?:Time)?")) - ("dbm" . ("DBM")) - ("delegate" . ("DelegateClass" "Delegator" "SimpleDelegator ")) - ("digest" . ("MD5" "SHA1")) - ("dl" . ("DL")) - ("enumerator" . ("(?:enum|each)_(?:cons|slice)" "enum_(?:for|with_index)" "to_enum ")) - ("erb" . ("ERB")) - ("etc" . ("Etc")) - ("fcntl" . ("Fcntl")) - ("fileutils" . ("FileUtils")) - ("find" . ("Find(?:\.|::)find")) - ("forwardable" . ("(?:Single)?Forwardable")) - ("gdbm" . ("GDBM")) - ("generator" . ("Generator" "SyncEnumerator")) - ("getoptlong" . ("GetoptLong")) - ("gserver" . ("GServer")) - ("iconv" . ("Iconv")) - ("ipaddr" . ("IpAddr")) - ("logger" . ("Logger")) - ("matrix" . ("Matrix" "Vector")) - ("monitor" . ("Monitor(?:Mixin)?")) - ("net/ftp" . ("Net::FTP")) - ("net/http" . ("Net::HTTP")) - ("net/imap" . ("Net::IMAP")) - ("net/pop" . ("Net::(?:APOP|POP3)")) - ("net/smtp" . ("Net::SMTP")) - ("net/telnet" . ("Net::Telnet")) - ("nkf" . ("NKF")) - ("observer" . ("Observable")) - ("open3" . ("Open3")) - ("optparse" . ("OptionParser")) - ("ostruct" . ("OpenStruct")) - ("pathname" . ("Pathname")) - ("ping" . ("Ping")) - ("pp" . ("pp")) - ("pstore" . ("PStore")) - ("rational" . ("Rational")) - ("rdoc/usage" . ("RDoc(?:\.|::)usage")) - ("rdoc/markup/simple_markup" . ("SM::SimpleMarkup")) - ("rdoc/markup/simple_markup/to_html" . ("SM::SimpleMarkup")) - ("rdoc/usage" . ("RDoc(?:\.|::)usage")) - ("resolv" . ("Resolv")) - ("rexml/document" . ("REXML")) - ("rinda/tuplespace" . ("Rinda::TupleSpace(?:Proxy)?")) - ("rinda/ring" . ("Rinda::Ring(?:Finger|Server)?")) - ("rss" . ("RSS")) - ("scanf" . ("scanf")) - ("sdbm" . ("SDBM")) - ("set" . ("(?:Sorted)?Set")) - ("singleton" . ("Singleton")) - ("soap" . ("SOAP")) - ("socket" . (" (?:TCP|UNIX)(?:Socket|Server)" "(?:UDP)?Socket")) - ("stringio" . ("StringIO")) - ("strscan" . ("StringScanner")) - ("syslog" . ("Syslog")) - ("tempfile" . ("Tempfile")) - ("test/unit" . ("Test::Unit")) - ("thread" . (" ConditionVariable" "Mutex" "(?:Sized)?Queue ")) - ("time" . ("Time(?:\.|::)parse")) - ("timeout" . ("Timeout(?:\.|::)timeout")) - ("tk" . ("TK")) - ("tmpdir" . ("Dir(?:\.|::)tmpdir")) - ("tracer" . ("Tracer")) - ("tsort" . ("TSort")) - ("uri" . ("URI")) - ("weakref" . ("WeakRef")) - ("webrick" . ("WEBrick")) - ("Win32API" . ("Win32(?:API)?")) - ("win32ole" . ("WIN32OLE")) - ("wsdl" . ("WSDL")) - ("xmlrpc" . ("XMLRPC")) - ("yaml" . ("YAML")) - ("zlib" . ("Zlib")))) - -(defun yas/ruby-require (package) - (save-excursion - (goto-char (point-min)) - (unless (search-forward-regexp (format "^[\s\t]*require[( ][ ]*\"%s\"[ )]*$" - package) nil t) - (unless (search-forward-regexp "^[\s\t]*require.*\n" nil t) - (search-forward-regexp "^[\s\t]*[^#]" nil t) - (goto-char (line-beginning-position))) - (insert "require \"" package "\"\n")))) - -(defun yas/ruby-pipe-through-xmpfilter () - (interactive) - (let ((start (or (and mark-active - (region-beginning)) - (point-min))) - (end (or (and mark-active - (region-end)) - (point-max))) - (orig (point)) - retval - (orig-line (count-screen-lines (window-start) (line-beginning-position)))) - - (unless (zerop (shell-command-on-region start end "xmpfilter" (get-buffer-create "*xmpfilter*") t (get-buffer-create "*xmpfilter errors*") t)) - ;;some undo actions here - ) - (goto-char (min (point-max) orig)) - (recenter orig-line) - retval)) - -(put (intern "ruby-thing") 'bounds-of-thing-at-point 'yas/ri-ruby-thing-bounds) -(defun yas/ri-ruby-thing-bounds () - (let ((start (point)) - (end (point))) - (save-excursion - (while (not (and (zerop (skip-syntax-forward "\w\_")) - (zerop (skip-chars-forward "#:")))) - (setq end (point))) - (while (not (and (zerop (skip-syntax-backward "\w\_")) - (zerop (skip-chars-backward "#:")))) - (setq start (point)))) - (unless (= start end) - (cons start end)))) - -(defvar yas/ri-history nil - "History of yas/ri queries.") -(require 'ansi-color) -(defun yas/ri (query) - (interactive (list (read-from-minibuffer "Ri query: " - (thing-at-point 'ruby-thing) - nil - nil - 'ri-history))) - (with-current-buffer (get-buffer-create "*Ri*") - (setq buffer-read-only nil) - (shell-command (concat "ri -f ansi " query) "*Ri*") - (ansi-color-apply-on-region (point-min) (point-max)) - (yas/ri-mode) - (display-buffer (current-buffer))) - t) - -(defun yas/ri-mode () - "Mode for viewing Ruby documentation." - (buffer-disable-undo) - (kill-all-local-variables) - (local-set-key (kbd "q") 'quit-window) - (local-set-key (kbd "RET") 'yas/ri) - (setq mode-name "ri") - (setq major-mode 'yas/ri-mode) - (setq buffer-read-only t) - (run-hooks 'yas/ri-mode-hook)) - -;; conditions -;; -(yas/define-condition-cache yas/ruby-in-interpolated-string-p (member (fourth (syntax-ppss)) (list ?\" ?\`))) -(yas/define-condition-cache yas/ruby-in-comment-p (fifth (syntax-ppss))) -(yas/define-condition-cache yas/ruby-in-string-p (fourth (syntax-ppss))) -(yas/define-condition-cache yas/ruby-end-is-block-end-p - (save-excursion - (ruby-backward-sexp) - (not (eq (point) (point-min))))) - -;; My work in progress substitutions -;; -;; Substitutions for: content -;; -;; ${1/.+/(/} =yyas> ${1:$(and (yas/text) "(")} -;; ${1/.+/)/} =yyas> ${1:$(and (yas/text) ")")} -;; ${2/.+/ => /} =yyas> ${2:$(and (yas/text) " => ")} -;; ${1:${TM_FILENAME/\.\w+//} =yyas> ${1:$(and buffer-file-name (file-name-sans-extension buffer-file-name))} -;; ${1/(^.*?\S.*)|.*/(?1:\()/} =yyas> ${1:$(and (string-match "[^\s\t]" yas/text) "(" )} -;; ${1/(^.*?\S.*)|.*/(?1:\))/} =yyas> ${1:$(and (string-match "[^\s\t]" yas/text) ")" )} -;; ${2/(^.*?\S.*)|.*/(?1:\()/} =yyas> ${2:$(and (string-match "[^\s\t]" yas/text) "(" )} -;; ${2/(^.*?\S.*)|.*/(?1:\))/} =yyas> ${2:$(and (string-match "[^\s\t]" yas/text) ")" )} -;; ${3/(^.*?\S.*)|.*/(?1:\()/} =yyas> ${3:$(and (string-match "[^\s\t]" yas/text) "(" )} -;; ${3/(^.*?\S.*)|.*/(?1:\))/} =yyas> ${3:$(and (string-match "[^\s\t]" yas/text) ")" )} -;; ${2/^\s*$|(.*\S.*)/(?1: )/} =yyas> ${2:$(and (string-match "[^\s\t]" yas/text) " " )} -;; ${3/^\s*$|(.*\S.*)/(?1: )/} =yyas> ${3:$(and (string-match "[^\s\t]" yas/text) " " )} -;; ${3/(^[rwab+]+$)|.*/(?1:, ")/} =yyas> ${3:$(and (string-match "^[rwab+]+$" yas/text) ", \\"" )} -;; ${3/(^[rwab+]+$)|.*/(?1:")/} =yyas> ${3:$(and (string-match "^[rwab+]+$" yas/text) "\\"" )} -;; ${3/^\s*$|(.*\S.*)/(?1:, )/} =yyas> ${3:$(and (string-match "[^\s\t]" (yas/text) ", ")} -;; ${TM_SELECTED_TEXT/([\t ]*).*/$1/m} =yyas> -;; ${TM_SELECTED_TEXT/(\A.*)|(.+)|\n\z/(?1:$0:(?2:\t$0))/g} =yyas> `yas/selected-text` -;; (yas/multi-line-unknown BF487539-8085-4FF4-8601-1AD20FABAEDC) =yyas> `(yas/ruby-infer-class-name)` -;; (yas/multi-line-unknown 2B73EC5F-06D2-460C-A14F-6FA05AFCF0CC) =yyas> `(yas/ruby-infer-class-name)` -;; -;; ${TM_FILENAME/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g} =yyas> `(yas/ruby-infer-class-name)` -;; -;; ${1/(^(?\s*[a-z_][a-zA-Z0-9_]*\s*)(,\g)*,?\s*$)|.*/(?1:|)/} =yyas> ${1:$(and (yas/text) "|")} -;; ${1/(^(?\s*[a-z_][a-zA-Z0-9_]*\s*)(,\g)*,?\s*$)|.*/(?1: |)/} =yyas> ${1:$(and (yas/text) " |")} -;; ${1/(^(?\s*[a-z_][a-zA-Z0-9_]*\s*)(,\g)*,?\s*$)|.*/(?1:| )/} =yyas> ${1:$(and (yas/text) "| ")} -;; -;; ${1/(^(?\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g)*,?\s*$)|.*/(?1:|)/} =yyas> ${1:$(and (yas/text) "|")} -;; ${1/(^(?\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g)*,?\s*$)|.*/(?1:| )/} =yyas> ${1:$(and (yas/text) "| ")} -;; ${2/(^(?\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g)*,?\s*$)|.*/(?1:|)/} =yyas> ${2:$(and (yas/text) "|")} -;; ${2/(^(?\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g)*,?\s*$)|.*/(?1:| )/} =yyas> ${2:$(and (yas/text) "| ")} -;; -;; ${1/([\w&&[^_]]+)|./\u$1/g} =yyas> ${1:$(replace-regexp-in-string "[_/]" "" (capitalize yas/text))} -;; -;; 7990EE60-C850-4779-A8C0-7FD2C853B99B =yyas> (yas/ruby-toggle-single-multi-line-block) -;; 7E084412-80E6-4B70-8092-C03D1ECE4CD2 =yyas> (yas/ruby-require "eac")(yas/expand-uuid 'ruby-mode "FDD73070-6D32-4301-A86A-C55B77C3D8ED") -;; FBFC214F-B019-4967-95D2-028F374A3221 =yyas> (yas/ruby-pipe-through-xmpfilter) -;; 63F3B3B7-CBE2-426B-B551-657733F3868B =yyas> (call-interactively (if (featurep 'ri) 'ri 'yas/ri)) - -;; -;; `[[ $TM_LINE_INDEX != 0 ]] && echo; echo` =yyas> `(concat (if (eq 0 current-line) "\n" "") "\n")` -;; `snippet_paren.rb` =yyas> `yas/ruby-snippet-open-paren` -;; `snippet_paren.rb end` =yyas> `yas/ruby-snippet-close-paren` -;; ${TM_RUBY_SWITCHES: -wKU} =yyas> `yas/ruby-shebang-args` -;; -;; Substitutions for: condition -;; -;; 7990EE60-C850-4779-A8C0-7FD2C853B99B =yyas> 'force-in-comment -;; FBFC214F-B019-4967-95D2-028F374A3221 =yyas> 'force-in-comment -;; 88BC3896-DC39-4307-A271-21D33340F15A =yyas> 'force-in-comment -;; 0F940CBC-2173-49FF-B6FD-98A62863F8F2 =yyas> 'force-in-comment -;; 451A0596-1F72-4AFB-AF2F-45900FABB0F7 =yyas> (not (yas/ruby-end-is-block-end-p)) -;; (string.quoted.double.ruby|string.interpolated.ruby) - string source =yyas> (and (yas/ruby-in-interpolated-string-p) 'force-in-comment) -;; text.html.ruby, text.html source.ruby =yyas> (yas/unimplemented) -;; text.html, source.yaml, meta.erb =yyas> (yas/unimplemented) -;; keyword.control.start-block.ruby, meta.syntax.ruby.start-block =yyas> -;; -;; Substitutions for: binding -;; -;; # as in Commands/New Method.yasnippet -;; $ =yyas> C-c M-m -;; ^W =yyas> C-c M-w -;; # =yyas> # -;; ^{ =yyas> C-c M-{ -;; @R =yyas> C-c M-R -;; @r =yyas> C-c M-r -;; ^R =yyas> C-c M-S-r -;; @i =yyas> s-i -;; @b =yyas> s-b -;; ^@E =yyas> C-c M-e -;; ^: =yyas> C-c M-: -;; ^> =yyas> C-c M-> -;; ^h =yyas> C-c M-h -;; -;; -;; # as in Commands/Enclose in + (RDoc comments).yasnippet -;; @k =yyas> (yas/unknown) -;; -;; # as in Commands/Check Ruby Syntax.yasnippet -;; ^V =yyas> (yas/unknown) -;; -;; # as in Commands/Omit from RDoc.yasnippet -;; ^@O =yyas> (yas/unknown) -;; -;; # as in Commands/Enclose in (RDoc comments).yasnippet -;; @b =yyas> (yas/unknown) -;; -;; # as in Snippets/hash pointer.yasnippet -;; ^l =yyas> (yas/unknown) -;; -;; # as in Commands/Make Destructive Call.yasnippet -;; ^! =yyas> (yas/unknown) -;; -;; # as in Commands/Toggle Quote Style.yasnippet -;; ^" =yyas> (yas/unknown) -;; -;; # as in Commands/Open Require.yasnippet -;; @D =yyas> (yas/unknown) -;; -;; # as in Commands/Execute Line with Ruby.yasnippet -;; ^E =yyas> (yas/unknown) -;; -;; # as in Commands/Completion Ruby (rcodetools).yasnippet -;; ~ =yyas> (yas/unknown) -;; -;; # as in Macros/Delete forwardbackward.yasnippet -;;  =yyas> (yas/unknown) -;; -;; --**-- -;; Automatically generated code, do not edit this part -;; -;; Translated menu -;; -(yas/define-menu 'ruby-mode - '(;; Ignoring Run - (yas/ignore-item "35222962-C50D-4D58-A6AE-71E7AD980BE4") - ;; Ignoring Run Focused Unit Test - (yas/ignore-item "5289EE40-86B8-11D9-A8D4-000A95E13C98") - ;; Ignoring Run Rake Task - (yas/ignore-item "569C9822-8C41-4907-94C7-1A8A0031B66D") - - ;; Documentation for Word / Selection - (yas/item "63F3B3B7-CBE2-426B-B551-657733F3868B") - (yas/submenu "RDoc" - (;; Ignoring Show for Current File / Project - (yas/ignore-item "1AD6A138-2E89-4D6A-AB3F-416BF9CE968D") - - (yas/submenu "Format" - (;; Ignoring Bold - (yas/ignore-item "931DD73E-615E-476E-9B0D-8341023AE730") - ;; Ignoring Italic - (yas/ignore-item "DAA69A0C-FC1E-4509-9931-DFFB38B4D6AE") - ;; Ignoring Typewriter - (yas/ignore-item "2DDB6FE0-6111-4C40-A149-8E67E76F8272"))) - - ;; New Block - (yas/item "05984208-D559-4C04-A69C-2019361A985A") - ;; Ignoring Omit - (yas/ignore-item "BF4CA9F1-51CD-48D4-8357-852234F59046") - - ;; :yields: - (yas/item "ED6368FB-A11D-4622-9F42-7879481094F1"))) - (yas/separator) - (yas/submenu "Rake" - (;; namespace :name ... end - (yas/item "A3D89AAA-9156-4077-A026-37BB7358C3BA") - ;; namespace :name ... task :default ... end - (yas/item "2031FC41-CBD3-41CC-B9A9-7F068E607A05") - ;; desc ... - (yas/item "F686E1AD-B03D-45A6-BD51-6E3FD1298FE0") - ;; task :name ... end - (yas/item "CB81DA55-F3BC-4BFB-B0C5-29F0EE6F8081") - ;; desc ... task :name ... end - (yas/item "FE9A8EDA-C243-4068-8F38-A615B82D08C9") - ;; Ignoring Rake/Sake task using file path - (yas/ignore-item "E07FF68B-C87D-4332-8477-D026929FDADA"))) - (yas/separator) - ;; Ignoring Open Require - (yas/ignore-item "8646378E-91F5-4771-AC7C-43FC49A93576") - ;; Ignoring Validate Syntax - (yas/ignore-item "EE5F19BA-6C02-11D9-92BA-0011242E4184") - - ;; Ignoring Execute Line / Selection as Ruby - (yas/ignore-item "EE5F1FB2-6C02-11D9-92BA-0011242E4184") - ;; Execute and Update ‘# =>’ Markers - (yas/item "FBFC214F-B019-4967-95D2-028F374A3221") - ;; Add ‘# =>’ Marker - (yas/item "88BC3896-DC39-4307-A271-21D33340F15A") - (yas/separator) - ;; Ignoring Insert Missing Requires - (yas/ignore-item "9FB64639-F776-499B-BA6F-BB45F86F80FD") - ;; Ignoring Add ! to Method in Line / Selection - (yas/ignore-item "7F79BC8D-8A4F-4570-973B-05DFEC25747F") - ;; Ignoring Toggle String / Symbol - (yas/ignore-item "B297E4B8-A8FF-49CE-B9C4-6D4911724D43") - ;; Insert ERb’s <% .. %> or <%= .. %> - (yas/item "FDFABCB9-DF58-4469-AE11-5407A4FF4D70") - (yas/separator) - (yas/submenu "Declarations" - (;; begin … rescue … end - (yas/item "0F940CBC-2173-49FF-B6FD-98A62863F8F2") - ;; case … end - (yas/item "667083EE-62C3-11D9-B8CF-000D93589AF6") - ;; when … - (yas/item "48D8E498-C9A5-4B1B-9A18-71A5860276FB") - ;; if … end - (yas/item "6670835F-62C3-11D9-B8CF-000D93589AF6") - ;; if … else … end - (yas/item "667082E6-62C3-11D9-B8CF-000D93589AF6") - ;; elsif ... - (yas/item "CD1609FA-47DA-4EE4-9C5B-5C56D953F5B1") - ;; unless … end - (yas/item "F53E098D-D08E-4CE2-990A-B0BD70E60614") - ;; while ... end - (yas/item "D121FC61-96A4-4B8F-8709-280EDA876FF3") - ;; until ... end - (yas/item "488B387C-50C0-4B2D-9260-5A7E7EAF9B42") - (yas/separator) - (yas/submenu "Classes and Modules" - (;; class .. end - (yas/item "BF487539-8085-4FF4-8601-1AD20FABAEDC") - ;; class .. initialize .. end - (yas/item "83EED068-8C1C-4BAF-9893-902DC00616AB") - ;; class .. < ParentClass .. initialize .. end - (yas/item "0CCBE04E-F4E2-4E55-9506-7DE67ACF8388") - ;; ClassName = Struct .. do .. end - (yas/item "05DFF82C-5A29-4EBD-93FE-C165FFFB5EA8") - ;; class BlankSlate .. initialize .. end - (yas/item "E98FB8F9-7302-431D-8BF2-275A68A6126C") - ;; Ignoring class .. < DelegateClass .. initialize .. end - (yas/ignore-item "121B334B-2AA6-4E9A-A8B8-BF93B627982B") - ;; class .. < DelegateClass .. initialize .. end - (yas/item "AFE1D078-EA16-45F5-AD8A-FAC1B523D861") - ;; class << self .. end - (yas/item "C7AAAE45-487A-4B61-8962-D47675AAC05F") - (yas/separator) - ;; module .. end - (yas/item "2B73EC5F-06D2-460C-A14F-6FA05AFCF0CC") - ;; module .. module_function .. end - (yas/item "0E85EC81-2FAB-4648-B590-119CC1BB6E41") - ;; module .. ClassMethods .. end - (yas/item "A71A18CF-2D71-4BFF-AA0C-D9B8C59BC4EB"))) - (yas/submenu "Methods" - (;; Ignoring New Method - (yas/ignore-item "0275EF39-9357-408F-AF20-79E415CA9504") - - ;; attr_reader .. - (yas/item "A150C2D8-25B3-4339-BC92-8A0160A70486") - ;; attr_writer .. - (yas/item "3D383096-A03F-4EF8-9060-3C727045AB34") - ;; attr_accessor .. - (yas/item "D7A7D3C9-1714-4C50-8CC0-D83A03883E8F") - (yas/separator) - ;; include Enumerable .. - (yas/item "AAD5D511-6BE7-41DA-8F2B-1593A48FBB08") - ;; include Comparable .. - (yas/item "6C9D6B3D-D8E9-4606-9534-577C8D21FFF6") - (yas/separator) - ;; Ignoring extend Forwardable - (yas/ignore-item "58FDEA60-10AF-4C49-AA09-29B77030DB25") - ;; extend Forwardable - (yas/item "7F46C90A-595B-4B83-A4F7-058F63CE4218") - (yas/separator) - ;; def … end - (yas/item "4E9A7A73-875C-11D9-897C-000393CBCE2E") - ;; def self .. end - (yas/item "7C6E88FA-CA0E-4110-8C75-A94E54286A75") - ;; def method_missing .. end - (yas/item "87D5F8AD-8DA6-4AED-A0D8-B51CAC980445") - ;; def_delegator .. - (yas/item "C44ED391-614F-4BA2-BB0F-87668EEA9954") - ;; def_delegators .. - (yas/item "4A6EFD6B-88E2-4822-AD48-03460EDBC796") - (yas/separator) - ;; alias_method .. - (yas/item "988C8AEF-FC71-4455-9C4F-9338C05685A4"))) - ;; __END__ - (yas/item "451A0596-1F72-4AFB-AF2F-45900FABB0F7") - (yas/separator) - ;; #!/usr/bin/env ruby -wKU - (yas/item "A05CBDD6-845D-45EB-94FB-F8787F5456BE") - ;; require ".." - (yas/item "97DE939B-D243-4D5C-B953-1C9090912E7C") - ;; application { .. } - (yas/item "E16D24D2-CC7E-4786-BE0B-1725FC865D78") - ;; usage_if() - (yas/item "21C0D711-F32A-4665-AA0D-B136F9DD3945") - ;; usage_unless() - (yas/item "49D69DEC-6991-49F4-8D9B-BA60BFDD3D17"))) - (yas/submenu "Iterators" - ((yas/submenu "Arrays" - (;; Array.new(10) { |i| .. } - (yas/item "DAE6A754-D906-4763-B816-CE67125CEF08") - (yas/separator) - ;; delete_if { |e| .. } - (yas/item "263C94DC-63CF-4BA3-9692-C5582CA8F1AB") - ;; fill(range) { |i| .. } - (yas/item "6021BBDC-4AAD-447B-A0C2-A4BB31721558") - ;; flatten_once() - (yas/item "3DDB99C4-486D-4C11-A217-5680FDD8EC19") - ;; zip(enums) { |row| .. } - (yas/item "FD010022-E0E7-44DB-827F-33F7D9310DA2"))) - (yas/submenu "Counting" - (;; downto(0) { |n| .. } - (yas/item "4991BB86-736E-4758-B9B2-E4FA90B9368F") - ;; step(2) { |e| .. } - (yas/item "36853A11-0307-4AE7-B835-7CE6358717A5") - ;; times { |n| .. } - (yas/item "206D54AF-E67A-4DF0-B7F4-3D42FEB81685") - ;; upto(1.0/0.0) { |n| .. } - (yas/item "51954118-81D7-42B6-9A10-BE23D8B9FFE2") - (yas/separator) - ;; loop { .. } - (yas/item "567E3D18-BF2B-4379-8927-2777EC9F495E"))) - (yas/submenu "Each Element" - (;; each { |e| .. } - (yas/item "ECBA4CA0-275F-460E-85BE-E82FEA2E2B26") - ;; each_byte { |byte| .. } - (yas/item "338EC03D-3FF4-4435-94E8-1CEF20CEC75D") - ;; each_char { |chr| .. } - (yas/item "7E084412-80E6-4B70-8092-C03D1ECE4CD2") - ;; each_char { |chr| .. } - (yas/item "FDD73070-6D32-4301-A86A-C55B77C3D8ED") - ;; Ignoring each_cons(..) { |group| .. } - (yas/ignore-item "EC73D5CC-5F05-46B9-A6F4-82037E4A38C9") - ;; each_cons(..) { |group| .. } - (yas/item "3C04589C-5127-478E-97B3-CA7DD2EA7ECD") - ;; each_index { |i| .. } - (yas/item "689120C9-AB40-4081-8268-9362E00FA4A0") - ;; each_key { |key| .. } - (yas/item "E54F7077-3C33-4B53-A4F7-21E16132D3AD") - ;; each_line { |line| .. } - (yas/item "02913388-EE8E-4C55-AC94-94F3D751F47E") - ;; each_pair { |name, val| .. } - (yas/item "7A3CECED-452B-438E-A5C6-95B6BDC43243") - ;; Ignoring each_slice(..) { |group| .. } - (yas/ignore-item "825B721D-4367-4DF7-98C0-F005695DF9E3") - ;; each_slice(..) { |group| .. } - (yas/item "CD748479-D2A4-4AB5-95BD-4C89512BA210") - ;; each_value { |val| .. } - (yas/item "844DBD70-BC23-4FBF-9C18-F4A610239DF2") - ;; each_with_index { |e, i| .. } - (yas/item "1DD13CF5-39C0-4F10-B655-56DACEBC7F94") - ;; reverse_each { |e| .. } - (yas/item "F3C5F719-EF03-4FF7-A777-4A8402FE3B6B") - (yas/separator) - ;; inject(init) { |mem, var| .. } - (yas/item "B563E0D7-513D-49B4-9733-1B04A6F25A74") - (yas/separator) - ;; map { |e| .. } - (yas/item "5A3754FC-43A3-462B-AB42-E3E951872E6F") - ;; Ignoring map_with_index { |e, i| .. } - (yas/ignore-item "BFB65D1C-62F1-485D-8A67-3E5A2E55107C") - ;; map_with_index { |e, i| .. } - (yas/item "BD4CFD7B-1AC0-4569-9BDA-FD491F41F4E6"))) - (yas/submenu "Files" - (;; Dir.glob("..") { |file| .. } - (yas/item "332AA973-AA71-48CB-AEE9-1D71E11019AC") - ;; File.foreach ("..") { |line| .. } - (yas/item "8F594E5E-6F46-4E98-B5FB-1C8F3BA9828F") - ;; open("path/or/url", "w") { |io| .. } - (yas/item "418F1817-255F-430A-B09A-222964ED66A7") - ;; unix_filter { .. } - (yas/item "8CEF9711-88D5-4202-AFB9-29EF4EFD25C1") - (yas/separator) - ;; option_parse { .. } - (yas/item "C3C48948-4F49-484E-A8DE-DEB44723099E") - ;; option(..) - (yas/item "209D5D73-7A77-4931-A158-3FB6D5B48A88"))) - (yas/submenu "Ordering" - (;; sort { |a, b| .. } - (yas/item "9E0B4D4B-2956-4B3A-800A-3D8CE54E66BF") - ;; sort_by { |e| .. } - (yas/item "BA9440C9-36C3-4031-BB61-67B581D5B179") - (yas/separator) - ;; randomize() - (yas/item "B0CE57EC-FB2E-4482-8CCE-448DC2588715"))) - (yas/submenu "Searching and Selection" - (;; all? { |e| .. } - (yas/item "07D1F987-7CDB-4EAD-B64A-27A93051700E") - ;; any? { |e| .. } - (yas/item "A3B9B76B-2BC5-425C-AB24-9FAAFC375798") - ;; classify { |e| .. } - (yas/item "5DA9E1E8-2C54-420A-9B84-B040A1AF2B9E") - ;; collect { |e| .. } - (yas/item "669A86AD-936F-4EDA-8E4E-6863804072DA") - ;; detect { |e| .. } - (yas/item "6C6B9849-9631-49FF-A9F9-F0E94A1512C5") - ;; fetch(name) { |key| .. } - (yas/item "1F72122A-35AD-4BA1-AA01-889A10319666") - ;; find { |e| .. } - (yas/item "E23FE534-8061-4828-98A5-46270B6910B0") - ;; find_all { |e| .. } - (yas/item "197709C5-8382-4A59-B6D7-31A0CC0F23B7") - ;; grep(/pattern/) { |match| .. } - (yas/item "9D9E7BA3-8C5D-4532-83EA-326358C2F5BB") - ;; max { |a, b| .. } - (yas/item "98182B9E-7C61-4824-BE4C-9CD69C816037") - ;; min { |a, b| .. } - (yas/item "CB03D11A-7204-48D0-92C1-E109034403E7") - ;; partition { |e| .. } - (yas/item "52B8BF63-F09E-4789-8407-06168A8AE666") - ;; reject { |e| .. } - (yas/item "B79B9DAB-ABEF-44F6-BF7E-635E7BA11DFD") - ;; select { |e| .. } - (yas/item "4E409AA4-E7D4-46B7-A4E9-E32F992B33E9"))) - (yas/submenu "Strings" - (;; sub(/../) { |match| .. } - (yas/item "8021944C-CEA4-4983-8D1C-78D18D4004A1") - ;; gsub(/../) { |match| .. } - (yas/item "2514FC26-468C-4D08-A788-494A444C4286") - (yas/separator) - ;; scan(/../) { |match| .. } - (yas/item "66802933-B49F-479B-9DF9-1D898FF1FA90"))))) - (yas/submenu "Blocks" - (;; Toggle ‘do … end’ / ‘{ … }’ - (yas/item "7990EE60-C850-4779-A8C0-7FD2C853B99B") - (yas/separator) - ;; Insert { |variable| … } - (yas/item "855FC4EF-7B1E-48EE-AD4E-5ECB8ED79D1C") - ;; Insert do |variable| … end - (yas/item "4B72C5C3-6CA7-41AC-B2F9-51DEA25D469E") - (yas/separator) - ;; lambda { |args| .. } - (yas/item "21E75321-0CF7-45E8-A297-BCC7C0DDDD15"))) - (yas/submenu "Hashes" - (;; Hash.new { |hash, key| hash[key] = .. } - (yas/item "E16EE658-1CA0-4950-954B-B962E50B754F") - (yas/separator) - ;; Hash Pair — :key => "value" - (yas/item "840B9C4C-7037-4C3B-9028-EB9DC75EDB3E") - ;; Hash Pointer — => - (yas/item "B9E3A6DF-875D-11D9-897C-000393CBCE2E"))) - (yas/submenu "Tests" - (;; class .. < Test::Unit::TestCase .. end - (yas/item "31D1F145-33AB-4441-BA11-4D1C46928C4C") - ;; def test_ .. end - (yas/item "00F66D41-25AF-4597-B67D-E540965A5222") - ;; require "tc_.." .. - (yas/item "5297FD0C-98B1-4514-BBD1-1516810BECA6") - (yas/separator) - ;; assert(..) - (yas/item "B32C147D-44A6-478A-9D5D-189D7831E9A7") - ;; assert_equal(..) - (yas/item "43A61A22-6BEE-4997-961C-1CDE739C05FE") - ;; assert_not_equal(..) - (yas/item "A243E96F-DC21-4AA0-B340-13A7674F6AFF") - ;; assert_in_delta(..) - (yas/item "429D0EF5-580D-4166-8F79-713DE96B77F1") - ;; assert_instance_of(..) - (yas/item "0E831E03-67E1-4357-8323-C60685C23C4F") - ;; assert_kind_of(..) - (yas/item "671F05E2-D9CC-485E-BB1B-B13EF20FAC65") - ;; assert_nil(..) - (yas/item "4C79256C-480A-459C-BDE8-BB0D972811DB") - ;; assert_not_nil(..) - (yas/item "79FEC3CC-2A40-4611-9A85-ECDB22FE0701") - ;; assert_match(..) - (yas/item "711ED6C3-0F18-41FB-9A7D-3094BB319A85") - ;; assert_no_match(..) - (yas/item "A072BB1E-1DD1-45D3-9346-8CA3BA21B364") - ;; assert_operator(..) - (yas/item "1B925A4D-8EE4-442B-9254-293599F5717F") - ;; assert_raise(..) { .. } - (yas/item "68B21F6F-5D89-41FA-A19C-F29C2F912B4E") - ;; assert_nothing_raised(..) { .. } - (yas/item "82F8EEE0-2452-411E-8102-7BFDDBCA2E72") - ;; assert_respond_to(..) - (yas/item "09A11FDA-49FC-4466-8787-8D1D5D111A89") - ;; assert_same(..) - (yas/item "29340695-E426-4F77-8CF7-C59360A549F4") - ;; assert_not_same(..) - (yas/item "F91C25EC-EC76-498B-BFB5-FDA8F57C5875") - ;; assert_send(..) - (yas/item "7850AD5C-A90D-4E2C-A931-EADFF8D3D9A3") - ;; assert_throws(..) { .. } - (yas/item "05655BD8-23C6-445F-BFD1-420BF25C3030") - ;; assert_nothing_thrown { .. } - (yas/item "33639D7A-BD8C-4396-9C44-307B8AC87C9E") - ;; flunk(..) - (yas/item "DB457094-1AC9-4856-AEFC-43A9576B6775") - (yas/separator) - ;; Ignoring Benchmark.bmbm do .. end - (yas/ignore-item "C649F945-DAB8-4DA2-B73C-2EFF9D7D34F3") - ;; Benchmark.bmbm do .. end - (yas/item "942F20E2-C40A-44B8-A3F2-99AAC68CB534") - ;; results.report(..) { .. } - (yas/item "1C60D589-DD46-4109-90CA-6B34AEA2F298"))) - (yas/submenu "Serialization" - (;; Marshal.dump(.., file) - (yas/item "0CB48BCA-3F6E-4AE0-85BC-08A1D2508216") - ;; Marshal.load(obj) - (yas/item "20AAD0BC-075D-4EC0-9057-E3E5E62C4125") - (yas/separator) - ;; Ignoring PStore.new( .. ) - (yas/ignore-item "5AE7CFB4-418E-4E00-AD76-06DB755EE876") - ;; PStore.new( .. ) - (yas/item "5B46ECFD-23A4-4F0C-9951-F64C19C72C2B") - ;; transaction( .. ) { .. } - (yas/item "46BF99AD-E172-4D49-BCF7-072F4730E1D9") - (yas/separator) - ;; Ignoring YAML.dump(.., file) - (yas/ignore-item "9460392B-C036-4A76-A5AE-1191F10E4B1B") - ;; YAML.dump(.., file) - (yas/item "3BA6762A-BB6B-489E-8006-F30F386AEF48") - ;; Ignoring YAML.load(file) - (yas/ignore-item "2C07D4E7-D74F-4AE4-82BE-B0BA82247AFA") - ;; YAML.load(file) - (yas/item "8343ACF4-EEB7-44B5-B835-94826466D4D5") - (yas/separator) - ;; Ignoring xmlread(..) - (yas/ignore-item "F6BF907E-FDF7-4D9B-9E57-BE159561349D") - ;; xmlread(..) - (yas/item "B904D4AA-D15D-48A4-8EB2-563BAF489332") - ;; xpath(..) { .. } - (yas/item "CC300D44-6C3F-4F6C-A8AB-86F5A2DC57CF"))) - (yas/submenu "Idioms" - (;; class_from_name() - (yas/item "2DBEE50B-3097-4A57-AB48-3586CF392D8B") - ;; deep_copy(..) - (yas/item "0BA2B2F1-E767-4A03-9791-0AC0183251F1") - ;; path_from_here( .. ) - (yas/item "A4E89D97-D5ED-48BB-B5FF-1BFB79211FCD") - ;; singleton_class() - (yas/item "B46D35B8-5DEB-4C10-A110-BA1965A2EB9C") - ;; Ignoring word_wrap() - (yas/ignore-item "97054C4D-E4A3-45B1-9C00-B82DBCB30CAD"))) - (yas/submenu "File" - (;; require File.dirname(__FILE__) + "/.." - (yas/item "7C42D878-FD0F-4181-A71A-57A091C0154A") - (yas/separator) - ;; File.dirname(__FILE__) - (yas/item "16920DC1-6FA6-48C8-90C5-C19E2C734303") - (yas/separator) - ;; File.read(filename) - (yas/item "FAFE9F5C-BF9C-4416-8623-2CB8EBC31B3C") - ;; File.open(filename, 'r') { |f| f.read } - (yas/item "005EB926-4BFE-4BFA-93B2-C9030636289C"))) - ;; class .. < Test::Unit::TestCase with test_helper - (yas/item "228CAB3A-E221-4727-B430-31E94F76C9D3")) - '("E5158F94-CC52-4424-A495-14EF9272653F" - "EEE6D060-C5A0-400D-A2E0-0835013C5365" - "76FCF165-54CB-4213-BC55-BD60B9C6A3EC" - "6519CB08-8326-4B77-A251-54722FFBFC1F" - "835FAAC6-5431-436C-998B-241F7226B99B" - "A83F68A9-F751-4BB4-AE16-56812878C16A" - "47D203ED-EB9B-4653-A07B-A897800CEB76" - "835FAAC6-5431-436C-998B-241F7226B99B" - "569C9822-8C41-4907-94C7-1A8A0031B66D" - "BF4CA9F1-51CD-48D4-8357-852234F59046" - "B3875596-723C-41EE-9E6F-F84930C3B568" - "B297E4B8-A8FF-49CE-B9C4-6D4911724D43" - "931DD73E-615E-476E-9B0D-8341023AE730" - "DAA69A0C-FC1E-4509-9931-DFFB38B4D6AE" - "47D203ED-EB9B-4653-A07B-A897800CEB76" - "2DDB6FE0-6111-4C40-A149-8E67E76F8272" - "35222962-C50D-4D58-A6AE-71E7AD980BE4" - "8646378E-91F5-4771-AC7C-43FC49A93576" - "E07FF68B-C87D-4332-8477-D026929FDADA" - "2C07D4E7-D74F-4AE4-82BE-B0BA82247AFA" - "E5158F94-CC52-4424-A495-14EF9272653F" - "58FDEA60-10AF-4C49-AA09-29B77030DB25" - "825B721D-4367-4DF7-98C0-F005695DF9E3" - "121B334B-2AA6-4E9A-A8B8-BF93B627982B" - "BFB65D1C-62F1-485D-8A67-3E5A2E55107C" - "EC73D5CC-5F05-46B9-A6F4-82037E4A38C9" - "9460392B-C036-4A76-A5AE-1191F10E4B1B" - "1AD6A138-2E89-4D6A-AB3F-416BF9CE968D" - "EE5F1FB2-6C02-11D9-92BA-0011242E4184" - "9FB64639-F776-499B-BA6F-BB45F86F80FD" - "7F79BC8D-8A4F-4570-973B-05DFEC25747F" - "EE5F19BA-6C02-11D9-92BA-0011242E4184" - "97054C4D-E4A3-45B1-9C00-B82DBCB30CAD" - "76FCF165-54CB-4213-BC55-BD60B9C6A3EC" - "0275EF39-9357-408F-AF20-79E415CA9504" - "5289EE40-86B8-11D9-A8D4-000A95E13C98" - "6519CB08-8326-4B77-A251-54722FFBFC1F" - "C649F945-DAB8-4DA2-B73C-2EFF9D7D34F3" - "5AE7CFB4-418E-4E00-AD76-06DB755EE876" - "A83F68A9-F751-4BB4-AE16-56812878C16A" - "F6BF907E-FDF7-4D9B-9E57-BE159561349D")) - -;; Unknown substitutions -;; -;; Substitutions for: content -;; -;; # as in Macros/xmlread(__).yasnippet -;; F6BF907E-FDF7-4D9B-9E57-BE159561349D =yyas> (yas/unknown) -;; -;; # as in Commands/Check Ruby Syntax.yasnippet -;; EE5F19BA-6C02-11D9-92BA-0011242E4184 =yyas> (yas/unknown) -;; -;; # as in Macros/Overwrite } in #{ .. }.yasnippet -;; E5158F94-CC52-4424-A495-14EF9272653F =yyas> (yas/unknown) -;; -;; # as in Commands/Enclose in + (RDoc comments).yasnippet -;; 2DDB6FE0-6111-4C40-A149-8E67E76F8272 =yyas> (yas/unknown) -;; -;; # as in Snippets/RDoc documentation block.yasnippet -;; `(concat (if (eq 0 current-line) "\n" "") "\n")` =yyas> (yas/unknown) -;; -;; # as in Snippets/class __ TestUnitTestCase with test_helper.yasnippet -;; (yas/multi-line-unknown 228CAB3A-E221-4727-B430-31E94F76C9D3) =yyas> (yas/unknown) -;; -;; # as in Macros/YAML.dump(.., file) (Yd).yasnippet -;; 9460392B-C036-4A76-A5AE-1191F10E4B1B =yyas> (yas/unknown) -;; -;; # as in Macros/map_with_index { e, i .. } (mapwi).yasnippet -;; BFB65D1C-62F1-485D-8A67-3E5A2E55107C =yyas> (yas/unknown) -;; -;; # as in Macros/each_slice(..) { group .. } (eas).yasnippet -;; 825B721D-4367-4DF7-98C0-F005695DF9E3 =yyas> (yas/unknown) -;; -;; # as in Commands/Run.yasnippet -;; 35222962-C50D-4D58-A6AE-71E7AD980BE4 =yyas> (yas/unknown) -;; -;; # as in Commands/Enclose in _ (RDoc comments).yasnippet -;; DAA69A0C-FC1E-4509-9931-DFFB38B4D6AE =yyas> (yas/unknown) -;; -;; # as in Commands/Omit from RDoc.yasnippet -;; BF4CA9F1-51CD-48D4-8357-852234F59046 =yyas> (yas/unknown) -;; -;; # as in Snippets/assert_not_nil(..) (asnn).yasnippet -;; `yas/ruby-snippet-close-paren` =yyas> (yas/unknown) -;; -;; # as in Macros/YAML.load(file) (Yl).yasnippet -;; 2C07D4E7-D74F-4AE4-82BE-B0BA82247AFA =yyas> (yas/unknown) -;; -;; # as in Commands/Toggle StringSymbol.yasnippet -;; B297E4B8-A8FF-49CE-B9C4-6D4911724D43 =yyas> (yas/unknown) -;; -;; # as in Commands/Run Rake Task.yasnippet -;; 569C9822-8C41-4907-94C7-1A8A0031B66D =yyas> (yas/unknown) -;; -;; # as in Macros/Benchmark_bmbm(__) do __ end.yasnippet -;; C649F945-DAB8-4DA2-B73C-2EFF9D7D34F3 =yyas> (yas/unknown) -;; -;; # as in Commands/Toggle Quote Style.yasnippet -;; 6519CB08-8326-4B77-A251-54722FFBFC1F =yyas> (yas/unknown) -;; -;; # as in Commands/word_wrap() (worw).yasnippet -;; 97054C4D-E4A3-45B1-9C00-B82DBCB30CAD =yyas> (yas/unknown) -;; -;; # as in Snippets/class .. TestUnitTestCase .. end (tc).yasnippet -;; (yas/multi-line-unknown 31D1F145-33AB-4441-BA11-4D1C46928C4C) =yyas> (yas/unknown) -;; -;; # as in Commands/Make Destructive Call.yasnippet -;; 7F79BC8D-8A4F-4570-973B-05DFEC25747F =yyas> (yas/unknown) -;; -;; # as in Commands/Insert Missing Requires.yasnippet -;; 9FB64639-F776-499B-BA6F-BB45F86F80FD =yyas> (yas/unknown) -;; -;; # as in Macros/extend Forwardable (Forw).yasnippet -;; 58FDEA60-10AF-4C49-AA09-29B77030DB25 =yyas> (yas/unknown) -;; -;; # as in Commands/RakeSake task using file path.yasnippet -;; E07FF68B-C87D-4332-8477-D026929FDADA =yyas> (yas/unknown) -;; -;; # as in Commands/Completion Ruby (rcodetools).yasnippet -;; 47D203ED-EB9B-4653-A07B-A897800CEB76 =yyas> (yas/unknown) -;; -;; # as in Commands/gsub - remove whitespace from front of line.yasnippet -;; B3875596-723C-41EE-9E6F-F84930C3B568 =yyas> (yas/unknown) -;; -;; # as in Commands/Toggle ERb Tags.yasnippet -;; 835FAAC6-5431-436C-998B-241F7226B99B =yyas> (yas/unknown) -;; -;; # as in Snippets/assert_not_nil(..) (asnn).yasnippet -;; `yas/ruby-snippet-open-paren` =yyas> (yas/unknown) -;; -;; # as in Commands/New Method.yasnippet -;; 0275EF39-9357-408F-AF20-79E415CA9504 =yyas> (yas/unknown) -;; -;; # as in Commands/Execute Line with Ruby.yasnippet -;; EE5F1FB2-6C02-11D9-92BA-0011242E4184 =yyas> (yas/unknown) -;; -;; # as in Macros/class .. DelegateClass .. initialize .. end (class).yasnippet -;; 121B334B-2AA6-4E9A-A8B8-BF93B627982B =yyas> (yas/unknown) -;; -;; # as in Macros/PStore_new( __ ).yasnippet -;; 5AE7CFB4-418E-4E00-AD76-06DB755EE876 =yyas> (yas/unknown) -;; -;; # as in Commands/Run focused unit test.yasnippet -;; 5289EE40-86B8-11D9-A8D4-000A95E13C98 =yyas> (yas/unknown) -;; -;; # as in Commands/Show RDoc for this file.yasnippet -;; 1AD6A138-2E89-4D6A-AB3F-416BF9CE968D =yyas> (yas/unknown) -;; -;; # as in Snippets/module .. end.yasnippet -;; `(yas/ruby-infer-class-name)` =yyas> (yas/unknown) -;; -;; # as in Commands/Check ERB Syntax.yasnippet -;; 76FCF165-54CB-4213-BC55-BD60B9C6A3EC =yyas> (yas/unknown) -;; -;; # as in Snippets/embed string variable.yasnippet -;; `yas/selected-text` =yyas> (yas/unknown) -;; -;; # as in Macros/Delete forwardbackward.yasnippet -;; A83F68A9-F751-4BB4-AE16-56812878C16A =yyas> (yas/unknown) -;; -;; # as in Macros/each_cons(..) { group .. } (eac).yasnippet -;; EC73D5CC-5F05-46B9-A6F4-82037E4A38C9 =yyas> (yas/unknown) -;; -;; # as in Commands/Open Require.yasnippet -;; 8646378E-91F5-4771-AC7C-43FC49A93576 =yyas> (yas/unknown) -;; -;; # as in Commands/Enclose in (RDoc comments).yasnippet -;; 931DD73E-615E-476E-9B0D-8341023AE730 =yyas> (yas/unknown) -;; -;; - -;; Substitutions for: condition -;; -;; # as in Macros/xmlread(__).yasnippet -;; =yyas> (yas/unknown) -;; -;; # as in Snippets/Insert ERb's __ or = __.yasnippet -;; text.html, source.yaml =yyas> (yas/unknown) -;; -;; - -;; Substitutions for: binding -;; -;; # as in Commands/Enclose in + (RDoc comments).yasnippet -;; @k =yyas> (yas/unknown) -;; -;; # as in Commands/Check ERB Syntax.yasnippet -;; ^V =yyas> (yas/unknown) -;; -;; # as in Commands/Omit from RDoc.yasnippet -;; ^@O =yyas> (yas/unknown) -;; -;; # as in Snippets/hash pointer.yasnippet -;; ^l =yyas> (yas/unknown) -;; -;; # as in Commands/Make Destructive Call.yasnippet -;; ^! =yyas> (yas/unknown) -;; -;; # as in Commands/Toggle Quote Style.yasnippet -;; ^" =yyas> (yas/unknown) -;; -;; # as in Commands/Open Require.yasnippet -;; @D =yyas> (yas/unknown) -;; -;; # as in Commands/Execute Line with Ruby.yasnippet -;; ^E =yyas> (yas/unknown) -;; -;; # as in Macros/Overwrite } in #{ .. }.yasnippet -;; } =yyas> (yas/unknown) -;; -;; # as in Commands/Completion Ruby (rcodetools).yasnippet -;; ~ =yyas> (yas/unknown) -;; -;; # as in Macros/Delete forwardbackward.yasnippet -;;  =yyas> (yas/unknown) -;; -;; - -;; .yas-setup.el for ruby-mode ends here diff --git a/extensions/yasnippet/extras/textmate_import.rb b/extensions/yasnippet/extras/textmate_import.rb deleted file mode 100755 index e7a9281..0000000 --- a/extensions/yasnippet/extras/textmate_import.rb +++ /dev/null @@ -1,516 +0,0 @@ -#!/usr/bin/ruby -# -*- coding: utf-8 -*- -#!/usr/bin/env ruby -# -*- coding: utf-8 -*- -# textmate_import.rb --- import textmate snippets -# -# Copyright (C) 2009 Rob Christie, 2010 João Távora -# -# This is a quick script to generate YASnippets from TextMate Snippets. -# -# I based the script off of a python script of a similar nature by -# Jeff Wheeler: http://nokrev.com -# http://code.nokrev.com/?p=snippet-copier.git;a=blob_plain;f=snippet_copier.py -# -# Use textmate_import.rb --help to get usage information. - -require 'rubygems' -require 'plist' -require 'choice' -require 'fileutils' -require 'shellwords' # String#shellescape -require 'ruby-debug' if $DEBUG - -Choice.options do - header '' - header 'Standard Options:' - - option :bundle_dir do - short '-d' - long '--bundle-dir=PATH' - desc 'Tells the program the directory to find the TextMate bundle directory' - default '.' - end - - option :output_dir do - short '-o' - long '--output-dir=PATH' - desc 'What directory to write the new YASnippets to' - end - - option :snippet do - short '-f' - long '--file=SNIPPET FILE NAME' - desc 'A specific snippet that you want to copy or a glob for various files' - default '*.{tmSnippet,tmCommand,plist,tmMacro}' - end - - option :print_pretty do - short '-p' - long '--pretty-print' - desc 'Pretty prints multiple snippets when printing to standard out' - end - - option :quiet do - short '-q' - long '--quiet' - desc 'Be quiet.' - end - - option :convert_bindings do - short '-b' - long '--convert-bindings' - desc "TextMate \"keyEquivalent\" keys are translated to YASnippet \"# binding :\" directives" - end - - option :info_plist do - short '-g' - long '--info-plist=PLIST' - desc "Specify a plist file derive menu information from defaults to \"bundle-dir\"/info.plist" - end - - separator '' - separator 'Common options: ' - - option :help do - long '--help' - desc 'Show this message' - end -end - -# Represents and is capable of outputting the representation of a -# TextMate menu in terms of `yas/define-menu' -# -class TmSubmenu - - @@excluded_items = []; - def self.excluded_items; @@excluded_items; end - - attr_reader :items, :name - def initialize(name, hash) - @items = hash["items"] - @name = name - end - - def to_lisp(allsubmenus, - deleteditems, - indent = 0, - thingy = ["(", ")"]) - - first = true; - - string = "" - separator_useless = true; - items.each do |uuid| - if deleteditems.index(uuid) - $stderr.puts "#{uuid} has been deleted!" - next - end - string += "\n" - string += " " * indent - string += (first ? thingy[0] : (" " * thingy[0].length)) - - submenu = allsubmenus[uuid] - snippet = TmSnippet::snippets_by_uid[uuid] - unimplemented = TmSnippet::unknown_substitutions["content"][uuid] - if submenu - str = "(yas/submenu " - string += str + "\"" + submenu.name + "\"" - string += submenu.to_lisp(allsubmenus, deleteditems, - indent + str.length + thingy[0].length) - elsif snippet and not unimplemented - string += ";; " + snippet.name + "\n" - string += " " * (indent + thingy[0].length) - string += "(yas/item \"" + uuid + "\")" - separator_useless = false; - elsif snippet and unimplemented - string += ";; Ignoring " + snippet.name + "\n" - string += " " * (indent + thingy[0].length) - string += "(yas/ignore-item \"" + uuid + "\")" - separator_useless = true; - elsif (uuid =~ /---------------------/) - string += "(yas/separator)" unless separator_useless - end - first = false; - end - string += ")" - string += thingy[1] - - return string - end - - def self.main_menu_to_lisp (parsed_plist, modename) - mainmenu = parsed_plist["mainMenu"] - deleted = parsed_plist["deleted"] - - root = TmSubmenu.new("__main_menu__", mainmenu) - all = {} - - mainmenu["submenus"].each_pair do |k,v| - all[k] = TmSubmenu.new(v["name"], v) - end - - excluded = mainmenu["excludedItems"] + TmSubmenu::excluded_items - closing = "\n '(" - closing+= excluded.collect do |uuid| - "\"" + uuid + "\"" - end.join( "\n ") + "))" - - str = "(yas/define-menu " - return str + "'#{modename}" + root.to_lisp(all, - deleted, - str.length, - ["'(" , closing]) - end -end - - -# Represents a textmate snippet -# -# - @file is the .tmsnippet/.plist file path relative to cwd -# -# - optional @info is a Plist.parsed info.plist found in the bundle dir -# -# - @@snippets_by_uid is where one can find all the snippets parsed so -# far. -# -# -class SkipSnippet < RuntimeError; end -class TmSnippet - @@known_substitutions = { - "content" => { - "${TM_RAILS_TEMPLATE_START_RUBY_EXPR}" => "<%= ", - "${TM_RAILS_TEMPLATE_END_RUBY_EXPR}" => " %>", - "${TM_RAILS_TEMPLATE_START_RUBY_INLINE}" => "<% ", - "${TM_RAILS_TEMPLATE_END_RUBY_INLINE}" => " -%>", - "${TM_RAILS_TEMPLATE_END_RUBY_BLOCK}" => "end" , - "${0:$TM_SELECTED_TEXT}" => "${0:`yas/selected-text`}", - /\$\{(\d+)\}/ => "$\\1", - "${1:$TM_SELECTED_TEXT}" => "${1:`yas/selected-text`}", - "${2:$TM_SELECTED_TEXT}" => "${2:`yas/selected-text`}", - '$TM_SELECTED_TEXT' => "`yas/selected-text`", - %r'\$\{TM_SELECTED_TEXT:([^\}]*)\}' => "`(or (yas/selected-text) \"\\1\")`", - %r'`[^`]+\n[^`]`' => Proc.new {|uuid, match| "(yas/multi-line-unknown " + uuid + ")"}}, - "condition" => { - /^source\..*$/ => "" }, - "binding" => {}, - "type" => {} - } - - def self.extra_substitutions; @@extra_substitutions; end - @@extra_substitutions = { - "content" => {}, - "condition" => {}, - "binding" => {}, - "type" => {} - } - - def self.unknown_substitutions; @@unknown_substitutions; end - @@unknown_substitutions = { - "content" => {}, - "condition" => {}, - "binding" => {}, - "type" => {} - } - - @@snippets_by_uid={} - def self.snippets_by_uid; @@snippets_by_uid; end - - def initialize(file,info=nil) - @file = file - @info = info - @snippet = TmSnippet::read_plist(file) - @@snippets_by_uid[self.uuid] = self; - raise SkipSnippet.new "not a snippet/command/macro." unless (@snippet["scope"] || @snippet["command"]) - raise SkipSnippet.new "looks like preferences."if @file =~ /Preferences\// - raise RuntimeError.new("Cannot convert this snippet #{file}!") unless @snippet; - end - - def name - @snippet["name"] - end - - def uuid - @snippet["uuid"] - end - - def key - @snippet["tabTrigger"] - end - - def condition - yas_directive "condition" - end - - def type - override = yas_directive "type" - if override - return override - else - return "# type: command\n" if @file =~ /(Commands\/|Macros\/)/ - end - end - - def binding - yas_directive "binding" - end - - def content - known = @@known_substitutions["content"] - extra = @@extra_substitutions["content"] - if direct = extra[uuid] - return direct - else - ct = @snippet["content"] - if ct - known.each_pair do |k,v| - if v.respond_to? :call - ct.gsub!(k) {|match| v.call(uuid, match)} - else - ct.gsub!(k,v) - end - end - extra.each_pair do |k,v| - ct.gsub!(k,v) - end - # the remaining stuff is an unknown substitution - # - [ %r'\$\{ [^/\}\{:]* / [^/]* / [^/]* / [^\}]*\}'x , - %r'\$\{[^\d][^}]+\}', - %r'`[^`]+`', - %r'\$TM_[\w_]+', - %r'\(yas/multi-line-unknown [^\)]*\)' - ].each do |reg| - ct.scan(reg) do |match| - @@unknown_substitutions["content"][match] = self - end - end - return ct - else - @@unknown_substitutions["content"][uuid] = self - TmSubmenu::excluded_items.push(uuid) - return "(yas/unimplemented)" - end - end - end - - def to_yas - doc = "# -*- mode: snippet -*-\n" - doc << (self.type || "") - doc << "# uuid: #{self.uuid}\n" - doc << "# key: #{self.key}\n" if self.key - doc << "# contributor: Translated from textmate snippet by PROGRAM_NAME\n" - doc << "# name: #{self.name}\n" - doc << (self.binding || "") - doc << (self.condition || "") - doc << "# --\n" - doc << (self.content || "(yas/unimplemented)") - doc - end - - def self.canonicalize(filename) - invalid_char = /[^ a-z_0-9.+=~(){}\/'`&#,-]/i - - filename. - gsub(invalid_char, ''). # remove invalid characters - gsub(/ {2,}/,' '). # squeeze repeated spaces into a single one - rstrip # remove trailing whitespaces - end - - def yas_file() - File.join(TmSnippet::canonicalize(@file[0, @file.length-File.extname(@file).length]) + ".yasnippet") - end - - def self.read_plist(xml_or_binary) - begin - parsed = Plist::parse_xml(xml_or_binary) - return parsed if parsed - raise ArgumentError.new "Probably in binary format and parse_xml is very quiet..." - rescue StandardError => e - if (system "plutil -convert xml1 #{xml_or_binary.shellescape} -o /tmp/textmate_import.tmpxml") - return Plist::parse_xml("/tmp/textmate_import.tmpxml") - else - raise RuntimeError.new "plutil failed miserably, check if you have it..." - end - end - end - - private - - @@yas_to_tm_directives = {"condition" => "scope", "binding" => "keyEquivalent", "key" => "tabTrigger"} - def yas_directive(yas_directive) - # - # Merge "known" hardcoded substitution with "extra" substitutions - # provided in the .yas-setup.el file. - # - merged = @@known_substitutions[yas_directive]. - merge(@@extra_substitutions[yas_directive]) - # - # First look for an uuid-based direct substitution for this - # directive. - # - if direct = merged[uuid] - return "# #{yas_directive}: "+ direct + "\n" unless direct.empty? - else - tm_directive = @@yas_to_tm_directives[yas_directive] - val = tm_directive && @snippet[tm_directive] - if val and !val.delete(" ").empty? then - # - # Sort merged substitutions by length (bigger ones first, - # regexps last), and apply them to the value gotten for plist. - # - merged.sort_by do |what, with| - if what.respond_to? :length then -what.length else 0 end - end.each do |sub| - if val.gsub!(sub[0],sub[1]) - return "# #{yas_directive}: "+ val + "\n" unless val.empty? - end - end - # - # If we get here, no substitution matched, so mark this an - # unknown substitution. - # - @@unknown_substitutions[yas_directive][val] = self - return "## #{yas_directive}: \""+ val + "\n" - end - end - end - -end - - -if $0 == __FILE__ - # Read the the bundle's info.plist if can find it/guess it - # - info_plist_file = Choice.choices.info_plist || File.join(Choice.choices.bundle_dir,"info.plist") - info_plist = TmSnippet::read_plist(info_plist_file) if info_plist_file and File.readable? info_plist_file; - - # Calculate the mode name - # - modename = File.basename Choice.choices.output_dir || "major-mode-name" - - # Read in .yas-setup.el looking for the separator between auto-generated - # - original_dir = Dir.pwd - yas_setup_el_file = File.join(original_dir, Choice.choices.output_dir, ".yas-setup.el") - separator = ";; --**--" - whole, head , tail = "", "", "" - if File::exists? yas_setup_el_file - File.open yas_setup_el_file, 'r' do |file| - whole = file.read - head , tail = whole.split(separator) - end - else - head = ";; .yas-setup.el for #{modename}\n" + ";; \n" - end - - # Now iterate the tail part to find extra substitutions - # - tail ||= "" - head ||= "" - directive = nil - # puts "get this head #{head}" - head.each_line do |line| - case line - when /^;; Substitutions for:(.*)$/ - directive = $~[1].strip - # puts "found the directove #{directive}" - when /^;;(.*)[ ]+=yyas>(.*)$/ - replacewith = $~[2].strip - lookfor = $~[1] - lookfor.gsub!(/^[ ]*/, "") - lookfor.gsub!(/[ ]*$/, "") - # puts "found this wonderful substitution for #{directive} which is #{lookfor} => #{replacewith}" - unless !directive or replacewith =~ /yas\/unknown/ then - TmSnippet.extra_substitutions[directive][lookfor] = replacewith - end - end - end - - # Glob snippets into snippet_files, going into subdirs - # - Dir.chdir Choice.choices.bundle_dir - snippet_files_glob = File.join("**", Choice.choices.snippet) - snippet_files = Dir.glob(snippet_files_glob) - - # Attempt to convert each snippet files in snippet_files - # - puts "Will try to convert #{snippet_files.length} snippets...\n" unless Choice.choices.quiet - - - # Iterate the globbed files - # - snippet_files.each do |file| - begin - puts "Processing \"#{File.join(Choice.choices.bundle_dir,file)}\"\n" unless Choice.choices.quiet - snippet = TmSnippet.new(file,info_plist) - - if - file_to_create = File.join(original_dir, Choice.choices.output_dir, snippet.yas_file) - FileUtils.mkdir_p(File.dirname(file_to_create)) - File.open(file_to_create, 'w') do |f| - f.write(snippet.to_yas) - end - else - if Choice.choices.print_pretty - puts "--------------------------------------------" - end - puts snippet.to_yas if Choice.choices.print_pretty or not Choice.choices.info_plist - if Choice.choices.print_pretty - puts "--------------------------------------------\n\n" - end - end - rescue SkipSnippet => e - $stdout.puts "Skipping \"#{file}\": #{e.message}" - rescue RuntimeError => e - $stderr.puts "Oops.... \"#{file}\": #{e.message}" - $strerr.puts "#{e.backtrace.join("\n")}" unless Choice.choices.quiet - end - end - - # Attempt to decypher the menu - # - menustr = TmSubmenu::main_menu_to_lisp(info_plist, modename) if info_plist - puts menustr if $DEBUG - - # Write some basic .yas-* files - # - if Choice.choices.output_dir - FileUtils.mkdir_p Choice.choices.output_dir - FileUtils.touch File.join(original_dir, Choice.choices.output_dir, ".yas-make-groups") unless menustr - FileUtils.touch File.join(original_dir, Choice.choices.output_dir, ".yas-ignore-filenames-as-triggers") - - # Now, output head + a new tail in (possibly new) .yas-setup.el - # file - # - File.open yas_setup_el_file, 'w' do |file| - file.puts head - file.puts separator - file.puts ";; Automatically generated code, do not edit this part" - file.puts ";; " - file.puts ";; Translated menu" - file.puts ";; " - file.puts menustr - file.puts - file.puts ";; Unknown substitutions" - file.puts ";; " - ["content", "condition", "binding"].each do |type| - file.puts ";; Substitutions for: #{type}" - file.puts ";; " - # TmSnippet::extra_substitutions[type]. - # each_pair do |k,v| - # file.puts ";; " + k + "" + (" " * [1, 90-k.length].max) + " =yyas> " + v - # end - unknown = TmSnippet::unknown_substitutions[type]; - unknown.keys.uniq.each do |k| - file.puts ";; # as in " + unknown[k].yas_file - file.puts ";; " + k + "" + (" " * [1, 90-k.length].max) + " =yyas> (yas/unknown)" - file.puts ";; " - end - file.puts ";; " - file.puts - end - file.puts ";; .yas-setup.el for #{modename} ends here" - end - end -end diff --git a/extensions/yasnippet/snippets/c++-mode/.yas-parents b/extensions/yasnippet/snippets/c++-mode/.yas-parents deleted file mode 100644 index ce9828b..0000000 --- a/extensions/yasnippet/snippets/c++-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -cc-mode diff --git a/extensions/yasnippet/snippets/c++-mode/beginend b/extensions/yasnippet/snippets/c++-mode/beginend deleted file mode 100644 index 68303e2..0000000 --- a/extensions/yasnippet/snippets/c++-mode/beginend +++ /dev/null @@ -1,3 +0,0 @@ -#name : v.begin(), v.end() -# -- -${1:v}.begin(), $1.end \ No newline at end of file diff --git a/extensions/yasnippet/snippets/c++-mode/class b/extensions/yasnippet/snippets/c++-mode/class deleted file mode 100644 index 820fc6c..0000000 --- a/extensions/yasnippet/snippets/c++-mode/class +++ /dev/null @@ -1,8 +0,0 @@ -#name : class ... { ... } -# -- -class ${1:Name} -{ -public: - ${1:$(yas/substr text "[^: ]*")}($2); - virtual ~${1:$(yas/substr text "[^: ]*")}(); -}; \ No newline at end of file diff --git a/extensions/yasnippet/snippets/c++-mode/ns b/extensions/yasnippet/snippets/c++-mode/ns deleted file mode 100644 index 0c2513f..0000000 --- a/extensions/yasnippet/snippets/c++-mode/ns +++ /dev/null @@ -1,3 +0,0 @@ -#name : namespace ... -# -- -namespace \ No newline at end of file diff --git a/extensions/yasnippet/snippets/c++-mode/template b/extensions/yasnippet/snippets/c++-mode/template deleted file mode 100644 index 7e50616..0000000 --- a/extensions/yasnippet/snippets/c++-mode/template +++ /dev/null @@ -1,3 +0,0 @@ -#name : template -# -- -template \ No newline at end of file diff --git a/extensions/yasnippet/snippets/c++-mode/using b/extensions/yasnippet/snippets/c++-mode/using deleted file mode 100644 index 13d0f5d..0000000 --- a/extensions/yasnippet/snippets/c++-mode/using +++ /dev/null @@ -1,4 +0,0 @@ -#name : using namespace ... -# -- -using namespace ${std}; -$0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/c-mode/.yas-parents b/extensions/yasnippet/snippets/c-mode/.yas-parents deleted file mode 100644 index ce9828b..0000000 --- a/extensions/yasnippet/snippets/c-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -cc-mode diff --git a/extensions/yasnippet/snippets/c-mode/fopen b/extensions/yasnippet/snippets/c-mode/fopen deleted file mode 100644 index 044c743..0000000 --- a/extensions/yasnippet/snippets/c-mode/fopen +++ /dev/null @@ -1,3 +0,0 @@ -#name : FILE *fp = fopen(..., ...); -# -- -FILE *${fp} = fopen(${"file"}, "${r}"); diff --git a/extensions/yasnippet/snippets/c-mode/printf b/extensions/yasnippet/snippets/c-mode/printf deleted file mode 100644 index 055461d..0000000 --- a/extensions/yasnippet/snippets/c-mode/printf +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -# name : printf -# contributor : joaotavora -# -- -printf ("${1:%s}\\n"${1:$(if (string-match "%" text) "," "\);") -}$2${1:$(if (string-match "%" text) "\);" "")} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/cc-mode/.yas-parents b/extensions/yasnippet/snippets/cc-mode/.yas-parents deleted file mode 100644 index eed5b44..0000000 --- a/extensions/yasnippet/snippets/cc-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -text-mode diff --git a/extensions/yasnippet/snippets/cc-mode/do b/extensions/yasnippet/snippets/cc-mode/do deleted file mode 100644 index 5f7a313..0000000 --- a/extensions/yasnippet/snippets/cc-mode/do +++ /dev/null @@ -1,6 +0,0 @@ -#name : do { ... } while (...) -# -- -do -{ - $0 -} while (${1:condition}); \ No newline at end of file diff --git a/extensions/yasnippet/snippets/cc-mode/for b/extensions/yasnippet/snippets/cc-mode/for deleted file mode 100644 index c4cade6..0000000 --- a/extensions/yasnippet/snippets/cc-mode/for +++ /dev/null @@ -1,6 +0,0 @@ -#name : for (...; ...; ...) { ... } -# -- -for (${1:int i = 0}; ${2:i < N}; ${3:++i}) -{ - $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/cc-mode/if b/extensions/yasnippet/snippets/cc-mode/if deleted file mode 100644 index c3fe10d..0000000 --- a/extensions/yasnippet/snippets/cc-mode/if +++ /dev/null @@ -1,6 +0,0 @@ -#name : if (...) { ... } -# -- -if (${1:condition}) -{ - $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/cc-mode/inc b/extensions/yasnippet/snippets/cc-mode/inc deleted file mode 100644 index ae33328..0000000 --- a/extensions/yasnippet/snippets/cc-mode/inc +++ /dev/null @@ -1,3 +0,0 @@ -#name : #include "..." -# -- -#include "$1" diff --git a/extensions/yasnippet/snippets/cc-mode/inc.1 b/extensions/yasnippet/snippets/cc-mode/inc.1 deleted file mode 100644 index 66326cd..0000000 --- a/extensions/yasnippet/snippets/cc-mode/inc.1 +++ /dev/null @@ -1,3 +0,0 @@ -#name : #include <...> -# -- -#include <$1> diff --git a/extensions/yasnippet/snippets/cc-mode/main b/extensions/yasnippet/snippets/cc-mode/main deleted file mode 100644 index 9249049..0000000 --- a/extensions/yasnippet/snippets/cc-mode/main +++ /dev/null @@ -1,7 +0,0 @@ -#name: int main(argc, argv) { ... } -# -- -int main(int argc, char *argv[]) -{ - $0 - return 0; -} diff --git a/extensions/yasnippet/snippets/cc-mode/once b/extensions/yasnippet/snippets/cc-mode/once deleted file mode 100644 index 1b63c39..0000000 --- a/extensions/yasnippet/snippets/cc-mode/once +++ /dev/null @@ -1,8 +0,0 @@ -#name : #ifndef XXX; #define XXX; #endif -# -- -#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/extensions/yasnippet/snippets/cc-mode/struct b/extensions/yasnippet/snippets/cc-mode/struct deleted file mode 100644 index f50dabf..0000000 --- a/extensions/yasnippet/snippets/cc-mode/struct +++ /dev/null @@ -1,6 +0,0 @@ -#name : struct ... { ... } -# -- -struct ${1:name} -{ - $0 -}; \ No newline at end of file diff --git a/extensions/yasnippet/snippets/cperl-mode/.yas-parents b/extensions/yasnippet/snippets/cperl-mode/.yas-parents deleted file mode 100644 index bfa2993..0000000 --- a/extensions/yasnippet/snippets/cperl-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -perl-mode diff --git a/extensions/yasnippet/snippets/csharp-mode/.yas-parents b/extensions/yasnippet/snippets/csharp-mode/.yas-parents deleted file mode 100644 index ce9828b..0000000 --- a/extensions/yasnippet/snippets/csharp-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -cc-mode diff --git a/extensions/yasnippet/snippets/csharp-mode/attrib b/extensions/yasnippet/snippets/csharp-mode/attrib deleted file mode 100644 index 9e14e22..0000000 --- a/extensions/yasnippet/snippets/csharp-mode/attrib +++ /dev/null @@ -1,7 +0,0 @@ -#contributor : Alejandro Espinoza Esparza -#name : private attribute ....; -# -- -/// -/// $3 -/// -private $1 $2; diff --git a/extensions/yasnippet/snippets/csharp-mode/attrib.1 b/extensions/yasnippet/snippets/csharp-mode/attrib.1 deleted file mode 100644 index 099cc7b..0000000 --- a/extensions/yasnippet/snippets/csharp-mode/attrib.1 +++ /dev/null @@ -1,21 +0,0 @@ -#contributor : Alejandro Espinoza Esparza -#name : private attribute ....; public property ... ... { ... } -# -- -/// -/// $3 -/// -private $1 $2; - -/// -/// $4 -/// -/// $5 -public $1 $2 -{ - get { - return this.$2; - } - set { - this.$2 = value; - } -} diff --git a/extensions/yasnippet/snippets/csharp-mode/attrib.2 b/extensions/yasnippet/snippets/csharp-mode/attrib.2 deleted file mode 100644 index 566eacf..0000000 --- a/extensions/yasnippet/snippets/csharp-mode/attrib.2 +++ /dev/null @@ -1,21 +0,0 @@ -#contributor : Alejandro Espinoza Esparza -#name : private _attribute ....; public Property ... ... { ... } -# -- -/// -/// $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; - } -} diff --git a/extensions/yasnippet/snippets/csharp-mode/class b/extensions/yasnippet/snippets/csharp-mode/class deleted file mode 100644 index 1cce2e8..0000000 --- a/extensions/yasnippet/snippets/csharp-mode/class +++ /dev/null @@ -1,21 +0,0 @@ -#contributor : Alejandro Espinoza Esparza -#name : class ... { ... } -# -- -${5:public} class ${1:Name} -{ - #region Ctor & Destructor - /// - /// ${3:Standard Constructor} - /// - public $1($2) - { - } - - /// - /// ${4:Default Destructor} - /// - public ~$1() - { - } - #endregion -} diff --git a/extensions/yasnippet/snippets/csharp-mode/comment b/extensions/yasnippet/snippets/csharp-mode/comment deleted file mode 100644 index 3bd20d3..0000000 --- a/extensions/yasnippet/snippets/csharp-mode/comment +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Alejandro Espinoza Esparza -#name : /// ... -# -- -/// -/// $1 -/// diff --git a/extensions/yasnippet/snippets/csharp-mode/comment.1 b/extensions/yasnippet/snippets/csharp-mode/comment.1 deleted file mode 100644 index 3c14ad9..0000000 --- a/extensions/yasnippet/snippets/csharp-mode/comment.1 +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Alejandro Espinoza Esparza -#name : /// ... -# -- -/// $2 diff --git a/extensions/yasnippet/snippets/csharp-mode/comment.2 b/extensions/yasnippet/snippets/csharp-mode/comment.2 deleted file mode 100644 index 63a6a20..0000000 --- a/extensions/yasnippet/snippets/csharp-mode/comment.2 +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Alejandro Espinoza Esparza -#name : /// ... -# -- -/// $1 diff --git a/extensions/yasnippet/snippets/csharp-mode/comment.3 b/extensions/yasnippet/snippets/csharp-mode/comment.3 deleted file mode 100644 index 394c323..0000000 --- a/extensions/yasnippet/snippets/csharp-mode/comment.3 +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Alejandro Espinoza Esparza -#name : /// ... -# -- -/// $2 diff --git a/extensions/yasnippet/snippets/csharp-mode/method b/extensions/yasnippet/snippets/csharp-mode/method deleted file mode 100644 index e9a5906..0000000 --- a/extensions/yasnippet/snippets/csharp-mode/method +++ /dev/null @@ -1,10 +0,0 @@ -#contributor : Alejandro Espinoza Esparza -#name : public void Method { ... } -# -- -/// -/// ${5:Description} -/// ${2:$(if (string= (upcase text) "VOID") "" (format "%s%s%s" "\n/// " text ""))} -${1:public} ${2:void} ${3:MethodName}($4) -{ -$0 -} diff --git a/extensions/yasnippet/snippets/csharp-mode/namespace b/extensions/yasnippet/snippets/csharp-mode/namespace deleted file mode 100644 index af7c928..0000000 --- a/extensions/yasnippet/snippets/csharp-mode/namespace +++ /dev/null @@ -1,7 +0,0 @@ -#contributor : Alejandro Espinoza Esparza -#name : namespace .. { ... } -# -- -namespace $1 -{ -$0 -} diff --git a/extensions/yasnippet/snippets/csharp-mode/prop b/extensions/yasnippet/snippets/csharp-mode/prop deleted file mode 100644 index df9df91..0000000 --- a/extensions/yasnippet/snippets/csharp-mode/prop +++ /dev/null @@ -1,16 +0,0 @@ -#contributor : Alejandro Espinoza Esparza -#name : property ... ... { ... } -# -- -/// -/// $5 -/// -/// $6 -$1 $2 $3 -{ - get { - return this.$4; - } - set { - this.$4 = value; - } -} diff --git a/extensions/yasnippet/snippets/csharp-mode/region b/extensions/yasnippet/snippets/csharp-mode/region deleted file mode 100644 index 83f9a24..0000000 --- a/extensions/yasnippet/snippets/csharp-mode/region +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Alejandro Espinoza Esparza -#name : #region ... #endregion -# -- -#region $1 -$0 -#endregion diff --git a/extensions/yasnippet/snippets/csharp-mode/using b/extensions/yasnippet/snippets/csharp-mode/using deleted file mode 100644 index 704637e..0000000 --- a/extensions/yasnippet/snippets/csharp-mode/using +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Alejandro Espinoza Esparza -#name : using ...; -# -- -using $1; diff --git a/extensions/yasnippet/snippets/csharp-mode/using.1 b/extensions/yasnippet/snippets/csharp-mode/using.1 deleted file mode 100644 index e9f0bb0..0000000 --- a/extensions/yasnippet/snippets/csharp-mode/using.1 +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Alejandro Espinoza Esparza -#name : using System; -# -- -using System; diff --git a/extensions/yasnippet/snippets/csharp-mode/using.2 b/extensions/yasnippet/snippets/csharp-mode/using.2 deleted file mode 100644 index 0a3c07d..0000000 --- a/extensions/yasnippet/snippets/csharp-mode/using.2 +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Alejandro Espinoza Esparza -#name : using System....; -# -- -using System.$1; diff --git a/extensions/yasnippet/snippets/css-mode/.yas-parents b/extensions/yasnippet/snippets/css-mode/.yas-parents deleted file mode 100644 index eed5b44..0000000 --- a/extensions/yasnippet/snippets/css-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -text-mode diff --git a/extensions/yasnippet/snippets/css-mode/bg b/extensions/yasnippet/snippets/css-mode/bg deleted file mode 100644 index d731807..0000000 --- a/extensions/yasnippet/snippets/css-mode/bg +++ /dev/null @@ -1,3 +0,0 @@ -#name : background-color: ... -# -- -background-color: #${1:DDD}; \ No newline at end of file diff --git a/extensions/yasnippet/snippets/css-mode/bg.1 b/extensions/yasnippet/snippets/css-mode/bg.1 deleted file mode 100644 index d31f540..0000000 --- a/extensions/yasnippet/snippets/css-mode/bg.1 +++ /dev/null @@ -1,3 +0,0 @@ -#name : background-image: ... -# -- -background-image: url($1); \ No newline at end of file diff --git a/extensions/yasnippet/snippets/css-mode/bor b/extensions/yasnippet/snippets/css-mode/bor deleted file mode 100644 index eb3a2b4..0000000 --- a/extensions/yasnippet/snippets/css-mode/bor +++ /dev/null @@ -1,3 +0,0 @@ -#name : border size style color -# -- -border: ${1:1px} ${2:solid} #${3:999}; \ No newline at end of file diff --git a/extensions/yasnippet/snippets/css-mode/cl b/extensions/yasnippet/snippets/css-mode/cl deleted file mode 100644 index 4fc7a8d..0000000 --- a/extensions/yasnippet/snippets/css-mode/cl +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : rejeep -#name : clear: ... -# -- -clear: $1; diff --git a/extensions/yasnippet/snippets/css-mode/disp.block b/extensions/yasnippet/snippets/css-mode/disp.block deleted file mode 100644 index f74ea3c..0000000 --- a/extensions/yasnippet/snippets/css-mode/disp.block +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : rejeep -#name : display: block -# -- -display: block; diff --git a/extensions/yasnippet/snippets/css-mode/disp.inline b/extensions/yasnippet/snippets/css-mode/disp.inline deleted file mode 100644 index 30275a8..0000000 --- a/extensions/yasnippet/snippets/css-mode/disp.inline +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : rejeep -#name : display: inline -# -- -display: inline; diff --git a/extensions/yasnippet/snippets/css-mode/disp.none b/extensions/yasnippet/snippets/css-mode/disp.none deleted file mode 100644 index 80632a5..0000000 --- a/extensions/yasnippet/snippets/css-mode/disp.none +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : rejeep -#name : display: none -# -- -display: none; diff --git a/extensions/yasnippet/snippets/css-mode/ff b/extensions/yasnippet/snippets/css-mode/ff deleted file mode 100644 index a7352cf..0000000 --- a/extensions/yasnippet/snippets/css-mode/ff +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : rejeep -#name : font-family: ... -# -- -font-family: $1; diff --git a/extensions/yasnippet/snippets/css-mode/fs b/extensions/yasnippet/snippets/css-mode/fs deleted file mode 100644 index c28cdbb..0000000 --- a/extensions/yasnippet/snippets/css-mode/fs +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : rejeep -#name : font-size: ... -# -- -font-size: ${12px}; diff --git a/extensions/yasnippet/snippets/css-mode/mar.bottom b/extensions/yasnippet/snippets/css-mode/mar.bottom deleted file mode 100644 index 9672f60..0000000 --- a/extensions/yasnippet/snippets/css-mode/mar.bottom +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : rejeep -#name : margin-bottom: ... -# -- -margin-bottom: $1; diff --git a/extensions/yasnippet/snippets/css-mode/mar.left b/extensions/yasnippet/snippets/css-mode/mar.left deleted file mode 100644 index 414353e..0000000 --- a/extensions/yasnippet/snippets/css-mode/mar.left +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : rejeep -#name : margin-left: ... -# -- -margin-left: $1; diff --git a/extensions/yasnippet/snippets/css-mode/mar.mar b/extensions/yasnippet/snippets/css-mode/mar.mar deleted file mode 100644 index 13354db..0000000 --- a/extensions/yasnippet/snippets/css-mode/mar.mar +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : rejeep -#name : margin: ... -# -- -margin: $1; diff --git a/extensions/yasnippet/snippets/css-mode/mar.margin b/extensions/yasnippet/snippets/css-mode/mar.margin deleted file mode 100644 index 97de70c..0000000 --- a/extensions/yasnippet/snippets/css-mode/mar.margin +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : rejeep -#name : margin top right bottom left -# -- -margin: ${top} ${right} ${bottom} ${left}; diff --git a/extensions/yasnippet/snippets/css-mode/mar.right b/extensions/yasnippet/snippets/css-mode/mar.right deleted file mode 100644 index 47a4973..0000000 --- a/extensions/yasnippet/snippets/css-mode/mar.right +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : rejeep -#name : margin-right: ... -# -- -margin-right: $1; diff --git a/extensions/yasnippet/snippets/css-mode/mar.top b/extensions/yasnippet/snippets/css-mode/mar.top deleted file mode 100644 index c805754..0000000 --- a/extensions/yasnippet/snippets/css-mode/mar.top +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : rejeep -#name : margin-top: ... -# -- -margin-top: $1; diff --git a/extensions/yasnippet/snippets/css-mode/pad.bottom b/extensions/yasnippet/snippets/css-mode/pad.bottom deleted file mode 100644 index 3b9495e..0000000 --- a/extensions/yasnippet/snippets/css-mode/pad.bottom +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : rejeep -#name : padding-bottom: ... -# -- -padding-bottom: $1; diff --git a/extensions/yasnippet/snippets/css-mode/pad.left b/extensions/yasnippet/snippets/css-mode/pad.left deleted file mode 100644 index ecae515..0000000 --- a/extensions/yasnippet/snippets/css-mode/pad.left +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : rejeep -#name : padding-left: ... -# -- -padding-left: $1; diff --git a/extensions/yasnippet/snippets/css-mode/pad.pad b/extensions/yasnippet/snippets/css-mode/pad.pad deleted file mode 100644 index ee3a682..0000000 --- a/extensions/yasnippet/snippets/css-mode/pad.pad +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : rejeep -#name : padding: ... -# -- -padding: $1; diff --git a/extensions/yasnippet/snippets/css-mode/pad.padding b/extensions/yasnippet/snippets/css-mode/pad.padding deleted file mode 100644 index c1009d3..0000000 --- a/extensions/yasnippet/snippets/css-mode/pad.padding +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : rejeep -#name : padding: top right bottom left -# -- -padding: ${top} ${right} ${bottom} ${left}; diff --git a/extensions/yasnippet/snippets/css-mode/pad.right b/extensions/yasnippet/snippets/css-mode/pad.right deleted file mode 100644 index 98a9e12..0000000 --- a/extensions/yasnippet/snippets/css-mode/pad.right +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : rejeep -#name : padding-right: ... -# -- -padding-right: $1; diff --git a/extensions/yasnippet/snippets/css-mode/pad.top b/extensions/yasnippet/snippets/css-mode/pad.top deleted file mode 100644 index 34987f6..0000000 --- a/extensions/yasnippet/snippets/css-mode/pad.top +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : rejeep -#name : padding-top: ... -# -- -padding-top: $1; diff --git a/extensions/yasnippet/snippets/emacs-lisp-mode/.read_me b/extensions/yasnippet/snippets/emacs-lisp-mode/.read_me deleted file mode 100644 index 9e6e532..0000000 --- a/extensions/yasnippet/snippets/emacs-lisp-mode/.read_me +++ /dev/null @@ -1,11 +0,0 @@ -TITLE: Emacs Idiom Template Set. Version 1. 2009-02-22 - -DESCRIPTION: Some useful templates for emacs lisp. This template set is based on useful elisp idioms on common tasks. - -LICENSING: GPL version 3. - -AUTHOR: Xah Lee - -Home Page: latest version at: -• Emacs Lisp Idiom Templates - http://xahlee.org/emacs/elisp_idiom_templates.html diff --git a/extensions/yasnippet/snippets/emacs-lisp-mode/.yas-parents b/extensions/yasnippet/snippets/emacs-lisp-mode/.yas-parents deleted file mode 100644 index eed5b44..0000000 --- a/extensions/yasnippet/snippets/emacs-lisp-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -text-mode diff --git a/extensions/yasnippet/snippets/emacs-lisp-mode/defun b/extensions/yasnippet/snippets/emacs-lisp-mode/defun deleted file mode 100644 index 0105d20..0000000 --- a/extensions/yasnippet/snippets/emacs-lisp-mode/defun +++ /dev/null @@ -1,11 +0,0 @@ -#name : function template -#contributor : Xah Lee -# -- -(defun $1 () - "thisandthat." - (interactive) - (let (var1) - (setq var1 some) - $0 - ) -) \ No newline at end of file diff --git a/extensions/yasnippet/snippets/emacs-lisp-mode/dired.process_marked b/extensions/yasnippet/snippets/emacs-lisp-mode/dired.process_marked deleted file mode 100644 index 1b42597..0000000 --- a/extensions/yasnippet/snippets/emacs-lisp-mode/dired.process_marked +++ /dev/null @@ -1,16 +0,0 @@ -#name : process marked files in dired -#contributor : Xah Lee -# -- -;; 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 diff --git a/extensions/yasnippet/snippets/emacs-lisp-mode/file.process b/extensions/yasnippet/snippets/emacs-lisp-mode/file.process deleted file mode 100644 index abd1a33..0000000 --- a/extensions/yasnippet/snippets/emacs-lisp-mode/file.process +++ /dev/null @@ -1,17 +0,0 @@ -#name : a function that process a file -#contributor : Xah Lee -# -- -(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"))) diff --git a/extensions/yasnippet/snippets/emacs-lisp-mode/file.read-lines b/extensions/yasnippet/snippets/emacs-lisp-mode/file.read-lines deleted file mode 100644 index b4a1942..0000000 --- a/extensions/yasnippet/snippets/emacs-lisp-mode/file.read-lines +++ /dev/null @@ -1,17 +0,0 @@ -#name : read lines of a file -#contributor : Xah Lee -# -- -(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/extensions/yasnippet/snippets/emacs-lisp-mode/find-replace b/extensions/yasnippet/snippets/emacs-lisp-mode/find-replace deleted file mode 100644 index cefcf51..0000000 --- a/extensions/yasnippet/snippets/emacs-lisp-mode/find-replace +++ /dev/null @@ -1,17 +0,0 @@ -#name : find and replace on region -#contributor : Xah Lee -# -- -(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)) - ) - ) diff --git a/extensions/yasnippet/snippets/emacs-lisp-mode/grabstring b/extensions/yasnippet/snippets/emacs-lisp-mode/grabstring deleted file mode 100644 index 55600b1..0000000 --- a/extensions/yasnippet/snippets/emacs-lisp-mode/grabstring +++ /dev/null @@ -1,4 +0,0 @@ -#name : grab buffer substring -#contributor : Xah Lee -# -- -(setq $0 (buffer-substring-no-properties myStartPos myEndPos)) diff --git a/extensions/yasnippet/snippets/emacs-lisp-mode/grabthing b/extensions/yasnippet/snippets/emacs-lisp-mode/grabthing deleted file mode 100644 index 772b8dc..0000000 --- a/extensions/yasnippet/snippets/emacs-lisp-mode/grabthing +++ /dev/null @@ -1,4 +0,0 @@ -#name : grab word under cursor -#contributor : Xah Lee -# -- -(setq $0 (thing-at-point 'symbol)) diff --git a/extensions/yasnippet/snippets/emacs-lisp-mode/traverse_dir b/extensions/yasnippet/snippets/emacs-lisp-mode/traverse_dir deleted file mode 100644 index 2859cbd..0000000 --- a/extensions/yasnippet/snippets/emacs-lisp-mode/traverse_dir +++ /dev/null @@ -1,6 +0,0 @@ -#name : traversing a directory -#contributor : Xah Lee -# -- -;; apply a function to all files in a dir -(require 'find-lisp) -(mapc 'my-process-file (find-lisp-find-files "~/myweb/" "\\.html$")) diff --git a/extensions/yasnippet/snippets/emacs-lisp-mode/word-or-region b/extensions/yasnippet/snippets/emacs-lisp-mode/word-or-region deleted file mode 100644 index 66a59e4..0000000 --- a/extensions/yasnippet/snippets/emacs-lisp-mode/word-or-region +++ /dev/null @@ -1,27 +0,0 @@ -#name : Command that works on region or word -#contributor : Xah Lee -# -- -;; 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 - - ) -) diff --git a/extensions/yasnippet/snippets/erlang-mode/.yas-parents b/extensions/yasnippet/snippets/erlang-mode/.yas-parents deleted file mode 100644 index eed5b44..0000000 --- a/extensions/yasnippet/snippets/erlang-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -text-mode diff --git a/extensions/yasnippet/snippets/erlang-mode/after b/extensions/yasnippet/snippets/erlang-mode/after deleted file mode 100644 index 264e201..0000000 --- a/extensions/yasnippet/snippets/erlang-mode/after +++ /dev/null @@ -1,4 +0,0 @@ -#name : after ... -> -# -- -after - $1 -> $0 diff --git a/extensions/yasnippet/snippets/erlang-mode/begin b/extensions/yasnippet/snippets/erlang-mode/begin deleted file mode 100644 index 7b48494..0000000 --- a/extensions/yasnippet/snippets/erlang-mode/begin +++ /dev/null @@ -1,5 +0,0 @@ -#name : begin ... end -# -- -begin - $0 -end diff --git a/extensions/yasnippet/snippets/erlang-mode/beh b/extensions/yasnippet/snippets/erlang-mode/beh deleted file mode 100644 index 4975b26..0000000 --- a/extensions/yasnippet/snippets/erlang-mode/beh +++ /dev/null @@ -1,4 +0,0 @@ -#name : -behaviour(...). -# -- --behaviour(${1:gen_server}). -$0 diff --git a/extensions/yasnippet/snippets/erlang-mode/case b/extensions/yasnippet/snippets/erlang-mode/case deleted file mode 100644 index 5bed114..0000000 --- a/extensions/yasnippet/snippets/erlang-mode/case +++ /dev/null @@ -1,5 +0,0 @@ -#name : case ... of ... end -# -- -case $1 of - $0 -end diff --git a/extensions/yasnippet/snippets/erlang-mode/compile b/extensions/yasnippet/snippets/erlang-mode/compile deleted file mode 100644 index ae3a4d8..0000000 --- a/extensions/yasnippet/snippets/erlang-mode/compile +++ /dev/null @@ -1,4 +0,0 @@ -#name : -compile(...). -# -- --compile([${1:export_all}]). -$0 diff --git a/extensions/yasnippet/snippets/erlang-mode/def b/extensions/yasnippet/snippets/erlang-mode/def deleted file mode 100644 index 6fb92f1..0000000 --- a/extensions/yasnippet/snippets/erlang-mode/def +++ /dev/null @@ -1,4 +0,0 @@ -#name : -define(...,...). -# -- --define($1,$2). -$0 diff --git a/extensions/yasnippet/snippets/erlang-mode/exp b/extensions/yasnippet/snippets/erlang-mode/exp deleted file mode 100644 index 67f56da..0000000 --- a/extensions/yasnippet/snippets/erlang-mode/exp +++ /dev/null @@ -1,5 +0,0 @@ -#name : -export([]). -#contributor : hitesh -# -- --export([${1:start/0}]). -$0 diff --git a/extensions/yasnippet/snippets/erlang-mode/fun b/extensions/yasnippet/snippets/erlang-mode/fun deleted file mode 100644 index 77f8293..0000000 --- a/extensions/yasnippet/snippets/erlang-mode/fun +++ /dev/null @@ -1,3 +0,0 @@ -#name : fun (...) -> ... end -# -- -fun ($1) -> $0 end diff --git a/extensions/yasnippet/snippets/erlang-mode/if b/extensions/yasnippet/snippets/erlang-mode/if deleted file mode 100644 index 45674c4..0000000 --- a/extensions/yasnippet/snippets/erlang-mode/if +++ /dev/null @@ -1,6 +0,0 @@ -#name : if ... -> ... ; true -> ... end -# -- -if - $1 -> $2; - true -> $0 -end diff --git a/extensions/yasnippet/snippets/erlang-mode/ifdef b/extensions/yasnippet/snippets/erlang-mode/ifdef deleted file mode 100644 index ea89ecf..0000000 --- a/extensions/yasnippet/snippets/erlang-mode/ifdef +++ /dev/null @@ -1,5 +0,0 @@ -#name : -ifdef(...). ... -endif. -# -- --ifdef($1). -$0 --endif. diff --git a/extensions/yasnippet/snippets/erlang-mode/ifndef b/extensions/yasnippet/snippets/erlang-mode/ifndef deleted file mode 100644 index dcd67a7..0000000 --- a/extensions/yasnippet/snippets/erlang-mode/ifndef +++ /dev/null @@ -1,5 +0,0 @@ -#name : -ifndef(...). ... -endif. -# -- --ifndef($1). -$0 --endif. diff --git a/extensions/yasnippet/snippets/erlang-mode/imp b/extensions/yasnippet/snippets/erlang-mode/imp deleted file mode 100644 index c035ddd..0000000 --- a/extensions/yasnippet/snippets/erlang-mode/imp +++ /dev/null @@ -1,5 +0,0 @@ -#name : -import([]). -#contributor : hitesh -# -- --import(${1:lists}, [${2:map/2, sum/1}]). -$0 diff --git a/extensions/yasnippet/snippets/erlang-mode/inc b/extensions/yasnippet/snippets/erlang-mode/inc deleted file mode 100644 index f7b2161..0000000 --- a/extensions/yasnippet/snippets/erlang-mode/inc +++ /dev/null @@ -1,4 +0,0 @@ -#name : -include("..."). -# -- --include("$1"). -$0 diff --git a/extensions/yasnippet/snippets/erlang-mode/inc.lib b/extensions/yasnippet/snippets/erlang-mode/inc.lib deleted file mode 100644 index 09a6723..0000000 --- a/extensions/yasnippet/snippets/erlang-mode/inc.lib +++ /dev/null @@ -1,4 +0,0 @@ -#name : -include_lib("..."). -# -- --include_lib("$1"). -$0 diff --git a/extensions/yasnippet/snippets/erlang-mode/loop b/extensions/yasnippet/snippets/erlang-mode/loop deleted file mode 100644 index 0205802..0000000 --- a/extensions/yasnippet/snippets/erlang-mode/loop +++ /dev/null @@ -1,8 +0,0 @@ -#name : loop(...) -> receive _ -> loop(...) end. -# -- -${1:loop}($2) -> - receive - ${3:_} -> - $1($2) - end. -$0 diff --git a/extensions/yasnippet/snippets/erlang-mode/mod b/extensions/yasnippet/snippets/erlang-mode/mod deleted file mode 100644 index 7275d39..0000000 --- a/extensions/yasnippet/snippets/erlang-mode/mod +++ /dev/null @@ -1,6 +0,0 @@ -#name : -module(). -#contributor : hitesh -# -- --module(${1:`(file-name-nondirectory - (file-name-sans-extension (or (buffer-file-name) (buffer-name))))`}). -$0 diff --git a/extensions/yasnippet/snippets/erlang-mode/rcv b/extensions/yasnippet/snippets/erlang-mode/rcv deleted file mode 100644 index 804fb3f..0000000 --- a/extensions/yasnippet/snippets/erlang-mode/rcv +++ /dev/null @@ -1,5 +0,0 @@ -#name : receive ... -> ... end -# -- -receive - $1 -> $0 -end diff --git a/extensions/yasnippet/snippets/erlang-mode/rcv.after b/extensions/yasnippet/snippets/erlang-mode/rcv.after deleted file mode 100644 index 51046df..0000000 --- a/extensions/yasnippet/snippets/erlang-mode/rcv.after +++ /dev/null @@ -1,6 +0,0 @@ -#name : receive after ... -> ... end -# -- -receive -after - $1 -> $0 -end diff --git a/extensions/yasnippet/snippets/erlang-mode/rec b/extensions/yasnippet/snippets/erlang-mode/rec deleted file mode 100644 index 0d67834..0000000 --- a/extensions/yasnippet/snippets/erlang-mode/rec +++ /dev/null @@ -1,4 +0,0 @@ -#name : -record(...,{...}). -# -- --record($1,{$2}). -$0 diff --git a/extensions/yasnippet/snippets/erlang-mode/try b/extensions/yasnippet/snippets/erlang-mode/try deleted file mode 100644 index fa5c9c2..0000000 --- a/extensions/yasnippet/snippets/erlang-mode/try +++ /dev/null @@ -1,7 +0,0 @@ -#name : try ... of ... catch after end -# -- -try $1 of - $0 -catch -after -end diff --git a/extensions/yasnippet/snippets/erlang-mode/undef b/extensions/yasnippet/snippets/erlang-mode/undef deleted file mode 100644 index 7ab5dd4..0000000 --- a/extensions/yasnippet/snippets/erlang-mode/undef +++ /dev/null @@ -1,4 +0,0 @@ -#name : -undef(...). -# -- --undef($1). -$0 diff --git a/extensions/yasnippet/snippets/f90-mode/.yas-parents b/extensions/yasnippet/snippets/f90-mode/.yas-parents deleted file mode 100644 index eed5b44..0000000 --- a/extensions/yasnippet/snippets/f90-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -text-mode diff --git a/extensions/yasnippet/snippets/f90-mode/au b/extensions/yasnippet/snippets/f90-mode/au deleted file mode 100644 index 1f0af73..0000000 --- a/extensions/yasnippet/snippets/f90-mode/au +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu -#name : automatic -# -- -automatic $0 diff --git a/extensions/yasnippet/snippets/f90-mode/bd b/extensions/yasnippet/snippets/f90-mode/bd deleted file mode 100644 index 8840102..0000000 --- a/extensions/yasnippet/snippets/f90-mode/bd +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu -#name : block data -# -- -block data $0 diff --git a/extensions/yasnippet/snippets/f90-mode/c b/extensions/yasnippet/snippets/f90-mode/c deleted file mode 100644 index c7182e4..0000000 --- a/extensions/yasnippet/snippets/f90-mode/c +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu -#name : continue -# -- -continue $0 diff --git a/extensions/yasnippet/snippets/f90-mode/ch b/extensions/yasnippet/snippets/f90-mode/ch deleted file mode 100644 index 7e6b4cb..0000000 --- a/extensions/yasnippet/snippets/f90-mode/ch +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu -#name : character -# -- -character $0 diff --git a/extensions/yasnippet/snippets/f90-mode/cx b/extensions/yasnippet/snippets/f90-mode/cx deleted file mode 100644 index 8feb41e..0000000 --- a/extensions/yasnippet/snippets/f90-mode/cx +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu -#name : complex -# -- -complex $0 diff --git a/extensions/yasnippet/snippets/f90-mode/dc b/extensions/yasnippet/snippets/f90-mode/dc deleted file mode 100644 index 1992b1b..0000000 --- a/extensions/yasnippet/snippets/f90-mode/dc +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu -#name : double complex -# -- -double complex $0 diff --git a/extensions/yasnippet/snippets/f90-mode/do b/extensions/yasnippet/snippets/f90-mode/do deleted file mode 100644 index 2c117fd..0000000 --- a/extensions/yasnippet/snippets/f90-mode/do +++ /dev/null @@ -1,6 +0,0 @@ -#contributor: Li Zhu -#name : do while (...) end do -# -- -do while (${1:condition}) - $0 -end do diff --git a/extensions/yasnippet/snippets/f90-mode/dp b/extensions/yasnippet/snippets/f90-mode/dp deleted file mode 100644 index ad014b7..0000000 --- a/extensions/yasnippet/snippets/f90-mode/dp +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu -#name : double precision -# -- -double precision $0 diff --git a/extensions/yasnippet/snippets/f90-mode/eq b/extensions/yasnippet/snippets/f90-mode/eq deleted file mode 100644 index 0c6d09f..0000000 --- a/extensions/yasnippet/snippets/f90-mode/eq +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu -#name : equivalence -# -- -equivalence $0 diff --git a/extensions/yasnippet/snippets/f90-mode/ib b/extensions/yasnippet/snippets/f90-mode/ib deleted file mode 100644 index 9275a12..0000000 --- a/extensions/yasnippet/snippets/f90-mode/ib +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu -#name : implicit byte -# -- -implicit byte $0 diff --git a/extensions/yasnippet/snippets/f90-mode/ic b/extensions/yasnippet/snippets/f90-mode/ic deleted file mode 100644 index 79842ea..0000000 --- a/extensions/yasnippet/snippets/f90-mode/ic +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu -#name : implicit complex -# -- -implicit complex $0 diff --git a/extensions/yasnippet/snippets/f90-mode/ich b/extensions/yasnippet/snippets/f90-mode/ich deleted file mode 100644 index 53c7f81..0000000 --- a/extensions/yasnippet/snippets/f90-mode/ich +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu -#name : implicit character -# -- -implicit character $0 diff --git a/extensions/yasnippet/snippets/f90-mode/if b/extensions/yasnippet/snippets/f90-mode/if deleted file mode 100644 index b4fb526..0000000 --- a/extensions/yasnippet/snippets/f90-mode/if +++ /dev/null @@ -1,6 +0,0 @@ -#contributor: Li Zhu -#name : if then end if -# -- -if ( ${1:condition} ) then - $0 -end if diff --git a/extensions/yasnippet/snippets/f90-mode/ii b/extensions/yasnippet/snippets/f90-mode/ii deleted file mode 100644 index 4b1fee5..0000000 --- a/extensions/yasnippet/snippets/f90-mode/ii +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu -#name : implicit integer -# -- -implicit integer $0 diff --git a/extensions/yasnippet/snippets/f90-mode/il b/extensions/yasnippet/snippets/f90-mode/il deleted file mode 100644 index 8658af5..0000000 --- a/extensions/yasnippet/snippets/f90-mode/il +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu -#name : implicit logical -# -- -implicit logical $0 diff --git a/extensions/yasnippet/snippets/f90-mode/in b/extensions/yasnippet/snippets/f90-mode/in deleted file mode 100644 index 0c1d5e1..0000000 --- a/extensions/yasnippet/snippets/f90-mode/in +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu -#name : implicit none -# -- -implicit none diff --git a/extensions/yasnippet/snippets/f90-mode/inc b/extensions/yasnippet/snippets/f90-mode/inc deleted file mode 100644 index dd649c4..0000000 --- a/extensions/yasnippet/snippets/f90-mode/inc +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu -#name : include -# -- -include $0 diff --git a/extensions/yasnippet/snippets/f90-mode/intr b/extensions/yasnippet/snippets/f90-mode/intr deleted file mode 100644 index 147fffd..0000000 --- a/extensions/yasnippet/snippets/f90-mode/intr +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu -#name : intrinsic -# -- -intrinsic $0 diff --git a/extensions/yasnippet/snippets/f90-mode/ir b/extensions/yasnippet/snippets/f90-mode/ir deleted file mode 100644 index fb37082..0000000 --- a/extensions/yasnippet/snippets/f90-mode/ir +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu -#name : implicit real -# -- -implicit real $0 diff --git a/extensions/yasnippet/snippets/f90-mode/l b/extensions/yasnippet/snippets/f90-mode/l deleted file mode 100644 index 8605d69..0000000 --- a/extensions/yasnippet/snippets/f90-mode/l +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu -#name : logical -# -- -logical $0 diff --git a/extensions/yasnippet/snippets/f90-mode/pa b/extensions/yasnippet/snippets/f90-mode/pa deleted file mode 100644 index 1b1b503..0000000 --- a/extensions/yasnippet/snippets/f90-mode/pa +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu -#name : parameter -# -- -parameter $0 diff --git a/extensions/yasnippet/snippets/f90-mode/pr b/extensions/yasnippet/snippets/f90-mode/pr deleted file mode 100644 index e0f8baa..0000000 --- a/extensions/yasnippet/snippets/f90-mode/pr +++ /dev/null @@ -1,6 +0,0 @@ -#contributor: Li Zhu -#name : program ... end program ... -# -- -program ${1:name} - $0 -end program ${1:name} diff --git a/extensions/yasnippet/snippets/f90-mode/re b/extensions/yasnippet/snippets/f90-mode/re deleted file mode 100644 index 08c7ba0..0000000 --- a/extensions/yasnippet/snippets/f90-mode/re +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu -#name : read (*,*) -# -- -read (${1:*},${2:*}) $0 diff --git a/extensions/yasnippet/snippets/f90-mode/st b/extensions/yasnippet/snippets/f90-mode/st deleted file mode 100644 index 23ae7d0..0000000 --- a/extensions/yasnippet/snippets/f90-mode/st +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu -#name : structure -# -- -structure $0 diff --git a/extensions/yasnippet/snippets/f90-mode/su b/extensions/yasnippet/snippets/f90-mode/su deleted file mode 100644 index d3857b8..0000000 --- a/extensions/yasnippet/snippets/f90-mode/su +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu -#name : subroutine -# -- -subroutine $0 diff --git a/extensions/yasnippet/snippets/f90-mode/wr b/extensions/yasnippet/snippets/f90-mode/wr deleted file mode 100644 index 1ac3eb9..0000000 --- a/extensions/yasnippet/snippets/f90-mode/wr +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu -#name : write (*,*) -# -- -write (${1:*},${2:*}) $0 diff --git a/extensions/yasnippet/snippets/html-mode/.yas-make-groups b/extensions/yasnippet/snippets/html-mode/.yas-make-groups deleted file mode 100644 index e69de29..0000000 diff --git a/extensions/yasnippet/snippets/html-mode/.yas-parents b/extensions/yasnippet/snippets/html-mode/.yas-parents deleted file mode 100644 index eed5b44..0000000 --- a/extensions/yasnippet/snippets/html-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -text-mode diff --git a/extensions/yasnippet/snippets/html-mode/body b/extensions/yasnippet/snippets/html-mode/body deleted file mode 100644 index 3655775..0000000 --- a/extensions/yasnippet/snippets/html-mode/body +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Jimmy Wu -#name : ... -# -- - - $0 - \ No newline at end of file diff --git a/extensions/yasnippet/snippets/html-mode/br b/extensions/yasnippet/snippets/html-mode/br deleted file mode 100644 index 07c2d4a..0000000 --- a/extensions/yasnippet/snippets/html-mode/br +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Jimmy Wu -#name :
-# -- -
\ No newline at end of file diff --git a/extensions/yasnippet/snippets/html-mode/code b/extensions/yasnippet/snippets/html-mode/code deleted file mode 100644 index a5ad908..0000000 --- a/extensions/yasnippet/snippets/html-mode/code +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Jimmy Wu -#name : ... -# -- - - $0 - \ No newline at end of file diff --git a/extensions/yasnippet/snippets/html-mode/code.class b/extensions/yasnippet/snippets/html-mode/code.class deleted file mode 100644 index b910eb7..0000000 --- a/extensions/yasnippet/snippets/html-mode/code.class +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Jimmy Wu -#name : ... -# -- - - $0 - \ No newline at end of file diff --git a/extensions/yasnippet/snippets/html-mode/div b/extensions/yasnippet/snippets/html-mode/div deleted file mode 100644 index 1c9c0c8..0000000 --- a/extensions/yasnippet/snippets/html-mode/div +++ /dev/null @@ -1,3 +0,0 @@ -#name : ... -# -- -$0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/html-mode/div.class b/extensions/yasnippet/snippets/html-mode/div.class deleted file mode 100644 index 11c12d6..0000000 --- a/extensions/yasnippet/snippets/html-mode/div.class +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Jimmy Wu -#name :
...
-# -- -
- $0 -
\ No newline at end of file diff --git a/extensions/yasnippet/snippets/html-mode/div.id b/extensions/yasnippet/snippets/html-mode/div.id deleted file mode 100644 index cec25fb..0000000 --- a/extensions/yasnippet/snippets/html-mode/div.id +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Jimmy Wu -#name :
...
-# -- -
- $0 -
\ No newline at end of file diff --git a/extensions/yasnippet/snippets/html-mode/div.id-class b/extensions/yasnippet/snippets/html-mode/div.id-class deleted file mode 100644 index d5b1402..0000000 --- a/extensions/yasnippet/snippets/html-mode/div.id-class +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Jimmy Wu -#name :
...
-# -- -
- $0 -
\ No newline at end of file diff --git a/extensions/yasnippet/snippets/html-mode/dov b/extensions/yasnippet/snippets/html-mode/dov deleted file mode 100644 index e8341ea..0000000 --- a/extensions/yasnippet/snippets/html-mode/dov +++ /dev/null @@ -1,11 +0,0 @@ -#name : ... -# -- -a mirror up here $3 - - - - $0 - - - actually some other shit and $3 - diff --git a/extensions/yasnippet/snippets/html-mode/form b/extensions/yasnippet/snippets/html-mode/form deleted file mode 100644 index 043a59a..0000000 --- a/extensions/yasnippet/snippets/html-mode/form +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Jimmy Wu -#name :
-# -- -
- $0 -
\ No newline at end of file diff --git a/extensions/yasnippet/snippets/html-mode/head b/extensions/yasnippet/snippets/html-mode/head deleted file mode 100644 index 37ef1ad..0000000 --- a/extensions/yasnippet/snippets/html-mode/head +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Jimmy Wu -#name : ... -# -- - - $0 - \ No newline at end of file diff --git a/extensions/yasnippet/snippets/html-mode/header/h1 b/extensions/yasnippet/snippets/html-mode/header/h1 deleted file mode 100644 index dffe61e..0000000 --- a/extensions/yasnippet/snippets/html-mode/header/h1 +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Jimmy Wu -#name :

...

-# -- -

$1

diff --git a/extensions/yasnippet/snippets/html-mode/header/h2 b/extensions/yasnippet/snippets/html-mode/header/h2 deleted file mode 100644 index d785865..0000000 --- a/extensions/yasnippet/snippets/html-mode/header/h2 +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Jimmy Wu -#name :

...

-# -- -

$1

diff --git a/extensions/yasnippet/snippets/html-mode/header/h3 b/extensions/yasnippet/snippets/html-mode/header/h3 deleted file mode 100644 index 415261a..0000000 --- a/extensions/yasnippet/snippets/html-mode/header/h3 +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Jimmy Wu -#name :

...

-# -- -

$1

diff --git a/extensions/yasnippet/snippets/html-mode/header/h4 b/extensions/yasnippet/snippets/html-mode/header/h4 deleted file mode 100644 index 66ab06a..0000000 --- a/extensions/yasnippet/snippets/html-mode/header/h4 +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Jimmy Wu -#name :

...

-# -- -

$1

diff --git a/extensions/yasnippet/snippets/html-mode/header/h5 b/extensions/yasnippet/snippets/html-mode/header/h5 deleted file mode 100644 index 0c41b22..0000000 --- a/extensions/yasnippet/snippets/html-mode/header/h5 +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Jimmy Wu -#name :
...
-# -- -
$1
diff --git a/extensions/yasnippet/snippets/html-mode/header/h6 b/extensions/yasnippet/snippets/html-mode/header/h6 deleted file mode 100644 index 5670bc2..0000000 --- a/extensions/yasnippet/snippets/html-mode/header/h6 +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Jimmy Wu -#name :
...
-# -- -
$1
diff --git a/extensions/yasnippet/snippets/html-mode/hr b/extensions/yasnippet/snippets/html-mode/hr deleted file mode 100644 index 20e38b5..0000000 --- a/extensions/yasnippet/snippets/html-mode/hr +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Jimmy Wu -#name :
-# -- -
diff --git a/extensions/yasnippet/snippets/html-mode/href b/extensions/yasnippet/snippets/html-mode/href deleted file mode 100644 index 0425e6c..0000000 --- a/extensions/yasnippet/snippets/html-mode/href +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Jimmy Wu -#name : ... -# -- -$2 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/html-mode/html b/extensions/yasnippet/snippets/html-mode/html deleted file mode 100644 index 93a0ad7..0000000 --- a/extensions/yasnippet/snippets/html-mode/html +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Jimmy Wu -#name : ... -# -- - - $0 - diff --git a/extensions/yasnippet/snippets/html-mode/html.xmlns b/extensions/yasnippet/snippets/html-mode/html.xmlns deleted file mode 100644 index fd6adc8..0000000 --- a/extensions/yasnippet/snippets/html-mode/html.xmlns +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Jimmy Wu -#name : ... -# -- - - $0 - diff --git a/extensions/yasnippet/snippets/html-mode/img b/extensions/yasnippet/snippets/html-mode/img deleted file mode 100644 index 674b1dc..0000000 --- a/extensions/yasnippet/snippets/html-mode/img +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Jimmy Wu -#name : ... -# -- -$3 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/html-mode/input b/extensions/yasnippet/snippets/html-mode/input deleted file mode 100644 index 1ad74f8..0000000 --- a/extensions/yasnippet/snippets/html-mode/input +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Jimmy Wu -#name : -# -- - \ No newline at end of file diff --git a/extensions/yasnippet/snippets/html-mode/link.stylesheet b/extensions/yasnippet/snippets/html-mode/link.stylesheet deleted file mode 100644 index 0953396..0000000 --- a/extensions/yasnippet/snippets/html-mode/link.stylesheet +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Jimmy Wu -#name : -# -- - \ No newline at end of file diff --git a/extensions/yasnippet/snippets/html-mode/link.stylesheet-ie b/extensions/yasnippet/snippets/html-mode/link.stylesheet-ie deleted file mode 100644 index 9cf9fec..0000000 --- a/extensions/yasnippet/snippets/html-mode/link.stylesheet-ie +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Jimmy Wu -#name : -# -- - \ No newline at end of file diff --git a/extensions/yasnippet/snippets/html-mode/list/dd b/extensions/yasnippet/snippets/html-mode/list/dd deleted file mode 100644 index e447d4a..0000000 --- a/extensions/yasnippet/snippets/html-mode/list/dd +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Rodrigo Setti -#name :
...
-# -- -
$1
diff --git a/extensions/yasnippet/snippets/html-mode/list/dl b/extensions/yasnippet/snippets/html-mode/list/dl deleted file mode 100644 index a75c875..0000000 --- a/extensions/yasnippet/snippets/html-mode/list/dl +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Rodrigo Setti -#name :
...
-# -- -
- $0 -
diff --git a/extensions/yasnippet/snippets/html-mode/list/dl.id b/extensions/yasnippet/snippets/html-mode/list/dl.id deleted file mode 100644 index 28a6d37..0000000 --- a/extensions/yasnippet/snippets/html-mode/list/dl.id +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Rodrigo Setti -#name :
...
-# -- -
- $0 -
diff --git a/extensions/yasnippet/snippets/html-mode/list/dt b/extensions/yasnippet/snippets/html-mode/list/dt deleted file mode 100644 index 024cce4..0000000 --- a/extensions/yasnippet/snippets/html-mode/list/dt +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Rodrigo Setti -#name :
...
-# -- -
$1
diff --git a/extensions/yasnippet/snippets/html-mode/list/li b/extensions/yasnippet/snippets/html-mode/list/li deleted file mode 100644 index a199ca3..0000000 --- a/extensions/yasnippet/snippets/html-mode/list/li +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Jimmy Wu -#name :
  • ...
  • -# -- -
  • $1
  • diff --git a/extensions/yasnippet/snippets/html-mode/list/li.class b/extensions/yasnippet/snippets/html-mode/list/li.class deleted file mode 100644 index 313f512..0000000 --- a/extensions/yasnippet/snippets/html-mode/list/li.class +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Jimmy Wu -#name :
  • ...
  • -# -- -
  • $2
  • diff --git a/extensions/yasnippet/snippets/html-mode/list/ol b/extensions/yasnippet/snippets/html-mode/list/ol deleted file mode 100644 index 74057c8..0000000 --- a/extensions/yasnippet/snippets/html-mode/list/ol +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Jimmy Wu -#name :
      ...
    -# -- -
      - $0 -
    diff --git a/extensions/yasnippet/snippets/html-mode/list/ol.class b/extensions/yasnippet/snippets/html-mode/list/ol.class deleted file mode 100644 index fc24485..0000000 --- a/extensions/yasnippet/snippets/html-mode/list/ol.class +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Jimmy Wu -#name :
      ...
    -# -- -
      - $0 -
    diff --git a/extensions/yasnippet/snippets/html-mode/list/ol.id b/extensions/yasnippet/snippets/html-mode/list/ol.id deleted file mode 100644 index f875ff2..0000000 --- a/extensions/yasnippet/snippets/html-mode/list/ol.id +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Jimmy Wu -#name :
      ...
    -# -- -
      - $0 -
    diff --git a/extensions/yasnippet/snippets/html-mode/list/ul b/extensions/yasnippet/snippets/html-mode/list/ul deleted file mode 100644 index 5c6aeb2..0000000 --- a/extensions/yasnippet/snippets/html-mode/list/ul +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Jimmy Wu -#name :
      ...
    -# -- -
      - $0 -
    diff --git a/extensions/yasnippet/snippets/html-mode/list/ul.class b/extensions/yasnippet/snippets/html-mode/list/ul.class deleted file mode 100644 index bc27649..0000000 --- a/extensions/yasnippet/snippets/html-mode/list/ul.class +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Jimmy Wu -#name :
      ...
    -# -- -
      - $0 -
    diff --git a/extensions/yasnippet/snippets/html-mode/list/ul.id b/extensions/yasnippet/snippets/html-mode/list/ul.id deleted file mode 100644 index c323e7a..0000000 --- a/extensions/yasnippet/snippets/html-mode/list/ul.id +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Jimmy Wu -#name :
      ...
    -# -- -
      - $0 -
    diff --git a/extensions/yasnippet/snippets/html-mode/mailto b/extensions/yasnippet/snippets/html-mode/mailto deleted file mode 100644 index b134f2c..0000000 --- a/extensions/yasnippet/snippets/html-mode/mailto +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Jimmy Wu -#name : ... -# -- -$0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/html-mode/meta/doctype b/extensions/yasnippet/snippets/html-mode/meta/doctype deleted file mode 100644 index 91e1109..0000000 --- a/extensions/yasnippet/snippets/html-mode/meta/doctype +++ /dev/null @@ -1,3 +0,0 @@ -#name : Doctype HTML 4.01 Strict -# -- - diff --git a/extensions/yasnippet/snippets/html-mode/meta/doctype.xhml1 b/extensions/yasnippet/snippets/html-mode/meta/doctype.xhml1 deleted file mode 100644 index 63781f8..0000000 --- a/extensions/yasnippet/snippets/html-mode/meta/doctype.xhml1 +++ /dev/null @@ -1,3 +0,0 @@ -#name : DocType XHTML 1.0 frameset -# -- - diff --git a/extensions/yasnippet/snippets/html-mode/meta/doctype.xhtml1_1 b/extensions/yasnippet/snippets/html-mode/meta/doctype.xhtml1_1 deleted file mode 100644 index deaca2f..0000000 --- a/extensions/yasnippet/snippets/html-mode/meta/doctype.xhtml1_1 +++ /dev/null @@ -1,3 +0,0 @@ -#name : DocType XHTML 1.1 -# -- - diff --git a/extensions/yasnippet/snippets/html-mode/meta/doctype.xhtml1_strict b/extensions/yasnippet/snippets/html-mode/meta/doctype.xhtml1_strict deleted file mode 100644 index 1db1c92..0000000 --- a/extensions/yasnippet/snippets/html-mode/meta/doctype.xhtml1_strict +++ /dev/null @@ -1,3 +0,0 @@ -#name : DocType XHTML 1.0 Strict -# -- - diff --git a/extensions/yasnippet/snippets/html-mode/meta/doctype.xhtml1_transitional b/extensions/yasnippet/snippets/html-mode/meta/doctype.xhtml1_transitional deleted file mode 100644 index e138ac4..0000000 --- a/extensions/yasnippet/snippets/html-mode/meta/doctype.xhtml1_transitional +++ /dev/null @@ -1,3 +0,0 @@ -#name : DocType XHTML 1.0 Transitional -# -- - diff --git a/extensions/yasnippet/snippets/html-mode/meta/meta b/extensions/yasnippet/snippets/html-mode/meta/meta deleted file mode 100644 index a4fd453..0000000 --- a/extensions/yasnippet/snippets/html-mode/meta/meta +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Jimmy Wu -#name : -# -- - diff --git a/extensions/yasnippet/snippets/html-mode/meta/meta.http-equiv b/extensions/yasnippet/snippets/html-mode/meta/meta.http-equiv deleted file mode 100644 index 947e7fb..0000000 --- a/extensions/yasnippet/snippets/html-mode/meta/meta.http-equiv +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Jimmy Wu -#name : -# -- - diff --git a/extensions/yasnippet/snippets/html-mode/p b/extensions/yasnippet/snippets/html-mode/p deleted file mode 100644 index 579cc76..0000000 --- a/extensions/yasnippet/snippets/html-mode/p +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Jimmy Wu -#name :

    ...

    -# -- -

    $1

    \ No newline at end of file diff --git a/extensions/yasnippet/snippets/html-mode/pre b/extensions/yasnippet/snippets/html-mode/pre deleted file mode 100644 index 58e77cf..0000000 --- a/extensions/yasnippet/snippets/html-mode/pre +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Jimmy Wu -#name :
    ...
    -# -- -
    -  $0
    -
    \ No newline at end of file diff --git a/extensions/yasnippet/snippets/html-mode/quote b/extensions/yasnippet/snippets/html-mode/quote deleted file mode 100644 index 694185b..0000000 --- a/extensions/yasnippet/snippets/html-mode/quote +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Jimmy Wu -#name :
    ...
    -# -- -
    - $1 -
    \ No newline at end of file diff --git a/extensions/yasnippet/snippets/html-mode/script.javascript b/extensions/yasnippet/snippets/html-mode/script.javascript deleted file mode 100644 index 807f0ea..0000000 --- a/extensions/yasnippet/snippets/html-mode/script.javascript +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Jimmy Wu -#name : -# -- - \ No newline at end of file diff --git a/extensions/yasnippet/snippets/html-mode/script.javascript-src b/extensions/yasnippet/snippets/html-mode/script.javascript-src deleted file mode 100644 index 3e3cc3d..0000000 --- a/extensions/yasnippet/snippets/html-mode/script.javascript-src +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Jimmy Wu -#name : -# -- - \ No newline at end of file diff --git a/extensions/yasnippet/snippets/html-mode/span b/extensions/yasnippet/snippets/html-mode/span deleted file mode 100644 index 3dfdf2f..0000000 --- a/extensions/yasnippet/snippets/html-mode/span +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Jimmy Wu -#name : ... -# -- -$1 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/html-mode/span.class b/extensions/yasnippet/snippets/html-mode/span.class deleted file mode 100644 index 2d5ee55..0000000 --- a/extensions/yasnippet/snippets/html-mode/span.class +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Jimmy Wu -#name : ... -# -- -$2 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/html-mode/span.id b/extensions/yasnippet/snippets/html-mode/span.id deleted file mode 100644 index dbce842..0000000 --- a/extensions/yasnippet/snippets/html-mode/span.id +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Jimmy Wu -#name : ... -# -- -$2 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/html-mode/style b/extensions/yasnippet/snippets/html-mode/style deleted file mode 100644 index 83285a2..0000000 --- a/extensions/yasnippet/snippets/html-mode/style +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Jimmy Wu -#name : -# -- - \ No newline at end of file diff --git a/extensions/yasnippet/snippets/html-mode/table/table b/extensions/yasnippet/snippets/html-mode/table/table deleted file mode 100644 index a2ad495..0000000 --- a/extensions/yasnippet/snippets/html-mode/table/table +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Jimmy Wu -#name : ...
    -# -- - - $0 -
    diff --git a/extensions/yasnippet/snippets/html-mode/table/td b/extensions/yasnippet/snippets/html-mode/table/td deleted file mode 100644 index 9f1aad5..0000000 --- a/extensions/yasnippet/snippets/html-mode/table/td +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Jimmy Wu -#name : ... -# -- -$2 diff --git a/extensions/yasnippet/snippets/html-mode/table/th b/extensions/yasnippet/snippets/html-mode/table/th deleted file mode 100644 index fbae4cc..0000000 --- a/extensions/yasnippet/snippets/html-mode/table/th +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Jimmy Wu -#name : ... -# -- -$2 diff --git a/extensions/yasnippet/snippets/html-mode/table/tr b/extensions/yasnippet/snippets/html-mode/table/tr deleted file mode 100644 index 5f14238..0000000 --- a/extensions/yasnippet/snippets/html-mode/table/tr +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Jimmy Wu -#name : ... -# -- - - $0 - diff --git a/extensions/yasnippet/snippets/html-mode/textarea b/extensions/yasnippet/snippets/html-mode/textarea deleted file mode 100644 index 9553d7a..0000000 --- a/extensions/yasnippet/snippets/html-mode/textarea +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Jimmy Wu -#name : -# -- - \ No newline at end of file diff --git a/extensions/yasnippet/snippets/html-mode/title b/extensions/yasnippet/snippets/html-mode/title deleted file mode 100644 index 01e368b..0000000 --- a/extensions/yasnippet/snippets/html-mode/title +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Jimmy Wu -#name : ... -# -- -$1 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/latex-mode/.yas-parents b/extensions/yasnippet/snippets/latex-mode/.yas-parents deleted file mode 100644 index eed5b44..0000000 --- a/extensions/yasnippet/snippets/latex-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -text-mode diff --git a/extensions/yasnippet/snippets/latex-mode/begin b/extensions/yasnippet/snippets/latex-mode/begin deleted file mode 100644 index dc42d2f..0000000 --- a/extensions/yasnippet/snippets/latex-mode/begin +++ /dev/null @@ -1,7 +0,0 @@ -#contributor : Rodrigo Setti -#name : \begin{environment} ... \end{environment} -# -- - -\begin{${1:environment}} -$0 -\end{$1} diff --git a/extensions/yasnippet/snippets/markdown-mode/+ b/extensions/yasnippet/snippets/markdown-mode/+ deleted file mode 100644 index 0407169..0000000 --- a/extensions/yasnippet/snippets/markdown-mode/+ +++ /dev/null @@ -1,5 +0,0 @@ -#name : Unordered List -#contributor: Peng Deng -# -- -+ ${1:Text} -+$0 diff --git a/extensions/yasnippet/snippets/markdown-mode/- b/extensions/yasnippet/snippets/markdown-mode/- deleted file mode 100644 index 9d5c51d..0000000 --- a/extensions/yasnippet/snippets/markdown-mode/- +++ /dev/null @@ -1,5 +0,0 @@ -#name : Unordered List -#contributor: Peng Deng -# -- -- ${1:Text} --$0 diff --git a/extensions/yasnippet/snippets/markdown-mode/.yas-parents b/extensions/yasnippet/snippets/markdown-mode/.yas-parents deleted file mode 100644 index eed5b44..0000000 --- a/extensions/yasnippet/snippets/markdown-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -text-mode diff --git a/extensions/yasnippet/snippets/markdown-mode/_ b/extensions/yasnippet/snippets/markdown-mode/_ deleted file mode 100644 index 50ab476..0000000 --- a/extensions/yasnippet/snippets/markdown-mode/_ +++ /dev/null @@ -1,4 +0,0 @@ -#name : Emphasis -#contributor: Peng Deng -# -- -_${1:Text}_ $0 diff --git a/extensions/yasnippet/snippets/markdown-mode/__ b/extensions/yasnippet/snippets/markdown-mode/__ deleted file mode 100644 index b6304f3..0000000 --- a/extensions/yasnippet/snippets/markdown-mode/__ +++ /dev/null @@ -1,4 +0,0 @@ -#name : Strong -#contributor: Peng Deng -# -- -**${1:Text}** $0 diff --git a/extensions/yasnippet/snippets/markdown-mode/` b/extensions/yasnippet/snippets/markdown-mode/` deleted file mode 100644 index ae58211..0000000 --- a/extensions/yasnippet/snippets/markdown-mode/` +++ /dev/null @@ -1,4 +0,0 @@ -#name : Inline Code -#contributor: Peng Deng -# -- -\`${1:Code}\` $0 diff --git a/extensions/yasnippet/snippets/markdown-mode/h1.1 b/extensions/yasnippet/snippets/markdown-mode/h1.1 deleted file mode 100644 index 8bb7ea2..0000000 --- a/extensions/yasnippet/snippets/markdown-mode/h1.1 +++ /dev/null @@ -1,6 +0,0 @@ -#name : Header 1 (#) -#contributor: Peng Deng -# -- -# ${1:Header 1} # - -$0 diff --git a/extensions/yasnippet/snippets/markdown-mode/h1.2 b/extensions/yasnippet/snippets/markdown-mode/h1.2 deleted file mode 100644 index d2e7b5b..0000000 --- a/extensions/yasnippet/snippets/markdown-mode/h1.2 +++ /dev/null @@ -1,7 +0,0 @@ -#name : Header 1 (=) -#contributor: Peng Deng -# -- -${1:Header 1} -${1:$(make-string (string-width text) ?\=)} - -$0 diff --git a/extensions/yasnippet/snippets/markdown-mode/h2.1 b/extensions/yasnippet/snippets/markdown-mode/h2.1 deleted file mode 100644 index bfee3fc..0000000 --- a/extensions/yasnippet/snippets/markdown-mode/h2.1 +++ /dev/null @@ -1,6 +0,0 @@ -#name : Header 2 (##) -#contributor: Peng Deng -# -- -## ${1:Header 1} ## - -$0 diff --git a/extensions/yasnippet/snippets/markdown-mode/h2.2 b/extensions/yasnippet/snippets/markdown-mode/h2.2 deleted file mode 100644 index af06045..0000000 --- a/extensions/yasnippet/snippets/markdown-mode/h2.2 +++ /dev/null @@ -1,7 +0,0 @@ -#name : Header 2 (-) -#contributor: Peng Deng -# -- -${1:Header 2} -${1:$(make-string (string-width text) ?\-)} - -$0 diff --git a/extensions/yasnippet/snippets/markdown-mode/h3 b/extensions/yasnippet/snippets/markdown-mode/h3 deleted file mode 100644 index 44a6104..0000000 --- a/extensions/yasnippet/snippets/markdown-mode/h3 +++ /dev/null @@ -1,6 +0,0 @@ -#name : Header 3 -#contributor: Peng Deng -# -- -### ${1:Header 3} ### - -$0 diff --git a/extensions/yasnippet/snippets/markdown-mode/h4 b/extensions/yasnippet/snippets/markdown-mode/h4 deleted file mode 100644 index 315140a..0000000 --- a/extensions/yasnippet/snippets/markdown-mode/h4 +++ /dev/null @@ -1,6 +0,0 @@ -#name : Header 4 -#contributor: Peng Deng -# -- -#### ${1:Header 4} #### - -$0 diff --git a/extensions/yasnippet/snippets/markdown-mode/h5 b/extensions/yasnippet/snippets/markdown-mode/h5 deleted file mode 100644 index f50a785..0000000 --- a/extensions/yasnippet/snippets/markdown-mode/h5 +++ /dev/null @@ -1,6 +0,0 @@ -#name : Header 5 -#contributor: Peng Deng -# -- -##### ${1:Header 5} ##### - -$0 diff --git a/extensions/yasnippet/snippets/markdown-mode/h6 b/extensions/yasnippet/snippets/markdown-mode/h6 deleted file mode 100644 index 1cdfebb..0000000 --- a/extensions/yasnippet/snippets/markdown-mode/h6 +++ /dev/null @@ -1,6 +0,0 @@ -#name : Header 6 -#contributor: Peng Deng -# -- -###### ${1:Header 6} ###### - -$0 diff --git a/extensions/yasnippet/snippets/markdown-mode/hr.1 b/extensions/yasnippet/snippets/markdown-mode/hr.1 deleted file mode 100644 index 5fbe4f4..0000000 --- a/extensions/yasnippet/snippets/markdown-mode/hr.1 +++ /dev/null @@ -1,7 +0,0 @@ -#name : Horizontal Rule (-) -#contributor: Peng Deng -# -- - ----------- - -$0 diff --git a/extensions/yasnippet/snippets/markdown-mode/hr.2 b/extensions/yasnippet/snippets/markdown-mode/hr.2 deleted file mode 100644 index 2d4de22..0000000 --- a/extensions/yasnippet/snippets/markdown-mode/hr.2 +++ /dev/null @@ -1,7 +0,0 @@ -#name : Horizontal Rule (*) -#contributor: Peng Deng -# -- - -******* - -$0 diff --git a/extensions/yasnippet/snippets/markdown-mode/img b/extensions/yasnippet/snippets/markdown-mode/img deleted file mode 100644 index 69ee77d..0000000 --- a/extensions/yasnippet/snippets/markdown-mode/img +++ /dev/null @@ -1,4 +0,0 @@ -#name : Image -#contributor: Peng Deng -# -- -![${1:Alt Text}](${2:URL} $3) $0 diff --git a/extensions/yasnippet/snippets/markdown-mode/link b/extensions/yasnippet/snippets/markdown-mode/link deleted file mode 100644 index dd7f99b..0000000 --- a/extensions/yasnippet/snippets/markdown-mode/link +++ /dev/null @@ -1,4 +0,0 @@ -#name : Link -#contributor: Peng Deng -# -- -[${1:Link Text}](${2:URL} $3) $0 diff --git a/extensions/yasnippet/snippets/markdown-mode/ol b/extensions/yasnippet/snippets/markdown-mode/ol deleted file mode 100644 index e715669..0000000 --- a/extensions/yasnippet/snippets/markdown-mode/ol +++ /dev/null @@ -1,5 +0,0 @@ -#name : Ordered List -#contributor: Peng Deng -# -- -${1:1}. ${2:Text} -${1:$(number-to-string (1+ (string-to-number text)))}. $0 diff --git a/extensions/yasnippet/snippets/markdown-mode/rimg b/extensions/yasnippet/snippets/markdown-mode/rimg deleted file mode 100644 index caafb60..0000000 --- a/extensions/yasnippet/snippets/markdown-mode/rimg +++ /dev/null @@ -1,4 +0,0 @@ -#name : Referenced Image -#contributor: Peng Deng -# -- -![${1:Alt Text}][$2] $0 diff --git a/extensions/yasnippet/snippets/markdown-mode/rlb b/extensions/yasnippet/snippets/markdown-mode/rlb deleted file mode 100644 index 681d9f0..0000000 --- a/extensions/yasnippet/snippets/markdown-mode/rlb +++ /dev/null @@ -1,5 +0,0 @@ -#name : Reference Label -#contributor: Peng Deng -# -- -[${1:Reference}]: ${2:URL} $3 -$0 diff --git a/extensions/yasnippet/snippets/markdown-mode/rlink b/extensions/yasnippet/snippets/markdown-mode/rlink deleted file mode 100644 index e35a0c0..0000000 --- a/extensions/yasnippet/snippets/markdown-mode/rlink +++ /dev/null @@ -1,4 +0,0 @@ -#name : Reference Link -#contributor: Peng Deng -# -- -[${1:Link Text}][$2] $0 diff --git a/extensions/yasnippet/snippets/nxml-mode/.yas-make-groups b/extensions/yasnippet/snippets/nxml-mode/.yas-make-groups deleted file mode 100644 index e69de29..0000000 diff --git a/extensions/yasnippet/snippets/nxml-mode/.yas-parents b/extensions/yasnippet/snippets/nxml-mode/.yas-parents deleted file mode 100644 index eed5b44..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -text-mode diff --git a/extensions/yasnippet/snippets/nxml-mode/body b/extensions/yasnippet/snippets/nxml-mode/body deleted file mode 100644 index 9a9addc..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/body +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Anders Bach Nielsen -#name : ... -# -- - - $0 - \ No newline at end of file diff --git a/extensions/yasnippet/snippets/nxml-mode/br b/extensions/yasnippet/snippets/nxml-mode/br deleted file mode 100644 index 3e235ed..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/br +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Anders Bach Nielsen -#name :
    -# -- -
    \ No newline at end of file diff --git a/extensions/yasnippet/snippets/nxml-mode/code b/extensions/yasnippet/snippets/nxml-mode/code deleted file mode 100644 index 15da807..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/code +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Anders Bach Nielsen -#name : ... -# -- - - $0 - \ No newline at end of file diff --git a/extensions/yasnippet/snippets/nxml-mode/div b/extensions/yasnippet/snippets/nxml-mode/div deleted file mode 100644 index 90fbc2e..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/div +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Anders Bach Nielsen -#name : ... -# -- -$0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/nxml-mode/form b/extensions/yasnippet/snippets/nxml-mode/form deleted file mode 100644 index a83c4f9..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/form +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Anders Bach Nielsen -#name :
    -# -- -
    - $0 -
    \ No newline at end of file diff --git a/extensions/yasnippet/snippets/nxml-mode/head b/extensions/yasnippet/snippets/nxml-mode/head deleted file mode 100644 index 2a4865b..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/head +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Anders Bach Nielsen -#name : ... -# -- - - $0 - \ No newline at end of file diff --git a/extensions/yasnippet/snippets/nxml-mode/header/h1 b/extensions/yasnippet/snippets/nxml-mode/header/h1 deleted file mode 100644 index 08972eb..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/header/h1 +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Anders Bach Nielsen -#name :

    ...

    -# -- -

    $1

    diff --git a/extensions/yasnippet/snippets/nxml-mode/header/h2 b/extensions/yasnippet/snippets/nxml-mode/header/h2 deleted file mode 100644 index 1dfb50a..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/header/h2 +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Anders Bach Nielsen -#name :

    ...

    -# -- -

    $1

    diff --git a/extensions/yasnippet/snippets/nxml-mode/header/h3 b/extensions/yasnippet/snippets/nxml-mode/header/h3 deleted file mode 100644 index 651bf19..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/header/h3 +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Anders Bach Nielsen -#name :

    ...

    -# -- -

    $1

    diff --git a/extensions/yasnippet/snippets/nxml-mode/header/h4 b/extensions/yasnippet/snippets/nxml-mode/header/h4 deleted file mode 100644 index ac01b05..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/header/h4 +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Anders Bach Nielsen -#name :

    ...

    -# -- -

    $1

    diff --git a/extensions/yasnippet/snippets/nxml-mode/header/h5 b/extensions/yasnippet/snippets/nxml-mode/header/h5 deleted file mode 100644 index 8268413..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/header/h5 +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Anders Bach Nielsen -#name :
    ...
    -# -- -
    $1
    diff --git a/extensions/yasnippet/snippets/nxml-mode/header/h6 b/extensions/yasnippet/snippets/nxml-mode/header/h6 deleted file mode 100644 index 3de08c1..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/header/h6 +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Anders Bach Nielsen -#name :
    ...
    -# -- -
    $1
    diff --git a/extensions/yasnippet/snippets/nxml-mode/hr b/extensions/yasnippet/snippets/nxml-mode/hr deleted file mode 100644 index 85d4acb..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/hr +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Anders Bach Nielsen -#name :
    -# -- -
    diff --git a/extensions/yasnippet/snippets/nxml-mode/href b/extensions/yasnippet/snippets/nxml-mode/href deleted file mode 100644 index 3da0ece..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/href +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Anders Bach Nielsen -#name : ... -# -- -$2 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/nxml-mode/html b/extensions/yasnippet/snippets/nxml-mode/html deleted file mode 100644 index fdcb784..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/html +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Anders Bach Nielsen -#name : ... -# -- - - $0 - diff --git a/extensions/yasnippet/snippets/nxml-mode/img b/extensions/yasnippet/snippets/nxml-mode/img deleted file mode 100644 index 442d679..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/img +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Anders Bach Nielsen -#name : ... -# -- -$2 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/nxml-mode/input b/extensions/yasnippet/snippets/nxml-mode/input deleted file mode 100644 index 56cfc09..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/input +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Anders Bach Nielsen -#name : -# -- - \ No newline at end of file diff --git a/extensions/yasnippet/snippets/nxml-mode/li b/extensions/yasnippet/snippets/nxml-mode/li deleted file mode 100644 index 0c4c9e4..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/li +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Anders Bach Nielsen -#name :
  • ...
  • -# -- -
  • $1
  • \ No newline at end of file diff --git a/extensions/yasnippet/snippets/nxml-mode/link b/extensions/yasnippet/snippets/nxml-mode/link deleted file mode 100644 index d16475a..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/link +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Anders Bach Nielsen -#name : -# -- - \ No newline at end of file diff --git a/extensions/yasnippet/snippets/nxml-mode/meta/doctype b/extensions/yasnippet/snippets/nxml-mode/meta/doctype deleted file mode 100644 index af8fb49..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/meta/doctype +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Anders Bach Nielsen -#name : DocType XHTML 1.1 -# -- - diff --git a/extensions/yasnippet/snippets/nxml-mode/meta/doctype.xhtml1_strict b/extensions/yasnippet/snippets/nxml-mode/meta/doctype.xhtml1_strict deleted file mode 100644 index bb0b7de..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/meta/doctype.xhtml1_strict +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Anders Bach Nielsen -#name : DocType XHTML 1.0 Strict -# -- - diff --git a/extensions/yasnippet/snippets/nxml-mode/meta/doctype.xhtml1_transitional b/extensions/yasnippet/snippets/nxml-mode/meta/doctype.xhtml1_transitional deleted file mode 100644 index c8c50d3..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/meta/doctype.xhtml1_transitional +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Anders Bach Nielsen -#name : DocType XHTML 1.0 Transitional -# -- - diff --git a/extensions/yasnippet/snippets/nxml-mode/meta/meta b/extensions/yasnippet/snippets/nxml-mode/meta/meta deleted file mode 100644 index a8d0e2f..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/meta/meta +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Anders Bach Nielsen -#name : -# -- - diff --git a/extensions/yasnippet/snippets/nxml-mode/name b/extensions/yasnippet/snippets/nxml-mode/name deleted file mode 100644 index a7683d5..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/name +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Anders Bach Nielsen -#name : -# -- - \ No newline at end of file diff --git a/extensions/yasnippet/snippets/nxml-mode/ol b/extensions/yasnippet/snippets/nxml-mode/ol deleted file mode 100644 index d7993be..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/ol +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Anders Bach Nielsen -#name :
      ...
    -# -- -
      - $0 -
    \ No newline at end of file diff --git a/extensions/yasnippet/snippets/nxml-mode/p b/extensions/yasnippet/snippets/nxml-mode/p deleted file mode 100644 index c79b367..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/p +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Anders Bach Nielsen -#name :

    ...

    -# -- -

    $1

    \ No newline at end of file diff --git a/extensions/yasnippet/snippets/nxml-mode/pre b/extensions/yasnippet/snippets/nxml-mode/pre deleted file mode 100644 index b92cabb..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/pre +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Anders Bach Nielsen -#name :
    ...
    -# -- -
    -  $0
    -
    \ No newline at end of file diff --git a/extensions/yasnippet/snippets/nxml-mode/quote b/extensions/yasnippet/snippets/nxml-mode/quote deleted file mode 100644 index 5e17c98..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/quote +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Anders Bach Nielsen -#name :
    ...
    -# -- -
    - $1 -
    \ No newline at end of file diff --git a/extensions/yasnippet/snippets/nxml-mode/span b/extensions/yasnippet/snippets/nxml-mode/span deleted file mode 100644 index 69d5332..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/span +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Anders Bach Nielsen -#name : ... -# -- -$1 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/nxml-mode/style b/extensions/yasnippet/snippets/nxml-mode/style deleted file mode 100644 index 1f462cd..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/style +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Anders Bach Nielsen -#name : -# -- - \ No newline at end of file diff --git a/extensions/yasnippet/snippets/nxml-mode/table b/extensions/yasnippet/snippets/nxml-mode/table deleted file mode 100644 index 3d28497..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/table +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Anders Bach Nielsen -#name : ...
    -# -- - - $0 -
    \ No newline at end of file diff --git a/extensions/yasnippet/snippets/nxml-mode/tag.1l b/extensions/yasnippet/snippets/nxml-mode/tag.1l deleted file mode 100644 index 8988635..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/tag.1l +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Anders Bach Nielsen -#name : ... -# -- -<${1:tag}>$2$0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/nxml-mode/tag.2l b/extensions/yasnippet/snippets/nxml-mode/tag.2l deleted file mode 100644 index 08b4a26..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/tag.2l +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Anders Bach Nielsen -#name : \n...\n -# -- -<${1:tag}> - $2 -$0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/nxml-mode/td b/extensions/yasnippet/snippets/nxml-mode/td deleted file mode 100644 index 4543d5c..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/td +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Anders Bach Nielsen -#name : ... -# -- -$2 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/nxml-mode/th b/extensions/yasnippet/snippets/nxml-mode/th deleted file mode 100644 index 4b679ef..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/th +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Anders Bach Nielsen -#name : ... -# -- -$2 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/nxml-mode/title b/extensions/yasnippet/snippets/nxml-mode/title deleted file mode 100644 index 581d8bb..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/title +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Anders Bach Nielsen -#name : ... -# -- -$1 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/nxml-mode/tr b/extensions/yasnippet/snippets/nxml-mode/tr deleted file mode 100644 index 6726429..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/tr +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Anders Bach Nielsen -#name : ... -# -- - - $0 - \ No newline at end of file diff --git a/extensions/yasnippet/snippets/nxml-mode/ul b/extensions/yasnippet/snippets/nxml-mode/ul deleted file mode 100644 index 0462dd1..0000000 --- a/extensions/yasnippet/snippets/nxml-mode/ul +++ /dev/null @@ -1,6 +0,0 @@ -#contributor : Anders Bach Nielsen -#name :
      ...
    -# -- -
      - $0 -
    \ No newline at end of file diff --git a/extensions/yasnippet/snippets/objc-mode/.yas-parents b/extensions/yasnippet/snippets/objc-mode/.yas-parents deleted file mode 100644 index ce9828b..0000000 --- a/extensions/yasnippet/snippets/objc-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -cc-mode diff --git a/extensions/yasnippet/snippets/objc-mode/prop b/extensions/yasnippet/snippets/objc-mode/prop deleted file mode 100644 index 4d585db..0000000 --- a/extensions/yasnippet/snippets/objc-mode/prop +++ /dev/null @@ -1,13 +0,0 @@ -#name : foo { ... } ; setFoo { ... } -# -- -- (${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/extensions/yasnippet/snippets/perl-mode/.yas-parents b/extensions/yasnippet/snippets/perl-mode/.yas-parents deleted file mode 100644 index eed5b44..0000000 --- a/extensions/yasnippet/snippets/perl-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -text-mode diff --git a/extensions/yasnippet/snippets/perl-mode/eval b/extensions/yasnippet/snippets/perl-mode/eval deleted file mode 100644 index c1f1e1b..0000000 --- a/extensions/yasnippet/snippets/perl-mode/eval +++ /dev/null @@ -1,8 +0,0 @@ -#name : eval { ... } if ($@) { ... } -# -- -eval { - ${1:# do something risky...} -}; -if (\$@) { - ${2:# handle failure...} -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/perl-mode/for b/extensions/yasnippet/snippets/perl-mode/for deleted file mode 100644 index ec5532f..0000000 --- a/extensions/yasnippet/snippets/perl-mode/for +++ /dev/null @@ -1,5 +0,0 @@ -#name : for (...) { ... } -# -- -for (my \$${1:var} = 0; \$$1 < ${2:expression}; \$$1++) { - ${3:# body...} -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/perl-mode/fore b/extensions/yasnippet/snippets/perl-mode/fore deleted file mode 100644 index c878a0e..0000000 --- a/extensions/yasnippet/snippets/perl-mode/fore +++ /dev/null @@ -1,5 +0,0 @@ -#name : foreach ... { ... } -# -- -foreach my \$${1:x} (@${2:array}) { - ${3:# body...} -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/perl-mode/if b/extensions/yasnippet/snippets/perl-mode/if deleted file mode 100644 index 3191b97..0000000 --- a/extensions/yasnippet/snippets/perl-mode/if +++ /dev/null @@ -1,5 +0,0 @@ -#name : if (...) { ... } -# -- -if ($1) { - $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/perl-mode/ife b/extensions/yasnippet/snippets/perl-mode/ife deleted file mode 100644 index 23f7cf6..0000000 --- a/extensions/yasnippet/snippets/perl-mode/ife +++ /dev/null @@ -1,7 +0,0 @@ -#name : if (...) { ... } else { ... } -# -- -if ($1) { - $2 -} else { - $3 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/perl-mode/ifee b/extensions/yasnippet/snippets/perl-mode/ifee deleted file mode 100644 index 7c187d1..0000000 --- a/extensions/yasnippet/snippets/perl-mode/ifee +++ /dev/null @@ -1,9 +0,0 @@ -#name : if, elsif, else ... -# -- -if ($1) { - ${2:# body...} -} elsif ($3) { - ${4:# elsif...} -} else { - ${5:# else...} -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/perl-mode/sub b/extensions/yasnippet/snippets/perl-mode/sub deleted file mode 100644 index 5ab54d7..0000000 --- a/extensions/yasnippet/snippets/perl-mode/sub +++ /dev/null @@ -1,5 +0,0 @@ -#name : sub ... { ... } -# -- -sub ${1:function_name} { - $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/perl-mode/unless b/extensions/yasnippet/snippets/perl-mode/unless deleted file mode 100644 index baeffa2..0000000 --- a/extensions/yasnippet/snippets/perl-mode/unless +++ /dev/null @@ -1,5 +0,0 @@ -#name : unless (...) { ... } -# -- -unless ($1) { - $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/perl-mode/while b/extensions/yasnippet/snippets/perl-mode/while deleted file mode 100644 index 9c2c470..0000000 --- a/extensions/yasnippet/snippets/perl-mode/while +++ /dev/null @@ -1,5 +0,0 @@ -#name : while (...) { ... } -# -- -while ($1) { - $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/perl-mode/xfore b/extensions/yasnippet/snippets/perl-mode/xfore deleted file mode 100644 index 58e455d..0000000 --- a/extensions/yasnippet/snippets/perl-mode/xfore +++ /dev/null @@ -1,3 +0,0 @@ -#name : ... foreach ... -# -- -${1:expression} foreach @${2:array}; \ No newline at end of file diff --git a/extensions/yasnippet/snippets/perl-mode/xif b/extensions/yasnippet/snippets/perl-mode/xif deleted file mode 100644 index 1d4dba8..0000000 --- a/extensions/yasnippet/snippets/perl-mode/xif +++ /dev/null @@ -1,3 +0,0 @@ -#name : ... if ... -# -- -${1:expression} if ${2:condition} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/perl-mode/xunless b/extensions/yasnippet/snippets/perl-mode/xunless deleted file mode 100644 index f456db3..0000000 --- a/extensions/yasnippet/snippets/perl-mode/xunless +++ /dev/null @@ -1,3 +0,0 @@ -#name : ... unless ... -# -- -${1:expression} unless ${2:condition} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/perl-mode/xwhile b/extensions/yasnippet/snippets/perl-mode/xwhile deleted file mode 100644 index 2515586..0000000 --- a/extensions/yasnippet/snippets/perl-mode/xwhile +++ /dev/null @@ -1,3 +0,0 @@ -#name : ... while ... -# -- -${1:expression} while ${2:condition}; \ No newline at end of file diff --git a/extensions/yasnippet/snippets/python-mode/.yas-parents b/extensions/yasnippet/snippets/python-mode/.yas-parents deleted file mode 100644 index eed5b44..0000000 --- a/extensions/yasnippet/snippets/python-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -text-mode diff --git a/extensions/yasnippet/snippets/python-mode/__ b/extensions/yasnippet/snippets/python-mode/__ deleted file mode 100644 index a67dc49..0000000 --- a/extensions/yasnippet/snippets/python-mode/__ +++ /dev/null @@ -1,3 +0,0 @@ -#name : __...__ -# -- -__${init}__ \ No newline at end of file diff --git a/extensions/yasnippet/snippets/python-mode/class b/extensions/yasnippet/snippets/python-mode/class deleted file mode 100644 index 0c02035..0000000 --- a/extensions/yasnippet/snippets/python-mode/class +++ /dev/null @@ -1,8 +0,0 @@ -# -*- coding: utf-8 -*- -# name: class -# contributor: Orestis Markou -# contributor: Nishio Hirokazu -# contributor: Yasser González Fernández -# -- -class ${1:ClassName}(${2:object}): - $0 diff --git a/extensions/yasnippet/snippets/python-mode/def b/extensions/yasnippet/snippets/python-mode/def deleted file mode 100644 index 03926a9..0000000 --- a/extensions/yasnippet/snippets/python-mode/def +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# name: def -# contributor: Orestis Markou -# contributor: Yasser González Fernández -# -- -def ${1:name}($2): - $0 diff --git a/extensions/yasnippet/snippets/python-mode/doc b/extensions/yasnippet/snippets/python-mode/doc deleted file mode 100644 index c698930..0000000 --- a/extensions/yasnippet/snippets/python-mode/doc +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# name: doc -# contributor: Gabriele Lanaro -# expand-env ((yas/indent-line 'fixed) -# -- -"""$0 -""" diff --git a/extensions/yasnippet/snippets/python-mode/for b/extensions/yasnippet/snippets/python-mode/for deleted file mode 100644 index 84f3ddd..0000000 --- a/extensions/yasnippet/snippets/python-mode/for +++ /dev/null @@ -1,4 +0,0 @@ -#name : for ... in ... : ... -# -- -for ${var} in ${collection}: - $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/python-mode/from b/extensions/yasnippet/snippets/python-mode/from deleted file mode 100644 index 3679593..0000000 --- a/extensions/yasnippet/snippets/python-mode/from +++ /dev/null @@ -1,4 +0,0 @@ -#name : from ... import ... -# -- -from $1 import $2 -$0 diff --git a/extensions/yasnippet/snippets/python-mode/ifmain b/extensions/yasnippet/snippets/python-mode/ifmain deleted file mode 100644 index 6224923..0000000 --- a/extensions/yasnippet/snippets/python-mode/ifmain +++ /dev/null @@ -1,4 +0,0 @@ -#name : if __name__ == '__main__': ... -# -- -if __name__ == '__main__': - $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/python-mode/init b/extensions/yasnippet/snippets/python-mode/init deleted file mode 100644 index 6546bc4..0000000 --- a/extensions/yasnippet/snippets/python-mode/init +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -# name: init -# contributor: Gabriele Lanaro -# -- -def __init__(self$1): - $0 diff --git a/extensions/yasnippet/snippets/python-mode/ipdb b/extensions/yasnippet/snippets/python-mode/ipdb deleted file mode 100644 index 17f5cbb..0000000 --- a/extensions/yasnippet/snippets/python-mode/ipdb +++ /dev/null @@ -1,3 +0,0 @@ -# contributor: Fidel Ramos -# -- -import ipdb; ipdb.set_trace() \ No newline at end of file diff --git a/extensions/yasnippet/snippets/python-mode/param b/extensions/yasnippet/snippets/python-mode/param deleted file mode 100644 index 0cf98fe..0000000 --- a/extensions/yasnippet/snippets/python-mode/param +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -# name: param -# key: param -# condition: 'force-in-comment -# -- -:param $1: $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/python-mode/pdb b/extensions/yasnippet/snippets/python-mode/pdb deleted file mode 100644 index 523ef55..0000000 --- a/extensions/yasnippet/snippets/python-mode/pdb +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : matt harrison -#pdb : import pdb; pdb.set_trace() -# -- -import pdb; pdb.set_trace() diff --git a/extensions/yasnippet/snippets/python-mode/prop b/extensions/yasnippet/snippets/python-mode/prop deleted file mode 100644 index e415f19..0000000 --- a/extensions/yasnippet/snippets/python-mode/prop +++ /dev/null @@ -1,11 +0,0 @@ -#contributor : Julio Carlos Menendez -#name : decorator: @property def x: ... @x.setter -# expand-env: ((yas/indent-line 'fixed) (yas/wrap-around-region 'nil)) -# -- -@property -def ${1:prop}(self): - ${0:pass} - -@$1.setter -def $1(self, value): - pass diff --git a/extensions/yasnippet/snippets/python-mode/prop.fun b/extensions/yasnippet/snippets/python-mode/prop.fun deleted file mode 100644 index f5a8717..0000000 --- a/extensions/yasnippet/snippets/python-mode/prop.fun +++ /dev/null @@ -1,17 +0,0 @@ -# contributor: Mads D. Kristensen -# name: prop -# desc: property with fget/fset/fdel -# expand-env: ((yas/indent-line 'fixed) (yas/wrap-around-region 'nil)) -# -- -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 diff --git a/extensions/yasnippet/snippets/python-mode/super b/extensions/yasnippet/snippets/python-mode/super deleted file mode 100644 index f417116..0000000 --- a/extensions/yasnippet/snippets/python-mode/super +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -# name: super -# contributor: Gabriele Lanaro -# -- -super(${1:`(prev-class-name)`},self).${2:`(prev-def-name)`}(${3:`(prev-def-args)`}) - $0 diff --git a/extensions/yasnippet/snippets/python-mode/testcase b/extensions/yasnippet/snippets/python-mode/testcase deleted file mode 100644 index 5044334..0000000 --- a/extensions/yasnippet/snippets/python-mode/testcase +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -# name: unittest.TestCase normal -# contributor: Gabriele Lanaro -# -- -class ${1:TestCase}(${2:unittest.TestCase}): - $0 diff --git a/extensions/yasnippet/snippets/python-mode/try.except b/extensions/yasnippet/snippets/python-mode/try.except deleted file mode 100644 index cf6938b..0000000 --- a/extensions/yasnippet/snippets/python-mode/try.except +++ /dev/null @@ -1,6 +0,0 @@ -# This was cloned from a TextMate bundle for yasnippet. -# -- -try: - ${1:pass} -except ${2:Exception}, ${3:e}: - ${4:raise $3} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/python-mode/try.exceptelse b/extensions/yasnippet/snippets/python-mode/try.exceptelse deleted file mode 100644 index 3050ffc..0000000 --- a/extensions/yasnippet/snippets/python-mode/try.exceptelse +++ /dev/null @@ -1,8 +0,0 @@ -# This was cloned from a TextMate bundle for yasnippet. -# -- -try: - ${1:pass} -except ${2:Exception}, ${3:e}: - ${4:raise $3} -else: - ${5:pass} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/python-mode/try.exceptelsefinally b/extensions/yasnippet/snippets/python-mode/try.exceptelsefinally deleted file mode 100644 index c3c1ce1..0000000 --- a/extensions/yasnippet/snippets/python-mode/try.exceptelsefinally +++ /dev/null @@ -1,10 +0,0 @@ -# This was cloned from a TextMate bundle for yasnippet. -# -- -try: - ${1:pass} -except ${2:Exception}, ${3:e}}: - ${4:raise} -else: - ${5:pass} -finally: - ${6:pass} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/python-mode/try.exceptfinally b/extensions/yasnippet/snippets/python-mode/try.exceptfinally deleted file mode 100644 index 9b8aef3..0000000 --- a/extensions/yasnippet/snippets/python-mode/try.exceptfinally +++ /dev/null @@ -1,8 +0,0 @@ -# This was cloned from a TextMate bundle for yasnippet. -# -- -try: - ${1:pass} -except ${2:Exception}, ${3:e}: - ${4:raise $3} -finally: - ${5:pass} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/python-mode/utf8 b/extensions/yasnippet/snippets/python-mode/utf8 deleted file mode 100644 index 4a2ca32..0000000 --- a/extensions/yasnippet/snippets/python-mode/utf8 +++ /dev/null @@ -1,3 +0,0 @@ -# contributor: Fidel Ramos (haplo) -# -- -# -*- coding: utf-8 -*- diff --git a/extensions/yasnippet/snippets/python-mode/while b/extensions/yasnippet/snippets/python-mode/while deleted file mode 100644 index 704dd7c..0000000 --- a/extensions/yasnippet/snippets/python-mode/while +++ /dev/null @@ -1,4 +0,0 @@ -#name : while ... : ... -# -- -while ${condition}: - $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/rst-mode/.yas-parents b/extensions/yasnippet/snippets/rst-mode/.yas-parents deleted file mode 100644 index eed5b44..0000000 --- a/extensions/yasnippet/snippets/rst-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -text-mode diff --git a/extensions/yasnippet/snippets/rst-mode/chap b/extensions/yasnippet/snippets/rst-mode/chap deleted file mode 100644 index 6474c00..0000000 --- a/extensions/yasnippet/snippets/rst-mode/chap +++ /dev/null @@ -1,6 +0,0 @@ -#name : Chapter title -# -- -${1:Chapter} -${1:$(make-string (string-width text) ?\=)} - -$0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/rst-mode/sec b/extensions/yasnippet/snippets/rst-mode/sec deleted file mode 100644 index 76087ed..0000000 --- a/extensions/yasnippet/snippets/rst-mode/sec +++ /dev/null @@ -1,6 +0,0 @@ -#name : Section title -# -- -${1:Section} -${1:$(make-string (string-width text) ?\-)} - -$0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/rst-mode/tit b/extensions/yasnippet/snippets/rst-mode/tit deleted file mode 100644 index cac2e77..0000000 --- a/extensions/yasnippet/snippets/rst-mode/tit +++ /dev/null @@ -1,7 +0,0 @@ -#name : Document title -# -- -${1:$(make-string (string-width text) ?\=)} -${1:Title} -${1:$(make-string (string-width text) ?\=)} - -$0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/ruby-mode/.yas-make-groups b/extensions/yasnippet/snippets/ruby-mode/.yas-make-groups deleted file mode 100644 index e69de29..0000000 diff --git a/extensions/yasnippet/snippets/ruby-mode/.yas-parents b/extensions/yasnippet/snippets/ruby-mode/.yas-parents deleted file mode 100644 index eed5b44..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -text-mode diff --git a/extensions/yasnippet/snippets/ruby-mode/collections/all b/extensions/yasnippet/snippets/ruby-mode/collections/all deleted file mode 100644 index afb68a7..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/collections/all +++ /dev/null @@ -1,3 +0,0 @@ -#name : all? { |...| ... } -# -- -all? { |${e}| $0 } diff --git a/extensions/yasnippet/snippets/ruby-mode/collections/any b/extensions/yasnippet/snippets/ruby-mode/collections/any deleted file mode 100644 index 2f4f9f1..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/collections/any +++ /dev/null @@ -1,3 +0,0 @@ -#name : any? { |...| ... } -# -- -any? { |${e}| $0 } diff --git a/extensions/yasnippet/snippets/ruby-mode/collections/classify b/extensions/yasnippet/snippets/ruby-mode/collections/classify deleted file mode 100644 index d1ad6f3..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/collections/classify +++ /dev/null @@ -1,3 +0,0 @@ -#name : classify { |...| ... } -# -- -classify { |${e}| $0 } diff --git a/extensions/yasnippet/snippets/ruby-mode/collections/collect b/extensions/yasnippet/snippets/ruby-mode/collections/collect deleted file mode 100644 index 37cd4b5..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/collections/collect +++ /dev/null @@ -1,3 +0,0 @@ -#name : collect { |...| ... } -# -- -collect { |${e}| $0 } diff --git a/extensions/yasnippet/snippets/ruby-mode/collections/deli b/extensions/yasnippet/snippets/ruby-mode/collections/deli deleted file mode 100644 index f51d9a6..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/collections/deli +++ /dev/null @@ -1,3 +0,0 @@ -#name : delete_if { |...| ... } -# -- -delete_if { |${e} $0 } diff --git a/extensions/yasnippet/snippets/ruby-mode/collections/det b/extensions/yasnippet/snippets/ruby-mode/collections/det deleted file mode 100644 index 599898c..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/collections/det +++ /dev/null @@ -1,3 +0,0 @@ -#name : detect { |...| ... } -# -- -detect { |${e}| $0 } diff --git a/extensions/yasnippet/snippets/ruby-mode/collections/ea b/extensions/yasnippet/snippets/ruby-mode/collections/ea deleted file mode 100644 index 40cb2cd..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/collections/ea +++ /dev/null @@ -1,3 +0,0 @@ -#name : each { |...| ... } -# -- -each { |${e}| $0 } diff --git a/extensions/yasnippet/snippets/ruby-mode/collections/eac b/extensions/yasnippet/snippets/ruby-mode/collections/eac deleted file mode 100644 index 7a7ccd4..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/collections/eac +++ /dev/null @@ -1,3 +0,0 @@ -#name : each_cons(...) { |...| ... } -# -- -each_cons(${1:2}) { |${group}| $0 } diff --git a/extensions/yasnippet/snippets/ruby-mode/collections/eai b/extensions/yasnippet/snippets/ruby-mode/collections/eai deleted file mode 100644 index b68cf69..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/collections/eai +++ /dev/null @@ -1,3 +0,0 @@ -#name : each_index { |i| ... } -# -- -each_index { |${i}| $0 } diff --git a/extensions/yasnippet/snippets/ruby-mode/collections/eav b/extensions/yasnippet/snippets/ruby-mode/collections/eav deleted file mode 100644 index 189ceff..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/collections/eav +++ /dev/null @@ -1,3 +0,0 @@ -#name : each_value { |val| ... } -# -- -each_value { |${val}| $0 } diff --git a/extensions/yasnippet/snippets/ruby-mode/collections/eawi b/extensions/yasnippet/snippets/ruby-mode/collections/eawi deleted file mode 100644 index 8718f7a..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/collections/eawi +++ /dev/null @@ -1,3 +0,0 @@ -#name : each_with_index { |e, i| ... } -# -- -each_with_index { |${e}, ${i}| $0 } diff --git a/extensions/yasnippet/snippets/ruby-mode/collections/inject b/extensions/yasnippet/snippets/ruby-mode/collections/inject deleted file mode 100644 index eaa0f28..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/collections/inject +++ /dev/null @@ -1,3 +0,0 @@ -#name : inject(...) { |...| ... } -# -- -inject(${1:0}) { |${2:injection}, ${3:element}| $0 } diff --git a/extensions/yasnippet/snippets/ruby-mode/collections/reject b/extensions/yasnippet/snippets/ruby-mode/collections/reject deleted file mode 100644 index 032b06d..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/collections/reject +++ /dev/null @@ -1,3 +0,0 @@ -#name : reject { |...| ... } -# -- -reject { |${1:element}| $0 } diff --git a/extensions/yasnippet/snippets/ruby-mode/collections/select b/extensions/yasnippet/snippets/ruby-mode/collections/select deleted file mode 100644 index 5ea4ef8..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/collections/select +++ /dev/null @@ -1,3 +0,0 @@ -#name : select { |...| ... } -# -- -select { |${1:element}| $0 } diff --git a/extensions/yasnippet/snippets/ruby-mode/collections/zip b/extensions/yasnippet/snippets/ruby-mode/collections/zip deleted file mode 100644 index 910de64..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/collections/zip +++ /dev/null @@ -1,3 +0,0 @@ -#name : zip(...) { |...| ... } -# -- -zip(${enums}) { |${row}| $0 } diff --git a/extensions/yasnippet/snippets/ruby-mode/control structure/forin b/extensions/yasnippet/snippets/ruby-mode/control structure/forin deleted file mode 100644 index 197e09e..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/control structure/forin +++ /dev/null @@ -1,5 +0,0 @@ -#name : for ... in ...; ... end -# -- -for ${1:element} in ${2:collection} - $0 -end diff --git a/extensions/yasnippet/snippets/ruby-mode/control structure/if b/extensions/yasnippet/snippets/ruby-mode/control structure/if deleted file mode 100644 index c96069b..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/control structure/if +++ /dev/null @@ -1,5 +0,0 @@ -#name : if ... end -# -- -if ${1:condition} - $0 -end diff --git a/extensions/yasnippet/snippets/ruby-mode/control structure/ife b/extensions/yasnippet/snippets/ruby-mode/control structure/ife deleted file mode 100644 index 959d77c..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/control structure/ife +++ /dev/null @@ -1,7 +0,0 @@ -#name : if ... else ... end -# -- -if ${1:condition} - $2 -else - $3 -end diff --git a/extensions/yasnippet/snippets/ruby-mode/control structure/tim b/extensions/yasnippet/snippets/ruby-mode/control structure/tim deleted file mode 100644 index 44023c0..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/control structure/tim +++ /dev/null @@ -1,3 +0,0 @@ -#name : times { |n| ... } -# -- -times { |${n}| $0 } diff --git a/extensions/yasnippet/snippets/ruby-mode/control structure/until b/extensions/yasnippet/snippets/ruby-mode/control structure/until deleted file mode 100644 index b3534a8..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/control structure/until +++ /dev/null @@ -1,5 +0,0 @@ -#name : until ... end -# -- -until ${condition} - $0 -end diff --git a/extensions/yasnippet/snippets/ruby-mode/control structure/upt b/extensions/yasnippet/snippets/ruby-mode/control structure/upt deleted file mode 100644 index 73c0046..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/control structure/upt +++ /dev/null @@ -1,5 +0,0 @@ -#name : upto(...) { |n| ... } -# -- -upto(${n}) { |${i}| - $0 -} diff --git a/extensions/yasnippet/snippets/ruby-mode/control structure/when b/extensions/yasnippet/snippets/ruby-mode/control structure/when deleted file mode 100644 index 51f63a3..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/control structure/when +++ /dev/null @@ -1,5 +0,0 @@ -#name : when ... end -# -- -when ${condition} - $0 -end diff --git a/extensions/yasnippet/snippets/ruby-mode/control structure/while b/extensions/yasnippet/snippets/ruby-mode/control structure/while deleted file mode 100644 index 00e114f..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/control structure/while +++ /dev/null @@ -1,5 +0,0 @@ -#name : while ... end -# -- -while ${condition} - $0 -end diff --git a/extensions/yasnippet/snippets/ruby-mode/definitions/Comp b/extensions/yasnippet/snippets/ruby-mode/definitions/Comp deleted file mode 100644 index 7afea97..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/definitions/Comp +++ /dev/null @@ -1,7 +0,0 @@ -#name : include Comparable; def <=> ... end -# -- -include Comparable - -def <=> other - $0 -end diff --git a/extensions/yasnippet/snippets/ruby-mode/definitions/am b/extensions/yasnippet/snippets/ruby-mode/definitions/am deleted file mode 100644 index 68ceff0..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/definitions/am +++ /dev/null @@ -1,3 +0,0 @@ -#name : alias_method new, old -# -- -alias_method :${new_name}, :${old_name} diff --git a/extensions/yasnippet/snippets/ruby-mode/definitions/cla b/extensions/yasnippet/snippets/ruby-mode/definitions/cla deleted file mode 100644 index da71b10..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/definitions/cla +++ /dev/null @@ -1,5 +0,0 @@ -#name : class << self ... end -# -- -class << ${self} - $0 -end diff --git a/extensions/yasnippet/snippets/ruby-mode/definitions/cls b/extensions/yasnippet/snippets/ruby-mode/definitions/cls deleted file mode 100644 index 64ef27e..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/definitions/cls +++ /dev/null @@ -1,12 +0,0 @@ -#name : class ... end -#contributor : hitesh -# -- -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 diff --git a/extensions/yasnippet/snippets/ruby-mode/definitions/mm b/extensions/yasnippet/snippets/ruby-mode/definitions/mm deleted file mode 100644 index 7b348d7..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/definitions/mm +++ /dev/null @@ -1,5 +0,0 @@ -#name : def method_missing ... end -# -- -def method_missing(method, *args) - $0 -end diff --git a/extensions/yasnippet/snippets/ruby-mode/definitions/r b/extensions/yasnippet/snippets/ruby-mode/definitions/r deleted file mode 100644 index b933a13..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/definitions/r +++ /dev/null @@ -1,3 +0,0 @@ -#name : attr_reader ... -# -- -attr_reader : diff --git a/extensions/yasnippet/snippets/ruby-mode/definitions/rw b/extensions/yasnippet/snippets/ruby-mode/definitions/rw deleted file mode 100644 index 7153541..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/definitions/rw +++ /dev/null @@ -1,3 +0,0 @@ -#name : attr_accessor ... -# -- -attr_accessor : diff --git a/extensions/yasnippet/snippets/ruby-mode/definitions/w b/extensions/yasnippet/snippets/ruby-mode/definitions/w deleted file mode 100644 index cd6d473..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/definitions/w +++ /dev/null @@ -1,3 +0,0 @@ -#name : attr_writer ... -# -- -attr_writer : diff --git a/extensions/yasnippet/snippets/ruby-mode/general/# b/extensions/yasnippet/snippets/ruby-mode/general/# deleted file mode 100644 index b9e3f8a..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/general/# +++ /dev/null @@ -1,3 +0,0 @@ -#name : # => -# -- -# => diff --git a/extensions/yasnippet/snippets/ruby-mode/general/=b b/extensions/yasnippet/snippets/ruby-mode/general/=b deleted file mode 100644 index e396723..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/general/=b +++ /dev/null @@ -1,5 +0,0 @@ -#name : =begin rdoc ... =end -# -- -=begin rdoc - $0 -=end diff --git a/extensions/yasnippet/snippets/ruby-mode/general/app b/extensions/yasnippet/snippets/ruby-mode/general/app deleted file mode 100644 index b151ccc..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/general/app +++ /dev/null @@ -1,5 +0,0 @@ -#name : if __FILE__ == $PROGRAM_NAME ... end -# -- -if __FILE__ == $PROGRAM_NAME - $0 -end diff --git a/extensions/yasnippet/snippets/ruby-mode/general/bm b/extensions/yasnippet/snippets/ruby-mode/general/bm deleted file mode 100644 index 44fb2b6..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/general/bm +++ /dev/null @@ -1,5 +0,0 @@ -#name : Benchmark.bmbm(...) do ... end -# -- -Benchmark.bmbm(${1:10}) do |x| - $0 -end diff --git a/extensions/yasnippet/snippets/ruby-mode/general/case b/extensions/yasnippet/snippets/ruby-mode/general/case deleted file mode 100644 index b919081..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/general/case +++ /dev/null @@ -1,6 +0,0 @@ -#name : case ... end -# -- -case ${1:object} -when ${2:condition} - $0 -end diff --git a/extensions/yasnippet/snippets/ruby-mode/general/dee b/extensions/yasnippet/snippets/ruby-mode/general/dee deleted file mode 100644 index 496e187..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/general/dee +++ /dev/null @@ -1,3 +0,0 @@ -#name : deep_copy(...) -# -- -Marshal.load(Marshal.dump($0)) diff --git a/extensions/yasnippet/snippets/ruby-mode/general/rb b/extensions/yasnippet/snippets/ruby-mode/general/rb deleted file mode 100644 index 9153653..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/general/rb +++ /dev/null @@ -1,3 +0,0 @@ -#name : /usr/bin/ruby -wKU -# -- -#!/usr/bin/ruby -wKU diff --git a/extensions/yasnippet/snippets/ruby-mode/general/req b/extensions/yasnippet/snippets/ruby-mode/general/req deleted file mode 100644 index 3ada7d5..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/general/req +++ /dev/null @@ -1,3 +0,0 @@ -#name : require "..." -# -- -require "$0" diff --git a/extensions/yasnippet/snippets/ruby-mode/general/rreq b/extensions/yasnippet/snippets/ruby-mode/general/rreq deleted file mode 100644 index ff80c71..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/general/rreq +++ /dev/null @@ -1,3 +0,0 @@ -#name : require File.join(File.dirname(__FILE__), ...) -# -- -require File.join(File.dirname(__FILE__), $0) diff --git a/extensions/yasnippet/snippets/ruby-mode/general/y b/extensions/yasnippet/snippets/ruby-mode/general/y deleted file mode 100644 index a57fbde..0000000 --- a/extensions/yasnippet/snippets/ruby-mode/general/y +++ /dev/null @@ -1,3 +0,0 @@ -#name : :yields: arguments (rdoc) -# -- -:yields: $0 diff --git a/extensions/yasnippet/snippets/scala-mode/.yas-parents b/extensions/yasnippet/snippets/scala-mode/.yas-parents deleted file mode 100644 index eed5b44..0000000 --- a/extensions/yasnippet/snippets/scala-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -text-mode diff --git a/extensions/yasnippet/snippets/scala-mode/act b/extensions/yasnippet/snippets/scala-mode/act deleted file mode 100644 index fce52fc..0000000 --- a/extensions/yasnippet/snippets/scala-mode/act +++ /dev/null @@ -1,10 +0,0 @@ -#Author : Jonas Bonèr -#name : def act = { ..} -# -- -def act = { - loop { - react { - $0 - } - } -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/act.arg b/extensions/yasnippet/snippets/scala-mode/act.arg deleted file mode 100644 index fc6df9e..0000000 --- a/extensions/yasnippet/snippets/scala-mode/act.arg +++ /dev/null @@ -1,10 +0,0 @@ -#Author : Jonas Bonèr -#name : def act(arg: T) = { ..} -# -- -def act(${1:arg}: ${2:type}) = { - loop { - react { - $0 - } - } -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/actor b/extensions/yasnippet/snippets/scala-mode/actor deleted file mode 100644 index d38a183..0000000 --- a/extensions/yasnippet/snippets/scala-mode/actor +++ /dev/null @@ -1,10 +0,0 @@ -#Author : Jonas Bonèr -#name : val a = actor { ..} -# -- -val a = actor { - loop { - react { - $0 - } - } -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/ano b/extensions/yasnippet/snippets/scala-mode/ano deleted file mode 100644 index b949801..0000000 --- a/extensions/yasnippet/snippets/scala-mode/ano +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : (args) => ... -# -- -($1) => ${2:body} $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/app b/extensions/yasnippet/snippets/scala-mode/app deleted file mode 100644 index b89bab9..0000000 --- a/extensions/yasnippet/snippets/scala-mode/app +++ /dev/null @@ -1,6 +0,0 @@ -#Author : Anders Bach Nielsen -#name : object name extends Application -# -- -object ${1:name} extends Application { - $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/arr.new b/extensions/yasnippet/snippets/scala-mode/arr.new deleted file mode 100644 index e3297ca..0000000 --- a/extensions/yasnippet/snippets/scala-mode/arr.new +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : Array[T](..) -# -- -Array[${1:value}](${2:args}) $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/arr.val-new b/extensions/yasnippet/snippets/scala-mode/arr.val-new deleted file mode 100644 index 4de4720..0000000 --- a/extensions/yasnippet/snippets/scala-mode/arr.val-new +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : val a = Array[T](..) -# -- -val ${1:arr} = Array[${2:value}](${3:args}) $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/asof b/extensions/yasnippet/snippets/scala-mode/asof deleted file mode 100644 index 3b2b209..0000000 --- a/extensions/yasnippet/snippets/scala-mode/asof +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : asInstanceOf[T] -# -- -asInstanceOf[${1:type}] $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/ass b/extensions/yasnippet/snippets/scala-mode/ass deleted file mode 100644 index 653dcef..0000000 --- a/extensions/yasnippet/snippets/scala-mode/ass +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : assert(x === y) -# -- -assert(${1:x} === ${2:y}) $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/ass.true b/extensions/yasnippet/snippets/scala-mode/ass.true deleted file mode 100644 index 923c518..0000000 --- a/extensions/yasnippet/snippets/scala-mode/ass.true +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : assert(true) -# -- -assert(true) $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/at.author b/extensions/yasnippet/snippets/scala-mode/at.author deleted file mode 100644 index 82fe4cc..0000000 --- a/extensions/yasnippet/snippets/scala-mode/at.author +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Anders Bach Nielsen -#name : @author name -# -- -@author ${1:name} $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/at.param b/extensions/yasnippet/snippets/scala-mode/at.param deleted file mode 100644 index 72b6e79..0000000 --- a/extensions/yasnippet/snippets/scala-mode/at.param +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Anders Bach Nielsen -#name : @param name description -# -- -@param ${1:name} ${2:description} $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/at.return b/extensions/yasnippet/snippets/scala-mode/at.return deleted file mode 100644 index 9c3f41c..0000000 --- a/extensions/yasnippet/snippets/scala-mode/at.return +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Anders Bach Nielsen -#name : @return description -# -- -@return ${1:description} $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/at.version b/extensions/yasnippet/snippets/scala-mode/at.version deleted file mode 100644 index 1158ce2..0000000 --- a/extensions/yasnippet/snippets/scala-mode/at.version +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Anders Bach Nielsen -#name : @version number -# -- -@version ${1:0.1} $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/bang b/extensions/yasnippet/snippets/scala-mode/bang deleted file mode 100644 index a547da8..0000000 --- a/extensions/yasnippet/snippets/scala-mode/bang +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : actor ! message -# -- -${1:actor} ! ${2:message} $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/case b/extensions/yasnippet/snippets/scala-mode/case deleted file mode 100644 index 13d6aec..0000000 --- a/extensions/yasnippet/snippets/scala-mode/case +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : case pattern => -# -- -case ${1:pattern} => $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/case.match-all b/extensions/yasnippet/snippets/scala-mode/case.match-all deleted file mode 100644 index 028bf5f..0000000 --- a/extensions/yasnippet/snippets/scala-mode/case.match-all +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : case _ => -# -- -case _ => $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/cast b/extensions/yasnippet/snippets/scala-mode/cast deleted file mode 100644 index 3b2b209..0000000 --- a/extensions/yasnippet/snippets/scala-mode/cast +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : asInstanceOf[T] -# -- -asInstanceOf[${1:type}] $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/cc b/extensions/yasnippet/snippets/scala-mode/cc deleted file mode 100644 index 7ed1142..0000000 --- a/extensions/yasnippet/snippets/scala-mode/cc +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : case class T(arg: A) -# -- -case class ${1:name}(${2:arg}: ${3:type}) $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/cl b/extensions/yasnippet/snippets/scala-mode/cl deleted file mode 100644 index 1fd712c..0000000 --- a/extensions/yasnippet/snippets/scala-mode/cl +++ /dev/null @@ -1,6 +0,0 @@ -#Author : Jonas Bonèr -#name : class T { .. } -# -- -class ${1:name} { - $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/cl.abs b/extensions/yasnippet/snippets/scala-mode/cl.abs deleted file mode 100644 index 402dec7..0000000 --- a/extensions/yasnippet/snippets/scala-mode/cl.abs +++ /dev/null @@ -1,6 +0,0 @@ -#Author : Jonas Bonèr -#name : abstract class T { .. } -# -- -abstract class ${1:name} { - $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/cl.abs-arg b/extensions/yasnippet/snippets/scala-mode/cl.abs-arg deleted file mode 100644 index fe29524..0000000 --- a/extensions/yasnippet/snippets/scala-mode/cl.abs-arg +++ /dev/null @@ -1,6 +0,0 @@ -#Author : Jonas Bonèr -#name : abstract class T(args) { .. } -# -- -abstract class ${1:name}(${2:args}) { - $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/cl.arg b/extensions/yasnippet/snippets/scala-mode/cl.arg deleted file mode 100644 index f82460f..0000000 --- a/extensions/yasnippet/snippets/scala-mode/cl.arg +++ /dev/null @@ -1,6 +0,0 @@ -#Author : Jonas Bonèr -#name : class T(args) { .. } -# -- -class ${1:name}(${2:args}) { - $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/clof b/extensions/yasnippet/snippets/scala-mode/clof deleted file mode 100644 index 955726c..0000000 --- a/extensions/yasnippet/snippets/scala-mode/clof +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : classOf[T] -# -- -classOf[${1:type}] $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/co b/extensions/yasnippet/snippets/scala-mode/co deleted file mode 100644 index 75b1f3b..0000000 --- a/extensions/yasnippet/snippets/scala-mode/co +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : case object T -# -- -case object ${1:name} $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/cons b/extensions/yasnippet/snippets/scala-mode/cons deleted file mode 100644 index a48e4ff..0000000 --- a/extensions/yasnippet/snippets/scala-mode/cons +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : element1 :: element2 -# -- -${1:element1} :: ${2:element2} $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/cons.nil b/extensions/yasnippet/snippets/scala-mode/cons.nil deleted file mode 100644 index c288f93..0000000 --- a/extensions/yasnippet/snippets/scala-mode/cons.nil +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : element1 :: Nil -# -- -${1:element1} :: Nil $0 diff --git a/extensions/yasnippet/snippets/scala-mode/def.arg b/extensions/yasnippet/snippets/scala-mode/def.arg deleted file mode 100644 index 7765bbf..0000000 --- a/extensions/yasnippet/snippets/scala-mode/def.arg +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : def f(arg: T) = ... -# -- -def ${1:name}(${2:args}) = $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/def.arg-body b/extensions/yasnippet/snippets/scala-mode/def.arg-body deleted file mode 100644 index e6e278e..0000000 --- a/extensions/yasnippet/snippets/scala-mode/def.arg-body +++ /dev/null @@ -1,6 +0,0 @@ -#Author : Jonas Bonèr -#name : def f(arg: T) = {...} -# -- -def ${1:name}(${2:args}) = { - $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/def.arg-ret b/extensions/yasnippet/snippets/scala-mode/def.arg-ret deleted file mode 100644 index dddb9ce..0000000 --- a/extensions/yasnippet/snippets/scala-mode/def.arg-ret +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : def f(arg: T): R = ... -# -- -def ${1:name}(${2:args}): ${3:Unit} = $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/def.arg-ret-body b/extensions/yasnippet/snippets/scala-mode/def.arg-ret-body deleted file mode 100644 index 862f7fd..0000000 --- a/extensions/yasnippet/snippets/scala-mode/def.arg-ret-body +++ /dev/null @@ -1,6 +0,0 @@ -#Author : Jonas Bonèr -#name : def f(arg: T): R = {...} -# -- -def ${1:name}(${2:args}): ${3:Unit} = { - $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/def.body b/extensions/yasnippet/snippets/scala-mode/def.body deleted file mode 100644 index 858908c..0000000 --- a/extensions/yasnippet/snippets/scala-mode/def.body +++ /dev/null @@ -1,6 +0,0 @@ -#Author : Jonas Bonèr -#name : def f = {...} -# -- -def ${1:name} = { - $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/def.ret b/extensions/yasnippet/snippets/scala-mode/def.ret deleted file mode 100644 index e5483fb..0000000 --- a/extensions/yasnippet/snippets/scala-mode/def.ret +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : def f: R = ... -# -- -def ${1:name}: ${2:Unit} = $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/def.ret-body b/extensions/yasnippet/snippets/scala-mode/def.ret-body deleted file mode 100644 index f342e04..0000000 --- a/extensions/yasnippet/snippets/scala-mode/def.ret-body +++ /dev/null @@ -1,6 +0,0 @@ -#Author : Jonas Bonèr -#name : def f: R = {...} -# -- -def ${1:name}: ${3:Unit} = { - $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/def.simple b/extensions/yasnippet/snippets/scala-mode/def.simple deleted file mode 100644 index 4814c73..0000000 --- a/extensions/yasnippet/snippets/scala-mode/def.simple +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : def f = ... -# -- -def ${1:name} = $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/doc.class b/extensions/yasnippet/snippets/scala-mode/doc.class deleted file mode 100644 index 60442f1..0000000 --- a/extensions/yasnippet/snippets/scala-mode/doc.class +++ /dev/null @@ -1,8 +0,0 @@ -#Author : Anders Bach Nielsen -#name : /** cls/trt/obj name */ -# -- -/** - * `(scala-mode-find-clstrtobj-name-doc)` - * ${1:description} - * $0 - */ \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/doc.def b/extensions/yasnippet/snippets/scala-mode/doc.def deleted file mode 100644 index 8a3d614..0000000 --- a/extensions/yasnippet/snippets/scala-mode/doc.def +++ /dev/null @@ -1,6 +0,0 @@ -#Author : Anders Bach Nielsen -#name : /** method name */ -# -- -/** - * `(scala-mode-def-and-args-doc)` - */ \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/doc.file b/extensions/yasnippet/snippets/scala-mode/doc.file deleted file mode 100644 index 7da4289..0000000 --- a/extensions/yasnippet/snippets/scala-mode/doc.file +++ /dev/null @@ -1,9 +0,0 @@ -#Author : Anders Bach Nielsen -#name : /** file name */ -# -- -/** - * `(scala-mode-file-doc)` - * $0 - * @author ${1:name} - * @version ${2:0.1} - */ \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/doc.file-scala b/extensions/yasnippet/snippets/scala-mode/doc.file-scala deleted file mode 100644 index 6719348..0000000 --- a/extensions/yasnippet/snippets/scala-mode/doc.file-scala +++ /dev/null @@ -1,16 +0,0 @@ -#Author : Anders Bach Nielsen -#name : /** scala file */ -# -- -/* __ *\ -** ________ ___ / / ___ 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/extensions/yasnippet/snippets/scala-mode/doc.file-scala-api b/extensions/yasnippet/snippets/scala-mode/doc.file-scala-api deleted file mode 100644 index 4a762f5..0000000 --- a/extensions/yasnippet/snippets/scala-mode/doc.file-scala-api +++ /dev/null @@ -1,16 +0,0 @@ -#Author : Anders Bach Nielsen -#name : /** scala api file */ -# -- -/* __ *\ -** ________ ___ / / ___ 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/extensions/yasnippet/snippets/scala-mode/doc.scaladoc b/extensions/yasnippet/snippets/scala-mode/doc.scaladoc deleted file mode 100644 index 038428c..0000000 --- a/extensions/yasnippet/snippets/scala-mode/doc.scaladoc +++ /dev/null @@ -1,7 +0,0 @@ -#Author : Anders Bach Nielsen -#name : /** ... */ -# -- -/** - * ${1:description} - * $0 - */ \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/expect b/extensions/yasnippet/snippets/scala-mode/expect deleted file mode 100644 index 94c742c..0000000 --- a/extensions/yasnippet/snippets/scala-mode/expect +++ /dev/null @@ -1,6 +0,0 @@ -#Author : Jonas Bonèr -#name : expect(value) { ..} -# -- -expect(${1:reply}) { - $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/ext b/extensions/yasnippet/snippets/scala-mode/ext deleted file mode 100644 index e256317..0000000 --- a/extensions/yasnippet/snippets/scala-mode/ext +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : extends T -# -- -extends $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/for.extract b/extensions/yasnippet/snippets/scala-mode/for.extract deleted file mode 100644 index 60f1155..0000000 --- a/extensions/yasnippet/snippets/scala-mode/for.extract +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : x <- xs -# -- -${1:x} <- ${2:xs} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/for.if b/extensions/yasnippet/snippets/scala-mode/for.if deleted file mode 100644 index f44c544..0000000 --- a/extensions/yasnippet/snippets/scala-mode/for.if +++ /dev/null @@ -1,6 +0,0 @@ -#Author : Jonas Bonèr -#name : for (x <- xs if guard) { ... } -# -- -for (${1:x} <- ${2:xs} if ${3:guard}) { - $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/for.loop b/extensions/yasnippet/snippets/scala-mode/for.loop deleted file mode 100644 index 050d5e8..0000000 --- a/extensions/yasnippet/snippets/scala-mode/for.loop +++ /dev/null @@ -1,6 +0,0 @@ -#Author : Jonas Bonèr -#name : for (x <- xs) { ... } -# -- -for (${1:x} <- ${2:xs}) { - $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/for.multi b/extensions/yasnippet/snippets/scala-mode/for.multi deleted file mode 100644 index c512067..0000000 --- a/extensions/yasnippet/snippets/scala-mode/for.multi +++ /dev/null @@ -1,9 +0,0 @@ -#Author : Jonas Bonèr -#name : for {x <- xs \ y <- ys} { yield } -# -- -for { - ${1:x} <- ${2:xs} - ${3:x} <- ${4:xs} -} { - yield $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/foreach b/extensions/yasnippet/snippets/scala-mode/foreach deleted file mode 100644 index cafdd00..0000000 --- a/extensions/yasnippet/snippets/scala-mode/foreach +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : foreach(x => ..) -# -- -foreach(${1:x} => ${2:body}) $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/hmap.new b/extensions/yasnippet/snippets/scala-mode/hmap.new deleted file mode 100644 index dd564a0..0000000 --- a/extensions/yasnippet/snippets/scala-mode/hmap.new +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : new HashMap[K, V] -# -- -new HashMap[${1:key}, ${2:value}] $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/hmap.val-new b/extensions/yasnippet/snippets/scala-mode/hmap.val-new deleted file mode 100644 index 2f4a3c2..0000000 --- a/extensions/yasnippet/snippets/scala-mode/hmap.val-new +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : val m = new HashMap[K, V] -# -- -val ${1:m} = new HashMap[${2:key}, ${3:value}] $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/hset.new b/extensions/yasnippet/snippets/scala-mode/hset.new deleted file mode 100644 index d1be3ee..0000000 --- a/extensions/yasnippet/snippets/scala-mode/hset.new +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : new HashSet[K] -# -- -new HashSet[${1:key}] $0 diff --git a/extensions/yasnippet/snippets/scala-mode/hset.val-new b/extensions/yasnippet/snippets/scala-mode/hset.val-new deleted file mode 100644 index ba792a2..0000000 --- a/extensions/yasnippet/snippets/scala-mode/hset.val-new +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : val m = new HashSet[K] -# -- -val ${1:m} = new HashSet[${2:key}] $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/if b/extensions/yasnippet/snippets/scala-mode/if deleted file mode 100644 index 24891c0..0000000 --- a/extensions/yasnippet/snippets/scala-mode/if +++ /dev/null @@ -1,6 +0,0 @@ -#Author : Jonas Bonèr -#name : if (cond) { .. } -# -- -if (${1:condition}) { - $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/if.else b/extensions/yasnippet/snippets/scala-mode/if.else deleted file mode 100644 index ebff471..0000000 --- a/extensions/yasnippet/snippets/scala-mode/if.else +++ /dev/null @@ -1,8 +0,0 @@ -#Author : Jonas Bonèr -#name : if (cond) { .. } else { .. } -# -- -if (${1:condition}) { - $2 -} else { - $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/imp b/extensions/yasnippet/snippets/scala-mode/imp deleted file mode 100644 index cf5efa1..0000000 --- a/extensions/yasnippet/snippets/scala-mode/imp +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : import .. -# -- -import $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/intercept b/extensions/yasnippet/snippets/scala-mode/intercept deleted file mode 100644 index 4725eaa..0000000 --- a/extensions/yasnippet/snippets/scala-mode/intercept +++ /dev/null @@ -1,6 +0,0 @@ -#Author : Jonas Bonèr -#name : intercept(classOf[T]) { ..} -# -- -intercept(classOf[${1:Exception]}) { - $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/isof b/extensions/yasnippet/snippets/scala-mode/isof deleted file mode 100644 index a3538c8..0000000 --- a/extensions/yasnippet/snippets/scala-mode/isof +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : isInstanceOf[T] -# -- -isInstanceOf[${1:type}] $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/ls.new b/extensions/yasnippet/snippets/scala-mode/ls.new deleted file mode 100644 index 7a28e61..0000000 --- a/extensions/yasnippet/snippets/scala-mode/ls.new +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : List(..) -# -- -List(${1:args}, ${2:args}) $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/ls.val-new b/extensions/yasnippet/snippets/scala-mode/ls.val-new deleted file mode 100644 index 37138f0..0000000 --- a/extensions/yasnippet/snippets/scala-mode/ls.val-new +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : val l = List(..) -# -- -val ${1:l} = List(${2:args}, ${3:args}) $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/main b/extensions/yasnippet/snippets/scala-mode/main deleted file mode 100644 index ad314b3..0000000 --- a/extensions/yasnippet/snippets/scala-mode/main +++ /dev/null @@ -1,6 +0,0 @@ -#Author : Jonas Bonèr -#name: def main(args: Array[String]) = { ... } -# -- -def main(args: Array[String]) = { - $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/map b/extensions/yasnippet/snippets/scala-mode/map deleted file mode 100644 index 17322a5..0000000 --- a/extensions/yasnippet/snippets/scala-mode/map +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : map(x => ..) -# -- -map(${1:x} => ${2:body}) $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/map.new b/extensions/yasnippet/snippets/scala-mode/map.new deleted file mode 100644 index 21c95fb..0000000 --- a/extensions/yasnippet/snippets/scala-mode/map.new +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : Map(key -> value) -# -- -Map(${1:key} -> ${2:value}) $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/match b/extensions/yasnippet/snippets/scala-mode/match deleted file mode 100644 index e85fac1..0000000 --- a/extensions/yasnippet/snippets/scala-mode/match +++ /dev/null @@ -1,6 +0,0 @@ -#Author : Jonas Bonèr -#name : cc match { .. } -# -- -${1:cc} match { - case ${2:pattern} => $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/match.can b/extensions/yasnippet/snippets/scala-mode/match.can deleted file mode 100644 index 77d475b..0000000 --- a/extensions/yasnippet/snippets/scala-mode/match.can +++ /dev/null @@ -1,11 +0,0 @@ -#Author : Jonas Bonèr -#name : can match { case Full(res) => .. } -# -- -${1:option} match { - case Full(res) => $0 - - case Empty => - - case Failure(msg, _, _) => - -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/match.option b/extensions/yasnippet/snippets/scala-mode/match.option deleted file mode 100644 index 5b098f1..0000000 --- a/extensions/yasnippet/snippets/scala-mode/match.option +++ /dev/null @@ -1,8 +0,0 @@ -#Author : Jonas Bonèr -#name : option match { case None => .. } -# -- -${1:option} match { - case None => $0 - case Some(res) => - -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/mix b/extensions/yasnippet/snippets/scala-mode/mix deleted file mode 100644 index 5261e32..0000000 --- a/extensions/yasnippet/snippets/scala-mode/mix +++ /dev/null @@ -1,6 +0,0 @@ -#Author : Jonas Bonèr -#name : trait T { .. } -# -- -trait ${1:name} { - $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/ob b/extensions/yasnippet/snippets/scala-mode/ob deleted file mode 100644 index efbc82e..0000000 --- a/extensions/yasnippet/snippets/scala-mode/ob +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : object name extends T -# -- -object ${1:name} extends ${2:type} $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/pac b/extensions/yasnippet/snippets/scala-mode/pac deleted file mode 100644 index ed32216..0000000 --- a/extensions/yasnippet/snippets/scala-mode/pac +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : package .. -# -- -package $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/pr.newline b/extensions/yasnippet/snippets/scala-mode/pr.newline deleted file mode 100644 index 77088cb..0000000 --- a/extensions/yasnippet/snippets/scala-mode/pr.newline +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : println(..) -# -- -println(${1:obj}) $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/pr.simple b/extensions/yasnippet/snippets/scala-mode/pr.simple deleted file mode 100644 index 3a73f9d..0000000 --- a/extensions/yasnippet/snippets/scala-mode/pr.simple +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : print(..) -# -- -print(${1:obj}) $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/pr.string b/extensions/yasnippet/snippets/scala-mode/pr.string deleted file mode 100644 index 9c06ef7..0000000 --- a/extensions/yasnippet/snippets/scala-mode/pr.string +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : println("..") -# -- -println("${1:msg}") $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/pr.trace b/extensions/yasnippet/snippets/scala-mode/pr.trace deleted file mode 100644 index 9a0579c..0000000 --- a/extensions/yasnippet/snippets/scala-mode/pr.trace +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : println("obj: " + obj) -# -- -println("${1:obj}: " + ${1:obj}) $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/pri b/extensions/yasnippet/snippets/scala-mode/pri deleted file mode 100644 index 643ef2c..0000000 --- a/extensions/yasnippet/snippets/scala-mode/pri +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : private -# -- -private $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/pri.param b/extensions/yasnippet/snippets/scala-mode/pri.param deleted file mode 100644 index e53638a..0000000 --- a/extensions/yasnippet/snippets/scala-mode/pri.param +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : private[this] -# -- -private[${1:this}] $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/pro b/extensions/yasnippet/snippets/scala-mode/pro deleted file mode 100644 index e4b7b59..0000000 --- a/extensions/yasnippet/snippets/scala-mode/pro +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : protected -# -- -protected $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/pro.param b/extensions/yasnippet/snippets/scala-mode/pro.param deleted file mode 100644 index 712b050..0000000 --- a/extensions/yasnippet/snippets/scala-mode/pro.param +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : protected[this] -# -- -protected[${1:this}] $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/suite b/extensions/yasnippet/snippets/scala-mode/suite deleted file mode 100644 index a65cea7..0000000 --- a/extensions/yasnippet/snippets/scala-mode/suite +++ /dev/null @@ -1,8 +0,0 @@ -#Author : Jonas Bonèr -#name : class T extends Suite { .. } -# -- -import org.scalatest._ - -class ${1:name} extends Suite { - $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/test b/extensions/yasnippet/snippets/scala-mode/test deleted file mode 100644 index c4d13f6..0000000 --- a/extensions/yasnippet/snippets/scala-mode/test +++ /dev/null @@ -1,7 +0,0 @@ -#Author : Jonas Bonèr -#name : @Test def testX = ... -# -- -//@Test -def test${1:name} = { - $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/throw b/extensions/yasnippet/snippets/scala-mode/throw deleted file mode 100644 index f9a4932..0000000 --- a/extensions/yasnippet/snippets/scala-mode/throw +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : throw new Exception -# -- -throw new ${1:Exception}(${2:msg}) $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/tr b/extensions/yasnippet/snippets/scala-mode/tr deleted file mode 100644 index 68d8162..0000000 --- a/extensions/yasnippet/snippets/scala-mode/tr +++ /dev/null @@ -1,6 +0,0 @@ -#Author : Anders Bach Nielsen -#name : trait T { .. } -# -- -trait ${1:name} { - $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/tr.ext b/extensions/yasnippet/snippets/scala-mode/tr.ext deleted file mode 100644 index 2b82154..0000000 --- a/extensions/yasnippet/snippets/scala-mode/tr.ext +++ /dev/null @@ -1,6 +0,0 @@ -#Author : Anders Bach Nielsen -#name : trait T extends C { .. } -# -- -trait ${1:name} extends ${2:class} { - $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/tr.ext-with b/extensions/yasnippet/snippets/scala-mode/tr.ext-with deleted file mode 100644 index 8edb409..0000000 --- a/extensions/yasnippet/snippets/scala-mode/tr.ext-with +++ /dev/null @@ -1,6 +0,0 @@ -#Author : Anders Bach Nielsen -#name : trait T1 extends C with T2 { .. } -# -- -trait ${1:name} extends ${2:class} with ${3:trait} { - $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/tr.with b/extensions/yasnippet/snippets/scala-mode/tr.with deleted file mode 100644 index 19801eb..0000000 --- a/extensions/yasnippet/snippets/scala-mode/tr.with +++ /dev/null @@ -1,6 +0,0 @@ -#Author : Anders Bach Nielsen -#name : trait T1 with T2 { .. } -# -- -trait ${1:name} with ${2:trait} { - $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/try b/extensions/yasnippet/snippets/scala-mode/try deleted file mode 100644 index 0c33f10..0000000 --- a/extensions/yasnippet/snippets/scala-mode/try +++ /dev/null @@ -1,9 +0,0 @@ -#Author : Jonas Bonèr -#name : try { .. } catch { case e => ..} -# -- -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/extensions/yasnippet/snippets/scala-mode/try.catch-finally b/extensions/yasnippet/snippets/scala-mode/try.catch-finally deleted file mode 100644 index f146a20..0000000 --- a/extensions/yasnippet/snippets/scala-mode/try.catch-finally +++ /dev/null @@ -1,11 +0,0 @@ -#Author : Jonas Bonèr -#name : try { .. } catch { case e => ..} finally { ..} -# -- -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/extensions/yasnippet/snippets/scala-mode/try.finally b/extensions/yasnippet/snippets/scala-mode/try.finally deleted file mode 100644 index 63625f2..0000000 --- a/extensions/yasnippet/snippets/scala-mode/try.finally +++ /dev/null @@ -1,8 +0,0 @@ -#Author : Jonas Bonèr -#name : try { .. } finally { .. } -# -- -try { - -} finally { - $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/tup.arrow b/extensions/yasnippet/snippets/scala-mode/tup.arrow deleted file mode 100644 index 4e7ad69..0000000 --- a/extensions/yasnippet/snippets/scala-mode/tup.arrow +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : element1 -> element2 -# -- -${1:element1} -> ${2:element2} $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/tup.paren b/extensions/yasnippet/snippets/scala-mode/tup.paren deleted file mode 100644 index 4bff202..0000000 --- a/extensions/yasnippet/snippets/scala-mode/tup.paren +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : (element1, element2) -# -- -(${1:element1}, ${2:element2}) $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/val b/extensions/yasnippet/snippets/scala-mode/val deleted file mode 100644 index 3067cd4..0000000 --- a/extensions/yasnippet/snippets/scala-mode/val +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : val name = .. -# -- -val ${1:name} = ${2:obj} $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/val.new b/extensions/yasnippet/snippets/scala-mode/val.new deleted file mode 100644 index 35a0c6a..0000000 --- a/extensions/yasnippet/snippets/scala-mode/val.new +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : val name = new .. -# -- -val ${1:name} = new ${2:obj} $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/val.ret b/extensions/yasnippet/snippets/scala-mode/val.ret deleted file mode 100644 index 4bf4f10..0000000 --- a/extensions/yasnippet/snippets/scala-mode/val.ret +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : val name: T = .. -# -- -val ${1:name}: ${2:T} = ${3:obj} $0 diff --git a/extensions/yasnippet/snippets/scala-mode/var b/extensions/yasnippet/snippets/scala-mode/var deleted file mode 100644 index 662d6c8..0000000 --- a/extensions/yasnippet/snippets/scala-mode/var +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : var name = .. -# -- -var ${1:name} = ${2:obj} $0 diff --git a/extensions/yasnippet/snippets/scala-mode/var.new b/extensions/yasnippet/snippets/scala-mode/var.new deleted file mode 100644 index d681c4a..0000000 --- a/extensions/yasnippet/snippets/scala-mode/var.new +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : var name = new .. -# -- -var ${1:name} = new ${2:obj} $0 diff --git a/extensions/yasnippet/snippets/scala-mode/var.ret b/extensions/yasnippet/snippets/scala-mode/var.ret deleted file mode 100644 index 9d0ac3a..0000000 --- a/extensions/yasnippet/snippets/scala-mode/var.ret +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : var name: T = .. -# -- -var ${1:name}: ${2:T} = ${3:obj} $0 diff --git a/extensions/yasnippet/snippets/scala-mode/whi b/extensions/yasnippet/snippets/scala-mode/whi deleted file mode 100644 index 082c139..0000000 --- a/extensions/yasnippet/snippets/scala-mode/whi +++ /dev/null @@ -1,6 +0,0 @@ -#Author : Jonas Bonèr -#name : while(cond) { .. } -# -- -while (${1:condition}) { - $0 -} \ No newline at end of file diff --git a/extensions/yasnippet/snippets/scala-mode/with b/extensions/yasnippet/snippets/scala-mode/with deleted file mode 100644 index 6bd94e4..0000000 --- a/extensions/yasnippet/snippets/scala-mode/with +++ /dev/null @@ -1,4 +0,0 @@ -#Author : Jonas Bonèr -#name : with T -# -- -with $0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/snippet-mode/.yas-parents b/extensions/yasnippet/snippets/snippet-mode/.yas-parents deleted file mode 100644 index eed5b44..0000000 --- a/extensions/yasnippet/snippets/snippet-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -text-mode diff --git a/extensions/yasnippet/snippets/snippet-mode/field b/extensions/yasnippet/snippets/snippet-mode/field deleted file mode 100644 index bdaf0d4..0000000 --- a/extensions/yasnippet/snippets/snippet-mode/field +++ /dev/null @@ -1,5 +0,0 @@ -# name : ${ ... } field -# contributor : joaotavora -# key : $f -# -- -\${${1:${2:n}:}$3${4:\$(${5:lisp-fn})}\}$0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/snippet-mode/mirror b/extensions/yasnippet/snippets/snippet-mode/mirror deleted file mode 100644 index 1c32eeb..0000000 --- a/extensions/yasnippet/snippets/snippet-mode/mirror +++ /dev/null @@ -1,5 +0,0 @@ -# name : ${n:$(...)} mirror -# key : $m -# contributor : joaotavora -# -- -\${${2:n}:${4:\$(${5:reflection-fn})}\}$0 \ No newline at end of file diff --git a/extensions/yasnippet/snippets/snippet-mode/vars b/extensions/yasnippet/snippets/snippet-mode/vars deleted file mode 100644 index 0e8a0a5..0000000 --- a/extensions/yasnippet/snippets/snippet-mode/vars +++ /dev/null @@ -1,11 +0,0 @@ -# -*- mode: snippet -*- -# name : Snippet header -# contributor : joaotavora -# -- -# 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/extensions/yasnippet/snippets/sql-mode/.yas-parents b/extensions/yasnippet/snippets/sql-mode/.yas-parents deleted file mode 100644 index eed5b44..0000000 --- a/extensions/yasnippet/snippets/sql-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -text-mode diff --git a/extensions/yasnippet/snippets/sql-mode/column b/extensions/yasnippet/snippets/sql-mode/column deleted file mode 100644 index 90e4963..0000000 --- a/extensions/yasnippet/snippets/sql-mode/column +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Alejandro Espinoza Esparza -#name : , ColumnName ColumnType NOT NULL... -# -- - , ${1:Name} ${2:Type} ${3:NOT NULL} diff --git a/extensions/yasnippet/snippets/sql-mode/constraint b/extensions/yasnippet/snippets/sql-mode/constraint deleted file mode 100644 index 989e508..0000000 --- a/extensions/yasnippet/snippets/sql-mode/constraint +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Alejandro Espinoza Esparza -#name : CONSTRAINT [..] PRIMARY KEY ... -# -- -CONSTRAINT [${1:PK_Name}] PRIMARY KEY ${2:CLUSTERED} ([${3:ColumnName}]) diff --git a/extensions/yasnippet/snippets/sql-mode/constraint.1 b/extensions/yasnippet/snippets/sql-mode/constraint.1 deleted file mode 100644 index 98d89f0..0000000 --- a/extensions/yasnippet/snippets/sql-mode/constraint.1 +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Alejandro Espinoza Esparza -#name : CONSTRAINT [..] FOREIGN KEY ... -# -- -CONSTRAINT [${1:FK_Name}] FOREIGN KEY ${2:CLUSTERED} ([${3:ColumnName}]) diff --git a/extensions/yasnippet/snippets/sql-mode/create b/extensions/yasnippet/snippets/sql-mode/create deleted file mode 100644 index a34624d..0000000 --- a/extensions/yasnippet/snippets/sql-mode/create +++ /dev/null @@ -1,10 +0,0 @@ -#contributor : Alejandro Espinoza Esparza -#name : create table ... -# -- -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 diff --git a/extensions/yasnippet/snippets/sql-mode/create.1 b/extensions/yasnippet/snippets/sql-mode/create.1 deleted file mode 100644 index 1323daf..0000000 --- a/extensions/yasnippet/snippets/sql-mode/create.1 +++ /dev/null @@ -1,12 +0,0 @@ -#contributor : Alejandro Espinoza Esparza -#name : create procedure ... -# -- -CREATE PROCEDURE [${1:dbo}].[${2:Name}] -( - $3 $4 = ${5:NULL} ${6:OUTPUT} -) -AS -BEGIN -$0 -END -GO diff --git a/extensions/yasnippet/snippets/sql-mode/references b/extensions/yasnippet/snippets/sql-mode/references deleted file mode 100644 index f2e4eab..0000000 --- a/extensions/yasnippet/snippets/sql-mode/references +++ /dev/null @@ -1,4 +0,0 @@ -#contributor : Alejandro Espinoza Esparza -#name : REFERENCES ... -# -- -REFERENCES ${1:TableName}([${2:ColumnName}]) diff --git a/extensions/yasnippet/snippets/text-mode/email b/extensions/yasnippet/snippets/text-mode/email deleted file mode 100644 index 1ac7f94..0000000 --- a/extensions/yasnippet/snippets/text-mode/email +++ /dev/null @@ -1,3 +0,0 @@ -#name : (user's email) -# -- -`(replace-regexp-in-string "@" "@NOSPAM." user-mail-address)` \ No newline at end of file diff --git a/extensions/yasnippet/snippets/text-mode/time b/extensions/yasnippet/snippets/text-mode/time deleted file mode 100644 index d744f1a..0000000 --- a/extensions/yasnippet/snippets/text-mode/time +++ /dev/null @@ -1,3 +0,0 @@ -#name : (current time) -# -- -`(current-time-string)` \ No newline at end of file diff --git a/extensions/yasnippet/yasnippet-debug.el b/extensions/yasnippet/yasnippet-debug.el deleted file mode 100644 index f98eb93..0000000 --- a/extensions/yasnippet/yasnippet-debug.el +++ /dev/null @@ -1,128 +0,0 @@ -;;; yasnippet-debug.el --- debug functions for yasnippet - -;; Copyright (C) 2010 João Távora - -;; Author: João Távora(defun yas/debug-snippet-vars () -;; Keywords: emulations, convenience - -;; 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: - -;; Just some debug functions - -;;; Code: - -(require 'yasnippet) - -(defun yas/debug-snippet-vars () - "Debug snippets, fields, mirrors and the `buffer-undo-list'." - (interactive) - (with-output-to-temp-buffer "*YASnippet trace*" - (princ "Interesting YASnippet vars: \n\n") - - (princ (format "\nPost command hook: %s\n" post-command-hook)) - (princ (format "\nPre command hook: %s\n" pre-command-hook)) - - (princ (format "%s live snippets in total\n" (length (yas/snippets-at-point (quote all-snippets))))) - (princ (format "%s overlays in buffer:\n\n" (length (overlays-in (point-min) (point-max))))) - (princ (format "%s live snippets at point:\n\n" (length (yas/snippets-at-point)))) - - - (dolist (snippet (yas/snippets-at-point)) - (princ (format "\tsid: %d control overlay from %d to %d\n" - (yas/snippet-id snippet) - (overlay-start (yas/snippet-control-overlay snippet)) - (overlay-end (yas/snippet-control-overlay snippet)))) - (princ (format "\tactive field: %d from %s to %s covering \"%s\"\n" - (yas/field-number (yas/snippet-active-field snippet)) - (marker-position (yas/field-start (yas/snippet-active-field snippet))) - (marker-position (yas/field-end (yas/snippet-active-field snippet))) - (buffer-substring-no-properties (yas/field-start (yas/snippet-active-field snippet)) (yas/field-end (yas/snippet-active-field snippet))))) - (when (yas/snippet-exit snippet) - (princ (format "\tsnippet-exit: at %s next: %s\n" - (yas/exit-marker (yas/snippet-exit snippet)) - (yas/exit-next (yas/snippet-exit snippet))))) - (dolist (field (yas/snippet-fields snippet)) - (princ (format "\tfield: %d from %s to %s covering \"%s\" next: %s%s\n" - (yas/field-number field) - (marker-position (yas/field-start field)) - (marker-position (yas/field-end field)) - (buffer-substring-no-properties (yas/field-start field) (yas/field-end field)) - (yas/debug-format-fom-concise (yas/field-next field)) - (if (yas/field-parent-field field) "(has a parent)" ""))) - (dolist (mirror (yas/field-mirrors field)) - (princ (format "\t\tmirror: from %s to %s covering \"%s\" next: %s\n" - (marker-position (yas/mirror-start mirror)) - (marker-position (yas/mirror-end mirror)) - (buffer-substring-no-properties (yas/mirror-start mirror) (yas/mirror-end mirror)) - (yas/debug-format-fom-concise (yas/mirror-next mirror))))))) - - (princ (format "\nUndo is %s and point-max is %s.\n" - (if (eq buffer-undo-list t) - "DISABLED" - "ENABLED") - (point-max))) - (unless (eq buffer-undo-list t) - (princ (format "Undpolist has %s elements. First 10 elements follow:\n" (length buffer-undo-list))) - (let ((first-ten (subseq buffer-undo-list 0 19))) - (dolist (undo-elem first-ten) - (princ (format "%2s: %s\n" (position undo-elem first-ten) (truncate-string-to-width (format "%s" undo-elem) 70)))))))) - -(defun yas/debug-format-fom-concise (fom) - (when fom - (cond ((yas/field-p fom) - (format "field %d from %d to %d" - (yas/field-number fom) - (marker-position (yas/field-start fom)) - (marker-position (yas/field-end fom)))) - ((yas/mirror-p fom) - (format "mirror from %d to %d" - (marker-position (yas/mirror-start fom)) - (marker-position (yas/mirror-end fom)))) - (t - (format "snippet exit at %d" - (marker-position (yas/fom-start fom))))))) - - -(defun yas/exterminate-package () - (interactive) - (yas/global-mode -1) - (yas/minor-mode -1) - (mapatoms #'(lambda (atom) - (when (string-match "yas/" (symbol-name atom)) - (unintern atom))))) - -(defun yas/debug-test (&optional quiet) - (interactive "P") - (yas/load-directory (or (and (listp yas/snippet-dirs) - (first yas/snippet-dirs)) - yas/snippet-dirs - "~/Source/yasnippet/snippets/")) - (set-buffer (switch-to-buffer "*YAS TEST*")) - (mapc #'yas/commit-snippet (yas/snippets-at-point 'all-snippets)) - (erase-buffer) - (setq buffer-undo-list nil) - (setq undo-in-progress nil) - (snippet-mode) - (yas/minor-mode 1) - (let ((abbrev)) - (setq abbrev "$f") - (insert abbrev)) - (unless quiet - (add-hook 'post-command-hook 'yas/debug-snippet-vars 't 'local))) - -(provide 'yasnippet-debug) -;;; yasnippet-debug.el ends here - diff --git a/extensions/yasnippet/yasnippet.el b/extensions/yasnippet/yasnippet.el deleted file mode 100644 index c851b44..0000000 --- a/extensions/yasnippet/yasnippet.el +++ /dev/null @@ -1,4320 +0,0 @@ -;;; Yasnippet.el --- Yet another snippet extension for Emacs. - -;; Copyright 2008 pluskid -;; 2009 pluskid, joaotavora - -;; Authors: pluskid , joaotavora -;; Version: 0.7.0 -;; Package-version: 0.7.0 -;; X-URL: http://code.google.com/p/yasnippet/ -;; Keywords: convenience, emulation -;; URL: http://code.google.com/p/yasnippet/ -;; EmacsWiki: YaSnippetMode - -;; This file 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 2, or (at your option) -;; any later version. - -;; This file 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 GNU Emacs; see the file COPYING. If not, write to -;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. - -;;; Commentary: - -;; Basic steps to setup: -;; -;; 1. In your .emacs file: -;; (add-to-list 'load-path "/dir/to/yasnippet.el") -;; (require 'yasnippet) -;; 2. Place the `snippets' directory somewhere. E.g: ~/.emacs.d/snippets -;; 3. In your .emacs file -;; (setq yas/snippet-dirs "~/.emacs/snippets") -;; (yas/load-directory yas/snippet-dirs) -;; 4. To enable the YASnippet menu and tab-trigger expansion -;; M-x yas/minor-mode -;; 5. To globally enable the minor mode in *all* buffers -;; M-x yas/global-mode -;; -;; Steps 4. and 5. are optional, you don't have to use the minor -;; mode to use YASnippet. -;; -;; 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/find-snippets -;; -;; Lets you find the snippet files in the correct -;; subdirectory of `yas/snippet-dirs', according to the -;; active major mode (if it exists) like -;; `find-file-other-window'. -;; -;; 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://code.google.com/p/yasnippet/ - -;;; Code: - -(require 'cl) -(require 'assoc) -(require 'easymenu) -(require 'help-mode) - - -;;; User customizable variables - -(defgroup yasnippet nil - "Yet Another Snippet extension" - :group 'editing) - -;;;###autoload -(defcustom yas/snippet-dirs nil - "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 () - (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 `real-modes' only submenus whose name more or less -corresponds to a major mode are listed. - -- If set to `abbreviate', only the current major-mode -menu and the modes set in `yas/extra-modes' are listed. - -Any other non-nil value, every submenu is listed." - :type '(choice (const :tag "Full" t) - (const :tag "Real modes only" real-modes) - (const :tag "Abbreviate" abbreviate)) - :group 'yasnippet) - -(defcustom yas/trigger-symbol " =>" - "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/ignore-filenames-as-triggers nil - "If non-nil, don't derive tab triggers from filenames. - -This means a snippet without a \"# key:'\ directive won't have a -tab trigger." - :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_.()" "^ ") - "A list of syntax of a key. This list is tried in the order -to try to find a key. For example, if the list is '(\"w\" \"w_\"). -And in emacs-lisp-mode, where \"-\" has the syntax of \"_\": - -foo-bar - -will first try \"bar\", if not found, then \"foo-bar\" is tried.") - -(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: - - * 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.7.0") - -(defvar yas/menu-table (make-hash-table) - "A hash table of MAJOR-MODE symbols to menu keymaps.") - -(defun teste () - (interactive) - (message "AHAHA!")) - -(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))) - (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"] - ["Find snippets..." yas/find-snippets - :help "Invoke `find-file' in the appropriate snippet directory"] - "----" - ("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 \"Real\" modes only" (setq yas/use-menu 'real-modes) - :help "Show snippet submenus for modes that appear to be real major modes" - :active t :style radio :selected (eq yas/use-menu 'real-modes)] - ["Show all modes" (setq yas/use-menu 't) - :help "Show one snippet submenu for each loaded table" - :active t :style radio :selected (eq yas/use-menu 't)] - ["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-prompt - yas/prompt-functions))) - :help "Use a normal minibuffer prompt" - :active t :style radio :selected (eq (car yas/prompt-functions) - 'yas/completing-prompt-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] - ["Ignore filenames as triggers" - (setq yas/ignore-filenames-as-triggers - (not yas/ignore-filenames-as-triggers)) - :help "If non-nil don't derive tab triggers from filenames" - :style toggle :selected yas/ignore-filenames-as-triggers] - ) - "----" - ["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) - (define-key map "\C-c&\C-f" 'yas/find-snippets) - 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 MAJOR-MODE symbols to `yas/table' objects.") - -(defvar yas/direct-keymaps (list) - "Keymap alist supporting direct snippet keybindings. - -This variable is is placed `emulation-mode-map-alists'. - -Its elements looks like (TABLE-NAME . KEYMAP) and are -calculated when loading snippets. TABLE-NAME is a variable -set buffer-locally when entering `yas/minor-mode'. KEYMAP binds -all defined direct keybindings to the command -`yas/expand-from-keymap', which acts similarly to `yas/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) - (mapc #'(lambda (table) - (push (cons (intern (format "yas//direct-%s" name)) - (yas/table-direct-keymap table)) - yas/direct-keymaps)) - (cons table (yas/table-get-all-parents table)))) - yas/tables)) - -(defun yas/direct-keymaps-set-vars () - (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)) - (dolist (mode modes-to-activate) - (let ((name (intern (format "yas//direct-%s" mode)))) - (set-default name nil) - (set (make-local-variable name) t))))) - -(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 `tas/trigger-key' key expands -snippets of code depending on the 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) - ;; Load all snippets definitions unless we still don't have a - ;; root-directory or some snippets have already been loaded. - ;; - (unless (or (null yas/snippet-dirs) - (> (hash-table-count yas/tables) 0)) - (yas/reload-all)) - ;; 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'. - ;; - (add-hook 'emulation-mode-map-alists 'yas/direct-keymaps) - (add-hook 'yas/minor-mode-hook 'yas/direct-keymaps-set-vars-runonce 'append)) - (t - ;; Uninstall the direct keymaps. - ;; - (remove-hook 'emulation-mode-map-alists 'yas/direct-keymaps)))) - -(defun yas/direct-keymaps-set-vars-runonce () - (yas/direct-keymaps-set-vars) - (remove-hook 'yas/minor-mode-hook 'yas/direct-keymaps-set-vars-runonce)) - -(defvar yas/dont-activate #'(lambda () - (and yas/snippet-dirs - (null (yas/get-snippet-tables)))) - "If non-nil don't let `yas/minor-mode-on' active 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.") -(make-variable-buffer-local 'yas/dont-activate) - -(defun yas/minor-mode-on () - "Turn on YASnippet minor mode. - -Do this unless `yas/dont-activate' is t or the function -`yas/get-snippet-tables' (which see), returns an empty list." - (interactive) - (unless (or (and (functionp yas/dont-activate) - (funcall yas/dont-activate)) - (and (not (functionp yas/dont-activate)) - yas/dont-activate)) - (yas/minor-mode 1))) - -(defun yas/minor-mode-off () - "Turn off YASnippet minor mode." - (interactive) - (yas/minor-mode -1)) - -(define-globalized-minor-mode yas/global-mode yas/minor-mode yas/minor-mode-on - :group 'yasnippet - :require 'yasnippet) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; 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" - (set-syntax-table (standard-syntax-table)) - (setq font-lock-defaults '(yas/font-lock-keywords)) - (set (make-local-variable 'require-final-newline) nil) - (use-local-map snippet-mode-map)) - - - -;;; Internal structs for template management - -(defstruct (yas/template (:constructor yas/make-blank-template)) - "A template for a snippet." - table - 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' - ) - -(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-parents' - - A list of tables considered parents of this table: i.e. when - searching for expansions they are searched as well. - -`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, this works with two steps: -;; -;; 1. `yas/remove-template-by-uuid' to remove any existing mappings by -;; snippet uuid -;; -;; 2. `yas/add-template' to add the mappings again: -;; -;; Create or index the entry in TABLES's `yas/table-hash' -;; linking KEY to a namehash. That namehash links NAME to -;; TEMPLATE, and is also created a new namehash inside that -;; entry. -;; -(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 namehashed themselves if they've become empty - ;; - (dolist (key empty-keys) - (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 (car (yas/template-menu-binding-pair 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))) - - (when menu-binding - (setf (getf (cdr menu-binding) :keys) - (or (and keybinding (key-description keybinding)) - (and key (concat key yas/trigger-symbol)))) - (setcar (cdr menu-binding) - name)) - - (puthash (yas/template-uuid template) template (yas/table-uuidhash table)))) - -(defun yas/update-template (snippet-table template) - "Add or update TEMPLATE in SNIPPET-TABLE. - -Also takes care of adding and updaring to the associated menu." - ;; Remove from table by uuid - ;; - (yas/remove-template-by-uuid snippet-table (yas/template-uuid template)) - ;; Add to table again - ;; - (yas/add-template snippet-table template) - ;; Take care of the menu - ;; - (let ((keymap (yas/menu-keymap-get-create snippet-table)) - (group (yas/template-group template))) - (when (and yas/use-menu - keymap - (not (cdr (yas/template-menu-binding-pair template)))) - ;; Remove from menu keymap - ;; - (yas/delete-from-keymap keymap (yas/template-uuid template)) - - ;; Add necessary subgroups as necessary. - ;; - (dolist (subgroup group) - (let ((subgroup-keymap (lookup-key keymap (vector (make-symbol subgroup))))) - (unless (and subgroup-keymap - (keymapp subgroup-keymap)) - (setq subgroup-keymap (make-sparse-keymap)) - (define-key keymap (vector (make-symbol subgroup)) - `(menu-item ,subgroup ,subgroup-keymap))) - (setq keymap subgroup-keymap))) - - ;; Add this entry to the keymap - ;; - (let ((menu-binding-pair (yas/snippet-menu-binding-pair-get-create template))) - (define-key keymap (vector (make-symbol (yas/template-uuid template))) (car menu-binding-pair)))))) - -(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 - (let (alist) - (maphash #'(lambda (k v) - (push (cons k v) alist)) - namehash) - alist))))) - - -;;; Filtering/condition logic - -(defun yas/eval-condition (condition) - (condition-case err - (save-excursion - (save-restriction - (save-match-data - (eval condition)))) - (error (progn - (message (format "[yas] 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/table-get-all-parents (table) - "Returns a list of all parent tables of TABLE" - (let ((parents (yas/table-parents table))) - (when parents - (append (copy-list parents) - (mapcan #'yas/table-get-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 templates) - (when (yas/filter-templates-by-condition templates) - (push key acc))) - (yas/table-hash table)) - acc))) - - -;;; 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 - (format "[yas] elisp error! %s" (error-message-string err)) - (error (format "[yas] 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 - (format "[yas] elisp error! %s" (error-message-string err)) - (error (format "[yas] 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 ((keybinding-string (or (and (string-match "\".*\"" keybinding) - (read keybinding)) - ;; "KEY-DESC" with quotes is deprecated..., but supported - keybinding))) - (read-kbd-macro keybinding-string 'need-vector)) - (error - (message "[yas] 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 the snippet table corresponding to MODE. - -Optional DIRECTORY gets recorded as the default directory to -search for snippet files if the retrieved/created table didn't -already have such a property." - (let ((table (gethash mode - yas/tables))) - (unless table - (setq table (yas/make-snippet-table (symbol-name mode))) - (puthash mode table yas/tables) - (aput 'yas/direct-keymaps (intern (format "yas//direct-%s" mode)) - (yas/table-direct-keymap table))) - table)) - -(defun yas/get-snippet-tables (&optional mode-symbol dont-search-parents) - "Get snippet tables for current buffer. - -Return a list of 'yas/table' objects indexed by mode. - -The modes are tried in this order: optional MODE-SYMBOL, then -`yas/extra-modes', then `major-mode' then, unless -DONT-SEARCH-PARENTS is non-nil, the guessed parent mode of either -MODE-SYMBOL or `major-mode'. - -Guessing is done by looking up the MODE-SYMBOL's -`derived-mode-parent' property, see also `derived-mode-p'." - (let ((mode-tables - (remove nil - (mapcar #'(lambda (mode) - (gethash mode yas/tables)) - (remove nil (append (list mode-symbol) - (yas/extra-modes) - (list major-mode - (and (not dont-search-parents) - (get major-mode - 'derived-mode-parent))))))))) - (remove-duplicates - (append mode-tables - (mapcan #'yas/table-get-all-parents mode-tables))))) - -(defun yas/menu-keymap-get-create (table) - "Get or create the main menu keymap correspondong to MODE. - -This may very well create a plethora of menu keymaps and arrange -them in all `yas/menu-table'" - (let* ((mode (intern (yas/table-name table))) - (menu-keymap (or (gethash mode yas/menu-table) - (puthash mode (make-sparse-keymap) yas/menu-table))) - (parents (yas/table-parents 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 (unless yas/ignore-filenames-as-triggers - (and name - (file-name-sans-extension name)))) - 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)))) - (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 file?) - "Return subdirs or files of DIRECTORY according to FILE?." - (remove-if (lambda (file) - (or (string-match "^\\." - (file-name-nondirectory file)) - (string-match "^#.*#$" - (file-name-nondirectory file)) - (string-match "~$" - (file-name-nondirectory file)) - (if file? - (file-directory-p file) - (not (file-directory-p file))))) - (directory-files directory t))) - -(defun yas/make-menu-binding (template) - (let ((mode (intern (yas/table-name (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))))))) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Popping up for keys and templates -;; -(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))))) - -(defvar yas/x-pretty-prompt-templates nil - "If non-nil, attempt to prompt for templates like TextMate.") -(defun yas/x-pretty-prompt-templates (prompt templates) - "Display TEMPLATES, grouping neatly by table name." - (let ((pretty-alist (list)) - menu - more-than-one-table - prefix) - (dolist (tl templates) - (aput 'pretty-alist (yas/template-table tl) (cons tl (aget pretty-alist (yas/template-table tl))))) - (setq more-than-one-table (> (length pretty-alist) 1)) - (setq prefix (if more-than-one-table - " " "")) - (dolist (table-and-templates pretty-alist) - (when (cdr table-and-templates) - (if more-than-one-table - (push (yas/table-name (car table-and-templates)) menu)) - (dolist (template (cdr table-and-templates)) - (push (cons (concat prefix (yas/template-name template)) - template) menu)))) - (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 (featurep 'ido) - 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))) - (when chosen - (nth (position chosen formatted-choices :test #'string=) filtered-choices)))) - -(defun yas/no-prompt (prompt choices &optional display-fn) - (first choices)) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Loading snippets from files -;; -(defun yas/load-directory-1 (directory &optional mode-sym parents) - "Recursively load snippet templates from DIRECTORY." - - ;; Load .yas-setup.el files wherever we find them - ;; - (let ((file (concat directory "/" ".yas-setup"))) - (when (or (file-readable-p (concat file ".el")) - (file-readable-p (concat file ".elc"))) - (load file))) - - ;; - ;; - (unless (file-exists-p (concat directory "/" ".yas-skip")) - (let* ((major-mode-and-parents (if mode-sym - (cons mode-sym parents) - (yas/compute-major-mode-and-parents (concat directory - "/dummy")))) - (yas/ignore-filenames-as-triggers - (or yas/ignore-filenames-as-triggers - (file-exists-p (concat directory "/" - ".yas-ignore-filenames-as-triggers")))) - (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 (car major-mode-and-parents) - snippet-defs - (cdr major-mode-and-parents))) - ;; now recurse to a lower level - ;; - (dolist (subdir (yas/subdirs directory)) - (yas/load-directory-1 subdir - (car major-mode-and-parents) - (cdr major-mode-and-parents)))))) - -(defun yas/load-directory (directory) - "Load snippet definition from a directory hierarchy. - -Below the top-level directory, each directory is a mode -name. And under each subdirectory, each file is a definition -of a snippet. The file name is the trigger key and the -content of the file is the template." - (interactive "DSelect the root directory: ") - (unless (file-directory-p directory) - (error "Error %s not a directory" directory)) - (unless yas/snippet-dirs - (setq yas/snippet-dirs directory)) - (dolist (dir (yas/subdirs directory)) - (yas/load-directory-1 dir)) - (when (interactive-p) - (message "[yas] Loaded snippets from %s." directory))) - -(defun yas/load-snippet-dirs () - "Reload the directories listed in `yas/snippet-dirs' or - prompt the user to select one." - (if yas/snippet-dirs - (dolist (directory (reverse (yas/snippet-dirs))) - (yas/load-directory directory)) - (call-interactively 'yas/load-directory))) - -(defun yas/reload-all (&optional reset-root-directory) - "Reload all snippets and rebuild the YASnippet menu. " - (interactive "P") - ;; Turn off global modes and minor modes, save their state though - ;; - (let ((restore-global-mode (prog1 yas/global-mode - (yas/global-mode -1))) - (restore-minor-mode (prog1 yas/minor-mode - (yas/minor-mode -1)))) - ;; Empty all snippet tables and all menu tables - ;; - (setq yas/tables (make-hash-table)) - (setq yas/menu-table (make-hash-table)) - - ;; Init the `yas/minor-mode-map', taking care not to break the - ;; menu.... - ;; - (setf (cdr yas/minor-mode-map) - (cdr (yas/init-minor-keymap))) - - (when reset-root-directory - (setq yas/snippet-dirs nil)) - - ;; Reload the directories listed in `yas/snippet-dirs' or prompt - ;; the user to select one. - ;; - (yas/load-snippet-dirs) - ;; Reload the direct keybindings - ;; - (yas/direct-keymaps-reload) - ;; Restore the mode configuration - ;; - (when restore-minor-mode - (yas/minor-mode 1)) - (when restore-global-mode - (yas/global-mode 1)) - - (message "[yas] Reloading everything... Done."))) - -(defun yas/quote-string (string) - "Escape and quote STRING. -foo\"bar\\! -> \"foo\\\"bar\\\\!\"" - (concat "\"" - (replace-regexp-in-string "[\\\"]" - "\\\\\\&" - string - t) - "\"")) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; Yasnippet Bundle - -(defun yas/initialize () - "For backward compatibility, enable `yas/minor-mode' globally" - (yas/global-mode 1)) - -(defun yas/compile-bundle - (&optional yasnippet yasnippet-bundle snippet-roots code dropdown) - "Compile snippets in SNIPPET-ROOTS to a single bundle file. - -YASNIPPET is the yasnippet.el file path. - -YASNIPPET-BUNDLE is the output file of the compile result. - -SNIPPET-ROOTS is a list of root directories that contains the -snippets definition. - -CODE is the code to be placed at the end of the generated file -and that can initialize the YASnippet bundle. - -Last optional argument DROPDOWN is the filename of the -dropdown-list.el library. - -Here's the default value for all the parameters: - - (yas/compile-bundle \"yasnippet.el\" - \"yasnippet-bundle.el\" - \"snippets\") - \"(yas/initialize-bundle) - ### autoload - (require 'yasnippet-bundle)`\" - \"dropdown-list.el\") -" - (interactive (concat "ffind the yasnippet.el file: \nFTarget bundle file: " - "\nDSnippet directory to bundle: \nMExtra code? \nfdropdown-library: ")) - - (let* ((yasnippet (or yasnippet - "yasnippet.el")) - (yasnippet-bundle (or yasnippet-bundle - "./yasnippet-bundle.el")) - (snippet-roots (or snippet-roots - "snippets")) - (dropdown (or dropdown - "dropdown-list.el")) - (code (or (and code - (condition-case err (read code) (error nil)) - code) - (concat "(yas/initialize-bundle)" - "\n;;;###autoload" ; break through so that won't - "(require 'yasnippet-bundle)"))) - (dirs (or (and (listp snippet-roots) snippet-roots) - (list snippet-roots))) - (bundle-buffer nil)) - (with-temp-file yasnippet-bundle - (insert ";;; yasnippet-bundle.el --- " - "Yet another snippet extension (Auto compiled bundle)\n") - (insert-file-contents yasnippet) - (goto-char (point-max)) - (insert "\n") - (when dropdown - (insert-file-contents dropdown)) - (goto-char (point-max)) - (insert ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n") - (insert ";;;; Auto-generated code ;;;;\n") - (insert ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n") - (insert "(defun yas/initialize-bundle ()\n" - " \"Initialize YASnippet and load snippets in the bundle.\"") - (flet ((yas/define-snippets - (mode snippets &optional parent-or-parents) - (insert ";;; snippets for " (symbol-name mode) "\n") - (let ((literal-snippets (list))) - (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 ',parent-or-parents))) - (insert "\n\n")))) - (dolist (dir dirs) - (dolist (subdir (yas/subdirs dir)) - (let ((file (concat subdir "/.yas-setup.el"))) - (when (file-readable-p file) - (insert ";; Supporting elisp for subdir " (file-name-nondirectory subdir) "\n\n") - (goto-char (+ (point) - (second (insert-file-contents file)))))) - (yas/load-directory-1 subdir nil)))) - - (insert (pp-to-string `(yas/global-mode 1))) - (insert ")\n\n" code "\n") - - ;; bundle-specific provide and value for yas/dont-activate - (let ((bundle-feature-name (file-name-nondirectory - (file-name-sans-extension - yasnippet-bundle)))) - (insert (pp-to-string `(set-default 'yas/dont-activate - #'(lambda () - (and (or yas/snippet-dirs - (featurep ',(make-symbol bundle-feature-name))) - (null (yas/get-snippet-tables))))))) - (insert (pp-to-string `(provide ',(make-symbol bundle-feature-name))))) - - (insert ";;; " - (file-name-nondirectory yasnippet-bundle) - " ends here\n")))) - -(defun yas/compile-textmate-bundle () - (interactive) - (yas/compile-bundle "yasnippet.el" - "./yasnippet-textmate-bundle.el" - "extras/imported/" - (concat "(yas/initialize-bundle)" - "\n;;;###autoload" ; break through so that won't - "(require 'yasnippet-textmate-bundle)") - "dropdown-list.el")) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; Some user level functions -;;; - -(defun yas/about () - (interactive) - (message (concat "yasnippet (version " - yas/version - ") -- pluskid /joaotavora "))) - -(defun yas/define-snippets (mode snippets &optional parent-mode) - "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. - -Optional PARENT-MODE can be used to specify the parent tables of -MODE. It can be a mode symbol of a list of mode symbols. It does -not need to be a real mode." - ;; X) `snippet-table' is created or retrieved for MODE, same goes - ;; for the list of snippet tables `parent-tables'. - ;; - (let ((snippet-table (yas/table-get-create mode)) - (parent-tables (mapcar #'yas/table-get-create - (if (listp parent-mode) - parent-mode - (list parent-mode)))) - (template nil)) - ;; X) Connect `snippet-table' with `parent-tables'. - ;; - ;; TODO: this should be a remove-duplicates of the concatenation - ;; of `snippet-table's existings parents with the new parents... - ;; - (dolist (parent parent-tables) - (unless (find parent (yas/table-parents snippet-table)) - (push parent - (yas/table-parents snippet-table)))) - - ;; X) Now, iterate for evey snippet def list - ;; - (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 (or (car snippet) - (unless yas/ignore-filenames-as-triggers - (and file - (file-name-sans-extension (file-name-nondirectory file)))))) - (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)) - -(defun yas/snippet-menu-binding-pair-get-create (template &optional type) - "Get TEMPLATE's menu binding or assign it a new one." - (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/show-menu-p (mode) - (cond ((eq yas/use-menu 'abbreviate) - (find mode - (mapcar #'(lambda (table) - (intern (yas/table-name table))) - (yas/get-snippet-tables)))) - ((eq yas/use-menu 'real-modes) - (yas/real-mode? mode)) - (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 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 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. -" - (let* ((table (yas/table-get-create mode)) - (hash (yas/table-uuidhash table))) - (yas/define-menu-1 table - (yas/menu-keymap-get-create table) - 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 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 keymap (vector (make-symbol (second e))) - (car (yas/snippet-menu-binding-pair-get-create template :stay))))) - ((eq (first e) 'yas/submenu) - (let ((subkeymap (make-sparse-keymap))) - (define-key keymap (vector (make-symbol(second e))) - `(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 keymap (vector (gensym)) - '(menu-item "----"))) - (t - (message "[yas] 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'." - (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* ((vec (this-command-keys-vector)) - (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))) - - - -;;; 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)) - (message "[yas] 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] %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 (intern (yas/table-name (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 choose-instead-of-guess) - "" - (interactive "P") - (let ((guessed-directories (yas/guess-snippet-directories))) - - (switch-to-buffer "*new snippet*") - (erase-buffer) - (kill-all-local-variables) - (snippet-mode) - (set (make-local-variable 'yas/guessed-modes) (mapcar #'(lambda (d) - (intern (yas/table-name (car d)))) - guessed-directories)) - (unless (and choose-instead-of-guess - (not (y-or-n-p "Insert a snippet with useful headers? "))) - (yas/expand-snippet "\ -# -*- mode: snippet -*- -# name: $1 -# key: $2${3: -# binding: ${4:direct-keybinding}}${5: -# expand-env: ((${6:some-var} ${7:some-value}))}${8: -# type: command} -# -- -$0")))) - -(defun yas/find-snippets (&optional same-window ) - "Find snippet file in guessed current mode's directory. - -Calls `find-file' interactively in the guessed directory. - -With prefix arg SAME-WINDOW opens the buffer in the same window. - -Because snippets can be loaded from many different locations, -this has to guess the correct directory using -`yas/guess-snippet-directories', which returns a list of -options. - -If any one of these exists, it is taken and `find-file' is called -there, otherwise, proposes to create the first option returned by -`yas/guess-snippet-directories'." - (interactive "P") - (let* ((guessed-directories (yas/guess-snippet-directories)) - (chosen) - (buffer)) - (setq chosen (yas/make-directory-maybe (first guessed-directories) " main")) - (unless chosen - (if (y-or-n-p (format "Continue guessing for other active tables %s? " - (mapcar #'(lambda (table-and-dirs) - (yas/table-name (car table-and-dirs))) - (rest guessed-directories)))) - (setq chosen (some #'yas/make-directory-maybe - (rest guessed-directories))))) - (unless chosen - (when (y-or-n-p "Having trouble... go to snippet root dir? ") - (setq chosen (first (yas/snippet-dirs))))) - (if chosen - (let ((default-directory chosen)) - (setq buffer (call-interactively (if same-window - 'find-file - 'find-file-other-window))) - (when buffer - (save-excursion - (set-buffer buffer) - (when (eq major-mode 'fundamental-mode) - (snippet-mode))))) - (message "Could not guess snippet dir!")))) - -(defun yas/compute-major-mode-and-parents (file &optional prompt-if-failed) - (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)) - (when prompt-if-failed - (read-from-minibuffer - "[yas] Cannot auto-detect major mode! Enter a major mode: ")))) - (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") - (let ((yas/ignore-filenames-as-triggers - (or yas/ignore-filenames-as-triggers - (and buffer-file-name - (locate-dominating-file - buffer-file-name - ".yas-ignore-filenames-as-triggers"))))) - (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 shit - ;; - ;; 1) if `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). - ;; - ;; 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] 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)) - (message "[yas] 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] 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)) - (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 't 'local)))) - (t - (message "[yas] 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-alist (list)) - group) - (maphash #'(lambda (k v) - (setq group (or (yas/template-fine-group v) - "(top level)")) - (when (yas/template-name v) - - (aput 'groups-alist group (cons v (aget groups-alist group))))) - (yas/table-uuidhash table)) - (dolist (group-and-templates groups-alist) - (when (rest group-and-templates) - (setq group (truncate-string-to-width (car group-and-templates) 25 0 ? "...")) - (insert (make-string 100 ?-) "\n") - (dolist (p (cdr group-and-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"))))))) - - - - - -;;; 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 (format "[yas] 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 () - (if yas/current-template - (if (y-or-n-p "This snippet is unimplemented. Visit the snippet definition? ") - (yas/visit-snippet-file-1 yas/current-template)) - (message "No implementation."))) - - -;;; 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/deleted-text nil - "The text deleted in the last snippet expansion.") - -(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) -(make-variable-buffer-local 'yas/deleted-text) - -(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 (zerop (- (yas/field-start field) (yas/field-end field))) - (or (yas/field-parent-field field) - (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)) - (overlays-at (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 (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 ((>= 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) - (let ((inhibit-modification-hooks t)) - (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) - (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))) - - -;;; Some low level snippet-routines - -(defun yas/commit-snippet (snippet) - "Commit SNIPPET, but leave point as it is. This renders the -snippet as ordinary text. - -Return a buffer position where the point should be placed if -exiting the snippet. - -NO-HOOKS means don't run the `yas/after-exit-snippet-hook' hooks." - - (let ((control-overlay (yas/snippet-control-overlay snippet)) - yas/snippet-beg - yas/snippet-end) - ;; - ;; 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)) - - (let ((inhibit-modification-hooks t)) - (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))) - - (message "[yas] snippet %s exited." (yas/snippet-id snippet))) - -(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 snippets-left - (remove-hook 'post-command-hook 'yas/post-command-handler 'local) - (remove-hook 'pre-command-hook 'yas/pre-command-handler 'local) - (if snippet-exit-transform - (yas/eval-lisp-no-saves snippet-exit-transform) - (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 '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)))) - -(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 (yas/undo-in-progress) - (let* ((field (overlay-get yas/active-field-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)) - (let ((saved-point (point))) - (yas/field-update-display field (car (yas/snippets-at-point))) - (goto-char saved-point)) - (yas/update-mirrors (car (yas/snippets-at-point)))) - (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 - (let ((inhibit-modification-hooks t)) - (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'" - (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!$") - - -;;; Apropos stacked 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) - (setq yas/deleted-text to-delete)) - - (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 ((inhibit-modification-hooks t) - (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))) - - (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))) - (message "[yas] 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) - - (add-hook 'post-command-hook 'yas/post-command-handler nil t) - (add-hook 'pre-command-hook 'yas/pre-command-handler t t) - - (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)) - - ;; Setup hooks - (add-hook 'post-command-hook 'yas/post-command-handler nil t) - (add-hook 'pre-command-hook 'yas/pre-command-handler t t) - - 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 called "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) - (let ((parent (yas/fom-parent-field fom))) - (when parent - (yas/advance-end-maybe parent 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 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 (message "[yas] warning: yas/indent-according-to-mode habing 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)) - ;; stacked expansion: I added an `inhibit-modification-hooks' - ;; here, for safety, may need to remove if we the mechanism is - ;; altered. - ;; - (let ((inhibit-modification-hooks t) - (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)) - (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 ((inhibit-modification-hooks t) - (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)) - (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)))) - - -;;; Pre- and post-command hooks: - -(defvar yas/post-command-runonce-actions nil - "List of actions to run once `post-command-hook'. - -Each element of this list looks like (FN . ARGS) where FN is -called with ARGS as its arguments after the currently executing -snippet command. - -After all actions have been run, this list is emptied, and after -that the rest of `yas/post-command-handler' runs.") - -(defun yas/pre-command-handler () ) - -(defun yas/post-command-handler () - "Handles various yasnippet conditions after each command." - (when yas/post-command-runonce-actions - (condition-case err - (mapc #'(lambda (fn-and-args) - (apply (car fn-and-args) - (cdr fn-and-args))) - yas/post-command-runonce-actions) - (error (message "[yas] problem running `yas/post-command-runonce-actions'!"))) - (setq yas/post-command-runonce-actions nil)) - (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: - -(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))))) - - -;;; Some hacks: -;; `locate-dominating-file' is added for compatibility in emacs < 23 -(unless (or (eq emacs-major-version 23) - (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)))) - -(provide 'yasnippet) - -;;; yasnippet.el ends here