$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/doc/compile-doc.py b/doc/compile-doc.py
deleted file mode 100755
index 2d325e7..0000000
--- a/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/doc/define_snippet.rst b/doc/define_snippet.rst
deleted file mode 100644
index 9e312c3..0000000
--- a/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/doc/faq.rst b/doc/faq.rst
deleted file mode 100644
index 6eec677..0000000
--- a/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$1>
-
-.. _discussion group: http://groups.google.com/group/smart-snippet
diff --git a/doc/html4css1.css b/doc/html4css1.css
deleted file mode 100644
index bf10767..0000000
--- a/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/doc/index.rst b/doc/index.rst
deleted file mode 100644
index 7415186..0000000
--- a/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/doc/manual.org b/doc/manual.org
new file mode 100644
index 0000000..8c247c6
--- /dev/null
+++ b/doc/manual.org
@@ -0,0 +1,266 @@
+#+TITLE: Yet another snippet extension
+#+OPTIONS: toc:1
+#+STARTUP: showall
+
+#+STYLE:
+
+# External links
+#
+#+LINK: smart-snippet http://code.google.com/p/smart-snippet
+#+LINK: pluskid http://pluskid.lifegoo.org
+
+#+LINK: screencast http://www.youtube.com/watch?v=ZCGmZK4V7Sg
+#+LINK: docs http://capitaomorte.github.com/yasnippet
+#+LINK: issues https://github.com/capitaomorte/yasnippet/issues
+#+LINK: googlecode-tracker http://code.google.com/p/yasnippet/issues/list
+#+LINK: forum http://groups.google.com/group/smart-snippet
+
+
+* Quick start
+
+ *YASnippet* is a template system for Emacs. It allows you to type an
+ abbreviation and automatically expand it into function templates. Bundled
+ language templates includes: C, C++, C#, Perl, Python, Ruby, SQL, LaTeX, HTML,
+ CSS and more. The snippet syntax is inspired from TextMate's syntax, you can
+ even [[#import-textmate][import most TextMate snippets]]
+
+ YASnippet is an original creation of [[pluskid]] who also wrote its predecessor
+ [[smart-snippet]].
+
+** Watch a demo
+
+ [[youtube]]
+
+** Installation
+
+ Clone this repository somewhere
+
+ #+begin_example
+ $ cd ~/.emacs.d/plugins
+ $ git clone https://github.com/capitaomorte/yasnippet
+ #+end_example
+
+ Add the following in your =.emacs= file:
+
+ #+begin_src emacs-lisp :exports code
+ (add-to-list 'load-path
+ "~/.emacs.d/plugins/yasnippet")
+ (require 'yasnippet)
+ (yas/global-mode 1)
+ #+end_src
+
+ Add your own snippets to =~/.emacs.d/snippets= by placing files there or
+ invoking [[#yas-new-snippet][=yas-new-snippet=]].
+
+** Import textmate snippets (rails example)
+ :PROPERTIES:
+ :CUSTOM_ID: import-textmate
+ :END:
+
+ YASnippet lets you use TextMate bundles directly:
+
+ #+begin_example
+ $ cd ~/.emacs.d/plugins
+ $ git clone https://github.com/capitaomorte/yasnippet
+ $ cd yasnippet
+ $ git submodule init
+ $ git submodule update
+ $ gem install plist trollop
+ $ rake convert_bundles # will convert ruby, rails and html bundles from drnic
+ #+end_example
+
+ Then, in your =.emacs= file
+
+ #+begin_example
+ (add-to-list 'load-path
+ "~/.emacs.d/plugins/yasnippet")
+ (require 'yasnippet)
+ (setq yas/snippet-dirs '("~/.emacs.d/snippets" "~/.emacs.d/extras/imported"))
+ (yas/global-mode 1)
+ #+end_example
+
+ Open some rails file (model, app, etc) and start using the textmate
+ snippets. Consider that this is a work-in-progress and many snippets/commands
+ might not work. Patches welcome!
+
+** Contributing snippets
+
+ Please *do not ask me* to add snippets to the default collection under
+ =/snippets=. This collection is considered frozen. By customizing
+ [[#yas-snippet-dirs][=yas-snippet-dirs=]] you can point yasnippet to good
+ snippet collections out there.
+
+ The =extras/textmate-import.rb= tool can import many actual Textmate
+ snippets. I'm focusing on developing it and the accompanying =yas-setup.el=
+ files that guide it with more difficult importations. The idea is to deprecate
+ =/snippets= and replace it with =extras/imported=.
+
+** Documentation, issues, etc
+
+ Please refer to the comprehensive [[docs][documentation]] for full
+ customization and support. If you think you've found a bug, please report it
+ on [[issues][the GitHub issue tracker]]. (please **do not** submit new
+ issues to the old [[googlecode-tracker][googlecode tracker]])
+
+ If you run into problems using YASnippet, or have snippets to contribute,
+ post to the [[forum][yasnippet forum]]. Thank you very much for using
+ YASnippet!
+
+* Organizing snippets
+
+** Basic structure
+
+ Snippet collections can be stored in plain text files. They are arranged by
+ sub-directories naming *snippet tables*. These mostly name Emacs major names.
+
+ #+begin_example
+ .
+ |-- c-mode
+ | `-- printf
+ |-- java-mode
+ | `-- println
+ `-- text-mode
+ |-- email
+ `-- time
+ #+end_example
+
+ The collections are loaded into *snippet tables* which the triggering
+ mechanism (see [[#expand-snippets][Expanding snippets]]) looks up and
+ (hopefully) cause the right snippet to be expanded for you.
+
+** Setting up =yas-snippet-dirs=
+
+ The emacs variable [[#yas-snippet-dirs][=yas-snippet-dirs=]] tells YASnippet
+ which collections to consider. It's used when you activate
+ [[#yas-global-mode][=yas-global-mode=]] or call
+ [[#yas-reload-all][=yas-reload-all=]] interactively.
+
+ The default considers:
+
+ - a personal collection that lives in =~/.emacs.d/snippets=
+ - the bundled collection, taken as a relative path to =yasnippet.el= localtion
+
+ When you come across other snippet collections, do the following to try them
+ out:
+
+ #+begin_src emacs-lisp :exports code
+ ;; Develop in ~/emacs.d/mysnippets, but also
+ ;; try out snippets in ~/Downloads/interesting-snippets
+ (setq yas/snippet-dirs '("~/emacs.d/mysnippets"
+ "~/Downloads/interesting-snippets"))
+
+ ;; OR, keeping yasnippet's defaults try out ~/Downloads/interesting-snippets
+ (setq yas/snippet-dirs (append yas/snippet-dirs
+ '("~/Downloads/interesting-snippets")))
+ #+end_src
+
+ Collections appearing earlier in the list shadow snippets with same names
+ appearing in collections later in the list. [[#yas-new-snippet][=yas-new-snippet=]] always stores
+ snippets in the first collection.
+
+** The =.yas.parents= file
+
+ It's very useful to have certain modes share snippets between themselves. To do
+ this, choose a mode subdirectory and place a =.yas-parents= containing a
+ whitespace-separated list of other mode names. When you reload those modes
+ become parents of the original mode.
+
+ #+begin_example
+ .
+ |-- 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
+ #+end_example
+
+** TODO The =.yas-make-groups= file
+
+ If you place an empty plain text file =.yas-make-groups= inside one of the
+ mode directories, the names of these sub-directories are considered groups of
+ snippets and [[snippet-menu][the menu]] is organized much more cleanly:
+
+ (TODO image)
+
+ Another alternative way to achieve this is to place a =# group:= directive
+ inside the snippet definition. See [[#writing-snippets][Writing Snippets]]
+
+ #+begin_example
+ $ tree ruby-mode/
+ ruby-mode/
+ |-- .yas-make-groups
+ |-- collections
+ | |-- each
+ | `-- ...
+ |-- control structure
+ | |-- forin
+ | `-- ...
+ |-- definitions
+ | `-- ...
+ `-- general
+ `-- ...
+ #+end_example
+
+ Yet another way to create a nice snippet menu is to write into
+ =.yas-make-groups= a menu definition. TODO
+
+** TODO The =.yas-setup.el= file
+
+*** TODO
+
+** TODO The =.yas-compiled-snippet.el= file
+
+*** TODO
+
+** The =.yas-skip= file
+
+* Expanding Snippets
+
+ :PROPERTIES:
+ :CUSTOM_ID: expand-snippets
+ :END:
+
+ This section describes how YASnippet chooses snippets for expansion at point.
+
+ Maybe, you'll want some snippets to be expanded in a particular
+ mode, or only under certain conditions, or be prompted using
+
+** Triggering expansion
+
+ To make a snippet expand after the cursor:
+
+ * Type an the snippet's *trigger key* then press the key defined in
+ [[#yas-trigger-key][=yas-trigger-key=]] (usually to "TAB").
+
+ * Use the snippet's *keybinding*.
+
+ * Call [[#yas-insert-snippet][=yas-insert-snippet=]] (use =M-x
+ yas-insert-snippet== or its keybinding =C-c & C-s=).
+
+ * By expanding directly from the "YASnippet" menu in the menu-bar
+
+ * Using hippie-expand
+
+ * Use m2m's excellent auto-complete
+
+* Reference
+#+BEGIN_SRC emacs-lisp :exports results :results value raw
+(yas--document-symbols 2 `("Interactive functions" . ,#'interactive-form)
+ `("Customization variables" . ,#'(lambda (sym)
+ (and (boundp sym)
+ (get sym 'standard-value))))
+ `("Useful functions" . ,#'fboundp)
+ `("Useful variables" . ,#'boundp))
+#+END_SRC
+# Local Variables:
+# mode: org
+# fill-column: 80
+# coding: utf-8
+# End:
diff --git a/doc/snippet-development.rst b/doc/snippet-development.rst
deleted file mode 100644
index bb3c7a5..0000000
--- a/doc/snippet-development.rst
+++ /dev/null
@@ -1,630 +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 the snippet will not be expandable through the key mechanism.
-
-``# 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.
-
-``# 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/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/doc/snippet-expansion.rst b/doc/snippet-expansion.rst
deleted file mode 100644
index 8b64807..0000000
--- a/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.
-* Your window system may or may not allow to you use ``C-n``, ``C-p``
- to navigate this menu.
-* This function can't be used when in a terminal.
-
-.. 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/doc/snippet-menu.rst b/doc/snippet-menu.rst
deleted file mode 100644
index a40c5a8..0000000
--- a/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/doc/snippet-organization.rst b/doc/snippet-organization.rst
deleted file mode 100644
index bed3acb..0000000
--- a/doc/snippet-organization.rst
+++ /dev/null
@@ -1,183 +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.
-
-The ``.yas.parents`` file
--------------------------
-
-It's very useful to have certain modes share snippets between
-themselves. To do this, choose a mode subdirectory and place a
-``.yas-parents`` containing a whitespace-separated list of other
-mode names. When you reload those modes become parents of the
-original mode.
-
-.. 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
- `-- ...
-
-
-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/doc/styles.css b/doc/styles.css
deleted file mode 100644
index e0afa09..0000000
--- a/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/doc/stylesheets/styles.css b/doc/stylesheets/styles.css
new file mode 100644
index 0000000..a158012
--- /dev/null
+++ b/doc/stylesheets/styles.css
@@ -0,0 +1,93 @@
+@media all
+{
+ body {
+ margin: 1em auto;
+ /*margin: 10px 18% 10px 18%;*/
+ font-family: Arial;
+ /*text-align: justify;*/
+ font-size: 14pt;
+ padding: 10px;
+ line-height: 1.2em;
+ max-width: 600pt;
+ }
+
+ div#table-of-contents {
+ position: fixed;
+ left: 0%;
+ right: 0%;
+ top: 0px;
+ z-index: 100;
+ background: black;
+ }
+
+ div#table-of-contents h2 {
+ display: none;
+ }
+
+ div#table-of-contents a {
+ text-decoration: none;
+ color: white;
+ }
+
+ div#table-of-contents a:visited {
+ color: white;
+ }
+
+ div#table-of-contents a:hover {
+ color: orange;
+ }
+
+ div.outline-2 h2{
+ padding-top: 50px;
+ }
+
+ div#text-table-of-contents {
+ text-color: white;
+ text-align: center;
+ margin-left: 30%;
+ margin-right: 30%;
+ }
+
+ div#text-table-of-contents ul {
+ height: 2em;
+ width: 500px;
+ list-style: none;
+ margin: auto;
+ }
+
+ div#text-table-of-contents ul li {
+ float: left;
+ margin-left:auto;
+ margin-right: auto;
+ padding-left: 10px;
+ }
+
+ div#postamble{
+ position: fixed;
+ width: 800px;
+ height: 250px;
+ left: 50%;
+ right: 50%;
+ margin:-75px 0 0 -400px;
+ bottom: -20px;
+ font-size: 10pt;
+ color: grey;
+ background: url('siscog-bottom-logo.png') no-repeat;
+ /* background-size: 100% 100%; */
+ }
+
+ div#postamble *{
+ display: none;
+ }
+
+ div#postamble p.date{
+ position: relative;
+ bottom: -200px;
+ text-align: center;
+ display: block;
+ }
+
+
+
+
+}
\ No newline at end of file
diff --git a/doc/template.txt b/doc/template.txt
deleted file mode 100644
index e01d73d..0000000
--- a/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/doc/yas-doc-helper.el b/doc/yas-doc-helper.el
new file mode 100755
index 0000000..3217834
--- /dev/null
+++ b/doc/yas-doc-helper.el
@@ -0,0 +1,102 @@
+;;; yas-doc-helper.el --- Help generate documentation for YASnippet
+
+;; Copyright (C) 2012 João Távora
+
+;; Author: João Távora
+;; Keywords: 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:
+
+;; Some functions to help generate YASnippet docs
+
+;;; Code:
+
+(defun yas--document-symbol (symbol level)
+ (flet ((concat-lines (&rest lines)
+ (mapconcat #'identity lines "\n")))
+ (let* ((stars (make-string level ?*))
+ (heading (cond ((fboundp symbol)
+ (format "%s =%s= (%s)"
+ stars
+ symbol
+ (mapconcat #'symbol-name
+ (help-function-arglist symbol t) " ")))
+ (t
+ (format "%s =%s=\n" stars symbol))))
+ (after-heading
+ (concat-lines ":PROPERTIES:"
+ (format ":CUSTOM_ID: %s" symbol)
+ ":END:"))
+ (body (or (cond ((boundp symbol)
+ (documentation-property symbol 'variable-documentation t))
+ ((fboundp symbol)
+ (documentation-property symbol 'function-documentation t))
+ (t
+ (format "*WARNING*: no symbol named =%s=" symbol)))
+ (format "*WARNING*: no doc for symbol =%s=" symbol)))
+ (case-fold-search nil))
+ ;; do some transformations on the body: FOO becomes /foo/ and
+ ;; `bar' becomes [[#bar][=bar=]]
+ (setq body (replace-regexp-in-string
+ "[A-Z][A-Z-]+" #'(lambda (match)
+ (format "/%s/" (downcase match)))
+ body)
+ body (replace-regexp-in-string "`\\([a-z-]+\\)'" #'(lambda (match)
+ (let* ((name (downcase (match-string 1 match)))
+ (sym (intern name)))
+ (if (and (or (boundp sym)
+ (fboundp sym))
+ (save-match-data
+ (string-match "^yas-" name)))
+ (format "[[#%s][=%s=]]"
+ name name)
+ (format "=%s=" name))))
+ body))
+ ;; output the paragraph
+ ;;
+ (concat-lines heading
+ after-heading
+ body))))
+
+(defun yas--document-symbols (level &rest names-and-predicates)
+ (let ((sym-lists (make-vector (length names-and-predicates) (list)))
+ (retval ""))
+ (loop for sym in yas--exported-syms
+ do (loop for test in (mapcar #'cdr names-and-predicates)
+ for i from 0
+ do (when (funcall test sym)
+ (push sym (aref sym-lists i))
+ (return))))
+ (loop for slist across sym-lists
+ for name in (mapcar #'car names-and-predicates)
+ do (progn
+ (setq retval
+ (concat retval
+ (format "\n** %s\n" name)
+ (mapconcat #'yas--document-symbol slist "\n\n")))))
+ retval))
+
+(defun yas--internal-link-snippet ()
+ (interactive)
+ (yas-expand-snippet "[[#$1][=${1:`yas/selected-text`}=]]"))
+
+(define-key org-mode-map [M-f8] 'yas--internal-link-snippet)
+
+(provide 'yas-doc-helper)
+;;; yas-doc-helper.el ends here
+;; Local Variables:
+;; coding: utf-8
+;; End:
diff --git a/extras/imported/html-mode/.yas-setup.el b/extras/imported/html-mode/.yas-setup.el
index 2b18e02..e6faf15 100644
--- a/extras/imported/html-mode/.yas-setup.el
+++ b/extras/imported/html-mode/.yas-setup.el
@@ -1,19 +1,19 @@
;; .yas-setup.el for html-mode
-(defvar yas/html-default-tag "p")
+(defvar yas-html-default-tag "p")
-(defvar yas/html-xhtml-attr "")
+(defvar yas-html-xhtml-attr "")
-(defvar yas/html-just-like-tm nil
+(defvar yas-html-just-like-tm nil
"Html-mode snippets behave as close to TextMate as possible.")
-(defun yas/html-activate ()
- (add-to-list (make-local-variable 'yas/mode-symbol) 'html-mode))
+(defun yas-html-activate ()
+ (add-to-list (make-local-variable 'yas-mode-symbol) 'html-mode))
-(add-hook 'nxml-mode-hook 'yas/html-activate)
-(add-hook 'rhtml-mode-hook 'yas/html-activate)
+(add-hook 'nxml-mode-hook 'yas-html-activate)
+(add-hook 'rhtml-mode-hook 'yas-html-activate)
-(defun yas/html-remove-preceding-word ()
+(defun yas-html-remove-preceding-word ()
(interactive)
(let (word-begin
word-end
@@ -38,59 +38,59 @@
retval))))
-(defun yas/html-first-word (string)
+(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)))
+(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${1:$(yas/html-first-word yas/text)}>%s"
- (or yas/html-default-tag
+ (yas-expand-snippet (format "<${1:%s}>%s${1:$(yas-html-first-word yas-text)}>%s"
+ (or yas-html-default-tag
"p")
- (if yas/html-just-like-tm "$2" "$0")
+ (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)))
+ (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)))
+ (yas-expand-snippet (format "<%s $1%s/>%s" tag yas-html-xhtml-attr suffix)))
(t
- (yas/expand-snippet (format "<%s>%s%s>%s"
+ (yas-expand-snippet (format "<%s>%s%s>%s"
tag
- (if yas/html-just-like-tm "$1" "$0")
+ (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
+(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
"" mirror ">")))
(setq template (replace-regexp-in-string "\n" (concat "" mirror ">\n<$1>") template))
- (yas/expand-snippet template)))
+ (yas-expand-snippet template)))
-(defun yas/html-toggle-wrap (string wrap)
+(defun yas-html-toggle-wrap (string wrap)
(or (and string
(string-match (format "<%s>\\(.*\\)%s>" wrap wrap)
string)
(match-string 1 string))
(concat wrap string wrap)))
-(defun yas/html-between-tag-pair-p ()
+(defun yas-html-between-tag-pair-p ()
(save-excursion
(backward-word)
(looking-at "\\\w+>\\\w+>")))
-(defun yas/html-id-from-string (string)
+(defun yas-html-id-from-string (string)
(replace-regexp-in-string " " "_" (downcase string)))
-(defun yas/html-tidy ()
+(defun yas-html-tidy ()
(interactive)
(let ((start (or (and mark-active
(region-beginning))
@@ -104,11 +104,11 @@
(goto-char (min (point-max) orig))
(recenter (1- orig-line))))
-(defun yas/html-tag-description ()
+(defun yas-html-tag-description ()
(interactive)
(let* ((tag-at-point (sgml-beginning-of-tag))
(fragment (and tag-at-point
- (cdr (assoc (upcase tag-at-point) yas/html-tag-description-urls)))))
+ (cdr (assoc (upcase tag-at-point) yas-html-tag-description-urls)))))
(if fragment
(browse-url (concat "http://www.w3.org/TR/html4/index/"
fragment))
@@ -116,7 +116,7 @@
(message "No documentation for " tag-at-point)
(message "Not on a HTML tag.")))))
-(defvar yas/html-tag-description-urls
+(defvar yas-html-tag-description-urls
'(("A" . "../struct/links.html#edef-A")
("ABBR" . "../struct/text.html#edef-ABBR")
("ACRONYM" . "../struct/text.html#edef-ACRONYM")
@@ -213,18 +213,18 @@
;;
;; 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`
+;; ${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)
+;; 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
;;
@@ -248,28 +248,28 @@
;; ^@W =yyas> C-c M-W
;;
;; # as in Snippets/XHTML   NonBreakingSpace.yasnippet
-;; ~ =yyas> (yas/unknown)
+;; ~ =yyas> (yas-unknown)
;;
;; # as in Commands/Insert Entity.yasnippet
-;; @& =yyas> (yas/unknown)
+;; @& =yyas> (yas-unknown)
;;
;; # as in Commands/Refresh All Active Browsers.yasnippet
-;; @r =yyas> (yas/unknown)
+;; @r =yyas> (yas-unknown)
;;
;; # as in Commands/Persistent Include.yasnippet
-;; ^@i =yyas> (yas/unknown)
+;; ^@i =yyas> (yas-unknown)
;;
;; # as in Commands/CodeCompletion HTML Tags.yasnippet
-;; ~ =yyas> (yas/unknown)
+;; ~ =yyas> (yas-unknown)
;;
;; # as in Commands/Update Includes.yasnippet
-;; ^@u =yyas> (yas/unknown)
+;; ^@u =yyas> (yas-unknown)
;;
;; # as in Macros/Delete whitespace between tags.yasnippet
-;; ^~ =yyas> (yas/unknown)
+;; ^~ =yyas> (yas-unknown)
;;
;; # as in Commands/Tidy.yasnippet
-;; ^H =yyas> (yas/unknown)
+;; ^H =yyas> (yas-unknown)
;;
;;
;; --**--
@@ -277,180 +277,180 @@
;;
;; Translated menu
;;
-(yas/define-menu 'html-mode
+(yas-define-menu 'html-mode
'(;; Documentation for Tag
- (yas/item "637CEA2B-578C-429C-BB74-30E8D42BFA22")
+ (yas-item "637CEA2B-578C-429C-BB74-30E8D42BFA22")
;; Ignoring Validate Syntax (W3C)
- (yas/ignore-item "3F26240E-6E4A-11D9-B411-000D93589AF6")
+ (yas-ignore-item "3F26240E-6E4A-11D9-B411-000D93589AF6")
;; Open Document in Running Browser(s)
- (yas/item "970EE6B4-A091-11D9-A5A2-000D93C8BE28")
+ (yas-item "970EE6B4-A091-11D9-A5A2-000D93C8BE28")
;; Ignoring Refresh Running Browser(s)
- (yas/ignore-item "B8651C6E-A05E-11D9-86AC-000D93C8BE28")
+ (yas-ignore-item "B8651C6E-A05E-11D9-86AC-000D93C8BE28")
- (yas/submenu "Entities"
+ (yas-submenu "Entities"
(;; Ignoring Convert Character / Selection to Entities
- (yas/ignore-item "3DD8406C-A116-11D9-A5A2-000D93C8BE28")
+ (yas-ignore-item "3DD8406C-A116-11D9-A5A2-000D93C8BE28")
;; Ignoring Convert Character / Selection to Entities Excl. Tags
- (yas/ignore-item "43C9E8AE-3E53-4B82-A1AF-56697BB3EF09")
+ (yas-ignore-item "43C9E8AE-3E53-4B82-A1AF-56697BB3EF09")
;; Ignoring Decode Entities in Line / Selection
- (yas/ignore-item "C183920D-A126-11D9-A5A2-000D93C8BE28")
+ (yas-ignore-item "C183920D-A126-11D9-A5A2-000D93C8BE28")
;; Non-Breaking Space
- (yas/item "73B40BAE-A295-11D9-87F7-000D93C8BE28")
+ (yas-item "73B40BAE-A295-11D9-87F7-000D93C8BE28")
;; →
- (yas/item "C70BB693-0954-4440-AEB4-F2ADD6D923F0")
+ (yas-item "C70BB693-0954-4440-AEB4-F2ADD6D923F0")
;; â†
- (yas/item "C0418A4A-7E42-4D49-8F86-6E339296CB84")
+ (yas-item "C0418A4A-7E42-4D49-8F86-6E339296CB84")
;; ⇤
- (yas/item "7F102705-27D8-4029-BF61-2F042FB61E06")
+ (yas-item "7F102705-27D8-4029-BF61-2F042FB61E06")
;; ⌅
- (yas/item "7062316B-4236-4793-AD35-05E4A6577393")
+ (yas-item "7062316B-4236-4793-AD35-05E4A6577393")
;; ⌃
- (yas/item "B4987DA5-9C2F-4D2D-AC14-678115079205")
+ (yas-item "B4987DA5-9C2F-4D2D-AC14-678115079205")
;; ⌦
- (yas/item "44E448B6-37CE-4BFE-8611-C5113593B74B")
+ (yas-item "44E448B6-37CE-4BFE-8611-C5113593B74B")
;; ↩
- (yas/item "9B216475-D73D-4518-851F-CACD0066A909")
+ (yas-item "9B216475-D73D-4518-851F-CACD0066A909")
;; ⇥
- (yas/item "ADC78A82-40C2-4AAC-8968-93AF0ED98DF0")
+ (yas-item "ADC78A82-40C2-4AAC-8968-93AF0ED98DF0")
;; ⌫
- (yas/item "38E50882-27AF-4246-A039-355C3E1A699E")
+ (yas-item "38E50882-27AF-4246-A039-355C3E1A699E")
;; ⌘
- (yas/item "7214ACD1-93D9-4D3F-A428-8A7302E0A35E")
+ (yas-item "7214ACD1-93D9-4D3F-A428-8A7302E0A35E")
;; ↓
- (yas/item "35654B4E-2D76-4CD3-8FBB-2DA1F314BA19")
+ (yas-item "35654B4E-2D76-4CD3-8FBB-2DA1F314BA19")
;; →
- (yas/item "AC15621A-8A16-40DD-A671-EA4C37637215")
+ (yas-item "AC15621A-8A16-40DD-A671-EA4C37637215")
;; ↑
- (yas/item "0E2F4A47-EADE-4A05-931E-FC874FA28FC3")
+ (yas-item "0E2F4A47-EADE-4A05-931E-FC874FA28FC3")
;; ⇧
- (yas/item "1B8D58B9-D9DB-484C-AACD-5D5DF5385308")
+ (yas-item "1B8D58B9-D9DB-484C-AACD-5D5DF5385308")
;; ⎋
- (yas/item "D7CC7C7C-CD01-4357-AF91-AEFFD914DF98")
+ (yas-item "D7CC7C7C-CD01-4357-AF91-AEFFD914DF98")
;; ⌥
- (yas/item "980A8D39-CA8B-4EC2-9739-DC36A262F28E")
- (yas/separator)
+ (yas-item "980A8D39-CA8B-4EC2-9739-DC36A262F28E")
+ (yas-separator)
;; Ignoring Insert Entity…
- (yas/ignore-item "89E5CC0A-3EFF-4DEF-A299-2E9651DE6529")))
- (yas/submenu "URL Escapes"
+ (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")
+ (yas-ignore-item "6B024865-6095-4CE3-8EDD-DC6F2230C2FF")
;; Ignoring URL Unescape Line / Selection
- (yas/ignore-item "2C4C9673-B166-432A-8938-75A5CA622481")))
+ (yas-ignore-item "2C4C9673-B166-432A-8938-75A5CA622481")))
;; Ignoring Encrypt Line / Selection (ROT 13)
- (yas/ignore-item "9B13543F-8356-443C-B6E7-D9259B604927")
+ (yas-ignore-item "9B13543F-8356-443C-B6E7-D9259B604927")
;; Ignoring CodeCompletion HTML Attributes
- (yas/ignore-item "CBD82CF3-74E9-4E7A-B3F6-9348754EB5AA")
+ (yas-ignore-item "CBD82CF3-74E9-4E7A-B3F6-9348754EB5AA")
;; Insert Open/Close Tag (With Current Word)
- (yas/item "2ED44A32-C353-447F-BAE4-E3522DB6944D")
+ (yas-item "2ED44A32-C353-447F-BAE4-E3522DB6944D")
;; Ignoring Insert Close Tag
- (yas/ignore-item "0658019F-3635-462E-AAC2-74E4FE508A9B")
- (yas/submenu "Insert DocType"
+ (yas-ignore-item "0658019F-3635-462E-AAC2-74E4FE508A9B")
+ (yas-submenu "Insert DocType"
(;; HTML — 4.01 Strict
- (yas/item "944F1410-188C-4D70-8340-CECAA56FC7F2")
+ (yas-item "944F1410-188C-4D70-8340-CECAA56FC7F2")
;; HTML — 4.01 Transitional
- (yas/item "B2AAEE56-42D8-42C3-8F67-865473F50E8D")
- (yas/separator)
+ (yas-item "B2AAEE56-42D8-42C3-8F67-865473F50E8D")
+ (yas-separator)
;; XHTML — 1.0 Frameset
- (yas/item "9ED6ABBE-A802-11D9-BFC8-000D93C8BE28")
+ (yas-item "9ED6ABBE-A802-11D9-BFC8-000D93C8BE28")
;; XHTML — 1.0 Strict
- (yas/item "C8B83564-A802-11D9-BFC8-000D93C8BE28")
+ (yas-item "C8B83564-A802-11D9-BFC8-000D93C8BE28")
;; XHTML — 1.0 Transitional
- (yas/item "7D8C2F74-A802-11D9-BFC8-000D93C8BE28")
+ (yas-item "7D8C2F74-A802-11D9-BFC8-000D93C8BE28")
;; XHTML — 1.1
- (yas/item "5CE8FC6E-A802-11D9-BFC8-000D93C8BE28")))
- (yas/submenu "Insert Tag"
+ (yas-item "5CE8FC6E-A802-11D9-BFC8-000D93C8BE28")))
+ (yas-submenu "Insert Tag"
(;; Ignoring CodeCompletion HTML Tags
- (yas/ignore-item "3463E85F-F500-49A0-8631-D78ED85F9D60")
+ (yas-ignore-item "3463E85F-F500-49A0-8631-D78ED85F9D60")
;; Base
- (yas/item "4462A6B8-A08A-11D9-A5A2-000D93C8BE28")
+ (yas-item "4462A6B8-A08A-11D9-A5A2-000D93C8BE28")
;; Body
- (yas/item "4905D47B-A08B-11D9-A5A2-000D93C8BE28")
+ (yas-item "4905D47B-A08B-11D9-A5A2-000D93C8BE28")
;; Br
- (yas/item "3E008E42-A5C9-11D9-9BCD-000D93C8BE28")
+ (yas-item "3E008E42-A5C9-11D9-9BCD-000D93C8BE28")
;; Div
- (yas/item "576036C0-A60E-11D9-ABD6-000D93C8BE28")
+ (yas-item "576036C0-A60E-11D9-ABD6-000D93C8BE28")
;; Embed QT Movie
- (yas/item "42F15753-9B6D-4DD8-984C-807B94363277")
+ (yas-item "42F15753-9B6D-4DD8-984C-807B94363277")
;; Fieldset
- (yas/item "9BD2BE01-A854-4D55-B584-725D04C075C0")
+ (yas-item "9BD2BE01-A854-4D55-B584-725D04C075C0")
;; Form
- (yas/item "232C2E8B-A08E-11D9-A5A2-000D93C8BE28")
+ (yas-item "232C2E8B-A08E-11D9-A5A2-000D93C8BE28")
;; Head
- (yas/item "9CF008C4-A086-11D9-A5A2-000D93C8BE28")
+ (yas-item "9CF008C4-A086-11D9-A5A2-000D93C8BE28")
;; Heading
- (yas/item "65BA66DC-A07F-11D9-A5A2-000D93C8BE28")
+ (yas-item "65BA66DC-A07F-11D9-A5A2-000D93C8BE28")
;; Input
- (yas/item "44180979-A08E-11D9-A5A2-000D93C8BE28")
+ (yas-item "44180979-A08E-11D9-A5A2-000D93C8BE28")
;; Input with Label
- (yas/item "D8DCCC81-749A-4E2A-B4BC-D109D5799CAA")
+ (yas-item "D8DCCC81-749A-4E2A-B4BC-D109D5799CAA")
;; Link
- (yas/item "77BFD0C0-A08A-11D9-A5A2-000D93C8BE28")
+ (yas-item "77BFD0C0-A08A-11D9-A5A2-000D93C8BE28")
;; Mail Anchor
- (yas/item "81DA4C74-A530-11D9-9BCD-000D93C8BE28")
+ (yas-item "81DA4C74-A530-11D9-9BCD-000D93C8BE28")
;; Meta
- (yas/item "DA99AC44-A083-11D9-A5A2-000D93C8BE28")
+ (yas-item "DA99AC44-A083-11D9-A5A2-000D93C8BE28")
;; Option
- (yas/item "5820372E-A093-4F38-B25C-B0CCC50A0FC4")
+ (yas-item "5820372E-A093-4F38-B25C-B0CCC50A0FC4")
;; Script
- (yas/item "6592050A-A087-11D9-A5A2-000D93C8BE28")
+ (yas-item "6592050A-A087-11D9-A5A2-000D93C8BE28")
;; Script With External Source
- (yas/item "7D676C4C-A087-11D9-A5A2-000D93C8BE28")
+ (yas-item "7D676C4C-A087-11D9-A5A2-000D93C8BE28")
;; Select Box
- (yas/item "26023CFF-C73F-4EF5-9803-E4DBA2CBEADD")
+ (yas-item "26023CFF-C73F-4EF5-9803-E4DBA2CBEADD")
;; Style
- (yas/item "3C518074-A088-11D9-A5A2-000D93C8BE28")
+ (yas-item "3C518074-A088-11D9-A5A2-000D93C8BE28")
;; Table
- (yas/item "57176082-A12F-11D9-A5A2-000D93C8BE28")
+ (yas-item "57176082-A12F-11D9-A5A2-000D93C8BE28")
;; Text Area
- (yas/item "AAC9D7B8-A12C-11D9-A5A2-000D93C8BE28")
+ (yas-item "AAC9D7B8-A12C-11D9-A5A2-000D93C8BE28")
;; Title
- (yas/item "B62ECABE-A086-11D9-A5A2-000D93C8BE28")))
+ (yas-item "B62ECABE-A086-11D9-A5A2-000D93C8BE28")))
- (yas/submenu "Includes"
+ (yas-submenu "Includes"
(;; Ignoring Add Persistent Include
- (yas/ignore-item "0D814247-7A00-46EE-A2A4-45FBBF4B1181")
+ (yas-ignore-item "0D814247-7A00-46EE-A2A4-45FBBF4B1181")
;; Ignoring Update Document
- (yas/ignore-item "4400BCE9-20E3-426E-B1D7-2C0BCA53BCF8")
+ (yas-ignore-item "4400BCE9-20E3-426E-B1D7-2C0BCA53BCF8")
;; Ignoring Help: Persistent Includes
- (yas/ignore-item "9AFDEB2C-D9F0-423E-8211-EBB089F51F0C")))
- (yas/submenu "Format"
+ (yas-ignore-item "9AFDEB2C-D9F0-423E-8211-EBB089F51F0C")))
+ (yas-submenu "Format"
(;; Strong
- (yas/item "4117D930-B6FA-4022-97E7-ECCAF4E70F63")
+ (yas-item "4117D930-B6FA-4022-97E7-ECCAF4E70F63")
;; Emphasize
- (yas/item "EBB98620-3292-4621-BA38-D8A9A65D9551")))
- (yas/submenu "Conditional Comments"
+ (yas-item "EBB98620-3292-4621-BA38-D8A9A65D9551")))
+ (yas-submenu "Conditional Comments"
(;; IE Conditional Comment: Internet Explorer
- (yas/item "0ED6DA73-F38F-4A65-B18F-3379D2BA9387")
+ (yas-item "0ED6DA73-F38F-4A65-B18F-3379D2BA9387")
;; IE Conditional Comment: Internet Explorer 5.0 only
- (yas/item "3A517A94-001E-464D-8184-1FE56D0D0D70")
+ (yas-item "3A517A94-001E-464D-8184-1FE56D0D0D70")
;; IE Conditional Comment: Internet Explorer 5.5 only
- (yas/item "E3F8984E-7269-4981-9D30-967AB56A6ACE")
+ (yas-item "E3F8984E-7269-4981-9D30-967AB56A6ACE")
;; IE Conditional Comment: Internet Explorer 5.x
- (yas/item "F3512848-7889-45DA-993B-0547976C8E6D")
+ (yas-item "F3512848-7889-45DA-993B-0547976C8E6D")
;; IE Conditional Comment: Internet Explorer 6 and below
- (yas/item "32BBB9AB-8732-4F91-A587-354941A27B69")
+ (yas-item "32BBB9AB-8732-4F91-A587-354941A27B69")
;; IE Conditional Comment: Internet Explorer 6 only
- (yas/item "48DF7485-52EA-49B3-88AF-3A41F933F325")
+ (yas-item "48DF7485-52EA-49B3-88AF-3A41F933F325")
;; IE Conditional Comment: Internet Explorer 7 and above
- (yas/item "CBC24AF4-88E0-498B-BE50-934B9CF29EC7")
+ (yas-item "CBC24AF4-88E0-498B-BE50-934B9CF29EC7")
;; IE Conditional Comment: NOT Internet Explorer
- (yas/item "F00170EE-4A82-413F-A88B-85293E69A88B")))
+ (yas-item "F00170EE-4A82-413F-A88B-85293E69A88B")))
;; Wrap Selection in Open/Close Tag
- (yas/item "BC8B8AE2-5F16-11D9-B9C3-000D93589AF6")
+ (yas-item "BC8B8AE2-5F16-11D9-B9C3-000D93589AF6")
;; Wrap Each Selected Line in Open/Close Tag
- (yas/item "991E7EBD-F3F5-469A-BA01-DC30E04AD472")
+ (yas-item "991E7EBD-F3F5-469A-BA01-DC30E04AD472")
;; Wrap in = … ?>
- (yas/item "912906A0-9A29-434B-AE98-E9DFDE6E48B4")
- (yas/separator)
+ (yas-item "912906A0-9A29-434B-AE98-E9DFDE6E48B4")
+ (yas-separator)
;; Ignoring Strip HTML Tags from Document / Selection
- (yas/ignore-item "20D760B5-A127-11D9-A5A2-000D93C8BE28")
+ (yas-ignore-item "20D760B5-A127-11D9-A5A2-000D93C8BE28")
;; Ignoring Tidy
- (yas/ignore-item "45F92B81-6F0E-11D9-A1E4-000D9332809C"))
+ (yas-ignore-item "45F92B81-6F0E-11D9-A1E4-000D9332809C"))
'("7B7E945E-A112-11D9-A5A2-000D93C8BE28"
"3C44EABE-8D6F-4B1B-AB91-F419FAD1A0AD"
"9AFDEB2C-D9F0-423E-8211-EBB089F51F0C"
@@ -485,205 +485,205 @@
;;
;; 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.yasnippet
-;; `(or (yas/selected-text) " IE Conditional Comment: Internet Explorer ")` =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 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 Snippets/XHTML form.yasnippet
-;; ${TM_FILENAME/(.*?)\..*/$1_submit/} =yyas> (yas/unknown)
-;;
-;; # as in Snippets/XHTML body.yasnippet
-;; ${TM_FILENAME/(.*)\..*/\L$1/} =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 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 DragCommands/CSS Link.yasnippet
-;; C8B717C2-6B33-11D9-BB47-000D93589AF6 =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 Commands/About Persistent Includes.yasnippet
-;; 9AFDEB2C-D9F0-423E-8211-EBB089F51F0C =yyas> (yas/unknown)
-;;
-;; # as in Snippets/XHTML meta.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 Snippets/XHTML title.yasnippet
-;; ${TM_FILENAME/((.+)\..*)?/(?2:$2:Page Title)/} =yyas> (yas/unknown)
-;;
-;; # as in Commands/Tidy.yasnippet
-;; 45F92B81-6F0E-11D9-A1E4-000D9332809C =yyas> (yas/unknown)
-;;
-;; # as in Commands/Strip HTML tags.yasnippet
-;; 20D760B5-A127-11D9-A5A2-000D93C8BE28 =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/W3C validation.yasnippet
-;; 3F26240E-6E4A-11D9-B411-000D93589AF6 =yyas> (yas/unknown)
-;;
-;; # as in Commands/Convert Line Selection to URL Escapes.yasnippet
-;; 6B024865-6095-4CE3-8EDD-DC6F2230C2FF =yyas> (yas/unknown)
-;;
-;; # as in Commands/Update Includes.yasnippet
-;; 4400BCE9-20E3-426E-B1D7-2C0BCA53BCF8 =yyas> (yas/unknown)
-;;
-;; # as in Commands/CodeCompletion HTML Attributes.yasnippet
-;; CBD82CF3-74E9-4E7A-B3F6-9348754EB5AA =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/IE Conditional Comment NOT Internet Explorer.yasnippet
-;; `(or (yas/selected-text) " IE Conditional Comment: NOT Internet Explorer ")` =yyas> (yas/unknown)
+;; `(yas-html-toggle-wrap yas-selected-text "em")` =yyas> (yas-unknown)
;;
;; # as in Snippets/XHTML h1.yasnippet
-;; `yas/selected-text` =yyas> (yas/unknown)
+;; `yas-selected-text` =yyas> (yas-unknown)
;;
-;; # as in Templates/XHTML 1.0 Frameset/info.yasnippet
-;; 26068A55-4C84-409D-BA00-162B55AF6961 =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 Commands/Decode HTML Entities.yasnippet
-;; C183920D-A126-11D9-A5A2-000D93C8BE28 =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 Snippets/IE Conditional Comment Internet Explorer 7+.yasnippet
-;; `(or (yas/selected-text) " IE Conditional Comment: Internet Explorer 7 and above ")` =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 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 6 only.yasnippet
-;; `(or (yas/selected-text) " IE Conditional Comment: Internet Explorer 6 only ")` =yyas> (yas/unknown)
+;; `(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)
+;;
+;; # as in Snippets/IE Conditional Comment Internet Explorer.yasnippet
+;; `(or (yas-selected-text) " IE Conditional Comment: Internet Explorer ")` =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 Snippets/XHTML meta.yasnippet
+;; `yas-html-xhtml-attr` =yyas> (yas-unknown)
+;;
+;; # as in Snippets/Strong.yasnippet
+;; `(yas-html-toggle-wrap yas-selected-text "strong")` =yyas> (yas-unknown)
+;;
+;; # as in Commands/About Persistent Includes.yasnippet
+;; 9AFDEB2C-D9F0-423E-8211-EBB089F51F0C =yyas> (yas-unknown)
+;;
+;; # as in Commands/CodeCompletion HTML Attributes.yasnippet
+;; CBD82CF3-74E9-4E7A-B3F6-9348754EB5AA =yyas> (yas-unknown)
+;;
+;; # as in Commands/CodeCompletion HTML Tags.yasnippet
+;; 3463E85F-F500-49A0-8631-D78ED85F9D60 =yyas> (yas-unknown)
+;;
+;; # as in Commands/Encrypt Line Selection (ROT 13).yasnippet
+;; 9B13543F-8356-443C-B6E7-D9259B604927 =yyas> (yas-unknown)
+;;
+;; # as in Commands/Persistent Include.yasnippet
+;; 0D814247-7A00-46EE-A2A4-45FBBF4B1181 =yyas> (yas-unknown)
+;;
+;; # as in Commands/Update Includes.yasnippet
+;; 4400BCE9-20E3-426E-B1D7-2C0BCA53BCF8 =yyas> (yas-unknown)
+;;
+;; # as in Commands/Convert Line Selection to URL Escapes.yasnippet
+;; 6B024865-6095-4CE3-8EDD-DC6F2230C2FF =yyas> (yas-unknown)
+;;
+;; # as in Commands/Convert to HTML Entities.yasnippet
+;; 3DD8406C-A116-11D9-A5A2-000D93C8BE28 =yyas> (yas-unknown)
+;;
+;; # as in Commands/Convert to named entities excl tags.yasnippet
+;; 43C9E8AE-3E53-4B82-A1AF-56697BB3EF09 =yyas> (yas-unknown)
+;;
+;; # as in Commands/Decode HTML Entities.yasnippet
+;; C183920D-A126-11D9-A5A2-000D93C8BE28 =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/Insert Close Tag.yasnippet
+;; 0658019F-3635-462E-AAC2-74E4FE508A9B =yyas> (yas-unknown)
+;;
+;; # as in Commands/Insert Entity.yasnippet
+;; 89E5CC0A-3EFF-4DEF-A299-2E9651DE6529 =yyas> (yas-unknown)
+;;
+;; # as in Commands/Refresh All Active Browsers.yasnippet
+;; B8651C6E-A05E-11D9-86AC-000D93C8BE28 =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 Commands/W3C validation.yasnippet
+;; 3F26240E-6E4A-11D9-B411-000D93589AF6 =yyas> (yas-unknown)
+;;
+;; # as in DragCommands/Anchor Tag.yasnippet
+;; B23D6E15-6B33-11D9-86C1-000D93589AF6 =yyas> (yas-unknown)
+;;
+;; # as in DragCommands/CSS Link.yasnippet
+;; C8B717C2-6B33-11D9-BB47-000D93589AF6 =yyas> (yas-unknown)
+;;
+;; # as in DragCommands/Image Tag.yasnippet
+;; CD6D2CC6-6B33-11D9-BDFD-000D93589AF6 =yyas> (yas-unknown)
+;;
+;; # as in Macros/Delete whitespace between tags.yasnippet
+;; 7B7E945E-A112-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 Snippets/XHTML title.yasnippet
+;; ${TM_FILENAME/((.+)\..*)?/(?2:$2:Page Title)/} =yyas> (yas-unknown)
+;;
+;; # as in Templates/HTML 4.0 Strict/info.yasnippet
+;; 04332FA8-8157-46C4-9854-8C190FFD96C6 =yyas> (yas-unknown)
+;;
+;; # as in Templates/HTML 4.0 Transitional/info.yasnippet
+;; E6F19171-F664-4B4F-92DA-3E15E6CAD35C =yyas> (yas-unknown)
+;;
+;; # as in Templates/XHTML 1.0 Frameset/info.yasnippet
+;; 26068A55-4C84-409D-BA00-162B55AF6961 =yyas> (yas-unknown)
+;;
+;; # as in Templates/XHTML 1.0 Strict/info.yasnippet
+;; EBEE6B51-29C7-4362-818F-A190CACD5296 =yyas> (yas-unknown)
+;;
+;; # as in Templates/XHTML 1.0 Transitional/info.yasnippet
+;; 65D38039-6B0A-48E9-9E49-43832ECC4107 =yyas> (yas-unknown)
+;;
+;; # as in Templates/XHTML 1.1/info.yasnippet
+;; CDE8EFD6-9DE2-4E8C-BB6A-52E8CCD2E977 =yyas> (yas-unknown)
;;
;;
;; Substitutions for: condition
;;
-;; # as in Snippets/XHTML head.yasnippet
-;; text.html - text.html source =yyas> (yas/unknown)
+;; # as in Templates/XHTML 1.1/info.yasnippet
+;; text.html =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)
+;; text.html punctuation.definition.tag -source, text.html meta.tag -entity.other.attribute-name -source =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/XHTML 1.1/info.yasnippet
-;; text.html =yyas> (yas/unknown)
+;; text.html -entity.other.attribute-name -string.quoted, invalid.illegal.incomplete.html =yyas> (yas-unknown)
;;
;; # as in Commands/Documentation for Tag.yasnippet
-;; text.html, text.html entity.name.tag =yyas> (yas/unknown)
+;; 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 Commands/Refresh All Active Browsers.yasnippet
+;; text.html, source.css =yyas> (yas-unknown)
+;;
+;; # as in Snippets/Smart returnindent for tag pairs.yasnippet
+;; meta.scope.between-tag-pair =yyas> (yas-unknown)
+;;
+;; # as in Snippets/Wrap Selection In Tag.yasnippet
+;; text.html, =yyas> (yas-unknown)
;;
;; # as in Snippets/Wrap in =.yasnippet
-;; text.html string =yyas> (yas/unknown)
+;; text.html string =yyas> (yas-unknown)
+;;
+;; # as in Snippets/XHTML head.yasnippet
+;; text.html - text.html source =yyas> (yas-unknown)
+;;
+;; # as in Snippets/XHTML title.yasnippet
+;; text.html - text.blog =yyas> (yas-unknown)
;;
;;
;; Substitutions for: binding
;;
-;; # as in Commands/Persistent Include.yasnippet
-;; =yyas> (yas/unknown)
-;;
-;; # as in Snippets/XHTML   NonBreakingSpace.yasnippet
-;; ~ =yyas> (yas/unknown)
-;;
-;; # as in Snippets/Smart returnindent for tag pairs.yasnippet
-;;
=yyas> (yas/unknown)
-;;
-;; # as in Commands/W3C validation.yasnippet
-;; ^V =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/CodeCompletion HTML Tags.yasnippet
+;; ~ =yyas> (yas-unknown)
;;
;; # as in Commands/Insert Entity.yasnippet
-;; @& =yyas> (yas/unknown)
+;; @& =yyas> (yas-unknown)
;;
-;; # as in Commands/Refresh All Active Browsers.yasnippet
-;; @r =yyas> (yas/unknown)
-;;
-;; # as in Commands/CodeCompletion HTML Tags.yasnippet
-;; ~ =yyas> (yas/unknown)
+;; # as in Commands/Persistent Include.yasnippet
+;; =yyas> (yas-unknown)
;;
;; # as in Commands/Update Includes.yasnippet
-;; ^@u =yyas> (yas/unknown)
+;; ^@u =yyas> (yas-unknown)
;;
-;; # as in Macros/Delete whitespace between tags.yasnippet
-;; ^~ =yyas> (yas/unknown)
+;; # as in Commands/Insert Close Tag.yasnippet
+;; ~@. =yyas> (yas-unknown)
+;;
+;; # as in Commands/Refresh All Active Browsers.yasnippet
+;; @r =yyas> (yas-unknown)
;;
;; # as in Commands/Tidy.yasnippet
-;; ^H =yyas> (yas/unknown)
+;; ^H =yyas> (yas-unknown)
+;;
+;; # as in Commands/W3C validation.yasnippet
+;; ^V =yyas> (yas-unknown)
+;;
+;; # as in Macros/Delete whitespace between tags.yasnippet
+;; ^~ =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 Snippets/XHTML br.yasnippet
+;; ^
=yyas> (yas-unknown)
;;
;;
diff --git a/extras/imported/objc-mode/.yas-setup.el b/extras/imported/objc-mode/.yas-setup.el
index 9f5ab6e..3d00490 100644
--- a/extras/imported/objc-mode/.yas-setup.el
+++ b/extras/imported/objc-mode/.yas-setup.el
@@ -1,19 +1,19 @@
-(defun yas/objc-docset-query (query)
+(defun yas-objc-docset-query (query)
)
-(defvar yas/objc-method-names (make-vector 1023 0))
-(defvar yas/objc-class-names (make-vector 1023 0))
+(defvar yas-objc-method-names (make-vector 1023 0))
+(defvar yas-objc-class-names (make-vector 1023 0))
-(defvar yas/objc-languages (list))
-(defvar yas/objc-defkinds (list))
+(defvar yas-objc-languages (list))
+(defvar yas-objc-defkinds (list))
-(defun yas/objc-extract-super-list ()
+(defun yas-objc-extract-super-list ()
(interactive)
- (setq yas/objc-method-names (make-vector 1023 0)
- yas/objc-class-names (make-vector 1023 0)
- yas/objc-languages (list)
- yas/objc-defkinds (list))
+ (setq yas-objc-method-names (make-vector 1023 0)
+ yas-objc-class-names (make-vector 1023 0)
+ yas-objc-languages (list)
+ yas-objc-defkinds (list))
(with-temp-buffer
(shell-command
"/Developer/usr/bin/docsetutil dump -skip-text /Developer/Documentation/DocSets/com.apple.adc.documentation.AppleSnowLeopard.CoreReference.docset/"
@@ -21,21 +21,21 @@
(goto-char (point-min))
(search-forward-regexp "API index contains .* tokens")
(while (search-forward-regexp "^\\([^/]*\\)/\\([^/]*\\)/\\([^/]*\\)/\\([^/]*\\)$" nil 'noerror)
- (intern (match-string 3) yas/objc-class-names)
- (intern (match-string 4) yas/objc-method-names)
- (add-to-list 'yas/objc-languages (match-string 1))
- (add-to-list 'yas/objc-defkinds (match-string 2)))))
+ (intern (match-string 3) yas-objc-class-names)
+ (intern (match-string 4) yas-objc-method-names)
+ (add-to-list 'yas-objc-languages (match-string 1))
+ (add-to-list 'yas-objc-defkinds (match-string 2)))))
-;; (put (intern-soft (setq chosen (completing-read "Method: " yas/objc-method-names)) yas/objc-method-names)
+;; (put (intern-soft (setq chosen (completing-read "Method: " yas-objc-method-names)) yas-objc-method-names)
;; 'someshit
;; 'someday)
-;; (completing-read "Class: " yas/objc-class-names)
+;; (completing-read "Class: " yas-objc-class-names)
-;; (get (intern-soft (setq chosen (completing-read "hey: " yas/objc-method-names)) yas/objc-method-names)
+;; (get (intern-soft (setq chosen (completing-read "hey: " yas-objc-method-names)) yas-objc-method-names)
;; 'someshit)
-(defun yas/objc-current-method-signature ()
+(defun yas-objc-current-method-signature ()
(let ((orig-point (point))
(start-point nil)
sig
@@ -58,7 +58,7 @@
(concat (or sig "") (match-string-no-properties 0)))))
sig))))
-(defun yas/objc-current-method-signature ()
+(defun yas-objc-current-method-signature ()
(let ((orig-point (point))
(start-point nil)
sig
diff --git a/extras/imported/rails-mode/.yas-setup.el b/extras/imported/rails-mode/.yas-setup.el
index 8b9fc13..c4205ce 100644
--- a/extras/imported/rails-mode/.yas-setup.el
+++ b/extras/imported/rails-mode/.yas-setup.el
@@ -1,23 +1,23 @@
;; .yas-setup.el for rails-mode
-(defvar yas/rails-root-cache nil)
+(defvar yas-rails-root-cache nil)
-(defun yas/rails-online-doc ()
+(defun yas-rails-online-doc ()
(interactive)
(browse-url (format "http://apidock.com/rails/search/quick?query=%s" (read-from-minibuffer "Word: " (thing-at-point 'word)))))
(if (require 'rhtml-mode nil t)
(add-to-list 'auto-mode-alist '("\\.erb$" . rhtml-mode))
- (add-to-list 'auto-mode-alist '("\\.erb$" . yas/rails-erb-mode)))
+ (add-to-list 'auto-mode-alist '("\\.erb$" . yas-rails-erb-mode)))
-(define-derived-mode 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)
+ (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
+(defvar yas-rails-erb-font-lock-keywords
'(("\\(<%=\\)\\(.*+\\)\\(%>\\)"
(1 font-lock-function-name-face)
(2 font-lock-string-face)
@@ -28,35 +28,35 @@
(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)
+(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)
+(defun yas-rails-root (&optional dir)
(or dir (setq dir default-directory))
(or (and (featurep 'rinari) (rinari-root dir))
- yas/rails-root-cache
+ 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)
+ (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))))))
+ (yas-rails-root new-dir))))))
-(defun yas/rails-find-alternate-file ()
+(defun yas-rails-find-alternate-file ()
(if (featurep 'rinari)
- (cond ((yas/rails-view-p)
+ (cond ((yas-rails-view-p)
(rinari-find-model))
- ((yas/rails-model-p)
+ ((yas-rails-model-p)
(rinari-find-controller))
- ((yas/rails-controller-p)
+ ((yas-rails-controller-p)
(rinari-find-view))
(t
- (message "oops, have to improve `yas/rails-find-alternate-file'")))
- (yas/unimplemented)))
+ (message "oops, have to improve `yas-rails-find-alternate-file'")))
+ (yas-unimplemented)))
;; stolen from rinari-mode's rinari-extract-partial
-(defun yas/rails-extract-partial (begin end partial-name)
+(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)
@@ -76,7 +76,7 @@
;;;
;;; The TextMate "intelligent" migration snippet
;;
-(defvar yas/rails-intelligent-migration-snippet-bits
+(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" )))
@@ -114,271 +114,271 @@
(:down . "remove_index :$1, :name . :$5" )))))
-(defun yas/rails-intelligent-migration-snippet (type)
+(defun yas-rails-intelligent-migration-snippet (type)
(let* ((start (point))
(end (save-excursion
(search-forward-regexp "^\s*def\sself\.down" nil 'noerror)))
- (up (cdr (assoc :up (cdr (assoc type yas/rails-intelligent-migration-snippet-bits)))))
- (down (cdr (assoc :down (cdr (assoc type yas/rails-intelligent-migration-snippet-bits)))))
+ (up (cdr (assoc :up (cdr (assoc type yas-rails-intelligent-migration-snippet-bits)))))
+ (down (cdr (assoc :down (cdr (assoc type yas-rails-intelligent-migration-snippet-bits)))))
(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-expand-snippet snippet))))
-(yas/define-condition-cache
- yas/rails-intelligent-migration-snippet-condition-p
+(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")))
+ (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)
+(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
+(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-rails-in-ruby-block-like "create_table"))
-(yas/define-condition-cache
- yas/rails-in-change-table-p
+(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-rails-in-ruby-block-like "change_table"))
-(yas/define-condition-cache
- yas/rails-model-p
+(yas-define-condition-cache
+ yas-rails-model-p
"Non-nil if the current buffer is a rails model."
- (and (yas/rails-root)
+ (and (yas-rails-root)
(string-match "app/models/$" default-directory)))
-(yas/define-condition-cache
- yas/rails-view-p
+(yas-define-condition-cache
+ yas-rails-view-p
"Non-nil if the current buffer is a rails view."
- (and (yas/rails-root)
+ (and (yas-rails-root)
(string-match "app/views/" default-directory)))
-(yas/define-condition-cache
- yas/rails-helper-p
+(yas-define-condition-cache
+ yas-rails-helper-p
"Non-nil if the current buffer is a rails helper."
- (and (yas/rails-root)
+ (and (yas-rails-root)
(string-match "app/helpers/" default-directory)))
-(yas/define-condition-cache
- yas/rails-controller-p
+(yas-define-condition-cache
+ yas-rails-controller-p
"Non-nil if the current buffer is a rails controller."
- (and (yas/rails-root)
+ (and (yas-rails-root)
(string-match "app/controllers/$" default-directory)))
-(yas/define-condition-cache
- yas/rails-migration-p
+(yas-define-condition-cache
+ yas-rails-migration-p
"Non-nil if the current buffer is a rails migration."
- (and (yas/rails-root)
+ (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)))
+(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
+(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))
+ (setq yas-rails-root-cache nil)
+ (yas-rails-activate-maybe))
-(add-hook 'yas/minor-mode-hook '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)
+;; 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)
+;; A7F692C1-778A-48B8-945E-573568BA0403 =yyas> (yas-unknown)
;;
;; # as in Commands/Go To Unit Test.yasnippet
-;; BDBB15A4-2824-4BEC-93A5-7475F9C46A39 =yyas> (if (featurep 'rinari) (rinari-find-test) (yas/unimplemented 'rinari))
+;; BDBB15A4-2824-4BEC-93A5-7475F9C46A39 =yyas> (if (featurep 'rinari) (rinari-find-test) (yas-unimplemented 'rinari))
;;
;; # 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)
+;; 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")
+;; CFDA9F62-D071-4E0F-AD10-66AE0729FFCF =yyas> (yas-rails-compile "rake")
;;
;; # as in Commands/Documentation for Word.yasnippet
-;; 32F30207-D827-46D9-889A-451C35269D52 =yyas> (yas/rails-online-doc)
+;; 32F30207-D827-46D9-889A-451C35269D52 =yyas> (yas-rails-online-doc)
;;
;; # as in Commands/Autocomplete Foreign Key Fixture Reference.yasnippet
-;; 0BCF0EE2-35EE-4959-A771-E74D55271D5A =yyas> (yas/unknown)
+;; 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)
+;; 275C0B86-F735-49B6-8A22-218A8F4CC2E0 =yyas> (yas-unknown)
;;
;; # as in Macros/Change Change Table.yasnippet
-;; 20FC02C5-32A3-4F20-B163-FF75C9FDFABF =yyas> (yas/rails-intelligent-migration-snippet :change_change_table)
+;; 20FC02C5-32A3-4F20-B163-FF75C9FDFABF =yyas> (yas-rails-intelligent-migration-snippet :change_change_table)
;;
;; # as in Commands/Rake Migrate.yasnippet
-;; 985F56D4-82ED-4C45-8250-2ECCFC71957E =yyas> (yas/unknown)
+;; 985F56D4-82ED-4C45-8250-2ECCFC71957E =yyas> (yas-unknown)
;;
;; # as in Commands/DB Schema Import.yasnippet
-;; 6DEF923E-2347-46EC-AFBE-183D08E63DC1 =yyas> (yas/unknown)
+;; 6DEF923E-2347-46EC-AFBE-183D08E63DC1 =yyas> (yas-unknown)
;;
;; # as in Commands/Load Fixtures (Test DB).yasnippet
-;; F758BFD1-00CA-4742-BE71-032580080F5C =yyas> (yas/unknown)
+;; F758BFD1-00CA-4742-BE71-032580080F5C =yyas> (yas-unknown)
;;
;; # as in Commands/Generate Quick Migration.yasnippet
-;; D696FA2C-785A-4B73-A2F6-F750904DD7C2 =yyas> (yas/unknown)
+;; D696FA2C-785A-4B73-A2F6-F750904DD7C2 =yyas> (yas-unknown)
;;
;; # as in Macros/Remove 3A Add Timestamps.yasnippet
-;; E885A3E8-8020-4AC3-A25E-510B26F114B2 =yyas> (yas/unknown)
+;; 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)
+;; 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)
+;; 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> (if (featurep 'rinari) (rinari-find-view) (yas/unimplemented 'rinari))
+;; EE862691-A624-4797-90CF-EDD39EFB2D8E =yyas> (if (featurep 'rinari) (rinari-find-view) (yas-unimplemented 'rinari))
;;
;; # as in Commands/Test Plugins.yasnippet
-;; 0D966168-D9B1-11DC-94E9-00112475D960 =yyas> (yas/unknown)
+;; 0D966168-D9B1-11DC-94E9-00112475D960 =yyas> (yas-unknown)
;;
;; # as in Macros/Change Column.yasnippet
-;; 42DE1441-D1B7-4998-BAF9-16B1EC7E210C =yyas> (yas/unknown)
+;; 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)
+;; 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> (if (featurep 'rinari) (rinari-find-test) (yas/unimplemented 'rinari))
+;; DFE393BE-0764-49FE-B464-6350A50921E6 =yyas> (if (featurep 'rinari) (rinari-find-test) (yas-unimplemented 'rinari))
;;
;; # as in Commands/Test Recent.yasnippet
-;; 190401C2-D9B1-11DC-94E9-00112475D960 =yyas> (yas/unknown)
+;; 190401C2-D9B1-11DC-94E9-00112475D960 =yyas> (yas-unknown)
;;
;; # as in Commands/Test All.yasnippet
-;; DC549A45-D9B0-11DC-94E9-00112475D960 =yyas> (yas/unknown)
+;; DC549A45-D9B0-11DC-94E9-00112475D960 =yyas> (yas-unknown)
;;
;; # as in Macros/Rename Column.yasnippet
-;; AC50762C-DE40-4EB9-9A22-2F6AF2EA4EA3 =yyas> (yas/unknown)
+;; AC50762C-DE40-4EB9-9A22-2F6AF2EA4EA3 =yyas> (yas-unknown)
;;
;; # as in Macros/Create 3A Drop Table.yasnippet
-;; 25F8F5D8-2BD1-45D8-8B2A-9F2EA4F73AA2 =yyas> (yas/unknown)
+;; 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)
+;; 33057A79-677B-4DFB-99D4-1492778BDDC6 =yyas> (yas-unknown)
;;
;; # as in Macros/Add 3A Remove Timestamps.yasnippet
-;; 221969A1-A5EA-4A8E-8817-C74EBED63901 =yyas> (yas/unknown)
+;; 221969A1-A5EA-4A8E-8817-C74EBED63901 =yyas> (yas-unknown)
;;
;; # as in Commands/Go To Helper.yasnippet
-;; 51C9C27A-D931-49F9-B6D8-C0E7ABEC992D =yyas> (if (featurep 'rinari) (rinari-find-helper) (yas/unimplemented 'rinari))
+;; 51C9C27A-D931-49F9-B6D8-C0E7ABEC992D =yyas> (if (featurep 'rinari) (rinari-find-helper) (yas-unimplemented 'rinari))
;;
;; # as in Commands/DB Schema Dump.yasnippet
-;; 310C901C-EF32-4E88-938A-804ABBF8C428 =yyas> (yas/unknown)
+;; 310C901C-EF32-4E88-938A-804ABBF8C428 =yyas> (yas-unknown)
;;
;; # as in Commands/Test Functionals.yasnippet
-;; F4EA552D-D9B0-11DC-94E9-00112475D960 =yyas> (yas/unknown)
+;; F4EA552D-D9B0-11DC-94E9-00112475D960 =yyas> (yas-unknown)
;;
;; # as in Commands/Migrate to Previous Version.yasnippet
-;; 9A1AE6BA-8350-4AB7-B5BD-969A7E64CF29 =yyas> (yas/unknown)
+;; 9A1AE6BA-8350-4AB7-B5BD-969A7E64CF29 =yyas> (yas-unknown)
;;
;; # as in Commands/Go To Model.yasnippet
-;; C7151BF3-7068-4344-9B09-86F3BF4A9C63 =yyas> (if (featurep 'rinari) (rinari-find-model) (yas/unimplemented 'rinari))
+;; C7151BF3-7068-4344-9B09-86F3BF4A9C63 =yyas> (if (featurep 'rinari) (rinari-find-model) (yas-unimplemented 'rinari))
;;
;; # as in Macros/Drop 3A Create Table.yasnippet
-;; A2135370-67A1-488D-B43C-B4F221127C2F =yyas> (yas/unknown)
+;; A2135370-67A1-488D-B43C-B4F221127C2F =yyas> (yas-unknown)
;;
;; # as in Macros/Change Column Default.yasnippet
-;; A219EBB8-004A-4012-B5B2-232C9A5C94F8 =yyas> (yas/unknown)
+;; A219EBB8-004A-4012-B5B2-232C9A5C94F8 =yyas> (yas-unknown)
;;
;; # as in Macros/Add 3A Remove Index.yasnippet
-;; 95F83E1D-5B03-424F-8BEC-8AF66C8939BC =yyas> (yas/unknown)
+;; 95F83E1D-5B03-424F-8BEC-8AF66C8939BC =yyas> (yas-unknown)
;;
;; # as in Commands/Load Fixtures.yasnippet
-;; 5EEA0C71-B34B-4408-953B-F47AAD343CCC =yyas> (yas/unknown)
+;; 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)
+;; 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)
+;; F03162DE-9DB6-417B-9DD7-52D9F11EA736 =yyas> (yas-unknown)
;;
;; # as in Commands/Go To Stylesheet.yasnippet
-;; B207BBD4-D6AA-41E9-9530-27210F2D7B66 =yyas> (if (featurep 'rinari) (rinari-find-stylesheet) (yas/unimplemented 'rinari))
+;; B207BBD4-D6AA-41E9-9530-27210F2D7B66 =yyas> (if (featurep 'rinari) (rinari-find-stylesheet) (yas-unimplemented 'rinari))
;;
;; # as in Commands/Go To Javascript.yasnippet
-;; B078346F-61D8-4E75-9427-80720FBC67F7 =yyas> (if (featurep 'rinari) (rinari-find-javascript) (yas/unimplemented 'rinari))
+;; B078346F-61D8-4E75-9427-80720FBC67F7 =yyas> (if (featurep 'rinari) (rinari-find-javascript) (yas-unimplemented 'rinari))
;;
;; # as in Commands/Rake Migrate to Version.yasnippet
-;; 07C696F8-79F5-4E0B-9EE9-03B693A54ABB =yyas> (yas/unknown)
+;; 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-file)
+;; 9453F0B3-B946-445F-BDB0-B01DE70732FC =yyas> (yas-rails-find-alternate-file)
;;
;; # as in Commands/View demo help.yasnippet
-;; 964436B8-E578-11DC-8177-00112475D960 =yyas> (yas/unknown)
+;; 964436B8-E578-11DC-8177-00112475D960 =yyas> (yas-unknown)
;;
;; # as in Commands/Go to Fixture.yasnippet
-;; 638D94A4-BDFC-4FE9-8909-9934F3FD2899 =yyas> (if (featurep 'rinari) (rinari-find-fixture) (yas/unimplemented 'rinari))
+;; 638D94A4-BDFC-4FE9-8909-9934F3FD2899 =yyas> (if (featurep 'rinari) (rinari-find-fixture) (yas-unimplemented 'rinari))
;;
;; # as in Macros/Rename Table.yasnippet
-;; FD8CC811-2AD3-480F-B975-DF959DC96C67 =yyas> (yas/unknown)
+;; 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)
+;; 04A86178-71B1-430A-A06D-DFF7C9A338B5 =yyas> (yas-unknown)
;;
;; # as in Commands/Generate.yasnippet
-;; 4904EDC7-5ED3-4132-AAB2-C2AD87C97EFE =yyas> (yas/unknown)
+;; 4904EDC7-5ED3-4132-AAB2-C2AD87C97EFE =yyas> (yas-unknown)
;;
;; # as in Commands/Test Integration.yasnippet
-;; 04A30A4D-D9B1-11DC-94E9-00112475D960 =yyas> (yas/unknown)
+;; 04A30A4D-D9B1-11DC-94E9-00112475D960 =yyas> (yas-unknown)
;;
;; # as in Commands/Show DB Schema.yasnippet
-;; 1970AE74-3949-40B3-B263-727AA3FF167A =yyas> (yas/unknown)
+;; 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)
+;; 7BC860E6-7561-4E6E-983B-507D7A6F6228 =yyas> (yas-unknown)
;;
;; # as in Commands/Install Bundled Plugin.yasnippet
-;; 46ECE243-0448-4A64-A223-27CC21E7704D =yyas> (yas/unknown)
+;; 46ECE243-0448-4A64-A223-27CC21E7704D =yyas> (yas-unknown)
;;
;; # as in Commands/Go To File.yasnippet
-;; 0CCC8443-40F3-4BAB-9440-D737562B5F45 =yyas> (if (featurep 'rinari) (rinari-find-file-in-project) (yas/unimplemented 'rinari))
+;; 0CCC8443-40F3-4BAB-9440-D737562B5F45 =yyas> (if (featurep 'rinari) (rinari-find-file-in-project) (yas-unimplemented 'rinari))
;;
;; # as in Commands/Test Units.yasnippet
-;; 2C60CBA1-D9B1-11DC-94E9-00112475D960 =yyas> (yas/unknown)
+;; 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) "|")}
+;; ${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))}
+;; ${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))}
+;; ${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)))}
+;; ${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`
+;; $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)))`
@@ -394,18 +394,18 @@ are recognized. Stolen from `rinari-mode' more or`' less."
;; meta.rails.controller, meta.rails.helper, meta.rails.model, meta.rails.functional_test, source.yaml =yyas> t
;; meta.rails.controller, meta.rails.mailer, source.js, source.css =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-create-table-p)
-;; meta.rails.functional_test =yyas> (yas/rails-functional-test-p)
-;; text.html.ruby, text.haml =yyas> (yas/rails-view-p)
-;; meta.rails.controller =yyas> (yas/rails-controller-p)
-;; meta.rails.routes =yyas> (yas/rails-routes-p)
-;; text.html.ruby =yyas> (yas/unknown)
+;; 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-create-table-p)
+;; meta.rails.functional_test =yyas> (yas-rails-functional-test-p)
+;; text.html.ruby, text.haml =yyas> (yas-rails-view-p)
+;; meta.rails.controller =yyas> (yas-rails-controller-p)
+;; meta.rails.routes =yyas> (yas-rails-routes-p)
+;; text.html.ruby =yyas> (yas-unknown)
;;
;;
-;; AC385ABF-96CD-4FCB-80AD-BF37D6EE79D2 =yyas> (and (member major-mode '(nxml-mode html-mode rhtml-mode)) (yas/rails-view-p))
+;; AC385ABF-96CD-4FCB-80AD-BF37D6EE79D2 =yyas> (and (member major-mode '(nxml-mode html-mode rhtml-mode)) (yas-rails-view-p))
;; Substitutions for: binding
@@ -414,16 +414,16 @@ are recognized. Stolen from `rinari-mode' more or`' less."
;; ^j =yyas> C-c M-j
;;
;; # as in Commands/Autocomplete Foreign Key Fixture Reference (habtm).yasnippet
-;; ~$ =yyas> (yas/unknown)
+;; ~$ =yyas> (yas-unknown)
;;
;; # as in Commands/Go To View.yasnippet
;; ~$@ïœ =yyas> [M-S-s-down]
;;
;; # as in Commands/Generate Quick Migration.yasnippet
-;; ^M =yyas> (yas/unknown)
+;; ^M =yyas> (yas-unknown)
;;
;; # as in Commands/Go To File on This Line.yasnippet
-;; ~@ =yyas> (yas/unknown)
+;; ~@ =yyas> (yas-unknown)
;;
;; # as in Commands/Show DB Schema.yasnippet
;; ^@S =yyas> C-c M-s
@@ -437,7 +437,7 @@ are recognized. Stolen from `rinari-mode' more or`' less."
;; 9453F0B3-B946-445F-BDB0-B01DE70732FC =yyas> [M-s-down]
;;
;; # as in Commands/Autocomplete Foreign Key Fixture Reference.yasnippet
-;; ~ =yyas> (yas/unknown)
+;; ~ =yyas> (yas-unknown)
;;
;; # as in Commands/Test Units.yasnippet
;; ^\ =yyas> C-c M-\
@@ -461,615 +461,650 @@ are recognized. Stolen from `rinari-mode' more or`' less."
;;
;; Translated menu
;;
-(yas/define-menu 'rails-mode
- '((yas/submenu "Go To"
+(yas-define-menu 'rails-mode
+ '(;; Ignoring Set RVM…
+ (yas-ignore-item "88047A77-B889-4F47-892D-4C3EBA98D968")
+
+ (yas-submenu "Go To"
(;; Alternate File
- (yas/item "0CCC8443-40F3-4BAB-9440-D737562B5F45")
+ (yas-item "0CCC8443-40F3-4BAB-9440-D737562B5F45")
;; File on Current Line
- (yas/item "09BB96F2-75FD-48A7-8314-B5B56B09B477")
- (yas/separator)
+ (yas-item "09BB96F2-75FD-48A7-8314-B5B56B09B477")
+ (yas-separator)
;; Go to Model
- (yas/item "C7151BF3-7068-4344-9B09-86F3BF4A9C63")
+ (yas-item "C7151BF3-7068-4344-9B09-86F3BF4A9C63")
;; Go to Controller
- (yas/item "9453F0B3-B946-445F-BDB0-B01DE70732FC")
+ (yas-item "9453F0B3-B946-445F-BDB0-B01DE70732FC")
;; Go to View
- (yas/item "EE862691-A624-4797-90CF-EDD39EFB2D8E")
+ (yas-item "EE862691-A624-4797-90CF-EDD39EFB2D8E")
;; Go to Functional Test
- (yas/item "DFE393BE-0764-49FE-B464-6350A50921E6")
+ (yas-item "DFE393BE-0764-49FE-B464-6350A50921E6")
;; Go to Helper
- (yas/item "51C9C27A-D931-49F9-B6D8-C0E7ABEC992D")
+ (yas-item "51C9C27A-D931-49F9-B6D8-C0E7ABEC992D")
;; Go to Javascript
- (yas/item "B078346F-61D8-4E75-9427-80720FBC67F7")
+ (yas-item "B078346F-61D8-4E75-9427-80720FBC67F7")
;; Go to Stylesheet
- (yas/item "B207BBD4-D6AA-41E9-9530-27210F2D7B66")
+ (yas-item "B207BBD4-D6AA-41E9-9530-27210F2D7B66")
;; Go to Unit Test
- (yas/item "BDBB15A4-2824-4BEC-93A5-7475F9C46A39")
+ (yas-item "BDBB15A4-2824-4BEC-93A5-7475F9C46A39")
;; Go to Fixture
- (yas/item "638D94A4-BDFC-4FE9-8909-9934F3FD2899")))
- (yas/submenu "Run Tests"
+ (yas-item "638D94A4-BDFC-4FE9-8909-9934F3FD2899")))
+ (yas-submenu "Run Tests"
(;; Ignoring Test All
- (yas/ignore-item "DC549A45-D9B0-11DC-94E9-00112475D960")
+ (yas-ignore-item "DC549A45-D9B0-11DC-94E9-00112475D960")
;; Ignoring Test Functionals
- (yas/ignore-item "F4EA552D-D9B0-11DC-94E9-00112475D960")
+ (yas-ignore-item "F4EA552D-D9B0-11DC-94E9-00112475D960")
;; Ignoring Test Integration
- (yas/ignore-item "04A30A4D-D9B1-11DC-94E9-00112475D960")
+ (yas-ignore-item "04A30A4D-D9B1-11DC-94E9-00112475D960")
;; Ignoring Test Plugins
- (yas/ignore-item "0D966168-D9B1-11DC-94E9-00112475D960")
+ (yas-ignore-item "0D966168-D9B1-11DC-94E9-00112475D960")
;; Ignoring Test Recent
- (yas/ignore-item "190401C2-D9B1-11DC-94E9-00112475D960")
+ (yas-ignore-item "190401C2-D9B1-11DC-94E9-00112475D960")
;; Ignoring Test Uncommitted
- (yas/ignore-item "212C3047-D9B1-11DC-94E9-00112475D960")
+ (yas-ignore-item "212C3047-D9B1-11DC-94E9-00112475D960")
;; Ignoring Test Units
- (yas/ignore-item "2C60CBA1-D9B1-11DC-94E9-00112475D960")))
+ (yas-ignore-item "2C60CBA1-D9B1-11DC-94E9-00112475D960")))
;; Ignoring Call Generate Script
- (yas/ignore-item "4904EDC7-5ED3-4132-AAB2-C2AD87C97EFE")
-
- (yas/submenu "Database"
+ (yas-ignore-item "4904EDC7-5ED3-4132-AAB2-C2AD87C97EFE")
+ (yas-submenu "Database"
(;; Ignoring Migrate to Current
- (yas/ignore-item "985F56D4-82ED-4C45-8250-2ECCFC71957E")
+ (yas-ignore-item "985F56D4-82ED-4C45-8250-2ECCFC71957E")
;; Ignoring Migrate to Version ...
- (yas/ignore-item "07C696F8-79F5-4E0B-9EE9-03B693A54ABB")
+ (yas-ignore-item "07C696F8-79F5-4E0B-9EE9-03B693A54ABB")
;; Ignoring Migrate to Previous Version
- (yas/ignore-item "9A1AE6BA-8350-4AB7-B5BD-969A7E64CF29")
+ (yas-ignore-item "9A1AE6BA-8350-4AB7-B5BD-969A7E64CF29")
;; Redo Last Migration
- (yas/item "CFDA9F62-D071-4E0F-AD10-66AE0729FFCF")
- (yas/separator)
+ (yas-item "CFDA9F62-D071-4E0F-AD10-66AE0729FFCF")
+ (yas-separator)
;; Ignoring Load Fixtures (Development DB)
- (yas/ignore-item "5EEA0C71-B34B-4408-953B-F47AAD343CCC")
+ (yas-ignore-item "5EEA0C71-B34B-4408-953B-F47AAD343CCC")
;; Ignoring Load Fixtures (Test DB)
- (yas/ignore-item "F758BFD1-00CA-4742-BE71-032580080F5C")
+ (yas-ignore-item "F758BFD1-00CA-4742-BE71-032580080F5C")
;; Ignoring Load schema.rb to DB
- (yas/ignore-item "6DEF923E-2347-46EC-AFBE-183D08E63DC1")
+ (yas-ignore-item "6DEF923E-2347-46EC-AFBE-183D08E63DC1")
;; Ignoring Dump DB to schema.rb
- (yas/ignore-item "310C901C-EF32-4E88-938A-804ABBF8C428")
+ (yas-ignore-item "310C901C-EF32-4E88-938A-804ABBF8C428")
;; Ignoring Clone Development DB to Test DB
- (yas/ignore-item "6F2AB859-46E3-4FF5-A9A7-E9A813AB5DE1")))
+ (yas-ignore-item "6F2AB859-46E3-4FF5-A9A7-E9A813AB5DE1")))
;; params[…]
- (yas/item "AC8EDA3E-875B-11D9-897C-000393CBCE2E")
+ (yas-item "AC8EDA3E-875B-11D9-897C-000393CBCE2E")
;; session[…]
- (yas/item "7B02ABF8-8763-11D9-897C-000393CBCE2E")
- (yas/submenu "Logger"
+ (yas-item "7B02ABF8-8763-11D9-897C-000393CBCE2E")
+ (yas-submenu "Logger"
(;; logger.debug
- (yas/item "D975E5C1-42C2-40F1-8960-0DA533B18113")
+ (yas-item "D975E5C1-42C2-40F1-8960-0DA533B18113")
;; logger.info
- (yas/item "36E2A3EE-E9CC-4B7F-A4CF-AFAF970B8699")
+ (yas-item "36E2A3EE-E9CC-4B7F-A4CF-AFAF970B8699")
;; logger.warn
- (yas/item "38D5CA05-E219-4399-A244-609AF40B1D0B")
+ (yas-item "38D5CA05-E219-4399-A244-609AF40B1D0B")
;; logger.error
- (yas/item "7053B86A-9B81-4154-AB3C-61B8035C5D33")
+ (yas-item "7053B86A-9B81-4154-AB3C-61B8035C5D33")
;; logger.fatal
- (yas/item "35E95C81-22F7-4C40-8297-ED21086DDA81")
+ (yas-item "35E95C81-22F7-4C40-8297-ED21086DDA81")
;; Rails.logger.debug
- (yas/item "7B15B396-1F41-4529-9253-32761E94448C")))
- (yas/separator)
- (yas/submenu "Models"
+ (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-ignore-item "1970AE74-3949-40B3-B263-727AA3FF167A")
- ;; alias_attribute
- (yas/item "5694BA8B-64EC-4B1B-A00D-6366D28500C5")
- (yas/separator)
- (yas/submenu "Callbacks"
+ (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")
+ (yas-item "A1776279-5396-4FE9-9218-8BF2C88C5271")
;; 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")
+ (yas-item "44FBD811-70A9-462B-AC56-F975ADAD62AF")
;; before_save
- (yas/item "523BE8A6-0845-493D-A9B6-532F73D21950")
+ (yas-item "523BE8A6-0845-493D-A9B6-532F73D21950")
;; after_save
- (yas/item "4D1787E3-1583-4CF3-8D99-CC45D7C35EED")
+ (yas-item "4D1787E3-1583-4CF3-8D99-CC45D7C35EED")
;; before_create
- (yas/item "D64D8863-DCB6-4397-B5B0-073E0AE04167")
+ (yas-item "D64D8863-DCB6-4397-B5B0-073E0AE04167")
;; after_create
- (yas/item "279D1981-B055-4693-B9AF-5B571A62A6AE")
+ (yas-item "279D1981-B055-4693-B9AF-5B571A62A6AE")
;; before_destroy
- (yas/item "3F4B502B-5F68-4687-88E9-6EF3BDF9677D")
+ (yas-item "3F4B502B-5F68-4687-88E9-6EF3BDF9677D")
;; after_update
- (yas/item "0C9EA1A1-66C5-4E1C-9C30-E1FFE8EC6EAE")
+ (yas-item "0C9EA1A1-66C5-4E1C-9C30-E1FFE8EC6EAE")
;; before_update
- (yas/item "1C20EEBE-B4BA-48C8-9B33-7B5BB00D958C")
+ (yas-item "1C20EEBE-B4BA-48C8-9B33-7B5BB00D958C")
;; after_destroy
- (yas/item "A2F3E8C1-4216-4890-8491-2F8C7534ED03")))
- (yas/submenu "Associations"
+ (yas-item "A2F3E8C1-4216-4890-8491-2F8C7534ED03")))
+ (yas-submenu "Associations"
(;; belongs_to
- (yas/item "B8F08BD7-6160-482C-8A3D-CBC6BD2079A4")
+ (yas-item "B8F08BD7-6160-482C-8A3D-CBC6BD2079A4")
;; has_and_belongs_to_many
- (yas/item "2AC3AC1F-743B-4A33-863C-C37885073806")
+ (yas-item "2AC3AC1F-743B-4A33-863C-C37885073806")
;; has_one
- (yas/item "BD2E4045-54E6-450E-B31B-5E1865CFFBC9")
+ (yas-item "BD2E4045-54E6-450E-B31B-5E1865CFFBC9")
;; has_many
- (yas/item "F396B7BD-8255-48B1-904A-06E7D7CC2741")
+ (yas-item "F396B7BD-8255-48B1-904A-06E7D7CC2741")
;; has_many :dependent => :destroy
- (yas/item "3E3AF538-171B-4108-AB92-827AD7E24C77")
+ (yas-item "3E3AF538-171B-4108-AB92-827AD7E24C77")
;; has_many (through)
- (yas/item "9D58B6C9-BA52-48B3-B639-D5CB894AF810")
- (yas/separator)
+ (yas-item "9D58B6C9-BA52-48B3-B639-D5CB894AF810")
+ (yas-separator)
;; accepts_nested_attributes_for
- (yas/item "D414D70D-BD2D-4C15-BDA6-1AAEABF7791F")))
- (yas/submenu "Scopes"
- (;; named_scope
- (yas/item "1CB65A0D-4FEC-4438-9B4F-8B0BD13FB875")
- ;; named_scope lambda
- (yas/item "4E286CB4-069E-474C-A970-95216FE7DE95")
+ (yas-item "D414D70D-BD2D-4C15-BDA6-1AAEABF7791F")))
+ (yas-submenu "Scopes"
+ (;; scope
+ (yas-item "8F87F3C7-8ABB-4778-9786-64CF95E99160")
+ ;; scope lambda
+ (yas-item "5D01527E-48FA-4A3D-A10B-A383C8AE3942")
+ ;; scope with extension
+ (yas-item "CEA1D76C-DEB0-4ADB-840D-220E569D5B8F")
+ (yas-separator)
;; default_scope
- (yas/item "83B80B60-6143-4465-B064-0DA25DDDCAA7")))
- (yas/submenu "Finders"
+ (yas-item "83B80B60-6143-4465-B064-0DA25DDDCAA7")))
+ (yas-submenu "Finders"
(;; find(id)
- (yas/item "59CD3A41-8164-4FB4-B462-D7ACE86BCDBF")
+ (yas-item "59CD3A41-8164-4FB4-B462-D7ACE86BCDBF")
;; find(:all)
- (yas/item "A017AB39-A875-40DC-8ACF-7E3551057CA0")
+ (yas-item "A017AB39-A875-40DC-8ACF-7E3551057CA0")
;; find(:first)
- (yas/item "FE430ECD-5D40-4D95-A73B-F064C73992DE")
+ (yas-item "FE430ECD-5D40-4D95-A73B-F064C73992DE")
;; find(:last)
- (yas/item "8B515110-41D3-11DD-AE16-0800200C9A66")
+ (yas-item "8B515110-41D3-11DD-AE16-0800200C9A66")
+ ;; find_each
+ (yas-item "B105C480-FB21-4511-9AD0-D5B4FED3BA21")
;; find_in_batches
- (yas/item "B660FC85-F69A-43BC-A72A-748CBEA0AA9A")
- (yas/separator)
+ (yas-item "B660FC85-F69A-43BC-A72A-748CBEA0AA9A")
+ (yas-separator)
;; scoped_by
- (yas/item "7CC002AE-83BA-4294-B87D-DE9790839D97")))
- (yas/submenu "Validations"
+ (yas-item "7CC002AE-83BA-4294-B87D-DE9790839D97")))
+ (yas-submenu "Validations"
(;; validates_acceptance_of
- (yas/item "89198999-7E6D-4D97-A20E-45263E1CA993")
+ (yas-item "89198999-7E6D-4D97-A20E-45263E1CA993")
;; validates_acceptance_of if
- (yas/item "A2477223-AD5A-4723-8052-943CE9BA634D")
+ (yas-item "A2477223-AD5A-4723-8052-943CE9BA634D")
;; validates_associated
- (yas/item "47944705-F605-4ED4-B4C0-9E823EE25138")
+ (yas-item "47944705-F605-4ED4-B4C0-9E823EE25138")
;; validates_associated if
- (yas/item "85E9264C-5414-4FA0-AC07-F305A798ED46")
+ (yas-item "85E9264C-5414-4FA0-AC07-F305A798ED46")
;; validates_confirmation_of
- (yas/item "B5893618-D07C-48F1-8867-736D0AAFF0E7")
+ (yas-item "B5893618-D07C-48F1-8867-736D0AAFF0E7")
;; validates_confirmation_of if
- (yas/item "1354726C-DA64-4CA6-A099-26626A865D8D")
+ (yas-item "1354726C-DA64-4CA6-A099-26626A865D8D")
;; validates_exclusion_of
- (yas/item "4CC98A56-B60B-4A89-80E0-400C5314A050")
+ (yas-item "4CC98A56-B60B-4A89-80E0-400C5314A050")
;; validates_exclusion_of if
- (yas/item "869AB0B7-12DD-440A-905A-BFB1E0E16E1C")
+ (yas-item "869AB0B7-12DD-440A-905A-BFB1E0E16E1C")
;; validates_inclusion_of
- (yas/item "4611F02E-E9BF-11DC-8518-00112475D960")
+ (yas-item "4611F02E-E9BF-11DC-8518-00112475D960")
;; validates_inclusion_of if
- (yas/item "47FF50AF-E9BF-11DC-8518-00112475D960")
+ (yas-item "47FF50AF-E9BF-11DC-8518-00112475D960")
;; validates_format_of
- (yas/item "EB47FBA1-AFB3-42F9-94A4-552D3175C17A")
+ (yas-item "EB47FBA1-AFB3-42F9-94A4-552D3175C17A")
;; validates_format_of if
- (yas/item "14BF0586-F2E8-4AB3-BB4B-E49099384403")
+ (yas-item "14BF0586-F2E8-4AB3-BB4B-E49099384403")
;; validates_length_of
- (yas/item "5CE8838A-BF2C-497E-B87A-E90C3BC482E0")
+ (yas-item "5CE8838A-BF2C-497E-B87A-E90C3BC482E0")
;; validates_length_of if
- (yas/item "EC511A43-D3B7-11DC-BA49-00112475D960")
+ (yas-item "EC511A43-D3B7-11DC-BA49-00112475D960")
;; validates_numericality_of
- (yas/item "B21BA16D-7C04-4912-8488-425CDCC332A8")
+ (yas-item "B21BA16D-7C04-4912-8488-425CDCC332A8")
;; validates_numericality_of if
- (yas/item "CF506019-E964-4172-A3DA-475AE3B65558")
+ (yas-item "CF506019-E964-4172-A3DA-475AE3B65558")
;; validates_presence_of
- (yas/item "5DAC28A7-33C8-4DA7-9E85-56618D6BEC9F")
+ (yas-item "5DAC28A7-33C8-4DA7-9E85-56618D6BEC9F")
;; validates_presence_of if
- (yas/item "F5CBBE16-F5CC-4EDA-8BC6-30281BD7D854")
+ (yas-item "F5CBBE16-F5CC-4EDA-8BC6-30281BD7D854")
;; validates_uniqueness_of
- (yas/item "F8316545-9AE4-4C7F-87ED-A2C00E6637FA")
+ (yas-item "F8316545-9AE4-4C7F-87ED-A2C00E6637FA")
;; validates_uniqueness_of if
- (yas/item "43680344-0818-42BF-95B4-58CD2D76545B")))))
- (yas/submenu "Controllers"
+ (yas-item "43680344-0818-42BF-95B4-58CD2D76545B")))
+ ;; alias_attribute
+ (yas-item "5694BA8B-64EC-4B1B-A00D-6366D28500C5")))
+ (yas-submenu "Controllers"
(;; Create controller class
- (yas/item "4B3F798E-E3B6-48C8-8C2F-CB8631011638")
+ (yas-item "4B3F798E-E3B6-48C8-8C2F-CB8631011638")
;; Create resources controller class
- (yas/item "F90BFB23-5706-484B-8108-B376A988C0A0")
+ (yas-item "F90BFB23-5706-484B-8108-B376A988C0A0")
;; layout
- (yas/item "CCF4C4A1-28EF-499D-AD81-4A4FD2FEF5B6")
+ (yas-item "CCF4C4A1-28EF-499D-AD81-4A4FD2FEF5B6")
;; before_filter
- (yas/item "B782A467-2C4D-48EB-AF39-518AFED4C056")
+ (yas-item "B782A467-2C4D-48EB-AF39-518AFED4C056")
;; 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"
+ (yas-item "D864896E-8763-11D9-897C-000393CBCE2E")
+ (yas-submenu "respond_to"
+ (;; respond_to
+ (yas-item "B41D3164-EA53-4DDC-850E-27B82B24061F")
+ ;; respond_with
+ (yas-item "DDE1BA27-6259-4F87-A840-6A6E92C8594A")
+ ;; format (respond_with)
+ (yas-item "32AB6C81-2C22-45E0-B5FE-23CD3E420E70")))
+ (yas-submenu "redirect_to"
(;; redirect_to (path)
- (yas/item "A909C4C3-8EFE-4E39-9D96-BA8F0ABE6085")
+ (yas-item "A909C4C3-8EFE-4E39-9D96-BA8F0ABE6085")
;; redirect_to (path plural)
- (yas/item "AFE06B67-CE98-42A6-93D1-8EC8E3B9F83C")
+ (yas-item "AFE06B67-CE98-42A6-93D1-8EC8E3B9F83C")
;; redirect_to (nested path)
- (yas/item "9D7228B3-A6ED-4598-B096-032B3600864F")
+ (yas-item "9D7228B3-A6ED-4598-B096-032B3600864F")
;; redirect_to (nested path plural)
- (yas/item "EF527A27-D1D4-4FD8-BD23-71397881C29A")
+ (yas-item "EF527A27-D1D4-4FD8-BD23-71397881C29A")
;; redirect_to (action)
- (yas/item "F2F3167C-73B9-11D9-B752-000D932CD5BA")
+ (yas-item "F2F3167C-73B9-11D9-B752-000D932CD5BA")
;; redirect_to (action, id)
- (yas/item "2233B484-73BA-11D9-B752-000D932CD5BA")
+ (yas-item "2233B484-73BA-11D9-B752-000D932CD5BA")
;; redirect_to (controller)
- (yas/item "053490FE-73BA-11D9-B752-000D932CD5BA")
+ (yas-item "053490FE-73BA-11D9-B752-000D932CD5BA")
;; redirect_to (controller, action)
- (yas/item "0C137FBF-73BA-11D9-B752-000D932CD5BA")
+ (yas-item "0C137FBF-73BA-11D9-B752-000D932CD5BA")
;; redirect_to (controller, action, id)
- (yas/item "18D3C1C3-73BA-11D9-B752-000D932CD5BA")
+ (yas-item "18D3C1C3-73BA-11D9-B752-000D932CD5BA")
;; redirect_to :back
- (yas/item "BC194AE7-FA60-4E65-9503-6920D1666A29")))
- (yas/submenu "render"
+ (yas-item "BC194AE7-FA60-4E65-9503-6920D1666A29")))
+ (yas-submenu "render"
(;; render (action)
- (yas/item "7B03D38B-7580-41AC-BC2B-3766AB074A43")
+ (yas-item "7B03D38B-7580-41AC-BC2B-3766AB074A43")
;; render (action, layout)
- (yas/item "053F1D6A-B413-43FF-B697-E3120FD0489F")
+ (yas-item "053F1D6A-B413-43FF-B697-E3120FD0489F")
;; render (file)
- (yas/item "7D43B0EA-2C3C-499B-9346-A8E48CBF29CD")
+ (yas-item "7D43B0EA-2C3C-499B-9346-A8E48CBF29CD")
;; render (file, use_full_path)
- (yas/item "2A8FBE48-E196-4019-AE76-BF3ED4B54F47")
+ (yas-item "2A8FBE48-E196-4019-AE76-BF3ED4B54F47")
;; render (inline)
- (yas/item "64E93A71-6E62-48D9-9694-123080AE6723")
+ (yas-item "64E93A71-6E62-48D9-9694-123080AE6723")
;; render (inline, locals)
- (yas/item "1E5DE984-510C-4992-8AD5-C5FA6D7F2A88")
+ (yas-item "1E5DE984-510C-4992-8AD5-C5FA6D7F2A88")
;; render (inline, type)
- (yas/item "A8AF8B90-94E8-42E1-8057-DDBA57809F6A")
+ (yas-item "A8AF8B90-94E8-42E1-8057-DDBA57809F6A")
;; render (layout)
- (yas/item "3F83272F-62D5-4BCB-BAA3-806083078829")
+ (yas-item "3F83272F-62D5-4BCB-BAA3-806083078829")
;; render (nothing)
- (yas/item "AC8A995F-0034-433C-905D-E5C1F29D6EFF")
+ (yas-item "AC8A995F-0034-433C-905D-E5C1F29D6EFF")
;; render (nothing, status)
- (yas/item "724A68C1-A727-46FF-AF59-288E26B09629")
+ (yas-item "724A68C1-A727-46FF-AF59-288E26B09629")
;; render (partial)
- (yas/item "498168A5-5AF8-4F59-8A2D-B517FAB98CDB")
+ (yas-item "498168A5-5AF8-4F59-8A2D-B517FAB98CDB")
;; render (partial, collection)
- (yas/item "046FB1B6-9C65-4702-91EC-4AA9878CD949")
+ (yas-item "046FB1B6-9C65-4702-91EC-4AA9878CD949")
;; render (partial, locals)
- (yas/item "6F41AFFD-B3A7-42D0-8A84-D6086C118D92")
+ (yas-item "6F41AFFD-B3A7-42D0-8A84-D6086C118D92")
;; render (partial, object)
- (yas/item "BFAAC8DA-A043-4684-967B-B3E5DAE08C62")
+ (yas-item "BFAAC8DA-A043-4684-967B-B3E5DAE08C62")
;; render (partial, status)
- (yas/item "CBB06A4E-3A82-45F3-91AA-259F02314B9D")
+ (yas-item "CBB06A4E-3A82-45F3-91AA-259F02314B9D")
;; render (text)
- (yas/item "67C5082F-5011-434A-8EAA-6B8D3600935F")
+ (yas-item "67C5082F-5011-434A-8EAA-6B8D3600935F")
;; render (text, layout)
- (yas/item "A3B09AFE-40B5-4623-8B85-E9F369ECE22D")
+ (yas-item "A3B09AFE-40B5-4623-8B85-E9F369ECE22D")
;; render (text, layout => true)
- (yas/item "97C0992D-715F-4322-A3E0-DD4D2B7E2FC2")
+ (yas-item "97C0992D-715F-4322-A3E0-DD4D2B7E2FC2")
;; render (text, status)
- (yas/item "4F636977-F7A6-4BF5-B09B-7F087683C3B9")
+ (yas-item "4F636977-F7A6-4BF5-B09B-7F087683C3B9")
;; render (update)
- (yas/item "ECB10C0B-E8B7-4606-ABF5-4A2A26E5AB1A")))
- (yas/submenu "REST methods"
+ (yas-item "ECB10C0B-E8B7-4606-ABF5-4A2A26E5AB1A")))
+ (yas-submenu "REST methods"
(;; def create - resource
- (yas/item "54F61419-001F-4B71-83AC-8DC633694AF0")))
- (yas/separator)
+ (yas-item "54F61419-001F-4B71-83AC-8DC633694AF0")))
+ (yas-submenu "Caching"
+ (;; caches_action
+ (yas-item "017634C2-FC55-41BA-B551-82436809D71B")))
+ (yas-separator)
;; verify — render
- (yas/item "9ECBF20C-003E-41D9-A881-4BAC0656F9DC")
+ (yas-item "9ECBF20C-003E-41D9-A881-4BAC0656F9DC")
;; verify — redirect
- (yas/item "7BBD3F57-57A5-4CD0-8E79-B931021FC110")))
- (yas/submenu "View Templates"
+ (yas-item "7BBD3F57-57A5-4CD0-8E79-B931021FC110")))
+ (yas-submenu "View Templates"
(;; Create Partial From Selection
- (yas/item "1DD8A214-1C97-45BA-ADEE-8F888DDE8570")
- (yas/separator)
+ (yas-item "1DD8A214-1C97-45BA-ADEE-8F888DDE8570")
+ (yas-separator)
;; form_for
- (yas/item "7D99041D-C3B7-4940-AE64-6B1758CDB47C")
+ (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"
+ (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")
+ (yas-item "402C251E-595B-4A58-8EB9-41989040F280")
;; f.text_field (fftf)
- (yas/item "CC1BCD1C-2479-4335-B511-17B880316A75")
+ (yas-item "CC1BCD1C-2479-4335-B511-17B880316A75")
;; f.text_area (ffta)
- (yas/item "06498926-F84D-466C-8736-B8A0AC586A94")
+ (yas-item "06498926-F84D-466C-8736-B8A0AC586A94")
;; f.check_box (ffcb)
- (yas/item "F579F9E7-E072-4BCC-BFF9-C8C5BAE7FFA5")
+ (yas-item "F579F9E7-E072-4BCC-BFF9-C8C5BAE7FFA5")
;; f.radio_button (ffrb)
- (yas/item "A95358D2-C68A-4894-8C36-062C9F45848A")
+ (yas-item "A95358D2-C68A-4894-8C36-062C9F45848A")
;; f.password_field (ffpf)
- (yas/item "42289456-C8D1-498C-AE30-5206544B349F")
+ (yas-item "42289456-C8D1-498C-AE30-5206544B349F")
;; f.hidden_field (ffhf)
- (yas/item "5DBA8F72-DD6C-4CBF-83FD-76301E159BA9")
+ (yas-item "5DBA8F72-DD6C-4CBF-83FD-76301E159BA9")
;; f.file_field (ffff)
- (yas/item "79BC2303-3D9D-4E21-AF85-73B388B7B56D")
+ (yas-item "79BC2303-3D9D-4E21-AF85-73B388B7B56D")
;; f.submit (ffs)
- (yas/item "C315EC5D-A7F3-49CB-9795-21B78BB42FF4")
+ (yas-item "C315EC5D-A7F3-49CB-9795-21B78BB42FF4")
;; f.fields_for (nff)
- (yas/item "BBE5B6F2-A8F2-4714-9186-4FCD21A5B432")))
- (yas/submenu "form_for helpers"
+ (yas-item "BBE5B6F2-A8F2-4714-9186-4FCD21A5B432")))
+ (yas-submenu "form_for helpers"
(;; form_for label
- (yas/item "B31822D9-2048-4D16-B2AF-00E0B4E5C368")
+ (yas-item "B31822D9-2048-4D16-B2AF-00E0B4E5C368")
;; form_for text_field
- (yas/item "F46EE8EE-239C-46D7-980B-3F861B7D9111")
+ (yas-item "F46EE8EE-239C-46D7-980B-3F861B7D9111")
;; form_for text_area
- (yas/item "4C898FA8-D09C-4B28-BE42-14BB4EA4E2B1")
+ (yas-item "4C898FA8-D09C-4B28-BE42-14BB4EA4E2B1")
;; form_for check_box
- (yas/item "F0DB6886-4FFE-45BA-907F-44326AD8142D")
+ (yas-item "F0DB6886-4FFE-45BA-907F-44326AD8142D")
;; form_for radio_button
- (yas/item "D4282CE1-4171-4B13-9220-3F2718BC2505")
+ (yas-item "D4282CE1-4171-4B13-9220-3F2718BC2505")
;; form_for password_field
- (yas/item "3379FB35-C664-4255-96C6-6E4B91F12759")
+ (yas-item "3379FB35-C664-4255-96C6-6E4B91F12759")
;; form_for hidden_field
- (yas/item "99FEFD9B-5A07-46E3-950D-5C474E42B695")
+ (yas-item "99FEFD9B-5A07-46E3-950D-5C474E42B695")
;; form_for file_field
- (yas/item "C8BA285D-E12E-4AB8-A941-514C963E8226")
+ (yas-item "C8BA285D-E12E-4AB8-A941-514C963E8226")
;; form_for submit
- (yas/item "3000E569-4E19-4566-B08E-A3FFFAAC9075")
+ (yas-item "3000E569-4E19-4566-B08E-A3FFFAAC9075")
;; form_for fields_for
- (yas/item "16645C58-C7C8-4E72-923F-3B44932F946D")))
+ (yas-item "16645C58-C7C8-4E72-923F-3B44932F946D")))
;; fields_for
- (yas/item "7C7FC66A-D566-40D3-B9DA-FCEA4EFF98C6")
- (yas/separator)
+ (yas-item "7C7FC66A-D566-40D3-B9DA-FCEA4EFF98C6")
+ (yas-separator)
;; form_tag
- (yas/item "F0F6DACA-6A0B-11D9-BDC2-000D932CD5BA")
+ (yas-item "F0F6DACA-6A0B-11D9-BDC2-000D932CD5BA")
;; submit_tag
- (yas/item "D0E29200-E910-11DC-A399-00112475D960")
- ;; image_tag
- (yas/item "4EA6FBD1-CDEA-4DF6-9F70-A1EDA35AC3D7")
+ (yas-item "D0E29200-E910-11DC-A399-00112475D960")
;; image_submit_tag
- (yas/item "9FB9848E-EA5A-11DC-9DE5-00112475D960")
- (yas/submenu "link_to"
+ (yas-item "9FB9848E-EA5A-11DC-9DE5-00112475D960")
+ ;; image_tag
+ (yas-item "4EA6FBD1-CDEA-4DF6-9F70-A1EDA35AC3D7")
+ (yas-submenu "link_to"
(;; link_to (path)
- (yas/item "326B57A7-B4A9-447B-A3D2-0EA74158E1E1")
+ (yas-item "326B57A7-B4A9-447B-A3D2-0EA74158E1E1")
;; link_to (path plural)
- (yas/item "6BA737F0-63D1-4D82-9381-4331E18B12C5")
+ (yas-item "6BA737F0-63D1-4D82-9381-4331E18B12C5")
;; link_to (nested path)
- (yas/item "750DEEF9-18A0-40FC-8E54-574CE5EE5565")
+ (yas-item "750DEEF9-18A0-40FC-8E54-574CE5EE5565")
;; link_to (nested path plural)
- (yas/item "866AAD87-E458-4F2D-9E7C-3CE73EFC047B")
+ (yas-item "866AAD87-E458-4F2D-9E7C-3CE73EFC047B")
;; link_to (action)
- (yas/item "9E2B42FE-7BC8-11D9-906A-000D932CD5BA")
+ (yas-item "9E2B42FE-7BC8-11D9-906A-000D932CD5BA")
;; link_to (action, id)
- (yas/item "B4F952F4-7BC8-11D9-906A-000D932CD5BA")
+ (yas-item "B4F952F4-7BC8-11D9-906A-000D932CD5BA")
;; link_to (controller)
- (yas/item "74590E16-7BCB-11D9-906A-000D932CD5BA")
+ (yas-item "74590E16-7BCB-11D9-906A-000D932CD5BA")
;; link_to (controller, action)
- (yas/item "C11C0BF5-7BC8-11D9-906A-000D932CD5BA")
+ (yas-item "C11C0BF5-7BC8-11D9-906A-000D932CD5BA")
;; link_to (controller, action, id)
- (yas/item "D21BE958-7BC8-11D9-906A-000D932CD5BA")
+ (yas-item "D21BE958-7BC8-11D9-906A-000D932CD5BA")
;; link_to model
- (yas/item "E5E08AA0-4EDD-4583-BF07-5D6C49E98410")))
+ (yas-item "E5E08AA0-4EDD-4583-BF07-5D6C49E98410")
+ ;; link_to_function
+ (yas-item "F5983CAF-0655-45FA-A385-9E9A8C28425C")))
+ ;; if (ERB)
+ (yas-item "1ED49D4D-D4A0-4CF0-8ED2-DCE70854B839")
+ ;; else (ERB)
+ (yas-item "B9889C00-FC9D-4956-81BF-600145F06976")
;; end (ERB)
- (yas/item "AC385ABF-96CD-4FCB-80AD-BF37D6EE79D2")
- (yas/separator)
+ (yas-item "AC385ABF-96CD-4FCB-80AD-BF37D6EE79D2")
+ (yas-separator)
;; map(&:sym_proc)
- (yas/item "EC605540-C431-4FD0-AD91-D913118DACA7")
- (yas/separator)
+ (yas-item "EC605540-C431-4FD0-AD91-D913118DACA7")
+ (yas-separator)
;; content_for
- (yas/item "9038B99B-4810-4C0B-B547-F72F2AD5CAFC")
+ (yas-item "9038B99B-4810-4C0B-B547-F72F2AD5CAFC")
;; for loop in rhtml
- (yas/item "F7744F07-306C-4951-AB5A-3D69BA5516B7")))
- (yas/submenu "Layouts"
+ (yas-item "F7744F07-306C-4951-AB5A-3D69BA5516B7")))
+ (yas-submenu "Layouts"
(;; javascript_include_tag
- (yas/item "FEF49C86-9386-405E-A191-684D1C963E3A")
+ (yas-item "FEF49C86-9386-405E-A191-684D1C963E3A")
;; stylesheet_link_tag
- (yas/item "980C7667-9D60-49FF-AF74-A7B19B379F45")))
- (yas/submenu "RJS"
+ (yas-item "980C7667-9D60-49FF-AF74-A7B19B379F45")))
+ (yas-submenu "RJS"
(;; page.replace (id, partial)
- (yas/item "273E5E76-8D13-4476-9C38-8AF87432CB96")
+ (yas-item "273E5E76-8D13-4476-9C38-8AF87432CB96")
;; page.hide (*ids)
- (yas/item "390A447F-0FA3-4F01-A10C-4F35675E0A43")
+ (yas-item "390A447F-0FA3-4F01-A10C-4F35675E0A43")
;; page.replace_html (id, partial)
- (yas/item "8B914165-9C66-4FA3-9AD6-1DA41B25F8F1")
+ (yas-item "8B914165-9C66-4FA3-9AD6-1DA41B25F8F1")
;; page.insert_html (position, id, partial)
- (yas/item "62BEA590-F4EF-4001-B661-764EDFB92811")
+ (yas-item "62BEA590-F4EF-4001-B661-764EDFB92811")
;; page.visual_effect (effect, id)
- (yas/item "CFDC27A3-58CF-4198-8F93-36360978F0D0")
+ (yas-item "CFDC27A3-58CF-4198-8F93-36360978F0D0")
;; page.show (*ids)
- (yas/item "5ACBF49D-B5A5-495C-89D8-18AA740D9D02")
+ (yas-item "5ACBF49D-B5A5-495C-89D8-18AA740D9D02")
;; page.toggle (*ids)
- (yas/item "028DA0A4-B310-4BEF-8643-2A22993C21C7")))
- (yas/submenu "Migrations"
+ (yas-item "028DA0A4-B310-4BEF-8643-2A22993C21C7")))
+ (yas-submenu "Migrations"
(;; Ignoring Quick Migration
- (yas/ignore-item "D696FA2C-785A-4B73-A2F6-F750904DD7C2")
+ (yas-ignore-item "D696FA2C-785A-4B73-A2F6-F750904DD7C2")
- (yas/submenu "Columns"
+ (yas-submenu "Columns"
(;; Add / Remove Column
- (yas/item "18C76913-061C-4D65-866D-67AA3724AFEF")
+ (yas-item "18C76913-061C-4D65-866D-67AA3724AFEF")
;; Ignoring Add / Remove Several Columns
- (yas/ignore-item "7BC860E6-7561-4E6E-983B-507D7A6F6228")
+ (yas-ignore-item "7BC860E6-7561-4E6E-983B-507D7A6F6228")
;; Add / Remove Several Columns (marcc)
- (yas/item "27A6C58A-896B-4956-BA81-D671A2EF9C7D")
+ (yas-item "27A6C58A-896B-4956-BA81-D671A2EF9C7D")
;; Ignoring Add / Remove Timestamps
- (yas/ignore-item "221969A1-A5EA-4A8E-8817-C74EBED63901")
+ (yas-ignore-item "221969A1-A5EA-4A8E-8817-C74EBED63901")
;; Ignoring Change Column
- (yas/ignore-item "42DE1441-D1B7-4998-BAF9-16B1EC7E210C")
+ (yas-ignore-item "42DE1441-D1B7-4998-BAF9-16B1EC7E210C")
;; Ignoring Change Column Default
- (yas/ignore-item "A219EBB8-004A-4012-B5B2-232C9A5C94F8")
+ (yas-ignore-item "A219EBB8-004A-4012-B5B2-232C9A5C94F8")
;; Ignoring Rename / Rename Column
- (yas/ignore-item "AC50762C-DE40-4EB9-9A22-2F6AF2EA4EA3")
+ (yas-ignore-item "AC50762C-DE40-4EB9-9A22-2F6AF2EA4EA3")
;; Ignoring Rename / Rename Several Columns
- (yas/ignore-item "F03162DE-9DB6-417B-9DD7-52D9F11EA736")
+ (yas-ignore-item "F03162DE-9DB6-417B-9DD7-52D9F11EA736")
;; Ignoring Rename / Rename Several Columns (mncc)
- (yas/ignore-item "04A86178-71B1-430A-A06D-DFF7C9A338B5")
+ (yas-ignore-item "04A86178-71B1-430A-A06D-DFF7C9A338B5")
;; Remove / Add Column
- (yas/item "16A705EB-10DC-42B5-9FF2-377E206421DC")
+ (yas-item "16A705EB-10DC-42B5-9FF2-377E206421DC")
;; Ignoring Remove / Add Timestamps
- (yas/ignore-item "E885A3E8-8020-4AC3-A25E-510B26F114B2")))
- (yas/submenu "Tables"
+ (yas-ignore-item "E885A3E8-8020-4AC3-A25E-510B26F114B2")))
+ (yas-submenu "Tables"
(;; Ignoring Create / Drop Table
- (yas/ignore-item "25F8F5D8-2BD1-45D8-8B2A-9F2EA4F73AA2")
+ (yas-ignore-item "25F8F5D8-2BD1-45D8-8B2A-9F2EA4F73AA2")
;; Ignoring Rename / Rename Table
- (yas/ignore-item "FD8CC811-2AD3-480F-B975-DF959DC96C67")
+ (yas-ignore-item "FD8CC811-2AD3-480F-B975-DF959DC96C67")
;; Drop / Create Table
- (yas/item "20375601-B13F-4314-B8E4-362706566636")
+ (yas-item "20375601-B13F-4314-B8E4-362706566636")
;; Change / Change Table
- (yas/item "20FC02C5-32A3-4F20-B163-FF75C9FDFABF")
- (yas/separator)
- (yas/submenu "Create columns t. drop-down list"
+ (yas-item "20FC02C5-32A3-4F20-B163-FF75C9FDFABF")
+ (yas-separator)
+ (yas-submenu "Create columns t. drop-down list"
(;; t.string (tcs)
- (yas/item "B757F7E5-E4BD-11DC-A11A-00112475D960")
+ (yas-item "B757F7E5-E4BD-11DC-A11A-00112475D960")
;; t.text (tct)
- (yas/item "FFE7B820-E4BD-11DC-A11A-00112475D960")
+ (yas-item "FFE7B820-E4BD-11DC-A11A-00112475D960")
;; t.integer (tci)
- (yas/item "0E63B7D5-E4BE-11DC-A11A-00112475D960")
+ (yas-item "0E63B7D5-E4BE-11DC-A11A-00112475D960")
;; t.float (tcf)
- (yas/item "1BDC463A-E4BE-11DC-A11A-00112475D960")
+ (yas-item "1BDC463A-E4BE-11DC-A11A-00112475D960")
;; t.decimal (tcd)
- (yas/item "26C09807-E4BE-11DC-A11A-00112475D960")
+ (yas-item "26C09807-E4BE-11DC-A11A-00112475D960")
;; t.datetime (tcdt)
- (yas/item "3458B140-E4BE-11DC-A11A-00112475D960")
+ (yas-item "3458B140-E4BE-11DC-A11A-00112475D960")
;; t.timestamp (tcts)
- (yas/item "49643690-E4BE-11DC-A11A-00112475D960")
+ (yas-item "49643690-E4BE-11DC-A11A-00112475D960")
;; t.time (tcti)
- (yas/item "537BDD48-E4BE-11DC-A11A-00112475D960")
+ (yas-item "537BDD48-E4BE-11DC-A11A-00112475D960")
;; t.date (tcda)
- (yas/item "61CF5B32-E4BE-11DC-A11A-00112475D960")
+ (yas-item "61CF5B32-E4BE-11DC-A11A-00112475D960")
;; t.boolean (tcb)
- (yas/item "6BE6F315-E4BE-11DC-A11A-00112475D960")
+ (yas-item "6BE6F315-E4BE-11DC-A11A-00112475D960")
;; t.binary (tcbi)
- (yas/item "7CE57C6C-E4BE-11DC-A11A-00112475D960")
+ (yas-item "7CE57C6C-E4BE-11DC-A11A-00112475D960")
;; t.timestamps (tctss)
- (yas/item "950B0BF2-E4BE-11DC-A11A-00112475D960")
+ (yas-item "950B0BF2-E4BE-11DC-A11A-00112475D960")
;; t.lock_version (tcl)
- (yas/item "A677FFD4-E4BE-11DC-A11A-00112475D960")
+ (yas-item "A677FFD4-E4BE-11DC-A11A-00112475D960")
;; t.references (tcr)
- (yas/item "B6D9225C-E4BE-11DC-A11A-00112475D960")))
- (yas/submenu "Create columns helpers"
+ (yas-item "B6D9225C-E4BE-11DC-A11A-00112475D960")))
+ (yas-submenu "Create columns helpers"
(;; Table column string
- (yas/item "377BF814-D52D-11DC-BD8E-00112475D960")
+ (yas-item "377BF814-D52D-11DC-BD8E-00112475D960")
;; Table column text
- (yas/item "6A9D4C30-D52D-11DC-BD8E-00112475D960")
+ (yas-item "6A9D4C30-D52D-11DC-BD8E-00112475D960")
;; Table column integer
- (yas/item "729D559E-D52D-11DC-BD8E-00112475D960")
+ (yas-item "729D559E-D52D-11DC-BD8E-00112475D960")
;; Table column float
- (yas/item "8AF989C4-D52E-11DC-BD8E-00112475D960")
+ (yas-item "8AF989C4-D52E-11DC-BD8E-00112475D960")
;; Table column decimal
- (yas/item "93A16768-D52E-11DC-BD8E-00112475D960")
+ (yas-item "93A16768-D52E-11DC-BD8E-00112475D960")
;; Table column datetime
- (yas/item "D6CBCA96-D52F-11DC-BD8E-00112475D960")
+ (yas-item "D6CBCA96-D52F-11DC-BD8E-00112475D960")
;; Table column timestamp
- (yas/item "4600CE20-D532-11DC-BD8E-00112475D960")
+ (yas-item "4600CE20-D532-11DC-BD8E-00112475D960")
;; Table column time
- (yas/item "4F5DDD37-D532-11DC-BD8E-00112475D960")
+ (yas-item "4F5DDD37-D532-11DC-BD8E-00112475D960")
;; Table column date
- (yas/item "56276686-D532-11DC-BD8E-00112475D960")
+ (yas-item "56276686-D532-11DC-BD8E-00112475D960")
;; Table column boolean
- (yas/item "967093B4-D532-11DC-BD8E-00112475D960")
+ (yas-item "967093B4-D532-11DC-BD8E-00112475D960")
;; Table column binary
- (yas/item "5E9B8B0E-D532-11DC-BD8E-00112475D960")
+ (yas-item "5E9B8B0E-D532-11DC-BD8E-00112475D960")
;; Table column timestamps
- (yas/item "E0C8FDC4-D532-11DC-BD8E-00112475D960")
+ (yas-item "E0C8FDC4-D532-11DC-BD8E-00112475D960")
;; Table column lock_version
- (yas/item "FC2523C1-D532-11DC-BD8E-00112475D960")
+ (yas-item "FC2523C1-D532-11DC-BD8E-00112475D960")
;; Table column(s) references
- (yas/item "EDA6568B-D533-11DC-BD8E-00112475D960")))
+ (yas-item "EDA6568B-D533-11DC-BD8E-00112475D960")))
;; Create Column in Table
- (yas/item "7592CA99-75D7-48B6-9133-00B9F148FF43")
+ (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"
+ (yas-item "67FD2F8F-5F25-45F2-A451-2F39977A9EDE")
+ (yas-submenu "Change columns t. drop-down list"
(;; t.change (tch)
- (yas/item "19761681-17E6-4DF1-8C08-73C337D29481")
+ (yas-item "19761681-17E6-4DF1-8C08-73C337D29481")
;; t.rename (tre)
- (yas/item "9D4E30E2-4A61-4941-B9F3-BEE97552747A")))
- (yas/submenu "Change columns helpers"
+ (yas-item "9D4E30E2-4A61-4941-B9F3-BEE97552747A")))
+ (yas-submenu "Change columns helpers"
(;; Table column(s) change
- (yas/item "57A9D5BC-DD0F-422B-B857-53F30B5D763A")
+ (yas-item "57A9D5BC-DD0F-422B-B857-53F30B5D763A")
;; Table column(s) rename
- (yas/item "DF30226E-1111-448A-B669-7CA34EE83909")))))
- (yas/submenu "Indexes"
+ (yas-item "DF30226E-1111-448A-B669-7CA34EE83909")))))
+ (yas-submenu "Indexes"
(;; Ignoring Add / Remove Index
- (yas/ignore-item "95F83E1D-5B03-424F-8BEC-8AF66C8939BC")
+ (yas-ignore-item "95F83E1D-5B03-424F-8BEC-8AF66C8939BC")
;; Ignoring Add / Remove Named Index
- (yas/ignore-item "A7F692C1-778A-48B8-945E-573568BA0403")
+ (yas-ignore-item "A7F692C1-778A-48B8-945E-573568BA0403")
;; Ignoring Add / Remove Unique Index
- (yas/ignore-item "33057A79-677B-4DFB-99D4-1492778BDDC6")))))
- (yas/submenu "Environment"
- (;; config.gem
- (yas/item "47A6800A-DC7E-4F72-AA0D-CEE2488E1618")))
- (yas/submenu "Routes"
- (;; map.named_route
- (yas/item "91C543BF-7BD8-4E3A-B493-AE572C5472A0")
+ (yas-ignore-item "33057A79-677B-4DFB-99D4-1492778BDDC6")))))
+ (yas-submenu "Gemfile"
+ (;; gem
+ (yas-item "5C773E3D-436E-4A28-8399-859CE41E504F")
+ ;; gem :git
+ (yas-item "675DD92F-42F1-4B55-B56A-5D4ABC1375C4")))
+ (yas-submenu "Routes"
+ (;; Ignoring Autocomplete Routes
+ (yas-ignore-item "0742F232-38ED-4C52-AD68-1858F0F2C601")
+
+ ;; match
+ (yas-item "856B8A7A-86FA-4424-B4D9-3D57D5C3E590")
+ ;; resources
+ (yas-item "92E54811-6041-4BF8-B808-918B8C11F1D9")
+ ;; member routes
+ (yas-item "7C2F96AF-7F07-4B71-A41C-812294ECA6EE")
+ ;; collection routes
+ (yas-item "0ECA205B-6766-43B7-8B7C-A17956E1213E")
+ (yas-separator)
+ ;; get :on => :collection
+ (yas-item "4B0DBED3-3A95-4BE4-B61B-9CDFB8B8C07A")
+ ;; get :on => :member
+ (yas-item "D696088D-DDCD-4F58-9C8A-E2D99B5F345B")
+ (yas-separator)
+ ;; map.named_route
+ (yas-item "91C543BF-7BD8-4E3A-B493-AE572C5472A0")
;; map.resources
- (yas/item "0FF86C46-0E01-4D03-8232-72CA5BD55706")
+ (yas-item "0FF86C46-0E01-4D03-8232-72CA5BD55706")
;; map.resource
- (yas/item "2183A9A9-17ED-4A4F-ABB6-668EDDD3A6E4")
+ (yas-item "2183A9A9-17ED-4A4F-ABB6-668EDDD3A6E4")
;; map.with_options
- (yas/item "BD4B90F7-2187-4E75-BFFB-77BE67CB8DAE")
+ (yas-item "BD4B90F7-2187-4E75-BFFB-77BE67CB8DAE")
;; map.catch_all
- (yas/item "F3606586-F905-4A91-92CA-82319239221D")))
- (yas/submenu "ActiveSupport"
+ (yas-item "F3606586-F905-4A91-92CA-82319239221D")))
+ (yas-submenu "ActiveSupport"
(;; cattr_accessor
- (yas/item "F57522B2-9F5F-4DF9-AE46-9478AF019C63")
+ (yas-item "F57522B2-9F5F-4DF9-AE46-9478AF019C63")
;; mattr_accessor
- (yas/item "B25B7560-FACB-4A9E-A226-B71C796BD1F3")
+ (yas-item "B25B7560-FACB-4A9E-A226-B71C796BD1F3")
;; returning do |variable| … end
- (yas/item "D2783155-23F3-4B90-A317-5BD139471193")))
- (yas/separator)
- (yas/submenu "Fixtures"
- (;; <%= 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")))
- ;; test do..end
- (yas/item "6ECA11FE-E8C1-4EC0-93F3-B4472752E60D")
- (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)
+ (yas-item "D2783155-23F3-4B90-A317-5BD139471193")))
+ (yas-separator)
+ (yas-submenu "Tests"
+ (;; test do..end
+ (yas-item "6ECA11FE-E8C1-4EC0-93F3-B4472752E60D")
+ ;; setup do..end
+ (yas-item "0A25B963-AF76-472D-BA68-07F88A64A10B")
+ (yas-submenu "Fixtures"
+ (;; <%= 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")
+ (yas-ignore-item "964436B8-E578-11DC-8177-00112475D960")
;; Documentation for Word
- (yas/item "32F30207-D827-46D9-889A-451C35269D52")
- ;; find_each
- (yas/item "B105C480-FB21-4511-9AD0-D5B4FED3BA21")
- )
+ (yas-item "32F30207-D827-46D9-889A-451C35269D52")
+ ;; Ignoring Jump to Method Definition
+ (yas-ignore-item "AECD46CF-9031-4059-B386-262DBABD97B1")
+ ;; Ignoring List columns of a model
+ (yas-ignore-item "CF489B31-5DD2-4B83-B503-AD3ECF7BDEB7")
+ ;; Create sweeper class
+ (yas-item "FF022038-CA5D-4045-909E-BF509343A5C7"))
'("A2135370-67A1-488D-B43C-B4F221127C2F"
"809BCA42-5C49-4B08-B3C4-BB773036C086"
"275C0B86-F735-49B6-8A22-218A8F4CC2E0"
"0BCF0EE2-35EE-4959-A771-E74D55271D5A"
+ "0742F232-38ED-4C52-AD68-1858F0F2C601"
"6F2AB859-46E3-4FF5-A9A7-E9A813AB5DE1"
"D696FA2C-785A-4B73-A2F6-F750904DD7C2"
"AECD46CF-9031-4059-B386-262DBABD97B1"
+ "CF489B31-5DD2-4B83-B503-AD3ECF7BDEB7"
"F758BFD1-00CA-4742-BE71-032580080F5C"
"5EEA0C71-B34B-4408-953B-F47AAD343CCC"
"9A1AE6BA-8350-4AB7-B5BD-969A7E64CF29"
"07C696F8-79F5-4E0B-9EE9-03B693A54ABB"
+ "88047A77-B889-4F47-892D-4C3EBA98D968"
"1970AE74-3949-40B3-B263-727AA3FF167A"
"DC549A45-D9B0-11DC-94E9-00112475D960"
"F4EA552D-D9B0-11DC-94E9-00112475D960"
@@ -1103,154 +1138,166 @@ are recognized. Stolen from `rinari-mode' more or`' less."
;;
;; 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/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 Snippets/find_in_batches.yasnippet
+;; `(downcase (replace-regexp-in-string "\..*$" "" (current-word)))` =yyas> (yas-unknown)
;;
;; # as in Commands/Autocomplete Foreign Key Fixture Reference (habtm).yasnippet
-;; 275C0B86-F735-49B6-8A22-218A8F4CC2E0 =yyas> (yas/unknown)
+;; 275C0B86-F735-49B6-8A22-218A8F4CC2E0 =yyas> (yas-unknown)
;;
-;; # as in Commands/Rake Migrate.yasnippet
-;; 985F56D4-82ED-4C45-8250-2ECCFC71957E =yyas> (yas/unknown)
+;; # as in Commands/Autocomplete Foreign Key Fixture Reference.yasnippet
+;; 0BCF0EE2-35EE-4959-A771-E74D55271D5A =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 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/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 Commands/Jump to Method Definition.yasnippet
-;; AECD46CF-9031-4059-B386-262DBABD97B1 =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/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 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/Autocomplete Routes.yasnippet
+;; 0742F232-38ED-4C52-AD68-1858F0F2C601 =yyas> (yas-unknown)
;;
;; # as in Commands/Clone Development DB to Test DB.yasnippet
-;; 6F2AB859-46E3-4FF5-A9A7-E9A813AB5DE1 =yyas> (yas/unknown)
+;; 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/Generate Quick Migration.yasnippet
+;; D696FA2C-785A-4B73-A2F6-F750904DD7C2 =yyas> (yas-unknown)
+;;
+;; # as in Commands/Jump to Method Definition.yasnippet
+;; AECD46CF-9031-4059-B386-262DBABD97B1 =yyas> (yas-unknown)
+;;
+;; # as in Commands/List columns of a model.yasnippet
+;; CF489B31-5DD2-4B83-B503-AD3ECF7BDEB7 =yyas> (yas-unknown)
+;;
+;; # as in Commands/Load Fixtures (Test DB).yasnippet
+;; F758BFD1-00CA-4742-BE71-032580080F5C =yyas> (yas-unknown)
+;;
+;; # as in Commands/Load Fixtures.yasnippet
+;; 5EEA0C71-B34B-4408-953B-F47AAD343CCC =yyas> (yas-unknown)
+;;
+;; # as in Commands/Migrate to Previous Version.yasnippet
+;; 9A1AE6BA-8350-4AB7-B5BD-969A7E64CF29 =yyas> (yas-unknown)
;;
;; # as in Commands/Rake Migrate to Version.yasnippet
-;; 07C696F8-79F5-4E0B-9EE9-03B693A54ABB =yyas> (yas/unknown)
+;; 07C696F8-79F5-4E0B-9EE9-03B693A54ABB =yyas> (yas-unknown)
;;
-;; # as in Snippets/find_in_batches.yasnippet
-;; `(downcase (replace-regexp-in-string "\..*$" "" (current-word)))` =yyas> (yas/unknown)
-;;
-;; # as in Commands/View demo help.yasnippet
-;; 964436B8-E578-11DC-8177-00112475D960 =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/Set RVM.yasnippet
+;; 88047A77-B889-4F47-892D-4C3EBA98D968 =yyas> (yas-unknown)
;;
;; # as in Commands/Show DB Schema.yasnippet
-;; 1970AE74-3949-40B3-B263-727AA3FF167A =yyas> (yas/unknown)
+;; 1970AE74-3949-40B3-B263-727AA3FF167A =yyas> (yas-unknown)
;;
-;; # as in Snippets/respond_to (html).yasnippet
-;; `yas/selected-text` =yyas> (yas/unknown)
+;; # as in Commands/Test All.yasnippet
+;; DC549A45-D9B0-11DC-94E9-00112475D960 =yyas> (yas-unknown)
;;
-;; # as in Macros/Add 3A Remove Several Columns.yasnippet
-;; 7BC860E6-7561-4E6E-983B-507D7A6F6228 =yyas> (yas/unknown)
+;; # as in Commands/Test Functionals.yasnippet
+;; F4EA552D-D9B0-11DC-94E9-00112475D960 =yyas> (yas-unknown)
+;;
+;; # as in Commands/Test Integration.yasnippet
+;; 04A30A4D-D9B1-11DC-94E9-00112475D960 =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 Uncommitted.yasnippet
+;; 212C3047-D9B1-11DC-94E9-00112475D960 =yyas> (yas-unknown)
;;
;; # as in Commands/Test Units.yasnippet
-;; 2C60CBA1-D9B1-11DC-94E9-00112475D960 =yyas> (yas/unknown)
+;; 2C60CBA1-D9B1-11DC-94E9-00112475D960 =yyas> (yas-unknown)
+;;
+;; # as in Commands/View demo help.yasnippet
+;; 964436B8-E578-11DC-8177-00112475D960 =yyas> (yas-unknown)
+;;
+;; # as in Commands/DB Schema Dump.yasnippet
+;; 310C901C-EF32-4E88-938A-804ABBF8C428 =yyas> (yas-unknown)
+;;
+;; # as in Commands/DB Schema Import.yasnippet
+;; 6DEF923E-2347-46EC-AFBE-183D08E63DC1 =yyas> (yas-unknown)
+;;
+;; # as in Commands/Generate.yasnippet
+;; 4904EDC7-5ED3-4132-AAB2-C2AD87C97EFE =yyas> (yas-unknown)
+;;
+;; # as in Commands/Rake Migrate.yasnippet
+;; 985F56D4-82ED-4C45-8250-2ECCFC71957E =yyas> (yas-unknown)
+;;
+;; # as in Macros/Add 3A Remove Index.yasnippet
+;; 95F83E1D-5B03-424F-8BEC-8AF66C8939BC =yyas> (yas-unknown)
+;;
+;; # as in Macros/Add 3A Remove Named Index.yasnippet
+;; A7F692C1-778A-48B8-945E-573568BA0403 =yyas> (yas-unknown)
+;;
+;; # as in Macros/Add 3A Remove Several Columns.yasnippet
+;; 7BC860E6-7561-4E6E-983B-507D7A6F6228 =yyas> (yas-unknown)
+;;
+;; # as in Macros/Add 3A Remove Timestamps.yasnippet
+;; 221969A1-A5EA-4A8E-8817-C74EBED63901 =yyas> (yas-unknown)
+;;
+;; # as in Macros/Add 3A Remove Unique Index.yasnippet
+;; 33057A79-677B-4DFB-99D4-1492778BDDC6 =yyas> (yas-unknown)
+;;
+;; # as in Macros/Change Column Default.yasnippet
+;; A219EBB8-004A-4012-B5B2-232C9A5C94F8 =yyas> (yas-unknown)
+;;
+;; # as in Macros/Change Column.yasnippet
+;; 42DE1441-D1B7-4998-BAF9-16B1EC7E210C =yyas> (yas-unknown)
+;;
+;; # as in Macros/Create 3A Drop Table.yasnippet
+;; 25F8F5D8-2BD1-45D8-8B2A-9F2EA4F73AA2 =yyas> (yas-unknown)
+;;
+;; # as in Macros/Drop 3A Create Table.yasnippet
+;; A2135370-67A1-488D-B43C-B4F221127C2F =yyas> (yas-unknown)
+;;
+;; # as in Macros/Remove 3A Add Column.yasnippet
+;; 809BCA42-5C49-4B08-B3C4-BB773036C086 =yyas> (yas-unknown)
+;;
+;; # as in Macros/Remove 3A Add Timestamps.yasnippet
+;; E885A3E8-8020-4AC3-A25E-510B26F114B2 =yyas> (yas-unknown)
+;;
+;; # as in Macros/Rename 3A Rename Several Columns (mncc).yasnippet
+;; 04A86178-71B1-430A-A06D-DFF7C9A338B5 =yyas> (yas-unknown)
+;;
+;; # as in Macros/Rename 3A Rename Several Columns.yasnippet
+;; F03162DE-9DB6-417B-9DD7-52D9F11EA736 =yyas> (yas-unknown)
+;;
+;; # as in Macros/Rename Column.yasnippet
+;; AC50762C-DE40-4EB9-9A22-2F6AF2EA4EA3 =yyas> (yas-unknown)
+;;
+;; # as in Macros/Rename Table.yasnippet
+;; FD8CC811-2AD3-480F-B975-DF959DC96C67 =yyas> (yas-unknown)
;;
;;
;; Substitutions for: condition
;;
;; # as in Snippets/verify - redirect (verify).yasnippet
-;; =yyas> (yas/unknown)
+;; =yyas> (yas-unknown)
;;
;; # as in Snippets/t_rename (tre).yasnippet
-;; meta.rails.migration.change_table =yyas> (yas/unknown)
+;; meta.rails.migration.change_table =yyas> (yas-unknown)
;;
-;; # as in Snippets/for loop erb.yasnippet
-;; text.html.ruby =yyas> (yas/unknown)
+;; # as in Snippets/has_one (ho).yasnippet
+;; meta.rails.model =yyas> (yas-unknown)
+;;
+;; # as in Snippets/if (ERB).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)
+;; ~$ =yyas> (yas-unknown)
;;
;; # as in Commands/Autocomplete Foreign Key Fixture Reference.yasnippet
-;; ~ =yyas> (yas/unknown)
+;; ~ =yyas> (yas-unknown)
+;;
+;; # as in Commands/Generate Quick Migration.yasnippet
+;; ^M =yyas> (yas-unknown)
;;
;; # as in Commands/Jump to Method Definition.yasnippet
-;; ^f =yyas> (yas/unknown)
+;; ^f =yyas> (yas-unknown)
+;;
+;; # as in Commands/List columns of a model.yasnippet
+;; ~ =yyas> (yas-unknown)
+;;
+;; # as in Commands/Go To File on This Line.yasnippet
+;; ~@ =yyas> (yas-unknown)
;;
;;
diff --git a/extras/imported/ruby-mode/.yas-setup.el b/extras/imported/ruby-mode/.yas-setup.el
index a3e200f..1351ac6 100644
--- a/extras/imported/ruby-mode/.yas-setup.el
+++ b/extras/imported/ruby-mode/.yas-setup.el
@@ -1,14 +1,14 @@
;; .yas-setup.el for ruby-mode
;; -*- coding: utf-8 -*-
;;
-(defvar yas/ruby-snippet-open-paren " "
+(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 " "
+(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"
+(defvar yas-ruby-shebang-args " -wKU"
"Arguments for the ruby shebang line.")
-(defun yas/ruby-infer-class-name ()
+(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
@@ -19,7 +19,7 @@
(t fn)))
"SomeClass"))
-(defun yas/ruby-chomp (x)
+(defun yas-ruby-chomp (x)
"Chomp string X, return nil if X became empty"
(let ((len (length x))
(start 0)
@@ -36,9 +36,9 @@
(unless (<= end start)
(substring x start (1+ end))))))
-(defvar yas/ruby-block-start-regexp "\\(^\\|[\s\t\n^]\\)\\(do\\)[\s\t\n]\\(|.*|\\)?")
+(defvar yas-ruby-block-start-regexp "\\(^\\|[\s\t\n^]\\)\\(do\\)[\s\t\n]\\(|.*|\\)?")
-(defun yas/ruby-toggle-single-multi-line-block ()
+(defun yas-ruby-toggle-single-multi-line-block ()
"Toggle \"do .. end\" blocks into \"{ .. }\" blocks back and forth."
;;
;; TODO: Some code to be refactored here.
@@ -48,9 +48,9 @@
(interactive)
(let* ((do-block-bounds (save-excursion
(when (or (save-excursion (beginning-of-line)
- (looking-at yas/ruby-block-start-regexp))
+ (looking-at yas-ruby-block-start-regexp))
(save-excursion (ruby-beginning-of-block)
- (looking-at yas/ruby-block-start-regexp)))
+ (looking-at yas-ruby-block-start-regexp)))
(cons (match-beginning 1)
(progn (goto-char (match-beginning 1))
(ruby-end-of-block) (point))))))
@@ -76,7 +76,7 @@
(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
+ (setq statements (remove nil (mapcar #'yas-ruby-chomp
(split-string block-region "\n"))))
(mapc #'(lambda (string)
(insert " " string)
@@ -97,7 +97,7 @@
(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
+ (setq statements (remove nil (mapcar #'yas-ruby-chomp
(split-string block-region ";"))))
(mapc #'(lambda (string)
(insert "\n" string)
@@ -110,7 +110,7 @@
(t
(message "No enclosing block found.")))))
-(defvar yas/ruby-require-regexps
+(defvar yas-ruby-require-regexps
'(("abbrev" . ("abbrev"))
("base64" . ("Base64"))
("benchmark" . ("Benchmark"))
@@ -194,7 +194,7 @@
("yaml" . ("YAML"))
("zlib" . ("Zlib"))))
-(defun yas/ruby-require (package)
+(defun yas-ruby-require (package)
(save-excursion
(goto-char (point-min))
(unless (search-forward-regexp (format "^[\s\t]*require[( ][ ]*\"%s\"[ )]*$"
@@ -204,7 +204,7 @@
(goto-char (line-beginning-position)))
(insert "require \"" package "\"\n"))))
-(defun yas/ruby-pipe-through-xmpfilter ()
+(defun yas-ruby-pipe-through-xmpfilter ()
(interactive)
(let ((start (or (and mark-active
(region-beginning))
@@ -223,8 +223,8 @@
(recenter orig-line)
retval))
-(put (intern "ruby-thing") 'bounds-of-thing-at-point 'yas/ri-ruby-thing-bounds)
-(defun yas/ri-ruby-thing-bounds ()
+(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
@@ -237,11 +237,11 @@
(unless (= start end)
(cons start end))))
-(defvar yas/ri-history nil
- "History of yas/ri queries.")
-(defvar yas/ri-executable "ri")
+(defvar yas-ri-history nil
+ "History of yas-ri queries.")
+(defvar yas-ri-executable "ri")
(require 'ansi-color)
-(defun yas/ri (query)
+(defun yas-ri (query)
(interactive (list (read-from-minibuffer "Ri query: "
(thing-at-point 'ruby-thing)
nil
@@ -252,82 +252,82 @@
(erase-buffer)
(setq default-directory "~")
(setq buffer-read-only nil)
- (shell-command (concat yas/ri-executable " -f ansi " query) "*Ri*")
+ (shell-command (concat yas-ri-executable " -f ansi " query) "*Ri*")
(ansi-color-apply-on-region (point-min) (point-max))
- (yas/ri-mode)
+ (yas-ri-mode)
(display-buffer (current-buffer)))
t)
-(defun yas/ri-mode ()
+(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)
+ (local-set-key (kbd "RET") 'yas-ri)
(setq mode-name "ri")
- (setq major-mode 'yas/ri-mode)
+ (setq major-mode 'yas-ri-mode)
(setq buffer-read-only t)
- (run-hooks 'yas/ri-mode-hook))
+ (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
+(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)))))
-(provide 'yas/ruby)
+(provide 'yas-ruby)
;; 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/.+/(/} =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) ", ")}
+;; ${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_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)`
+;; ${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) " |")}
+;; ${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/(^(?\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))}
+;; ${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 'yari) 'yari 'yas/ri))
+;; 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 'yari) 'yari '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`
+;; `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
;;
@@ -335,10 +335,10 @@
;; 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)
+;; 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
@@ -360,450 +360,450 @@
;;
;;
;; # as in Commands/Enclose in + (RDoc comments).yasnippet
-;; @k =yyas> (yas/unknown)
+;; @k =yyas> (yas-unknown)
;;
;; # as in Commands/Check Ruby Syntax.yasnippet
-;; ^V =yyas> (yas/unknown)
+;; ^V =yyas> (yas-unknown)
;;
;; # as in Commands/Omit from RDoc.yasnippet
-;; ^@O =yyas> (yas/unknown)
+;; ^@O =yyas> (yas-unknown)
;;
;; # as in Commands/Enclose in (RDoc comments).yasnippet
-;; @b =yyas> (yas/unknown)
+;; @b =yyas> (yas-unknown)
;;
;; # as in Snippets/hash pointer.yasnippet
-;; ^l =yyas> (yas/unknown)
+;; ^l =yyas> (yas-unknown)
;;
;; # as in Commands/Make Destructive Call.yasnippet
-;; ^! =yyas> (yas/unknown)
+;; ^! =yyas> (yas-unknown)
;;
;; # as in Commands/Toggle Quote Style.yasnippet
-;; ^" =yyas> (yas/unknown)
+;; ^" =yyas> (yas-unknown)
;;
;; # as in Commands/Open Require.yasnippet
-;; @D =yyas> (yas/unknown)
+;; @D =yyas> (yas-unknown)
;;
;; # as in Commands/Execute Line with Ruby.yasnippet
-;; ^E =yyas> (yas/unknown)
+;; ^E =yyas> (yas-unknown)
;;
;; # as in Commands/Completion Ruby (rcodetools).yasnippet
-;; ~ =yyas> (yas/unknown)
+;; ~ =yyas> (yas-unknown)
;;
;; # as in Macros/Delete forwardbackward.yasnippet
-;; =yyas> (yas/unknown)
+;; =yyas> (yas-unknown)
;;
;; --**--
;; Automatically generated code, do not edit this part
;;
;; Translated menu
;;
-(yas/define-menu 'ruby-mode
+(yas-define-menu 'ruby-mode
'(;; Ignoring Run
- (yas/ignore-item "35222962-C50D-4D58-A6AE-71E7AD980BE4")
+ (yas-ignore-item "35222962-C50D-4D58-A6AE-71E7AD980BE4")
;; Ignoring Run Focused Unit Test
- (yas/ignore-item "5289EE40-86B8-11D9-A8D4-000A95E13C98")
+ (yas-ignore-item "5289EE40-86B8-11D9-A8D4-000A95E13C98")
;; Ignoring Run Rake Task
- (yas/ignore-item "569C9822-8C41-4907-94C7-1A8A0031B66D")
+ (yas-ignore-item "569C9822-8C41-4907-94C7-1A8A0031B66D")
;; Documentation for Word / Selection
- (yas/item "63F3B3B7-CBE2-426B-B551-657733F3868B")
- (yas/submenu "RDoc"
+ (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-ignore-item "1AD6A138-2E89-4D6A-AB3F-416BF9CE968D")
- (yas/submenu "Format"
+ (yas-submenu "Format"
(;; Ignoring Bold
- (yas/ignore-item "931DD73E-615E-476E-9B0D-8341023AE730")
+ (yas-ignore-item "931DD73E-615E-476E-9B0D-8341023AE730")
;; Ignoring Italic
- (yas/ignore-item "DAA69A0C-FC1E-4509-9931-DFFB38B4D6AE")
+ (yas-ignore-item "DAA69A0C-FC1E-4509-9931-DFFB38B4D6AE")
;; Ignoring Typewriter
- (yas/ignore-item "2DDB6FE0-6111-4C40-A149-8E67E76F8272")))
+ (yas-ignore-item "2DDB6FE0-6111-4C40-A149-8E67E76F8272")))
;; New Block
- (yas/item "05984208-D559-4C04-A69C-2019361A985A")
+ (yas-item "05984208-D559-4C04-A69C-2019361A985A")
;; Ignoring Omit
- (yas/ignore-item "BF4CA9F1-51CD-48D4-8357-852234F59046")
+ (yas-ignore-item "BF4CA9F1-51CD-48D4-8357-852234F59046")
;; :yields:
- (yas/item "ED6368FB-A11D-4622-9F42-7879481094F1")))
- (yas/separator)
- (yas/submenu "Rake"
+ (yas-item "ED6368FB-A11D-4622-9F42-7879481094F1")))
+ (yas-separator)
+ (yas-submenu "Rake"
(;; namespace :name ... end
- (yas/item "A3D89AAA-9156-4077-A026-37BB7358C3BA")
+ (yas-item "A3D89AAA-9156-4077-A026-37BB7358C3BA")
;; namespace :name ... task :default ... end
- (yas/item "2031FC41-CBD3-41CC-B9A9-7F068E607A05")
+ (yas-item "2031FC41-CBD3-41CC-B9A9-7F068E607A05")
;; desc ...
- (yas/item "F686E1AD-B03D-45A6-BD51-6E3FD1298FE0")
+ (yas-item "F686E1AD-B03D-45A6-BD51-6E3FD1298FE0")
;; task :name ... end
- (yas/item "CB81DA55-F3BC-4BFB-B0C5-29F0EE6F8081")
+ (yas-item "CB81DA55-F3BC-4BFB-B0C5-29F0EE6F8081")
;; desc ... task :name ... end
- (yas/item "FE9A8EDA-C243-4068-8F38-A615B82D08C9")
+ (yas-item "FE9A8EDA-C243-4068-8F38-A615B82D08C9")
;; Ignoring Rake/Sake task using file path
- (yas/ignore-item "E07FF68B-C87D-4332-8477-D026929FDADA")))
- (yas/separator)
+ (yas-ignore-item "E07FF68B-C87D-4332-8477-D026929FDADA")))
+ (yas-separator)
;; Ignoring Open Require
- (yas/ignore-item "8646378E-91F5-4771-AC7C-43FC49A93576")
+ (yas-ignore-item "8646378E-91F5-4771-AC7C-43FC49A93576")
;; Ignoring Validate Syntax
- (yas/ignore-item "EE5F19BA-6C02-11D9-92BA-0011242E4184")
+ (yas-ignore-item "EE5F19BA-6C02-11D9-92BA-0011242E4184")
;; Ignoring Execute Line / Selection as Ruby
- (yas/ignore-item "EE5F1FB2-6C02-11D9-92BA-0011242E4184")
+ (yas-ignore-item "EE5F1FB2-6C02-11D9-92BA-0011242E4184")
;; Execute and Update ‘# =>’ Markers
- (yas/item "FBFC214F-B019-4967-95D2-028F374A3221")
+ (yas-item "FBFC214F-B019-4967-95D2-028F374A3221")
;; Add ‘# =>’ Marker
- (yas/item "88BC3896-DC39-4307-A271-21D33340F15A")
- (yas/separator)
+ (yas-item "88BC3896-DC39-4307-A271-21D33340F15A")
+ (yas-separator)
;; Ignoring Insert Missing Requires
- (yas/ignore-item "9FB64639-F776-499B-BA6F-BB45F86F80FD")
+ (yas-ignore-item "9FB64639-F776-499B-BA6F-BB45F86F80FD")
;; Ignoring Add ! to Method in Line / Selection
- (yas/ignore-item "7F79BC8D-8A4F-4570-973B-05DFEC25747F")
+ (yas-ignore-item "7F79BC8D-8A4F-4570-973B-05DFEC25747F")
;; Ignoring Toggle String / Symbol
- (yas/ignore-item "B297E4B8-A8FF-49CE-B9C4-6D4911724D43")
+ (yas-ignore-item "B297E4B8-A8FF-49CE-B9C4-6D4911724D43")
;; Insert ERb’s <% .. %> or <%= .. %>
- (yas/item "FDFABCB9-DF58-4469-AE11-5407A4FF4D70")
- (yas/separator)
- (yas/submenu "Declarations"
+ (yas-item "FDFABCB9-DF58-4469-AE11-5407A4FF4D70")
+ (yas-separator)
+ (yas-submenu "Declarations"
(;; begin … rescue … end
- (yas/item "0F940CBC-2173-49FF-B6FD-98A62863F8F2")
+ (yas-item "0F940CBC-2173-49FF-B6FD-98A62863F8F2")
;; case … end
- (yas/item "667083EE-62C3-11D9-B8CF-000D93589AF6")
+ (yas-item "667083EE-62C3-11D9-B8CF-000D93589AF6")
;; when …
- (yas/item "48D8E498-C9A5-4B1B-9A18-71A5860276FB")
+ (yas-item "48D8E498-C9A5-4B1B-9A18-71A5860276FB")
;; if … end
- (yas/item "6670835F-62C3-11D9-B8CF-000D93589AF6")
+ (yas-item "6670835F-62C3-11D9-B8CF-000D93589AF6")
;; if … else … end
- (yas/item "667082E6-62C3-11D9-B8CF-000D93589AF6")
+ (yas-item "667082E6-62C3-11D9-B8CF-000D93589AF6")
;; elsif ...
- (yas/item "CD1609FA-47DA-4EE4-9C5B-5C56D953F5B1")
+ (yas-item "CD1609FA-47DA-4EE4-9C5B-5C56D953F5B1")
;; unless … end
- (yas/item "F53E098D-D08E-4CE2-990A-B0BD70E60614")
+ (yas-item "F53E098D-D08E-4CE2-990A-B0BD70E60614")
;; while ... end
- (yas/item "D121FC61-96A4-4B8F-8709-280EDA876FF3")
+ (yas-item "D121FC61-96A4-4B8F-8709-280EDA876FF3")
;; until ... end
- (yas/item "488B387C-50C0-4B2D-9260-5A7E7EAF9B42")
- (yas/separator)
- (yas/submenu "Classes and Modules"
+ (yas-item "488B387C-50C0-4B2D-9260-5A7E7EAF9B42")
+ (yas-separator)
+ (yas-submenu "Classes and Modules"
(;; class .. end
- (yas/item "BF487539-8085-4FF4-8601-1AD20FABAEDC")
+ (yas-item "BF487539-8085-4FF4-8601-1AD20FABAEDC")
;; class .. initialize .. end
- (yas/item "83EED068-8C1C-4BAF-9893-902DC00616AB")
+ (yas-item "83EED068-8C1C-4BAF-9893-902DC00616AB")
;; class .. < ParentClass .. initialize .. end
- (yas/item "0CCBE04E-F4E2-4E55-9506-7DE67ACF8388")
+ (yas-item "0CCBE04E-F4E2-4E55-9506-7DE67ACF8388")
;; ClassName = Struct .. do .. end
- (yas/item "05DFF82C-5A29-4EBD-93FE-C165FFFB5EA8")
+ (yas-item "05DFF82C-5A29-4EBD-93FE-C165FFFB5EA8")
;; class BlankSlate .. initialize .. end
- (yas/item "E98FB8F9-7302-431D-8BF2-275A68A6126C")
+ (yas-item "E98FB8F9-7302-431D-8BF2-275A68A6126C")
;; Ignoring class .. < DelegateClass .. initialize .. end
- (yas/ignore-item "121B334B-2AA6-4E9A-A8B8-BF93B627982B")
+ (yas-ignore-item "121B334B-2AA6-4E9A-A8B8-BF93B627982B")
;; class .. < DelegateClass .. initialize .. end
- (yas/item "AFE1D078-EA16-45F5-AD8A-FAC1B523D861")
+ (yas-item "AFE1D078-EA16-45F5-AD8A-FAC1B523D861")
;; class << self .. end
- (yas/item "C7AAAE45-487A-4B61-8962-D47675AAC05F")
- (yas/separator)
+ (yas-item "C7AAAE45-487A-4B61-8962-D47675AAC05F")
+ (yas-separator)
;; module .. end
- (yas/item "2B73EC5F-06D2-460C-A14F-6FA05AFCF0CC")
+ (yas-item "2B73EC5F-06D2-460C-A14F-6FA05AFCF0CC")
;; module .. module_function .. end
- (yas/item "0E85EC81-2FAB-4648-B590-119CC1BB6E41")
+ (yas-item "0E85EC81-2FAB-4648-B590-119CC1BB6E41")
;; module .. ClassMethods .. end
- (yas/item "A71A18CF-2D71-4BFF-AA0C-D9B8C59BC4EB")))
- (yas/submenu "Methods"
+ (yas-item "A71A18CF-2D71-4BFF-AA0C-D9B8C59BC4EB")))
+ (yas-submenu "Methods"
(;; Ignoring New Method
- (yas/ignore-item "0275EF39-9357-408F-AF20-79E415CA9504")
+ (yas-ignore-item "0275EF39-9357-408F-AF20-79E415CA9504")
;; attr_reader ..
- (yas/item "A150C2D8-25B3-4339-BC92-8A0160A70486")
+ (yas-item "A150C2D8-25B3-4339-BC92-8A0160A70486")
;; attr_writer ..
- (yas/item "3D383096-A03F-4EF8-9060-3C727045AB34")
+ (yas-item "3D383096-A03F-4EF8-9060-3C727045AB34")
;; attr_accessor ..
- (yas/item "D7A7D3C9-1714-4C50-8CC0-D83A03883E8F")
- (yas/separator)
+ (yas-item "D7A7D3C9-1714-4C50-8CC0-D83A03883E8F")
+ (yas-separator)
;; include Enumerable ..
- (yas/item "AAD5D511-6BE7-41DA-8F2B-1593A48FBB08")
+ (yas-item "AAD5D511-6BE7-41DA-8F2B-1593A48FBB08")
;; include Comparable ..
- (yas/item "6C9D6B3D-D8E9-4606-9534-577C8D21FFF6")
- (yas/separator)
+ (yas-item "6C9D6B3D-D8E9-4606-9534-577C8D21FFF6")
+ (yas-separator)
;; Ignoring extend Forwardable
- (yas/ignore-item "58FDEA60-10AF-4C49-AA09-29B77030DB25")
+ (yas-ignore-item "58FDEA60-10AF-4C49-AA09-29B77030DB25")
;; extend Forwardable
- (yas/item "7F46C90A-595B-4B83-A4F7-058F63CE4218")
- (yas/separator)
+ (yas-item "7F46C90A-595B-4B83-A4F7-058F63CE4218")
+ (yas-separator)
;; def … end
- (yas/item "4E9A7A73-875C-11D9-897C-000393CBCE2E")
+ (yas-item "4E9A7A73-875C-11D9-897C-000393CBCE2E")
;; def self .. end
- (yas/item "7C6E88FA-CA0E-4110-8C75-A94E54286A75")
+ (yas-item "7C6E88FA-CA0E-4110-8C75-A94E54286A75")
;; def method_missing .. end
- (yas/item "87D5F8AD-8DA6-4AED-A0D8-B51CAC980445")
+ (yas-item "87D5F8AD-8DA6-4AED-A0D8-B51CAC980445")
;; def_delegator ..
- (yas/item "C44ED391-614F-4BA2-BB0F-87668EEA9954")
+ (yas-item "C44ED391-614F-4BA2-BB0F-87668EEA9954")
;; def_delegators ..
- (yas/item "4A6EFD6B-88E2-4822-AD48-03460EDBC796")
- (yas/separator)
+ (yas-item "4A6EFD6B-88E2-4822-AD48-03460EDBC796")
+ (yas-separator)
;; alias_method ..
- (yas/item "988C8AEF-FC71-4455-9C4F-9338C05685A4")))
+ (yas-item "988C8AEF-FC71-4455-9C4F-9338C05685A4")))
;; __END__
- (yas/item "451A0596-1F72-4AFB-AF2F-45900FABB0F7")
- (yas/separator)
+ (yas-item "451A0596-1F72-4AFB-AF2F-45900FABB0F7")
+ (yas-separator)
;; #!/usr/bin/env ruby -wKU
- (yas/item "A05CBDD6-845D-45EB-94FB-F8787F5456BE")
+ (yas-item "A05CBDD6-845D-45EB-94FB-F8787F5456BE")
;; require ".."
- (yas/item "97DE939B-D243-4D5C-B953-1C9090912E7C")
+ (yas-item "97DE939B-D243-4D5C-B953-1C9090912E7C")
;; application { .. }
- (yas/item "E16D24D2-CC7E-4786-BE0B-1725FC865D78")
+ (yas-item "E16D24D2-CC7E-4786-BE0B-1725FC865D78")
;; usage_if()
- (yas/item "21C0D711-F32A-4665-AA0D-B136F9DD3945")
+ (yas-item "21C0D711-F32A-4665-AA0D-B136F9DD3945")
;; usage_unless()
- (yas/item "49D69DEC-6991-49F4-8D9B-BA60BFDD3D17")))
- (yas/submenu "Iterators"
- ((yas/submenu "Arrays"
+ (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)
+ (yas-item "DAE6A754-D906-4763-B816-CE67125CEF08")
+ (yas-separator)
;; delete_if { |e| .. }
- (yas/item "263C94DC-63CF-4BA3-9692-C5582CA8F1AB")
+ (yas-item "263C94DC-63CF-4BA3-9692-C5582CA8F1AB")
;; fill(range) { |i| .. }
- (yas/item "6021BBDC-4AAD-447B-A0C2-A4BB31721558")
+ (yas-item "6021BBDC-4AAD-447B-A0C2-A4BB31721558")
;; flatten_once()
- (yas/item "3DDB99C4-486D-4C11-A217-5680FDD8EC19")
+ (yas-item "3DDB99C4-486D-4C11-A217-5680FDD8EC19")
;; zip(enums) { |row| .. }
- (yas/item "FD010022-E0E7-44DB-827F-33F7D9310DA2")))
- (yas/submenu "Counting"
+ (yas-item "FD010022-E0E7-44DB-827F-33F7D9310DA2")))
+ (yas-submenu "Counting"
(;; downto(0) { |n| .. }
- (yas/item "4991BB86-736E-4758-B9B2-E4FA90B9368F")
+ (yas-item "4991BB86-736E-4758-B9B2-E4FA90B9368F")
;; step(2) { |e| .. }
- (yas/item "36853A11-0307-4AE7-B835-7CE6358717A5")
+ (yas-item "36853A11-0307-4AE7-B835-7CE6358717A5")
;; times { |n| .. }
- (yas/item "206D54AF-E67A-4DF0-B7F4-3D42FEB81685")
+ (yas-item "206D54AF-E67A-4DF0-B7F4-3D42FEB81685")
;; upto(1.0/0.0) { |n| .. }
- (yas/item "51954118-81D7-42B6-9A10-BE23D8B9FFE2")
- (yas/separator)
+ (yas-item "51954118-81D7-42B6-9A10-BE23D8B9FFE2")
+ (yas-separator)
;; loop { .. }
- (yas/item "567E3D18-BF2B-4379-8927-2777EC9F495E")))
- (yas/submenu "Each Element"
+ (yas-item "567E3D18-BF2B-4379-8927-2777EC9F495E")))
+ (yas-submenu "Each Element"
(;; each { |e| .. }
- (yas/item "ECBA4CA0-275F-460E-85BE-E82FEA2E2B26")
+ (yas-item "ECBA4CA0-275F-460E-85BE-E82FEA2E2B26")
;; each_byte { |byte| .. }
- (yas/item "338EC03D-3FF4-4435-94E8-1CEF20CEC75D")
+ (yas-item "338EC03D-3FF4-4435-94E8-1CEF20CEC75D")
;; each_char { |chr| .. }
- (yas/item "7E084412-80E6-4B70-8092-C03D1ECE4CD2")
+ (yas-item "7E084412-80E6-4B70-8092-C03D1ECE4CD2")
;; each_char { |chr| .. }
- (yas/item "FDD73070-6D32-4301-A86A-C55B77C3D8ED")
+ (yas-item "FDD73070-6D32-4301-A86A-C55B77C3D8ED")
;; Ignoring each_cons(..) { |group| .. }
- (yas/ignore-item "EC73D5CC-5F05-46B9-A6F4-82037E4A38C9")
+ (yas-ignore-item "EC73D5CC-5F05-46B9-A6F4-82037E4A38C9")
;; each_cons(..) { |group| .. }
- (yas/item "3C04589C-5127-478E-97B3-CA7DD2EA7ECD")
+ (yas-item "3C04589C-5127-478E-97B3-CA7DD2EA7ECD")
;; each_index { |i| .. }
- (yas/item "689120C9-AB40-4081-8268-9362E00FA4A0")
+ (yas-item "689120C9-AB40-4081-8268-9362E00FA4A0")
;; each_key { |key| .. }
- (yas/item "E54F7077-3C33-4B53-A4F7-21E16132D3AD")
+ (yas-item "E54F7077-3C33-4B53-A4F7-21E16132D3AD")
;; each_line { |line| .. }
- (yas/item "02913388-EE8E-4C55-AC94-94F3D751F47E")
+ (yas-item "02913388-EE8E-4C55-AC94-94F3D751F47E")
;; each_pair { |name, val| .. }
- (yas/item "7A3CECED-452B-438E-A5C6-95B6BDC43243")
+ (yas-item "7A3CECED-452B-438E-A5C6-95B6BDC43243")
;; Ignoring each_slice(..) { |group| .. }
- (yas/ignore-item "825B721D-4367-4DF7-98C0-F005695DF9E3")
+ (yas-ignore-item "825B721D-4367-4DF7-98C0-F005695DF9E3")
;; each_slice(..) { |group| .. }
- (yas/item "CD748479-D2A4-4AB5-95BD-4C89512BA210")
+ (yas-item "CD748479-D2A4-4AB5-95BD-4C89512BA210")
;; each_value { |val| .. }
- (yas/item "844DBD70-BC23-4FBF-9C18-F4A610239DF2")
+ (yas-item "844DBD70-BC23-4FBF-9C18-F4A610239DF2")
;; each_with_index { |e, i| .. }
- (yas/item "1DD13CF5-39C0-4F10-B655-56DACEBC7F94")
+ (yas-item "1DD13CF5-39C0-4F10-B655-56DACEBC7F94")
;; reverse_each { |e| .. }
- (yas/item "F3C5F719-EF03-4FF7-A777-4A8402FE3B6B")
- (yas/separator)
+ (yas-item "F3C5F719-EF03-4FF7-A777-4A8402FE3B6B")
+ (yas-separator)
;; inject(init) { |mem, var| .. }
- (yas/item "B563E0D7-513D-49B4-9733-1B04A6F25A74")
- (yas/separator)
+ (yas-item "B563E0D7-513D-49B4-9733-1B04A6F25A74")
+ (yas-separator)
;; map { |e| .. }
- (yas/item "5A3754FC-43A3-462B-AB42-E3E951872E6F")
+ (yas-item "5A3754FC-43A3-462B-AB42-E3E951872E6F")
;; Ignoring map_with_index { |e, i| .. }
- (yas/ignore-item "BFB65D1C-62F1-485D-8A67-3E5A2E55107C")
+ (yas-ignore-item "BFB65D1C-62F1-485D-8A67-3E5A2E55107C")
;; map_with_index { |e, i| .. }
- (yas/item "BD4CFD7B-1AC0-4569-9BDA-FD491F41F4E6")))
- (yas/submenu "Files"
+ (yas-item "BD4CFD7B-1AC0-4569-9BDA-FD491F41F4E6")))
+ (yas-submenu "Files"
(;; Dir.glob("..") { |file| .. }
- (yas/item "332AA973-AA71-48CB-AEE9-1D71E11019AC")
+ (yas-item "332AA973-AA71-48CB-AEE9-1D71E11019AC")
;; File.foreach ("..") { |line| .. }
- (yas/item "8F594E5E-6F46-4E98-B5FB-1C8F3BA9828F")
+ (yas-item "8F594E5E-6F46-4E98-B5FB-1C8F3BA9828F")
;; open("path/or/url", "w") { |io| .. }
- (yas/item "418F1817-255F-430A-B09A-222964ED66A7")
+ (yas-item "418F1817-255F-430A-B09A-222964ED66A7")
;; unix_filter { .. }
- (yas/item "8CEF9711-88D5-4202-AFB9-29EF4EFD25C1")
- (yas/separator)
+ (yas-item "8CEF9711-88D5-4202-AFB9-29EF4EFD25C1")
+ (yas-separator)
;; option_parse { .. }
- (yas/item "C3C48948-4F49-484E-A8DE-DEB44723099E")
+ (yas-item "C3C48948-4F49-484E-A8DE-DEB44723099E")
;; option(..)
- (yas/item "209D5D73-7A77-4931-A158-3FB6D5B48A88")))
- (yas/submenu "Ordering"
+ (yas-item "209D5D73-7A77-4931-A158-3FB6D5B48A88")))
+ (yas-submenu "Ordering"
(;; sort { |a, b| .. }
- (yas/item "9E0B4D4B-2956-4B3A-800A-3D8CE54E66BF")
+ (yas-item "9E0B4D4B-2956-4B3A-800A-3D8CE54E66BF")
;; sort_by { |e| .. }
- (yas/item "BA9440C9-36C3-4031-BB61-67B581D5B179")
- (yas/separator)
+ (yas-item "BA9440C9-36C3-4031-BB61-67B581D5B179")
+ (yas-separator)
;; randomize()
- (yas/item "B0CE57EC-FB2E-4482-8CCE-448DC2588715")))
- (yas/submenu "Searching and Selection"
+ (yas-item "B0CE57EC-FB2E-4482-8CCE-448DC2588715")))
+ (yas-submenu "Searching and Selection"
(;; all? { |e| .. }
- (yas/item "07D1F987-7CDB-4EAD-B64A-27A93051700E")
+ (yas-item "07D1F987-7CDB-4EAD-B64A-27A93051700E")
;; any? { |e| .. }
- (yas/item "A3B9B76B-2BC5-425C-AB24-9FAAFC375798")
+ (yas-item "A3B9B76B-2BC5-425C-AB24-9FAAFC375798")
;; classify { |e| .. }
- (yas/item "5DA9E1E8-2C54-420A-9B84-B040A1AF2B9E")
+ (yas-item "5DA9E1E8-2C54-420A-9B84-B040A1AF2B9E")
;; collect { |e| .. }
- (yas/item "669A86AD-936F-4EDA-8E4E-6863804072DA")
+ (yas-item "669A86AD-936F-4EDA-8E4E-6863804072DA")
;; detect { |e| .. }
- (yas/item "6C6B9849-9631-49FF-A9F9-F0E94A1512C5")
+ (yas-item "6C6B9849-9631-49FF-A9F9-F0E94A1512C5")
;; fetch(name) { |key| .. }
- (yas/item "1F72122A-35AD-4BA1-AA01-889A10319666")
+ (yas-item "1F72122A-35AD-4BA1-AA01-889A10319666")
;; find { |e| .. }
- (yas/item "E23FE534-8061-4828-98A5-46270B6910B0")
+ (yas-item "E23FE534-8061-4828-98A5-46270B6910B0")
;; find_all { |e| .. }
- (yas/item "197709C5-8382-4A59-B6D7-31A0CC0F23B7")
+ (yas-item "197709C5-8382-4A59-B6D7-31A0CC0F23B7")
;; grep(/pattern/) { |match| .. }
- (yas/item "9D9E7BA3-8C5D-4532-83EA-326358C2F5BB")
+ (yas-item "9D9E7BA3-8C5D-4532-83EA-326358C2F5BB")
;; max { |a, b| .. }
- (yas/item "98182B9E-7C61-4824-BE4C-9CD69C816037")
+ (yas-item "98182B9E-7C61-4824-BE4C-9CD69C816037")
;; min { |a, b| .. }
- (yas/item "CB03D11A-7204-48D0-92C1-E109034403E7")
+ (yas-item "CB03D11A-7204-48D0-92C1-E109034403E7")
;; partition { |e| .. }
- (yas/item "52B8BF63-F09E-4789-8407-06168A8AE666")
+ (yas-item "52B8BF63-F09E-4789-8407-06168A8AE666")
;; reject { |e| .. }
- (yas/item "B79B9DAB-ABEF-44F6-BF7E-635E7BA11DFD")
+ (yas-item "B79B9DAB-ABEF-44F6-BF7E-635E7BA11DFD")
;; select { |e| .. }
- (yas/item "4E409AA4-E7D4-46B7-A4E9-E32F992B33E9")))
- (yas/submenu "Strings"
+ (yas-item "4E409AA4-E7D4-46B7-A4E9-E32F992B33E9")))
+ (yas-submenu "Strings"
(;; sub(/../) { |match| .. }
- (yas/item "8021944C-CEA4-4983-8D1C-78D18D4004A1")
+ (yas-item "8021944C-CEA4-4983-8D1C-78D18D4004A1")
;; gsub(/../) { |match| .. }
- (yas/item "2514FC26-468C-4D08-A788-494A444C4286")
- (yas/separator)
+ (yas-item "2514FC26-468C-4D08-A788-494A444C4286")
+ (yas-separator)
;; scan(/../) { |match| .. }
- (yas/item "66802933-B49F-479B-9DF9-1D898FF1FA90")))))
- (yas/submenu "Blocks"
+ (yas-item "66802933-B49F-479B-9DF9-1D898FF1FA90")))))
+ (yas-submenu "Blocks"
(;; Toggle ‘do … end’ / ‘{ … }’
- (yas/item "7990EE60-C850-4779-A8C0-7FD2C853B99B")
- (yas/separator)
+ (yas-item "7990EE60-C850-4779-A8C0-7FD2C853B99B")
+ (yas-separator)
;; Insert { |variable| … }
- (yas/item "855FC4EF-7B1E-48EE-AD4E-5ECB8ED79D1C")
+ (yas-item "855FC4EF-7B1E-48EE-AD4E-5ECB8ED79D1C")
;; Insert do |variable| … end
- (yas/item "4B72C5C3-6CA7-41AC-B2F9-51DEA25D469E")
- (yas/separator)
+ (yas-item "4B72C5C3-6CA7-41AC-B2F9-51DEA25D469E")
+ (yas-separator)
;; lambda { |args| .. }
- (yas/item "21E75321-0CF7-45E8-A297-BCC7C0DDDD15")))
- (yas/submenu "Hashes"
+ (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)
+ (yas-item "E16EE658-1CA0-4950-954B-B962E50B754F")
+ (yas-separator)
;; Hash Pair — :key => "value"
- (yas/item "840B9C4C-7037-4C3B-9028-EB9DC75EDB3E")
+ (yas-item "840B9C4C-7037-4C3B-9028-EB9DC75EDB3E")
;; Hash Pointer — =>
- (yas/item "B9E3A6DF-875D-11D9-897C-000393CBCE2E")))
- (yas/submenu "Tests"
+ (yas-item "B9E3A6DF-875D-11D9-897C-000393CBCE2E")))
+ (yas-submenu "Tests"
(;; class .. < Test::Unit::TestCase .. end
- (yas/item "31D1F145-33AB-4441-BA11-4D1C46928C4C")
+ (yas-item "31D1F145-33AB-4441-BA11-4D1C46928C4C")
;; def test_ .. end
- (yas/item "00F66D41-25AF-4597-B67D-E540965A5222")
+ (yas-item "00F66D41-25AF-4597-B67D-E540965A5222")
;; require "tc_.." ..
- (yas/item "5297FD0C-98B1-4514-BBD1-1516810BECA6")
- (yas/separator)
+ (yas-item "5297FD0C-98B1-4514-BBD1-1516810BECA6")
+ (yas-separator)
;; assert(..)
- (yas/item "B32C147D-44A6-478A-9D5D-189D7831E9A7")
+ (yas-item "B32C147D-44A6-478A-9D5D-189D7831E9A7")
;; assert_equal(..)
- (yas/item "43A61A22-6BEE-4997-961C-1CDE739C05FE")
+ (yas-item "43A61A22-6BEE-4997-961C-1CDE739C05FE")
;; assert_not_equal(..)
- (yas/item "A243E96F-DC21-4AA0-B340-13A7674F6AFF")
+ (yas-item "A243E96F-DC21-4AA0-B340-13A7674F6AFF")
;; assert_in_delta(..)
- (yas/item "429D0EF5-580D-4166-8F79-713DE96B77F1")
+ (yas-item "429D0EF5-580D-4166-8F79-713DE96B77F1")
;; assert_instance_of(..)
- (yas/item "0E831E03-67E1-4357-8323-C60685C23C4F")
+ (yas-item "0E831E03-67E1-4357-8323-C60685C23C4F")
;; assert_kind_of(..)
- (yas/item "671F05E2-D9CC-485E-BB1B-B13EF20FAC65")
+ (yas-item "671F05E2-D9CC-485E-BB1B-B13EF20FAC65")
;; assert_nil(..)
- (yas/item "4C79256C-480A-459C-BDE8-BB0D972811DB")
+ (yas-item "4C79256C-480A-459C-BDE8-BB0D972811DB")
;; assert_not_nil(..)
- (yas/item "79FEC3CC-2A40-4611-9A85-ECDB22FE0701")
+ (yas-item "79FEC3CC-2A40-4611-9A85-ECDB22FE0701")
;; assert_match(..)
- (yas/item "711ED6C3-0F18-41FB-9A7D-3094BB319A85")
+ (yas-item "711ED6C3-0F18-41FB-9A7D-3094BB319A85")
;; assert_no_match(..)
- (yas/item "A072BB1E-1DD1-45D3-9346-8CA3BA21B364")
+ (yas-item "A072BB1E-1DD1-45D3-9346-8CA3BA21B364")
;; assert_operator(..)
- (yas/item "1B925A4D-8EE4-442B-9254-293599F5717F")
+ (yas-item "1B925A4D-8EE4-442B-9254-293599F5717F")
;; assert_raise(..) { .. }
- (yas/item "68B21F6F-5D89-41FA-A19C-F29C2F912B4E")
+ (yas-item "68B21F6F-5D89-41FA-A19C-F29C2F912B4E")
;; assert_nothing_raised(..) { .. }
- (yas/item "82F8EEE0-2452-411E-8102-7BFDDBCA2E72")
+ (yas-item "82F8EEE0-2452-411E-8102-7BFDDBCA2E72")
;; assert_respond_to(..)
- (yas/item "09A11FDA-49FC-4466-8787-8D1D5D111A89")
+ (yas-item "09A11FDA-49FC-4466-8787-8D1D5D111A89")
;; assert_same(..)
- (yas/item "29340695-E426-4F77-8CF7-C59360A549F4")
+ (yas-item "29340695-E426-4F77-8CF7-C59360A549F4")
;; assert_not_same(..)
- (yas/item "F91C25EC-EC76-498B-BFB5-FDA8F57C5875")
+ (yas-item "F91C25EC-EC76-498B-BFB5-FDA8F57C5875")
;; assert_send(..)
- (yas/item "7850AD5C-A90D-4E2C-A931-EADFF8D3D9A3")
+ (yas-item "7850AD5C-A90D-4E2C-A931-EADFF8D3D9A3")
;; assert_throws(..) { .. }
- (yas/item "05655BD8-23C6-445F-BFD1-420BF25C3030")
+ (yas-item "05655BD8-23C6-445F-BFD1-420BF25C3030")
;; assert_nothing_thrown { .. }
- (yas/item "33639D7A-BD8C-4396-9C44-307B8AC87C9E")
+ (yas-item "33639D7A-BD8C-4396-9C44-307B8AC87C9E")
;; flunk(..)
- (yas/item "DB457094-1AC9-4856-AEFC-43A9576B6775")
- (yas/separator)
+ (yas-item "DB457094-1AC9-4856-AEFC-43A9576B6775")
+ (yas-separator)
;; Ignoring Benchmark.bmbm do .. end
- (yas/ignore-item "C649F945-DAB8-4DA2-B73C-2EFF9D7D34F3")
+ (yas-ignore-item "C649F945-DAB8-4DA2-B73C-2EFF9D7D34F3")
;; Benchmark.bmbm do .. end
- (yas/item "942F20E2-C40A-44B8-A3F2-99AAC68CB534")
+ (yas-item "942F20E2-C40A-44B8-A3F2-99AAC68CB534")
;; results.report(..) { .. }
- (yas/item "1C60D589-DD46-4109-90CA-6B34AEA2F298")))
- (yas/submenu "Serialization"
+ (yas-item "1C60D589-DD46-4109-90CA-6B34AEA2F298")))
+ (yas-submenu "Serialization"
(;; Marshal.dump(.., file)
- (yas/item "0CB48BCA-3F6E-4AE0-85BC-08A1D2508216")
+ (yas-item "0CB48BCA-3F6E-4AE0-85BC-08A1D2508216")
;; Marshal.load(obj)
- (yas/item "20AAD0BC-075D-4EC0-9057-E3E5E62C4125")
- (yas/separator)
+ (yas-item "20AAD0BC-075D-4EC0-9057-E3E5E62C4125")
+ (yas-separator)
;; Ignoring PStore.new( .. )
- (yas/ignore-item "5AE7CFB4-418E-4E00-AD76-06DB755EE876")
+ (yas-ignore-item "5AE7CFB4-418E-4E00-AD76-06DB755EE876")
;; PStore.new( .. )
- (yas/item "5B46ECFD-23A4-4F0C-9951-F64C19C72C2B")
+ (yas-item "5B46ECFD-23A4-4F0C-9951-F64C19C72C2B")
;; transaction( .. ) { .. }
- (yas/item "46BF99AD-E172-4D49-BCF7-072F4730E1D9")
- (yas/separator)
+ (yas-item "46BF99AD-E172-4D49-BCF7-072F4730E1D9")
+ (yas-separator)
;; Ignoring YAML.dump(.., file)
- (yas/ignore-item "9460392B-C036-4A76-A5AE-1191F10E4B1B")
+ (yas-ignore-item "9460392B-C036-4A76-A5AE-1191F10E4B1B")
;; YAML.dump(.., file)
- (yas/item "3BA6762A-BB6B-489E-8006-F30F386AEF48")
+ (yas-item "3BA6762A-BB6B-489E-8006-F30F386AEF48")
;; Ignoring YAML.load(file)
- (yas/ignore-item "2C07D4E7-D74F-4AE4-82BE-B0BA82247AFA")
+ (yas-ignore-item "2C07D4E7-D74F-4AE4-82BE-B0BA82247AFA")
;; YAML.load(file)
- (yas/item "8343ACF4-EEB7-44B5-B835-94826466D4D5")
- (yas/separator)
+ (yas-item "8343ACF4-EEB7-44B5-B835-94826466D4D5")
+ (yas-separator)
;; Ignoring xmlread(..)
- (yas/ignore-item "F6BF907E-FDF7-4D9B-9E57-BE159561349D")
+ (yas-ignore-item "F6BF907E-FDF7-4D9B-9E57-BE159561349D")
;; xmlread(..)
- (yas/item "B904D4AA-D15D-48A4-8EB2-563BAF489332")
+ (yas-item "B904D4AA-D15D-48A4-8EB2-563BAF489332")
;; xpath(..) { .. }
- (yas/item "CC300D44-6C3F-4F6C-A8AB-86F5A2DC57CF")))
- (yas/submenu "Idioms"
+ (yas-item "CC300D44-6C3F-4F6C-A8AB-86F5A2DC57CF")))
+ (yas-submenu "Idioms"
(;; class_from_name()
- (yas/item "2DBEE50B-3097-4A57-AB48-3586CF392D8B")
+ (yas-item "2DBEE50B-3097-4A57-AB48-3586CF392D8B")
;; deep_copy(..)
- (yas/item "0BA2B2F1-E767-4A03-9791-0AC0183251F1")
+ (yas-item "0BA2B2F1-E767-4A03-9791-0AC0183251F1")
;; path_from_here( .. )
- (yas/item "A4E89D97-D5ED-48BB-B5FF-1BFB79211FCD")
+ (yas-item "A4E89D97-D5ED-48BB-B5FF-1BFB79211FCD")
;; singleton_class()
- (yas/item "B46D35B8-5DEB-4C10-A110-BA1965A2EB9C")
+ (yas-item "B46D35B8-5DEB-4C10-A110-BA1965A2EB9C")
;; Ignoring word_wrap()
- (yas/ignore-item "97054C4D-E4A3-45B1-9C00-B82DBCB30CAD")))
- (yas/submenu "File"
+ (yas-ignore-item "97054C4D-E4A3-45B1-9C00-B82DBCB30CAD")))
+ (yas-submenu "File"
(;; require File.dirname(__FILE__) + "/.."
- (yas/item "7C42D878-FD0F-4181-A71A-57A091C0154A")
- (yas/separator)
+ (yas-item "7C42D878-FD0F-4181-A71A-57A091C0154A")
+ (yas-separator)
;; File.dirname(__FILE__)
- (yas/item "16920DC1-6FA6-48C8-90C5-C19E2C734303")
- (yas/separator)
+ (yas-item "16920DC1-6FA6-48C8-90C5-C19E2C734303")
+ (yas-separator)
;; File.read(filename)
- (yas/item "FAFE9F5C-BF9C-4416-8623-2CB8EBC31B3C")
+ (yas-item "FAFE9F5C-BF9C-4416-8623-2CB8EBC31B3C")
;; File.open(filename, 'r') { |f| f.read }
- (yas/item "005EB926-4BFE-4BFA-93B2-C9030636289C")))
+ (yas-item "005EB926-4BFE-4BFA-93B2-C9030636289C")))
;; class .. < Test::Unit::TestCase with test_helper
- (yas/item "228CAB3A-E221-4727-B430-31E94F76C9D3"))
+ (yas-item "228CAB3A-E221-4727-B430-31E94F76C9D3"))
'("E5158F94-CC52-4424-A495-14EF9272653F"
"EEE6D060-C5A0-400D-A2E0-0835013C5365"
"76FCF165-54CB-4213-BC55-BD60B9C6A3EC"
@@ -812,10 +812,9 @@
"A83F68A9-F751-4BB4-AE16-56812878C16A"
"47D203ED-EB9B-4653-A07B-A897800CEB76"
"47D203ED-EB9B-4653-A07B-A897800CEB76"
+ "931DD73E-615E-476E-9B0D-8341023AE730"
"2DDB6FE0-6111-4C40-A149-8E67E76F8272"
"DAA69A0C-FC1E-4509-9931-DFFB38B4D6AE"
- "931DD73E-615E-476E-9B0D-8341023AE730"
- "B3875596-723C-41EE-9E6F-F84930C3B568"
"BF4CA9F1-51CD-48D4-8357-852234F59046"
"8646378E-91F5-4771-AC7C-43FC49A93576"
"E07FF68B-C87D-4332-8477-D026929FDADA"
@@ -824,6 +823,7 @@
"835FAAC6-5431-436C-998B-241F7226B99B"
"B297E4B8-A8FF-49CE-B9C4-6D4911724D43"
"E0E058FC-0DC3-4872-A1C2-0B1A322A0CF5"
+ "B3875596-723C-41EE-9E6F-F84930C3B568"
"76FCF165-54CB-4213-BC55-BD60B9C6A3EC"
"EE5F19BA-6C02-11D9-92BA-0011242E4184"
"EE5F1FB2-6C02-11D9-92BA-0011242E4184"
@@ -834,14 +834,14 @@
"1AD6A138-2E89-4D6A-AB3F-416BF9CE968D"
"6519CB08-8326-4B77-A251-54722FFBFC1F"
"97054C4D-E4A3-45B1-9C00-B82DBCB30CAD"
+ "E5158F94-CC52-4424-A495-14EF9272653F"
+ "9460392B-C036-4A76-A5AE-1191F10E4B1B"
+ "2C07D4E7-D74F-4AE4-82BE-B0BA82247AFA"
"121B334B-2AA6-4E9A-A8B8-BF93B627982B"
"EC73D5CC-5F05-46B9-A6F4-82037E4A38C9"
"825B721D-4367-4DF7-98C0-F005695DF9E3"
"58FDEA60-10AF-4C49-AA09-29B77030DB25"
"BFB65D1C-62F1-485D-8A67-3E5A2E55107C"
- "E5158F94-CC52-4424-A495-14EF9272653F"
- "9460392B-C036-4A76-A5AE-1191F10E4B1B"
- "2C07D4E7-D74F-4AE4-82BE-B0BA82247AFA"
"C649F945-DAB8-4DA2-B73C-2EFF9D7D34F3"
"A83F68A9-F751-4BB4-AE16-56812878C16A"
"5AE7CFB4-418E-4E00-AD76-06DB755EE876"
@@ -851,181 +851,181 @@
;;
;; Substitutions for: content
;;
-;; # as in Snippets/flunk(..) (fl).yasnippet
-;; `yas/ruby-snippet-open-paren` =yyas> (yas/unknown)
-;;
-;; # as in Snippets/flunk(..) (fl).yasnippet
-;; `yas/ruby-snippet-close-paren` =yyas> (yas/unknown)
-;;
-;; # as in Snippets/class __ TestUnitTestCase with test_helper.tmSnippet.yasnippet
-;; (yas/multi-line-unknown 228CAB3A-E221-4727-B430-31E94F76C9D3) =yyas> (yas/unknown)
-;;
-;; # as in Snippets/Wrap in Begin Rescue End.yasnippet
-;; `yas/selected-text` =yyas> (yas/unknown)
+;; # as in Snippets/open yield block ({).yasnippet
+;; `yas-selected-text` =yyas> (yas-unknown)
;;
;; # as in Snippets/RDoc documentation block.yasnippet
-;; `(concat (if (eq 0 current-line) "\n" "") "\n")` =yyas> (yas/unknown)
+;; `(concat (if (eq 0 current-line) "\n" "") "\n")` =yyas> (yas-unknown)
;;
-;; # as in Commands/Completion Ruby (rcodetools).tmCommand.yasnippet
-;; 47D203ED-EB9B-4653-A07B-A897800CEB76 =yyas> (yas/unknown)
+;; # as in Snippets/flunk(..) (fl).yasnippet
+;; `yas-ruby-snippet-open-paren` =yyas> (yas-unknown)
;;
-;; # as in Commands/Enclose in + (RDoc comments).yasnippet
-;; 2DDB6FE0-6111-4C40-A149-8E67E76F8272 =yyas> (yas/unknown)
+;; # as in Snippets/flunk(..) (fl).yasnippet
+;; `yas-ruby-snippet-close-paren` =yyas> (yas-unknown)
;;
-;; # as in Commands/Enclose in _ (RDoc comments).yasnippet
-;; DAA69A0C-FC1E-4509-9931-DFFB38B4D6AE =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 Commands/Completion Ruby (rcodetools).yasnippet
+;; 47D203ED-EB9B-4653-A07B-A897800CEB76 =yyas> (yas-unknown)
;;
;; # as in Commands/Enclose in (RDoc comments).yasnippet
-;; 931DD73E-615E-476E-9B0D-8341023AE730 =yyas> (yas/unknown)
+;; 931DD73E-615E-476E-9B0D-8341023AE730 =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/Enclose in + (RDoc comments).yasnippet
+;; 2DDB6FE0-6111-4C40-A149-8E67E76F8272 =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)
+;; BF4CA9F1-51CD-48D4-8357-852234F59046 =yyas> (yas-unknown)
;;
;; # as in Commands/Open Require.yasnippet
-;; 8646378E-91F5-4771-AC7C-43FC49A93576 =yyas> (yas/unknown)
+;; 8646378E-91F5-4771-AC7C-43FC49A93576 =yyas> (yas-unknown)
;;
-;; # as in Commands/RakeSake task using file path.tmCommand.yasnippet
-;; E07FF68B-C87D-4332-8477-D026929FDADA =yyas> (yas/unknown)
+;; # as in Commands/RakeSake task using file path.yasnippet
+;; E07FF68B-C87D-4332-8477-D026929FDADA =yyas> (yas-unknown)
;;
;; # as in Commands/Run Rake Task.yasnippet
-;; 569C9822-8C41-4907-94C7-1A8A0031B66D =yyas> (yas/unknown)
+;; 569C9822-8C41-4907-94C7-1A8A0031B66D =yyas> (yas-unknown)
;;
;; # as in Commands/Run.yasnippet
-;; 35222962-C50D-4D58-A6AE-71E7AD980BE4 =yyas> (yas/unknown)
+;; 35222962-C50D-4D58-A6AE-71E7AD980BE4 =yyas> (yas-unknown)
;;
;; # as in Commands/Toggle ERb Tags.yasnippet
-;; 835FAAC6-5431-436C-998B-241F7226B99B =yyas> (yas/unknown)
+;; 835FAAC6-5431-436C-998B-241F7226B99B =yyas> (yas-unknown)
;;
-;; # as in Commands/Toggle StringSymbol.tmCommand.yasnippet
-;; B297E4B8-A8FF-49CE-B9C4-6D4911724D43 =yyas> (yas/unknown)
+;; # as in Commands/Toggle StringSymbol.yasnippet
+;; B297E4B8-A8FF-49CE-B9C4-6D4911724D43 =yyas> (yas-unknown)
;;
;; # as in Commands/Validate and Save.yasnippet
-;; E0E058FC-0DC3-4872-A1C2-0B1A322A0CF5 =yyas> (yas/unknown)
+;; E0E058FC-0DC3-4872-A1C2-0B1A322A0CF5 =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/Check ERB Syntax.yasnippet
-;; 76FCF165-54CB-4213-BC55-BD60B9C6A3EC =yyas> (yas/unknown)
+;; 76FCF165-54CB-4213-BC55-BD60B9C6A3EC =yyas> (yas-unknown)
;;
;; # as in Commands/Check Ruby Syntax.yasnippet
-;; EE5F19BA-6C02-11D9-92BA-0011242E4184 =yyas> (yas/unknown)
+;; EE5F19BA-6C02-11D9-92BA-0011242E4184 =yyas> (yas-unknown)
;;
;; # as in Commands/Execute Line with Ruby.yasnippet
-;; EE5F1FB2-6C02-11D9-92BA-0011242E4184 =yyas> (yas/unknown)
+;; EE5F1FB2-6C02-11D9-92BA-0011242E4184 =yyas> (yas-unknown)
;;
;; # as in Commands/Insert Missing Requires.yasnippet
-;; 9FB64639-F776-499B-BA6F-BB45F86F80FD =yyas> (yas/unknown)
+;; 9FB64639-F776-499B-BA6F-BB45F86F80FD =yyas> (yas-unknown)
;;
;; # as in Commands/Make Destructive Call.yasnippet
-;; 7F79BC8D-8A4F-4570-973B-05DFEC25747F =yyas> (yas/unknown)
+;; 7F79BC8D-8A4F-4570-973B-05DFEC25747F =yyas> (yas-unknown)
;;
;; # as in Commands/New Method.yasnippet
-;; 0275EF39-9357-408F-AF20-79E415CA9504 =yyas> (yas/unknown)
+;; 0275EF39-9357-408F-AF20-79E415CA9504 =yyas> (yas-unknown)
;;
;; # as in Commands/Run focused unit test.yasnippet
-;; 5289EE40-86B8-11D9-A8D4-000A95E13C98 =yyas> (yas/unknown)
+;; 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)
+;; 1AD6A138-2E89-4D6A-AB3F-416BF9CE968D =yyas> (yas-unknown)
;;
;; # as in Commands/Toggle Quote Style.yasnippet
-;; 6519CB08-8326-4B77-A251-54722FFBFC1F =yyas> (yas/unknown)
+;; 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 Macros/class .. DelegateClass .. initialize .. end (class).yasnippet
-;; 121B334B-2AA6-4E9A-A8B8-BF93B627982B =yyas> (yas/unknown)
-;;
-;; # as in Macros/each_cons(..) { group .. } (eac).yasnippet
-;; EC73D5CC-5F05-46B9-A6F4-82037E4A38C9 =yyas> (yas/unknown)
-;;
-;; # as in Macros/each_slice(..) { group .. } (eas).yasnippet
-;; 825B721D-4367-4DF7-98C0-F005695DF9E3 =yyas> (yas/unknown)
-;;
-;; # as in Macros/extend Forwardable (Forw).yasnippet
-;; 58FDEA60-10AF-4C49-AA09-29B77030DB25 =yyas> (yas/unknown)
-;;
-;; # as in Macros/map_with_index { e, i .. } (mapwi).yasnippet
-;; BFB65D1C-62F1-485D-8A67-3E5A2E55107C =yyas> (yas/unknown)
+;; 97054C4D-E4A3-45B1-9C00-B82DBCB30CAD =yyas> (yas-unknown)
;;
;; # as in Macros/Overwrite } in #{ .. }.yasnippet
-;; E5158F94-CC52-4424-A495-14EF9272653F =yyas> (yas/unknown)
+;; E5158F94-CC52-4424-A495-14EF9272653F =yyas> (yas-unknown)
;;
;; # as in Macros/YAML.dump(.., file) (Yd).yasnippet
-;; 9460392B-C036-4A76-A5AE-1191F10E4B1B =yyas> (yas/unknown)
+;; 9460392B-C036-4A76-A5AE-1191F10E4B1B =yyas> (yas-unknown)
;;
;; # as in Macros/YAML.load(file) (Yl).yasnippet
-;; 2C07D4E7-D74F-4AE4-82BE-B0BA82247AFA =yyas> (yas/unknown)
+;; 2C07D4E7-D74F-4AE4-82BE-B0BA82247AFA =yyas> (yas-unknown)
;;
-;; # as in Snippets/module .. end.yasnippet
-;; `(yas/ruby-infer-class-name)` =yyas> (yas/unknown)
+;; # as in Macros/class .. DelegateClass .. initialize .. end (class).yasnippet
+;; 121B334B-2AA6-4E9A-A8B8-BF93B627982B =yyas> (yas-unknown)
+;;
+;; # as in Macros/each_cons(..) { group .. } (eac).yasnippet
+;; EC73D5CC-5F05-46B9-A6F4-82037E4A38C9 =yyas> (yas-unknown)
+;;
+;; # as in Macros/each_slice(..) { group .. } (eas).yasnippet
+;; 825B721D-4367-4DF7-98C0-F005695DF9E3 =yyas> (yas-unknown)
+;;
+;; # as in Macros/extend Forwardable (Forw).yasnippet
+;; 58FDEA60-10AF-4C49-AA09-29B77030DB25 =yyas> (yas-unknown)
+;;
+;; # as in Macros/map_with_index { e, i .. } (mapwi).yasnippet
+;; BFB65D1C-62F1-485D-8A67-3E5A2E55107C =yyas> (yas-unknown)
;;
;; # as in Snippets/class .. TestUnitTestCase .. end (tc).yasnippet
-;; (yas/multi-line-unknown 31D1F145-33AB-4441-BA11-4D1C46928C4C) =yyas> (yas/unknown)
+;; (yas-multi-line-unknown 31D1F145-33AB-4441-BA11-4D1C46928C4C) =yyas> (yas-unknown)
+;;
+;; # as in Snippets/module .. end.yasnippet
+;; `(yas-ruby-infer-class-name)` =yyas> (yas-unknown)
;;
;; # as in Macros/Benchmark_bmbm(__) do __ end.yasnippet
-;; C649F945-DAB8-4DA2-B73C-2EFF9D7D34F3 =yyas> (yas/unknown)
+;; C649F945-DAB8-4DA2-B73C-2EFF9D7D34F3 =yyas> (yas-unknown)
;;
-;; # as in Macros/Delete forwardbackward.tmMacro.yasnippet
-;; A83F68A9-F751-4BB4-AE16-56812878C16A =yyas> (yas/unknown)
+;; # as in Macros/Delete forwardbackward.yasnippet
+;; A83F68A9-F751-4BB4-AE16-56812878C16A =yyas> (yas-unknown)
;;
;; # as in Macros/PStore_new( __ ).yasnippet
-;; 5AE7CFB4-418E-4E00-AD76-06DB755EE876 =yyas> (yas/unknown)
+;; 5AE7CFB4-418E-4E00-AD76-06DB755EE876 =yyas> (yas-unknown)
;;
;; # as in Macros/xmlread(__).yasnippet
-;; F6BF907E-FDF7-4D9B-9E57-BE159561349D =yyas> (yas/unknown)
+;; F6BF907E-FDF7-4D9B-9E57-BE159561349D =yyas> (yas-unknown)
;;
;;
;; Substitutions for: condition
;;
;; # as in Macros/xmlread(__).yasnippet
-;; =yyas> (yas/unknown)
+;; =yyas> (yas-unknown)
;;
;; # as in Snippets/Insert ERb's __ or = __.yasnippet
-;; text.html, source.yaml =yyas> (yas/unknown)
+;; text.html, source.yaml =yyas> (yas-unknown)
;;
;;
;; Substitutions for: binding
;;
-;; # as in Commands/Completion Ruby (rcodetools).tmCommand.yasnippet
-;; ~ =yyas> (yas/unknown)
+;; # as in Commands/Completion Ruby (rcodetools).yasnippet
+;; ~ =yyas> (yas-unknown)
;;
;; # as in Commands/Enclose in + (RDoc comments).yasnippet
-;; @k =yyas> (yas/unknown)
+;; @k =yyas> (yas-unknown)
;;
;; # as in Commands/Omit from RDoc.yasnippet
-;; ^@O =yyas> (yas/unknown)
+;; ^@O =yyas> (yas-unknown)
;;
;; # as in Commands/Open Require.yasnippet
-;; @D =yyas> (yas/unknown)
+;; @D =yyas> (yas-unknown)
;;
;; # as in Commands/Validate and Save.yasnippet
-;; @s =yyas> (yas/unknown)
+;; @s =yyas> (yas-unknown)
;;
;; # as in Commands/Check Ruby Syntax.yasnippet
-;; ^V =yyas> (yas/unknown)
+;; ^V =yyas> (yas-unknown)
;;
;; # as in Commands/Execute Line with Ruby.yasnippet
-;; ^E =yyas> (yas/unknown)
+;; ^E =yyas> (yas-unknown)
;;
;; # as in Commands/Make Destructive Call.yasnippet
-;; ^! =yyas> (yas/unknown)
+;; ^! =yyas> (yas-unknown)
;;
;; # as in Commands/Toggle Quote Style.yasnippet
-;; ^" =yyas> (yas/unknown)
+;; ^" =yyas> (yas-unknown)
;;
;; # as in Macros/Overwrite } in #{ .. }.yasnippet
-;; } =yyas> (yas/unknown)
+;; } =yyas> (yas-unknown)
;;
;; # as in Snippets/hash pointer.yasnippet
-;; ^l =yyas> (yas/unknown)
+;; ^l =yyas> (yas-unknown)
;;
-;; # as in Macros/Delete forwardbackward.tmMacro.yasnippet
-;; =yyas> (yas/unknown)
+;; # as in Macros/Delete forwardbackward.yasnippet
+;; =yyas> (yas-unknown)
;;
;;
diff --git a/extras/textmate_import.rb b/extras/textmate_import.rb
index c817907..f1ef769 100755
--- a/extras/textmate_import.rb
+++ b/extras/textmate_import.rb
@@ -1,9 +1,9 @@
#!/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
@@ -39,13 +39,13 @@ Trollop::die :plist_file, "must exist" if opts.plist_file && File.directory?(opt
# Represents and is capable of outputting the representation of a
-# TextMate menu in terms of `yas/define-menu'
+# 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"]
@@ -56,7 +56,7 @@ class TmSubmenu
deleteditems,
indent = 0,
thingy = ["(", ")"])
-
+
first = true;
string = ""
@@ -74,22 +74,22 @@ class TmSubmenu
snippet = TmSnippet::snippets_by_uid[uuid]
unimplemented = TmSnippet::unknown_substitutions["content"][uuid]
if submenu
- str = "(yas/submenu "
- string += str + "\"" + submenu.name + "\""
+ 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 + "\")"
+ string += "(yas-item \"" + uuid + "\")"
separator_useless = false;
- elsif snippet and unimplemented
+ elsif snippet and unimplemented
string += ";; Ignoring " + snippet.name + "\n"
string += " " * (indent + thingy[0].length)
- string += "(yas/ignore-item \"" + uuid + "\")"
+ string += "(yas-ignore-item \"" + uuid + "\")"
separator_useless = true;
elsif (uuid =~ /---------------------/)
- string += "(yas/separator)" unless separator_useless
+ string += "(yas-separator)" unless separator_useless
end
first = false;
end
@@ -102,10 +102,10 @@ class TmSubmenu
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
@@ -113,10 +113,10 @@ class TmSubmenu
excluded = (mainmenu["excludedItems"] || []) + TmSubmenu::excluded_items
closing = "\n '("
closing+= excluded.collect do |uuid|
- "\"" + uuid + "\""
+ "\"" + uuid + "\""
end.join( "\n ") + "))"
- str = "(yas/define-menu "
+ str = "(yas-define-menu "
return str + "'#{modename}" + root.to_lisp(all,
deleted,
str.length,
@@ -128,13 +128,13 @@ 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 = {
@@ -144,19 +144,19 @@ class TmSnippet
"${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`}",
+ "${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 + ")"}},
+ "${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" => {},
@@ -164,7 +164,7 @@ class TmSnippet
"binding" => {},
"type" => {}
}
-
+
def self.unknown_substitutions; @@unknown_substitutions; end
@@unknown_substitutions = {
"content" => {},
@@ -234,12 +234,12 @@ class TmSnippet
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 [^\)]*\)'
+ %r'\(yas-multi-line-unknown [^\)]*\)'
].each do |reg|
ct.scan(reg) do |match|
@@unknown_substitutions["content"][match] = self
@@ -249,7 +249,7 @@ class TmSnippet
else
@@unknown_substitutions["content"][uuid] = self
TmSubmenu::excluded_items.push(uuid)
- return "(yas/unimplemented)"
+ return "(yas-unimplemented)"
end
end
end
@@ -264,7 +264,7 @@ class TmSnippet
doc << (self.binding || "")
doc << (self.condition || "")
doc << "# --\n"
- doc << (self.content || "(yas/unimplemented)")
+ doc << (self.content || "(yas-unimplemented)")
doc
end
@@ -288,7 +288,7 @@ class TmSnippet
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")
+ return Plist::parse_xml("/tmp/textmate_import.tmpxml")
else
raise RuntimeError.new "plutil failed miserably, check if you have it..."
end
@@ -302,7 +302,7 @@ class TmSnippet
#
# Merge "known" hardcoded substitution with "extra" substitutions
# provided in the .yas-setup.el file.
- #
+ #
merged = @@known_substitutions[yas_directive].
merge(@@extra_substitutions[yas_directive])
#
@@ -348,7 +348,7 @@ if __FILE__ == $PROGRAM_NAME
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 opts.output_dir || "major-mode-name"
# Read in .yas-setup.el looking for the separator between auto-generated
@@ -383,7 +383,7 @@ if __FILE__ == $PROGRAM_NAME
lookfor.gsub!(/^[ ]*/, "")
lookfor.gsub!(/[ ]*$/, "")
# puts "found this wonderful substitution for #{directive} which is #{lookfor} => #{replacewith}"
- unless !directive or replacewith =~ /yas\/unknown/ then
+ unless !directive or replacewith =~ /yas-unknown/ then
TmSnippet.extra_substitutions[directive][lookfor] = replacewith
end
end
@@ -396,9 +396,9 @@ if __FILE__ == $PROGRAM_NAME
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 opts.quiet
-
+
# Iterate the globbed files
#
@@ -431,7 +431,7 @@ if __FILE__ == $PROGRAM_NAME
if opts.output_dir
FileUtils.mkdir_p opts.output_dir
FileUtils.touch File.join(original_dir, opts.output_dir, ".yas-make-groups") unless menustr
-
+
# Now, output head + a new tail in (possibly new) .yas-setup.el
# file
#
@@ -456,7 +456,7 @@ if __FILE__ == $PROGRAM_NAME
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 ";; " + k + "" + (" " * [1, 90-k.length].max) + " =yyas> (yas-unknown)"
file.puts ";; "
end
file.puts ";; "
diff --git a/snippets/c++-mode/class b/snippets/c++-mode/class
index e313176..f33f8b4 100644
--- a/snippets/c++-mode/class
+++ b/snippets/c++-mode/class
@@ -4,6 +4,6 @@
class ${1:Name}
{
public:
- ${1:$(yas/substr text "[^: ]*")}($2);
- virtual ~${1:$(yas/substr text "[^: ]*")}();
+ ${1:$(yas-substr text "[^: ]*")}($2);
+ virtual ~${1:$(yas-substr text "[^: ]*")}();
};
\ No newline at end of file
diff --git a/yasnippet-debug.el b/yasnippet-debug.el
index f98eb93..7e3be0e 100644
--- a/yasnippet-debug.el
+++ b/yasnippet-debug.el
@@ -1,8 +1,8 @@
;;; yasnippet-debug.el --- debug functions for yasnippet
-;; Copyright (C) 2010 João Távora
+;; Copyright (C) 2010 João Távora
-;; Author: João Távora(defun yas/debug-snippet-vars ()
+;; Author: João Távora
;; Keywords: emulations, convenience
;; This program is free software; you can redistribute it and/or modify
@@ -26,7 +26,7 @@
(require 'yasnippet)
-(defun yas/debug-snippet-vars ()
+(defun yas-debug-snippet-vars ()
"Debug snippets, fields, mirrors and the `buffer-undo-list'."
(interactive)
(with-output-to-temp-buffer "*YASnippet trace*"
@@ -35,39 +35,39 @@
(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 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))))
+ (princ (format "%s live snippets at point:\n\n" (length (yas--snippets-at-point))))
- (dolist (snippet (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))))
+ (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)
+ (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))
+ (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))
+ (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)))))))
+ (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)
@@ -80,49 +80,48 @@
(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)
+(defun yas--debug-format-fom-concise (fom)
(when fom
- (cond ((yas/field-p 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)
+ (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))))
+ (marker-position (yas--mirror-start fom))
+ (marker-position (yas--mirror-end fom))))
(t
(format "snippet exit at %d"
- (marker-position (yas/fom-start fom)))))))
+ (marker-position (yas--fom-start fom)))))))
-(defun yas/exterminate-package ()
+(defun yas-exterminate-package ()
(interactive)
- (yas/global-mode -1)
- (yas/minor-mode -1)
+ (yas-global-mode -1)
+ (yas-minor-mode -1)
(mapatoms #'(lambda (atom)
- (when (string-match "yas/" (symbol-name atom))
- (unintern atom)))))
+ (when (string-match "yas[-/]" (symbol-name atom))
+ (unintern atom obarray)))))
-(defun yas/debug-test (&optional quiet)
+(defun yas-debug-test (&optional quiet)
(interactive "P")
- (yas/load-directory (or (and (listp yas/snippet-dirs)
- (first yas/snippet-dirs))
- yas/snippet-dirs
+ (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))
+ (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)
+ (yas-minor-mode 1)
(let ((abbrev))
(setq abbrev "$f")
(insert abbrev))
(unless quiet
- (add-hook 'post-command-hook 'yas/debug-snippet-vars 't 'local)))
+ (add-hook 'post-command-hook 'yas-debug-snippet-vars 't 'local)))
(provide 'yasnippet-debug)
;;; yasnippet-debug.el ends here
-
diff --git a/yasnippet-tests.el b/yasnippet-tests.el
index d2224b2..eb1a245 100644
--- a/yasnippet-tests.el
+++ b/yasnippet-tests.el
@@ -1 +1,539 @@
-;;; yasnippet-tests.el --- some yasnippet tests
;; Copyright (C) 2012 João Távora
;; Author: João Távora
;; 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:
;; Test basic snippet mechanics and the loading system
;;; Code:
(require 'yasnippet)
(require 'ert)
(require 'ert-x)
;;; Snippet mechanics
(ert-deftest field-navigation ()
(with-temp-buffer
(yas/minor-mode 1)
(yas/expand-snippet "${1:brother} from another ${2:mother}")
(should (string= (buffer-substring-no-properties (point-min) (point-max))
"brother from another mother"))
(should (looking-at "brother"))
(ert-simulate-command '(yas/next-field-or-maybe-expand))
(should (looking-at "mother"))
(ert-simulate-command '(yas/prev-field))
(should (looking-at "brother"))))
(ert-deftest simple-mirror ()
(with-temp-buffer
(yas/minor-mode 1)
(yas/expand-snippet "${1:brother} from another $1")
(should (string= (buffer-substring-no-properties (point-min) (point-max))
"brother from another brother"))
(ert-simulate-command `(yas/mock-insert "bla"))
(should (string= (buffer-substring-no-properties (point-min) (point-max))
"bla from another bla"))))
(ert-deftest mirror-with-transformation ()
(with-temp-buffer
(yas/minor-mode 1)
(yas/expand-snippet "${1:brother} from another ${1:$(upcase yas/text)}")
(should (string= (buffer-substring-no-properties (point-min) (point-max))
"brother from another BROTHER"))
(ert-simulate-command `(yas/mock-insert "bla"))
(should (string= (buffer-substring-no-properties (point-min) (point-max))
"bla from another BLA"))))
(ert-deftest nested-placeholders-kill-superfield ()
(with-temp-buffer
(yas/minor-mode 1)
(yas/expand-snippet "brother from ${2:another ${3:mother}}!")
(should (string= (buffer-substring-no-properties (point-min) (point-max))
"brother from another mother!"))
(ert-simulate-command `(yas/mock-insert "bla"))
(should (string= (buffer-substring-no-properties (point-min) (point-max))
"brother from bla!"))))
(ert-deftest nested-placeholders-use-subfield ()
(with-temp-buffer
(yas/minor-mode 1)
(yas/expand-snippet "brother from ${2:another ${3:mother}}!")
(ert-simulate-command '(yas/next-field-or-maybe-expand))
(ert-simulate-command `(yas/mock-insert "bla"))
(should (string= (buffer-substring-no-properties (point-min) (point-max))
"brother from another bla!"))))
;; (ert-deftest in-snippet-undo ()
;; (with-temp-buffer
;; (yas/minor-mode 1)
;; (yas/expand-snippet "brother from ${2:another ${3:mother}}!")
;; (ert-simulate-command '(yas/next-field-or-maybe-expand))
;; (ert-simulate-command `(yas/mock-insert "bla"))
;; (ert-simulate-command '(undo))
;; (should (string= (buffer-substring-no-properties (point-min) (point-max))
;; "brother from another mother!"))))
;;; Misc tests
;;;
(ert-deftest protection-overlay-no-cheating ()
"Protection overlays at the very end of the buffer, are dealt by cheatingly inserting a newline!
TODO: correct this bug!"
:expected-result :failed
(with-temp-buffer
(yas/minor-mode 1)
(yas/expand-snippet "${2:brother} from another ${1:mother}")
(should (string= (buffer-substring-no-properties (point-min) (point-max))
"brother from another mother") ;; no newline should be here!
)))
;;; Loading
;;;
(defmacro with-some-interesting-snippet-dirs (&rest body)
`(yas/saving-variables
(with-snippet-dirs
'((".emacs.d/snippets"
("c-mode"
(".yas-parents" . "cc-mode")
("printf" . "printf($1);"))
("emacs-lisp-mode" ("ert-deftest" . "(ert-deftest ${1:name} () $0)"))
("lisp-interaction-mode" (".yas-parents" . "emacs-lisp-mode")))
("library/snippets"
("c-mode" (".yas-parents" . "c++-mode"))
("cc-mode" ("def" . "# define"))
("emacs-lisp-mode" ("dolist" . "(dolist)"))
("lisp-interaction-mode" ("sc" . "brother from another mother"))))
,@body)))
(ert-deftest basic-jit-loading ()
"Test basic loading and expansion of snippets"
(with-some-interesting-snippet-dirs
(yas/reload-all)
(yas/basic-jit-loading-1)))
(ert-deftest basic-jit-loading-with-compiled-snippets ()
"Test basic loading and expansion of snippets"
(with-some-interesting-snippet-dirs
(yas/reload-all)
(yas/recompile-all)
(flet ((yas/load-directory-2
(&rest dummies)
(ert-fail "yas/load-directory-2 shouldn't be called when snippets have been compiled")))
(yas/reload-all)
(yas/basic-jit-loading-1))))
(defun yas/basic-jit-loading-1 (&optional compile)
(with-temp-buffer
(should (= 4 (hash-table-count yas/scheduled-jit-loads)))
(should (= 0 (hash-table-count yas/tables)))
(lisp-interaction-mode)
(yas/minor-mode 1)
(should (= 2 (hash-table-count yas/scheduled-jit-loads)))
(should (= 2 (hash-table-count yas/tables)))
(should (= 1 (hash-table-count (yas/table-uuidhash (gethash 'lisp-interaction-mode yas/tables)))))
(should (= 2 (hash-table-count (yas/table-uuidhash (gethash 'emacs-lisp-mode yas/tables)))))
(yas/should-expand '(("sc" . "brother from another mother")
("dolist" . "(dolist)")
("ert-deftest" . "(ert-deftest name () )")))
(c-mode)
(yas/minor-mode 1)
(should (= 0 (hash-table-count yas/scheduled-jit-loads)))
(should (= 4 (hash-table-count yas/tables)))
(should (= 1 (hash-table-count (yas/table-uuidhash (gethash 'c-mode yas/tables)))))
(should (= 1 (hash-table-count (yas/table-uuidhash (gethash 'cc-mode yas/tables)))))
(yas/should-expand '(("printf" . "printf();")
("def" . "# define")))
(yas/should-not-expand '("sc" "dolist" "ert-deftest"))))
;;; Helpers
;;;
(defun yas/should-expand (keys-and-expansions)
(dolist (key-and-expansion keys-and-expansions)
(yas/exit-all-snippets)
(erase-buffer)
(insert (car key-and-expansion))
(let ((yas/fallback-behavior nil))
(ert-simulate-command '(yas/expand)))
(should (string= (buffer-substring-no-properties (point-min) (point-max))
(cdr key-and-expansion))))
(yas/exit-all-snippets))
(defun yas/should-not-expand (keys)
(dolist (key keys)
(yas/exit-all-snippets)
(erase-buffer)
(insert key)
(let ((yas/fallback-behavior nil))
(ert-simulate-command '(yas/expand)))
(should (string= (buffer-substring-no-properties (point-min) (point-max)) key))))
(defun yas/mock-insert (string)
(interactive)
(do ((i 0 (1+ i)))
((= i (length string)))
(insert (aref string i))))
(defun yas/make-file-or-dirs (ass)
(let ((file-or-dir-name (car ass))
(content (cdr ass)))
(cond ((listp content)
(make-directory file-or-dir-name 'parents)
(let ((default-directory (concat default-directory "/" file-or-dir-name)))
(mapc #'yas/make-file-or-dirs content)))
((stringp content)
(with-temp-buffer
(insert content)
(write-region nil nil file-or-dir-name nil 'nomessage)))
(t
(message "[yas] oops don't know this content")))))
(defun yas/variables ()
(let ((syms))
(mapatoms #'(lambda (sym)
(if (and (string-match "^yas/[^/]" (symbol-name sym))
(boundp sym))
(push sym syms))))
syms))
(defmacro yas/saving-variables (&rest body)
`(let ,(mapcar #'(lambda (sym)
`(,sym ,sym))
(yas/variables))
,@body))
(defun yas/call-with-snippet-dirs (dirs fn)
(let* ((default-directory (make-temp-file "yasnippet-fixture" t))
(yas/snippet-dirs (mapcar #'car dirs)))
(with-temp-message ""
(unwind-protect
(progn
(mapc #'yas/make-file-or-dirs dirs)
(funcall fn))
(when (>= emacs-major-version 23)
(delete-directory default-directory 'recursive))))))
(defmacro with-snippet-dirs (dirs &rest body)
`(yas/call-with-snippet-dirs ,dirs
#'(lambda ()
,@body)))
;;; Older emacsen
;;;
(unless (fboundp 'special-mode)
(define-minor-mode special-mode "Just a placeholder for something isn't in emacs 22"))
;;; btw to test this in emacs22 mac osx:
;;; curl -L -O https://github.com/mirrors/emacs/raw/master/lisp/emacs-lisp/ert.el
;;; curl -L -O https://github.com/mirrors/emacs/raw/master/lisp/emacs-lisp/ert-x.el
;;; /usr/bin/emacs -nw -Q -L . -l yasnippet-tests.el --batch -e ert
(provide 'yasnippet-tests)
;;; yasnippet-tests.el ends here
\ No newline at end of file
+;;; yasnippet-tests.el --- some yasnippet tests
+
+;; Copyright (C) 2012 João Távora
+
+;; Author: João Távora
+;; 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:
+
+;; Test basic snippet mechanics and the loading system
+
+;;; Code:
+
+(require 'yasnippet)
+(require 'ert)
+(require 'ert-x)
+
+
+;;; Snippet mechanics
+
+(defun yas--buffer-contents ()
+ (buffer-substring-no-properties (point-min) (point-max)))
+
+(ert-deftest field-navigation ()
+ (with-temp-buffer
+ (yas-minor-mode 1)
+ (yas-expand-snippet "${1:brother} from another ${2:mother}")
+ (should (string= (yas--buffer-contents)
+ "brother from another mother"))
+
+ (should (looking-at "brother"))
+ (ert-simulate-command '(yas-next-field-or-maybe-expand))
+ (should (looking-at "mother"))
+ (ert-simulate-command '(yas-prev-field))
+ (should (looking-at "brother"))))
+
+(ert-deftest simple-mirror ()
+ (with-temp-buffer
+ (yas-minor-mode 1)
+ (yas-expand-snippet "${1:brother} from another $1")
+ (should (string= (yas--buffer-contents)
+ "brother from another brother"))
+ (ert-simulate-command `(yas-mock-insert "bla"))
+ (should (string= (yas--buffer-contents)
+ "bla from another bla"))))
+
+(ert-deftest mirror-with-transformation ()
+ (with-temp-buffer
+ (yas-minor-mode 1)
+ (yas-expand-snippet "${1:brother} from another ${1:$(upcase yas-text)}")
+ (should (string= (yas--buffer-contents)
+ "brother from another BROTHER"))
+ (ert-simulate-command `(yas-mock-insert "bla"))
+ (should (string= (yas--buffer-contents)
+ "bla from another BLA"))))
+
+(ert-deftest primary-field-transformation ()
+ (with-temp-buffer
+ (yas-minor-mode 1)
+ (let ((snippet "${1:$$(upcase yas/text)}${1:$(concat \"bar\" yas/text)}"))
+ (yas-expand-snippet snippet)
+ (should (string= (yas--buffer-contents) "bar"))
+ (ert-simulate-command `(yas-mock-insert "foo"))
+ (should (string= (yas--buffer-contents) "FOObarFOO")))))
+
+(ert-deftest nested-placeholders-kill-superfield ()
+ (with-temp-buffer
+ (yas-minor-mode 1)
+ (yas-expand-snippet "brother from ${2:another ${3:mother}}!")
+ (should (string= (yas--buffer-contents)
+ "brother from another mother!"))
+ (ert-simulate-command `(yas-mock-insert "bla"))
+ (should (string= (yas--buffer-contents)
+ "brother from bla!"))))
+
+(ert-deftest nested-placeholders-use-subfield ()
+ (with-temp-buffer
+ (yas-minor-mode 1)
+ (yas-expand-snippet "brother from ${2:another ${3:mother}}!")
+ (ert-simulate-command '(yas-next-field-or-maybe-expand))
+ (ert-simulate-command `(yas-mock-insert "bla"))
+ (should (string= (yas--buffer-contents)
+ "brother from another bla!"))))
+
+;; (ert-deftest in-snippet-undo ()
+;; (with-temp-buffer
+;; (yas-minor-mode 1)
+;; (yas-expand-snippet "brother from ${2:another ${3:mother}}!")
+;; (ert-simulate-command '(yas-next-field-or-maybe-expand))
+;; (ert-simulate-command `(yas-mock-insert "bla"))
+;; (ert-simulate-command '(undo))
+;; (should (string= (yas--buffer-contents)
+;; "brother from another mother!"))))
+
+
+;;; Snippet expansion and character escaping
+;;; Thanks to @zw963 (Billy) for the testing
+;;;
+(ert-deftest escape-dollar ()
+ (with-temp-buffer
+ (yas-minor-mode 1)
+ (yas-expand-snippet "bla\\${1:bla}ble")
+ (should (string= (yas--buffer-contents) "bla${1:bla}ble"))))
+
+(ert-deftest escape-closing-brace ()
+ (with-temp-buffer
+ (yas-minor-mode 1)
+ (yas-expand-snippet "bla${1:bla\\}}ble")
+ (should (string= (yas--buffer-contents) "blabla}ble"))
+ (should (string= (yas-field-value 1) "bla}"))))
+
+(ert-deftest escape-backslashes ()
+ (with-temp-buffer
+ (yas-minor-mode 1)
+ (yas-expand-snippet "bla\\ble")
+ (should (string= (yas--buffer-contents) "bla\\ble"))))
+
+(ert-deftest escape-backquotes ()
+ (with-temp-buffer
+ (yas-minor-mode 1)
+ (yas-expand-snippet "bla`(upcase \"foo\\`bar\")`ble")
+ (should (string= (yas--buffer-contents) "blaFOO`BARble"))))
+
+(ert-deftest escape-some-elisp-with-strings ()
+ "elisp with strings and unbalance parens inside it"
+ (with-temp-buffer
+ (yas-minor-mode 1)
+ ;; The rules here is: to output a literal `"' you need to escape
+ ;; it with one backslash. You don't need to escape them in
+ ;; embedded elisp.
+ (yas-expand-snippet "soon \\\"`(concat (upcase \"(my arms\")\"\\\" were all around her\")`")
+ (should (string= (yas--buffer-contents) "soon \"(MY ARMS\" were all around her"))))
+
+(ert-deftest escape-some-elisp-with-backslashes ()
+ (with-temp-buffer
+ (yas-minor-mode 1)
+ ;; And the rule here is: to output a literal `\' inside a string
+ ;; inside embedded elisp you need a total of six `\'
+ (yas-expand-snippet "bla`(upcase \"hey\\\\\\yo\")`ble")
+ (should (string= (yas--buffer-contents) "blaHEY\\YOble"))))
+
+(ert-deftest be-careful-when-escaping-in-yas-selected-text ()
+ (with-temp-buffer
+ (yas-minor-mode 1)
+ (let ((yas/selected-text "He\\\\o world!"))
+ (yas-expand-snippet "Look ma! `(yas/selected-text)`")
+ (should (string= (yas--buffer-contents) "Look ma! He\\\\o world!")))
+ (yas-exit-all-snippets)
+ (erase-buffer)
+ (let ((yas/selected-text "He\"o world!"))
+ (yas-expand-snippet "Look ma! `(yas/selected-text)`")
+ (should (string= (yas--buffer-contents) "Look ma! He\"o world!")))
+ (yas-exit-all-snippets)
+ (erase-buffer)
+ (let ((yas/selected-text "He\"\)\\o world!"))
+ (yas-expand-snippet "Look ma! `(yas/selected-text)`")
+ (should (string= (yas--buffer-contents) "Look ma! He\"\)\\o world!")))
+ (yas-exit-all-snippets)
+ (erase-buffer)))
+
+(ert-deftest be-careful-when-escaping-in-yas-selected-text-2 ()
+ (with-temp-buffer
+ (let ((yas/selected-text "He)}o world!"))
+ (yas-expand-snippet "Look ma! ${1:`(yas/selected-text)`} OK?")
+ (should (string= (yas--buffer-contents) "Look ma! He)}o world! OK?")))))
+
+(ert-deftest example-for-issue-271 ()
+ (with-temp-buffer
+ (yas-minor-mode 1)
+ (let ((yas-selected-text "aaa")
+ (snippet "if ${1:condition}\n`yas/selected-text`\nelse\n$3\nend"))
+ (yas-expand-snippet snippet)
+ (yas-next-field)
+ (ert-simulate-command `(yas-mock-insert "bbb"))
+ (should (string= (yas--buffer-contents) "if condition\naaa\nelse\nbbb\nend")))))
+
+(ert-deftest another-example-for-issue-271 ()
+ (with-temp-buffer
+ (yas-minor-mode 1)
+ (let ((snippet "\\${${1:1}:`yas/selected-text`}"))
+ (insert "aaabbbccc")
+ (set-mark 4)
+ (goto-char 7)
+ (yas-expand-snippet snippet)
+ (should (string= (yas--buffer-contents) "aaa${1:bbb}ccc")))))
+
+(ert-deftest string-match-with-subregexp-in-embedded-elisp ()
+ (with-temp-buffer
+ (yas-minor-mode 1)
+ ;; the rule here is: To use regexps in embedded `(elisp)` expressions, write
+ ;; it like you would normal elisp, i.e. no need to escape the backslashes.
+ (let ((snippet "`(if (string-match \"foo\\\\(ba+r\\\\)foo\" \"foobaaaaaaaaaarfoo\")
+ \"ok\"
+ \"fail\")`"))
+ (yas-expand-snippet snippet))
+ (should (string= (yas--buffer-contents) "ok"))))
+
+(ert-deftest string-match-with-subregexp-in-mirror-transformations ()
+ (with-temp-buffer
+ (yas-minor-mode 1)
+ ;; the rule here is: To use regexps in embedded `(elisp)` expressions,
+ ;; escape backslashes once, i.e. to use \\( \\) constructs, write \\\\( \\\\).
+ (let ((snippet "$1${1:$(if (string-match \"foo\\\\\\\\(ba+r\\\\\\\\)baz\" yas/text)
+ \"ok\"
+ \"fail\")}"))
+ (yas-expand-snippet snippet)
+ (should (string= (yas--buffer-contents) "fail"))
+ (ert-simulate-command `(yas-mock-insert "foobaaar"))
+ (should (string= (yas--buffer-contents) "foobaaarfail"))
+ (ert-simulate-command `(yas-mock-insert "baz"))
+ (should (string= (yas--buffer-contents) "foobaaarbazok")))))
+
+
+;;; Misc tests
+;;;
+(ert-deftest protection-overlay-no-cheating ()
+ "Protection overlays at the very end of the buffer are dealt
+ with by cheatingly inserting a newline!
+
+TODO: correct this bug!"
+ :expected-result :failed
+ (with-temp-buffer
+ (yas-minor-mode 1)
+ (yas-expand-snippet "${2:brother} from another ${1:mother}")
+ (should (string= (yas--buffer-contents)
+ "brother from another mother") ;; no newline should be here!
+ )))
+
+;;; Loading
+;;;
+(defmacro yas-with-some-interesting-snippet-dirs (&rest body)
+ `(yas-saving-variables
+ (yas-with-snippet-dirs
+ '((".emacs.d/snippets"
+ ("c-mode"
+ (".yas-parents" . "cc-mode")
+ ("printf" . "printf($1);"))
+ ("emacs-lisp-mode" ("ert-deftest" . "(ert-deftest ${1:name} () $0)"))
+ ("lisp-interaction-mode" (".yas-parents" . "emacs-lisp-mode")))
+ ("library/snippets"
+ ("c-mode" (".yas-parents" . "c++-mode"))
+ ("cc-mode" ("def" . "# define"))
+ ("emacs-lisp-mode" ("dolist" . "(dolist)"))
+ ("lisp-interaction-mode" ("sc" . "brother from another mother"))))
+ ,@body)))
+
+(ert-deftest basic-jit-loading ()
+ "Test basic loading and expansion of snippets"
+ (yas-with-some-interesting-snippet-dirs
+ (yas-reload-all)
+ (yas--basic-jit-loading-1)))
+
+(ert-deftest basic-jit-loading-with-compiled-snippets ()
+ "Test basic loading and expansion of snippets"
+ (yas-with-some-interesting-snippet-dirs
+ (yas-reload-all)
+ (yas-recompile-all)
+ (flet ((yas--load-directory-2
+ (&rest dummies)
+ (ert-fail "yas--load-directory-2 shouldn't be called when snippets have been compiled")))
+ (yas-reload-all)
+ (yas--basic-jit-loading-1))))
+
+(defun yas--basic-jit-loading-1 (&optional compile)
+ (with-temp-buffer
+ (should (= 4 (hash-table-count yas--scheduled-jit-loads)))
+ (should (= 0 (hash-table-count yas--tables)))
+ (lisp-interaction-mode)
+ (yas-minor-mode 1)
+ (should (= 2 (hash-table-count yas--scheduled-jit-loads)))
+ (should (= 2 (hash-table-count yas--tables)))
+ (should (= 1 (hash-table-count (yas--table-uuidhash (gethash 'lisp-interaction-mode yas--tables)))))
+ (should (= 2 (hash-table-count (yas--table-uuidhash (gethash 'emacs-lisp-mode yas--tables)))))
+ (yas-should-expand '(("sc" . "brother from another mother")
+ ("dolist" . "(dolist)")
+ ("ert-deftest" . "(ert-deftest name () )")))
+ (c-mode)
+ (yas-minor-mode 1)
+ (should (= 0 (hash-table-count yas--scheduled-jit-loads)))
+ (should (= 4 (hash-table-count yas--tables)))
+ (should (= 1 (hash-table-count (yas--table-uuidhash (gethash 'c-mode yas--tables)))))
+ (should (= 1 (hash-table-count (yas--table-uuidhash (gethash 'cc-mode yas--tables)))))
+ (yas-should-expand '(("printf" . "printf();")
+ ("def" . "# define")))
+ (yas-should-not-expand '("sc" "dolist" "ert-deftest"))))
+
+
+;;; Menu
+;;;
+(defmacro yas-with-even-more-interesting-snippet-dirs (&rest body)
+ `(yas-saving-variables
+ (yas-with-snippet-dirs
+ `((".emacs.d/snippets"
+ ("c-mode"
+ (".yas-make-groups" . "")
+ ("printf" . "printf($1);")
+ ("foo-group-a"
+ ("fnprintf" . "fprintf($1);")
+ ("snprintf" . "snprintf($1);"))
+ ("foo-group-b"
+ ("strcmp" . "strecmp($1);")
+ ("strcasecmp" . "strcasecmp($1);")))
+ ("lisp-interaction-mode"
+ ("ert-deftest" . "# group: barbar\n# --\n(ert-deftest ${1:name} () $0)"))
+ ("fancy-mode"
+ ("a-guy" . "# uuid: 999\n# --\nyo!")
+ ("a-sir" . "# uuid: 12345\n# --\nindeed!")
+ ("a-lady" . "# uuid: 54321\n# --\noh-la-la!")
+ ("a-beggar" . "# uuid: 0101\n# --\narrrgh!")
+ ("an-outcast" . "# uuid: 666\n# --\narrrgh!")
+ (".yas-setup.el" . , (pp-to-string
+ '(yas-define-menu 'fancy-mode
+ '((yas-ignore-item "0101")
+ (yas-item "999")
+ (yas-submenu "sirs"
+ ((yas-item "12345")))
+ (yas-submenu "ladies"
+ ((yas-item "54321"))))
+ '("666")))))))
+ ,@body)))
+
+(ert-deftest test-yas-define-menu ()
+ (let ((yas-use-menu t))
+ (yas-with-even-more-interesting-snippet-dirs
+ (yas-reload-all 'no-jit)
+ (let ((menu (cdr (gethash 'fancy-mode yas--menu-table))))
+ (should (eql 4 (length menu)))
+ (dolist (item '("a-guy" "a-beggar"))
+ (should (find item menu :key #'third :test #'string=)))
+ (should-not (find "an-outcast" menu :key #'third :test #'string=))
+ (dolist (submenu '("sirs" "ladies"))
+ (should (keymapp
+ (fourth
+ (find submenu menu :key #'third :test #'string=)))))
+ ))))
+
+(ert-deftest test-group-menus ()
+ "Test group-based menus using .yas-make-groups and the group directive"
+ (let ((yas-use-menu t))
+ (yas-with-even-more-interesting-snippet-dirs
+ (yas-reload-all 'no-jit)
+ ;; first the subdir-based groups
+ ;;
+ (let ((menu (cdr (gethash 'c-mode yas--menu-table))))
+ (should (eql 3 (length menu)))
+ (dolist (item '("printf" "foo-group-a" "foo-group-b"))
+ (should (find item menu :key #'third :test #'string=)))
+ (dolist (submenu '("foo-group-a" "foo-group-b"))
+ (should (keymapp
+ (fourth
+ (find submenu menu :key #'third :test #'string=))))))
+ ;; now group directives
+ ;;
+ (let ((menu (cdr (gethash 'lisp-interaction-mode yas--menu-table))))
+ (should (eql 1 (length menu)))
+ (should (find "barbar" menu :key #'third :test #'string=))
+ (should (keymapp
+ (fourth
+ (find "barbar" menu :key #'third :test #'string=))))))))
+
+(ert-deftest test-group-menus-twisted ()
+ "Same as similarly named test, but be mean.
+
+TODO: be meaner"
+ (let ((yas-use-menu t))
+ (yas-with-even-more-interesting-snippet-dirs
+ ;; add a group directive conflicting with the subdir and watch
+ ;; behaviour
+ (with-temp-buffer
+ (insert "# group: foo-group-c\n# --\nstrecmp($1)")
+ (write-region nil nil (concat (first (yas-snippet-dirs))
+ "/c-mode/foo-group-b/strcmp")))
+ (yas-reload-all 'no-jit)
+ (let ((menu (cdr (gethash 'c-mode yas--menu-table))))
+ (should (eql 4 (length menu)))
+ (dolist (item '("printf" "foo-group-a" "foo-group-b" "foo-group-c"))
+ (should (find item menu :key #'third :test #'string=)))
+ (dolist (submenu '("foo-group-a" "foo-group-b" "foo-group-c"))
+ (should (keymapp
+ (fourth
+ (find submenu menu :key #'third :test #'string=))))))
+ ;; delete the .yas-make-groups file and watch behaviour
+ ;;
+ (delete-file (concat (first (yas-snippet-dirs))
+ "/c-mode/.yas-make-groups"))
+ (yas-reload-all 'no-jit)
+ (let ((menu (cdr (gethash 'c-mode yas--menu-table))))
+ (should (eql 5 (length menu))))
+ ;; Change a group directive and reload
+ ;;
+ (let ((menu (cdr (gethash 'lisp-interaction-mode yas--menu-table))))
+ (should (find "barbar" menu :key #'third :test #'string=)))
+
+ (with-temp-buffer
+ (insert "# group: foofoo\n# --\n(ert-deftest ${1:name} () $0)")
+ (write-region nil nil (concat (first (yas-snippet-dirs))
+ "/lisp-interaction-mode/ert-deftest")))
+ (yas-reload-all 'no-jit)
+ (let ((menu (cdr (gethash 'lisp-interaction-mode yas--menu-table))))
+ (should (eql 1 (length menu)))
+ (should (find "foofoo" menu :key #'third :test #'string=))
+ (should (keymapp
+ (fourth
+ (find "foofoo" menu :key #'third :test #'string=))))))))
+
+
+;;; The infamous and problematic tab keybinding
+;;;
+(ert-deftest test-yas-tab-binding ()
+ (with-temp-buffer
+ (yas-minor-mode -1)
+ (should (not (eq (key-binding (yas--read-keybinding yas-trigger-key)) 'yas-expand)))
+ (yas-minor-mode 1)
+ (should (eq (key-binding (yas--read-keybinding yas-trigger-key)) 'yas-expand))
+ (yas-expand-snippet "$1 $2 $3")
+ (dolist (k (if (listp yas-next-field-key)
+ yas-next-field-key
+ (list yas-next-field-key)))
+ (should (eq (key-binding (yas--read-keybinding k)) 'yas-next-field-or-maybe-expand)))
+ (dolist (k (if (listp yas-prev-field-key)
+ yas-prev-field-key
+ (list yas-prev-field-key)))
+ (should (eq (key-binding (yas--read-keybinding k)) 'yas-prev-field)))))
+
+(ert-deftest test-yas-in-org ()
+ (with-temp-buffer
+ (org-mode)
+ (yas-minor-mode 1)
+ (should (eq (key-binding (yas--read-keybinding yas-trigger-key)) 'yas-expand))))
+
+;;; Helpers
+;;;
+
+(defun yas-should-expand (keys-and-expansions)
+ (dolist (key-and-expansion keys-and-expansions)
+ (yas-exit-all-snippets)
+ (erase-buffer)
+ (insert (car key-and-expansion))
+ (let ((yas-fallback-behavior nil))
+ (ert-simulate-command '(yas-expand)))
+ (should (string= (yas--buffer-contents) (cdr key-and-expansion))))
+ (yas-exit-all-snippets))
+
+(defun yas-should-not-expand (keys)
+ (dolist (key keys)
+ (yas-exit-all-snippets)
+ (erase-buffer)
+ (insert key)
+ (let ((yas-fallback-behavior nil))
+ (ert-simulate-command '(yas-expand)))
+ (should (string= (yas--buffer-contents) key))))
+
+(defun yas-mock-insert (string)
+ (interactive)
+ (do ((i 0 (1+ i)))
+ ((= i (length string)))
+ (insert (aref string i))))
+
+(defun yas-make-file-or-dirs (ass)
+ (let ((file-or-dir-name (car ass))
+ (content (cdr ass)))
+ (cond ((listp content)
+ (make-directory file-or-dir-name 'parents)
+ (let ((default-directory (concat default-directory "/" file-or-dir-name)))
+ (mapc #'yas-make-file-or-dirs content)))
+ ((stringp content)
+ (with-temp-buffer
+ (insert content)
+ (write-region nil nil file-or-dir-name nil 'nomessage)))
+ (t
+ (message "[yas] oops don't know this content")))))
+
+
+(defun yas-variables ()
+ (let ((syms))
+ (mapatoms #'(lambda (sym)
+ (if (and (string-match "^yas-[^/]" (symbol-name sym))
+ (boundp sym))
+ (push sym syms))))
+ syms))
+
+(defun yas-call-with-saving-variables (fn)
+ (let* ((vars (yas-variables))
+ (saved-values (mapcar #'symbol-value vars)))
+ (unwind-protect
+ (funcall fn)
+ (loop for var in vars
+ for saved in saved-values
+ do (set var saved)))))
+
+(defmacro yas-saving-variables (&rest body)
+ `(yas-call-with-saving-variables #'(lambda () ,@body)))
+
+
+(defun yas-call-with-snippet-dirs (dirs fn)
+ (let* ((default-directory (make-temp-file "yasnippet-fixture" t))
+ (yas-snippet-dirs (mapcar #'car dirs)))
+ (with-temp-message ""
+ (unwind-protect
+ (progn
+ (mapc #'yas-make-file-or-dirs dirs)
+ (funcall fn))
+ (when (>= emacs-major-version 23)
+ (delete-directory default-directory 'recursive))))))
+
+(defmacro yas-with-snippet-dirs (dirs &rest body)
+ `(yas-call-with-snippet-dirs ,dirs
+ #'(lambda ()
+ ,@body)))
+
+;;; Older emacsen
+;;;
+(unless (fboundp 'special-mode)
+ (define-minor-mode special-mode "Just a placeholder for something isn't in emacs 22"))
+
+;;; btw to test this in emacs22 mac osx:
+;;; curl -L -O https://github.com/mirrors/emacs/raw/master/lisp/emacs-lisp/ert.el
+;;; curl -L -O https://github.com/mirrors/emacs/raw/master/lisp/emacs-lisp/ert-x.el
+;;; /usr/bin/emacs -nw -Q -L . -l yasnippet-tests.el --batch -e ert
+
+
+(provide 'yasnippet-tests)
+;;; yasnippet-tests.el ends here
+;; Local Variables:
+;; lexical-binding: t
+;; End:
diff --git a/yasnippet.el b/yasnippet.el
index 9e42761..603ac02 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -2,8 +2,8 @@
;; Copyright (C) 2008-2012 Free Software Foundation, Inc.
;; Authors: pluskid , João Távora
-;; Version: 0.7.0
-;; Package-version: 0.7.0
+;; Version: 0.8.0
+;; Package-version: 0.8.0
;; X-URL: http://github.com/capitaomorte/yasnippet
;; Keywords: convenience, emulation
;; URL: http://github.com/capitaomorte/yasnippet
@@ -29,17 +29,17 @@
;; (add-to-list 'load-path
;; "~/path-to-yasnippet")
;; (require 'yasnippet)
-;; (yas/global-mode 1)
+;; (yas-global-mode 1)
;;
;;
;; Interesting variables are:
;;
-;; `yas/snippet-dirs'
+;; `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
+;; 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.
@@ -47,12 +47,12 @@
;; The deprecated `yas/root-directory' aliases this variable
;; for backward-compatibility.
;;
-;; `yas/extra-modes'
+;; `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
+;; `yas-snippet-dirs' and is used for deciding which
;; snippets to consider for the active buffer.
;;
;; Deprecated `yas/mode-symbol' aliases this variable for
@@ -60,49 +60,49 @@
;;
;; Major commands are:
;;
-;; M-x yas/expand
+;; 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.
+;; 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
+;; M-x yas-load-directory
;;
;; Prompts you for a directory hierarchy of snippets to load.
;;
-;; M-x yas/insert-snippet
+;; M-x yas-insert-snippet
;;
;; Prompts you for possible snippet expansion if that is
;; possible according to buffer-local and snippet-local
;; expansion conditions. With prefix argument, ignore these
;; conditions.
;;
-;; M-x yas/visit-snippet-file
+;; M-x yas-visit-snippet-file
;;
;; Prompts you for possible snippet expansions like
-;; `yas/insert-snippet', but instead of expanding it, takes
+;; `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
+;; M-x yas-new-snippet
;;
;; Lets you create a new snippet file in the correct
-;; subdirectory of `yas/snippet-dirs', according to the
+;; subdirectory of `yas-snippet-dirs', according to the
;; active major mode.
;;
-;; M-x yas/load-snippet-buffer
+;; 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
+;; 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
+;; M-x yas-describe-tables
;;
;; Lists known snippets in a separate buffer. User is
;; prompted as to whether only the currently active tables
@@ -114,16 +114,16 @@
;; your .emacs file, for example:
;;
;; (require 'dropdown-list)
-;; (setq yas/prompt-functions '(yas/dropdown-prompt
-;; yas/ido-prompt
-;; yas/completing-prompt))
+;; (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
+;; `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.
;;
@@ -143,18 +143,19 @@
"Yet Another Snippet extension"
:group 'editing)
-(defvar yas/load-file-name load-file-name
+(defvar yas--load-file-name load-file-name
"Store the filename that yasnippet.el was originally loaded from.")
-(defcustom yas/snippet-dirs (remove nil
+
+(defcustom yas-snippet-dirs (remove nil
(list "~/.emacs.d/snippets"
- (when yas/load-file-name
- (concat (file-name-directory yas/load-file-name) "snippets"))))
+ (when yas--load-file-name
+ (concat (file-name-directory yas--load-file-name) "snippets"))))
"Directory or list of snippet dirs for each major mode.
The directory where user-created snippets are to be stored. Can
also be a list of directories. In that case, when used for
bulk (re)loading of snippets (at startup or via
-`yas/reload-all'), directories appearing earlier in the list
+`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)")
@@ -165,19 +166,21 @@ as the default for storing the user's new snippets."
(let ((old (and (boundp symbol)
(symbol-value symbol))))
(set-default symbol new)
- (unless (or (not (fboundp 'yas/reload-all))
+ (unless (or (not (fboundp 'yas-reload-all))
(equal old new))
- (yas/reload-all)))))
-(defun yas/snippet-dirs ()
- "Returns `yas/snippet-dirs' (which see) as a list."
- (if (listp yas/snippet-dirs) yas/snippet-dirs (list yas/snippet-dirs)))
-(defvaralias 'yas/root-directory 'yas/snippet-dirs)
+ (yas-reload-all)))))
-(defcustom yas/prompt-functions '(yas/x-prompt
- yas/dropdown-prompt
- yas/completing-prompt
- yas/ido-prompt
- yas/no-prompt)
+(defun yas-snippet-dirs ()
+ "Returns `yas-snippet-dirs' (which see) as a list."
+ (if (listp yas-snippet-dirs) yas-snippet-dirs (list yas-snippet-dirs)))
+
+(defvaralias 'yas/root-directory 'yas-snippet-dirs)
+
+(defcustom yas-prompt-functions '(yas-x-prompt
+ yas-dropdown-prompt
+ yas-completing-prompt
+ yas-ido-prompt
+ yas-no-prompt)
"Functions to prompt for keys, templates, etc interactively.
These functions are called with the following arguments:
@@ -204,7 +207,7 @@ signal `quit' with
:type '(repeat function)
:group 'yasnippet)
-(defcustom yas/indent-line 'auto
+(defcustom yas-indent-line 'auto
"Controls indenting applied to a recent snippet expansion.
The following values are possible:
@@ -221,20 +224,20 @@ applies)."
(const :tag "Auto" auto))
:group 'yasnippet)
-(defcustom yas/also-auto-indent-first-line nil
+(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'"
+Naturally this is only valid when `yas-indent-line' is `auto'"
:type 'boolean
:group 'yasnippet)
-(defcustom yas/snippet-revival t
+(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.
+(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'."
@@ -245,11 +248,11 @@ representation using `read-kbd-macro'."
(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)))))
+ ;; `yas-trigger-key' is *not* loaded.
+ (if (fboundp 'yas--trigger-key-reload)
+ (yas--trigger-key-reload old)))))
-(defcustom yas/next-field-key '("TAB" "")
+(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
@@ -261,11 +264,11 @@ Can also be a 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))))
+ (if (fboundp 'yas--init-yas-in-snippet-keymap)
+ (yas--init-yas-in-snippet-keymap))))
-(defcustom yas/prev-field-key '("" "")
+(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
@@ -277,10 +280,10 @@ Can also be a 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))))
+ (if (fboundp 'yas--init-yas-in-snippet-keymap)
+ (yas--init-yas-in-snippet-keymap))))
-(defcustom yas/skip-and-clear-key '("C-d" "" "")
+(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
@@ -292,25 +295,25 @@ Can also be a 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))))
+ (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.
+(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
+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.
+(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'.
+ and call the next command bound to `yas-trigger-key'.
- nil or the symbol `return-nil' mean do nothing. (and
- `yas/expand-returns' nil)
+ `yas-expand' returns nil)
- A lisp form (apply COMMAND . ARGS) means interactively call
COMMAND, if ARGS is non-nil, call COMMAND non-interactively
@@ -319,49 +322,53 @@ field"
(const :tag "Do nothing" return-nil))
:group 'yasnippet)
-(defcustom yas/choose-keys-first nil
+(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'."
+This affects `yas-insert-snippet' and `yas-visit-snippet-file'."
:type 'boolean
:group 'yasnippet)
-(defcustom yas/choose-tables-first nil
+(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'"
+This affects `yas-insert-snippet', `yas-visit-snippet-file'"
:type 'boolean
:group 'yasnippet)
-(defcustom yas/use-menu 'abbreviate
+(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.
+menu and the modes set in `yas-extra-modes' are listed.
+
+- If set to `full', every submenu is listed
+
+- It set to nil, don't display a menu at all (this requires a
+ `yas-reload-all' call if the menu is already visible).
Any other non-nil value, every submenu is listed."
- :type '(choice (const :tag "Full" t)
- (const :tag "Real modes only" real-modes)
- (const :tag "Abbreviate" abbreviate))
+ :type '(choice (const :tag "Full" full)
+ (const :tag "Abbreviate" abbreviate)
+ (const :tag "No menu" nil))
:group 'yasnippet)
-(defcustom yas/trigger-symbol " =>"
+(defcustom yas-trigger-symbol (if (eq window-system 'mac)
+ (char-to-string ?\x21E5) ;; little ->| sign
+ " =>")
"The text that will be used in menu to represent the trigger."
:type 'string
:group 'yasnippet)
-(defcustom yas/wrap-around-region nil
+(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
@@ -369,21 +376,21 @@ can be overriden on a per-snippet basis."
:type 'boolean
:group 'yasnippet)
-(defcustom yas/good-grace t
+(defcustom yas-good-grace t
"If non-nil, don't raise errors in inline elisp evaluation.
An error string \"[yas] error\" is returned instead."
:type 'boolean
:group 'yasnippet)
-(defcustom yas/visit-from-menu nil
+(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
+(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
@@ -399,37 +406,41 @@ the trigger key itself."
;; Only two faces, and one of them shouldn't even be used...
;;
-(defface yas/field-highlight-face
+(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
+(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)
+
+(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)
+(defun yas--init-yas-in-snippet-keymap ()
+ (setq 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)))
+
+(defvar yas-keymap (yas--init-yas-in-snippet-keymap)
"The keymap active while a snippet expansion is in progress.")
-(defvar yas/key-syntaxes (list "w" "w_" "w_." "w_.()" "^ ")
+(defvar yas-key-syntaxes (list "w" "w_" "w_." "w_.()" "^ ")
"List of character syntaxes used to find a trigger key before point.
The list is tried in the order while scanning characters
backwards from point. For example, if the list is '(\"w\" \"w_\")
@@ -444,27 +455,27 @@ will, according to the \"w\" element first try \"bar\". If that
isn't a trigger key, \"foo-bar\" is tried, respecting a second
\"w_\" element.")
-(defvar yas/after-exit-snippet-hook
+(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-beg' : The beginning of the region of the snippet.
-`yas/snippet-end' : Similar to beg.
+`yas-snippet-end' : Similar to beg.
Attention: These hooks are not run when exiting nested/stackd snippet expansion!")
-(defvar yas/before-expand-snippet-hook
+(defvar yas-before-expand-snippet-hook
'()
"Hooks to run just before expanding a snippet.")
-(defvar yas/buffer-local-condition
+(defvar yas-buffer-local-condition
'(if (and (or (fourth (syntax-ppss))
(fifth (syntax-ppss)))
- (eq (symbol-function this-command) 'yas/expand-from-trigger-key))
+ (eq (symbol-function this-command) 'yas-expand-from-trigger-key))
'(require-snippet-condition . force-in-comment)
t)
"Snippet expanding condition.
@@ -510,7 +521,7 @@ conditions.
(add-hook 'python-mode-hook
'(lambda ()
- (setq yas/buffer-local-condition
+ (setq yas-buffer-local-condition
'(if (python-in-string/comment)
'(require-snippet-condition . force-in-comment)
t))))
@@ -523,45 +534,45 @@ snippet itself contains a condition that returns the symbol
;;; Internal variables
-(defvar yas/version "0.7.0 (beta)")
+(defvar yas--version "0.8.0 (beta)")
-(defvar yas/menu-table (make-hash-table)
+(defvar yas--menu-table (make-hash-table)
"A hash table of MAJOR-MODE symbols to menu keymaps.")
-(defvar yas/known-modes
+(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
+(defvar yas--escaped-characters
'(?\\ ?` ?\" ?' ?$ ?} ?{ ?\( ?\))
"List of characters which *might* need to be escaped.")
-(defconst yas/field-regexp
+(defconst yas--field-regexp
"${\\([0-9]+:\\)?\\([^}]*\\)}"
"A regexp to *almost* recognize a field.")
-(defconst yas/multi-dollar-lisp-expression-regexp
+(defconst yas--multi-dollar-lisp-expression-regexp
"$+[ \t\n]*\\(([^)]*)\\)"
"A regexp to *almost* recognize a \"$(...)\" expression.")
-(defconst yas/backquote-lisp-expression-regexp
+(defconst yas--backquote-lisp-expression-regexp
"`\\([^`]*\\)`"
"A regexp to recognize a \"`lisp-expression`\" expression." )
-(defconst yas/transform-mirror-regexp
+(defconst yas--transform-mirror-regexp
"${\\(?:\\([0-9]+\\):\\)?$\\([ \t\n]*([^}]*\\)"
"A regexp to *almost* recognize a mirror with a transform.")
-(defconst yas/simple-mirror-regexp
+(defconst yas--simple-mirror-regexp
"$\\([0-9]+\\)"
"A regexp to recognize a simple mirror.")
-(defvar yas/snippet-id-seed 0
+(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)
+(defun yas--snippet-next-id ()
+ (let ((id yas--snippet-id-seed))
+ (incf yas--snippet-id-seed)
id))
@@ -570,291 +581,284 @@ snippet itself contains a condition that returns the symbol
;; 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
+(defvar yas--minor-mode-menu nil
"Holds the YASnippet menu")
-(defun yas/init-minor-keymap ()
+(defun yas--init-minor-keymap ()
(let ((map (make-sparse-keymap)))
- (easy-menu-define yas/minor-mode-menu
+ (when yas-use-menu
+ (easy-menu-define yas--minor-mode-menu
map
- "Menu used when YAS/minor-mode is active."
+ "Menu used when `yas-minor-mode' is active."
'("YASnippet"
"----"
- ["Expand trigger" yas/expand
+ ["Expand trigger" yas-expand
:help "Possibly expand tab trigger before point"]
- ["Insert at point..." yas/insert-snippet
+ ["Insert at point..." yas-insert-snippet
:help "Prompt for an expandable snippet and expand it at point"]
- ["New snippet..." yas/new-snippet
+ ["New snippet..." yas-new-snippet
:help "Create a new snippet in an appropriate directory"]
- ["Visit snippet file..." yas/visit-snippet-file
+ ["Visit snippet file..." yas-visit-snippet-file
:help "Prompt for an expandable snippet and find its file"]
"----"
("Snippet menu behaviour"
- ["Visit snippets" (setq yas/visit-from-menu t)
+ ["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)
+ :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)]
+ :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)
+ ["Show all known modes" (setq yas-use-menu 'full)
:help "Show one snippet submenu for each loaded table"
- :active t :style radio :selected (eq yas/use-menu 't)]
- ["Abbreviate according to current mode" (setq yas/use-menu 'abbreviate)
+ :active t :style radio :selected (eq yas-use-menu 'full)]
+ ["Abbreviate according to current mode" (setq yas-use-menu 'abbreviate)
:help "Show only snippet submenus for the current active modes"
- :active t :style radio :selected (eq yas/use-menu 'abbreviate)])
+ :active t :style radio :selected (eq yas-use-menu 'abbreviate)])
("Indenting"
- ["Auto" (setq yas/indent-line 'auto)
+ ["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)
+ :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)
+ :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)))]
+ :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))
+ ["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]
+ :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)))
+ ["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)))
+ :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)))
+ :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)))
+ :active t :style radio :selected (eq (car yas-prompt-functions)
+ 'yas-ido-prompt)]
+ ["Completing read" (setq yas-prompt-functions
+ (cons 'yas-completing-prompt
+ (remove 'yas-completing-prompt
+ yas-prompt-functions)))
:help "Use a normal minibuffer prompt"
- :active t :style radio :selected (eq (car yas/prompt-functions)
- 'yas/completing-prompt-prompt)]
+ :active t :style radio :selected (eq (car yas-prompt-functions)
+ 'yas-completing-prompt)]
)
("Misc"
["Wrap region in exit marker"
- (setq yas/wrap-around-region
- (not yas/wrap-around-region))
+ (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]
+ :style toggle :selected yas-wrap-around-region]
["Allow stacked expansions "
- (setq yas/triggers-in-field
- (not yas/triggers-in-field))
+ (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]
+ :style toggle :selected yas-triggers-in-field]
["Revive snippets on undo "
- (setq yas/snippet-revival
- (not yas/snippet-revival))
+ (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]
+ :style toggle :selected yas-snippet-revival]
["Good grace "
- (setq yas/good-grace
- (not yas/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]
+ :style toggle :selected yas-good-grace]
)
"----"
- ["Load snippets..." yas/load-directory
+ ["Load snippets..." yas-load-directory
:help "Load snippets from a specific directory"]
- ["Reload everything" yas/reload-all
+ ["Reload everything" yas-reload-all
:help "Cleanup stuff, reload snippets, rebuild menus"]
- ["About" yas/about
- :help "Display some information about YASsnippet"]))
+ ["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-s" 'yas-insert-snippet)
+ (define-key map "\C-c&\C-n" 'yas-new-snippet)
+ (define-key map "\C-c&\C-v" 'yas-visit-snippet-file)
map))
-(defvar yas/minor-mode-map (yas/init-minor-keymap)
- "The keymap used when `yas/minor-mode' is active.")
+(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'.
+(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'."
+`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)))
+ (define-key yas-minor-mode-map (read-kbd-macro unbind-key) nil))
+ (when (and yas-trigger-key
+ (stringp yas-trigger-key)
+ (not (string= yas-trigger-key "")))
+ (define-key yas-minor-mode-map (read-kbd-macro yas-trigger-key) 'yas-expand)))
-(defvar yas/tables (make-hash-table)
- "A hash table of mode symbols to `yas/table' objects.")
+(defvar yas--tables (make-hash-table)
+ "A hash table of mode symbols to `yas--table' objects.")
-(defvar yas/parents (make-hash-table)
+(defvar yas--parents (make-hash-table)
"A hash table of mode symbols do lists of direct parent mode symbols.
This list is populated when reading the \".yas-parents\" files
found when traversing snippet directories with
-`yas/load-directory'.
+`yas-load-directory'.
There might be additionalal parenting information stored in the
`derived-mode-parent' property of some mode symbols, but that is
not recorded here.")
-(defvar yas/direct-keymaps (list)
+(defvar yas--direct-keymaps (list)
"Keymap alist supporting direct snippet keybindings.
This variable is is placed in `emulation-mode-map-alists'.
Its elements looks like (TABLE-NAME . KEYMAP). They're
-instantiated on `yas/reload-all' but KEYMAP is added to only when
-loading snippets. `yas//direct-TABLE-NAME' is then a variable set
-buffer-locally when entering `yas/minor-mode'. KEYMAP binds all
+instantiated on `yas-reload-all' but KEYMAP is added to only when
+loading snippets. `yas--direct-TABLE-NAME' is then a variable set
+buffer-locally when entering `yas-minor-mode'. KEYMAP binds all
defined direct keybindings to the command
-`yas/expand-from-keymap' which then which snippet to expand.")
+`yas-expand-from-keymap' which then which snippet to expand.")
-(defun yas/direct-keymaps-reload ()
+(defun yas-direct-keymaps-reload ()
"Force reload the direct keybinding for active snippet tables."
(interactive)
- (setq yas/direct-keymaps nil)
+ (setq yas--direct-keymaps nil)
(maphash #'(lambda (name table)
- (push (cons (intern (format "yas//direct-%s" name))
- (yas/table-direct-keymap table))
- yas/direct-keymaps))
- yas/tables))
+ (push (cons (intern (format "yas--direct-%s" name))
+ (yas--table-direct-keymap table))
+ yas--direct-keymaps))
+ yas--tables))
-(defun yas/modes-to-activate ()
- "Compute list of mode symbols that are active for `yas/expand'
+(defun yas--modes-to-activate ()
+ "Compute list of mode symbols that are active for `yas-expand'
and friends."
(let ((modes-to-activate (list major-mode))
(mode major-mode))
(while (setq mode (get mode 'derived-mode-parent))
(push mode modes-to-activate))
- (dolist (mode (yas/extra-modes))
+ (dolist (mode (yas-extra-modes))
(push mode modes-to-activate))
(remove-duplicates
(append modes-to-activate
(mapcan #'(lambda (mode)
- (yas/all-parents mode))
+ (yas--all-parents mode))
modes-to-activate)))))
-(defvar yas/minor-mode-hook nil
- "Hook run when yas/minor-mode is turned on")
+(defvar yas-minor-mode-hook nil
+ "Hook run when yas-minor-mode is turned on")
;;;###autoload
-(define-minor-mode yas/minor-mode
+(define-minor-mode yas-minor-mode
"Toggle YASnippet mode.
-When YASnippet mode is enabled, the `yas/trigger-key' key expands
-snippets of code depending on the mode.
+When YASnippet mode is enabled, the `yas-trigger-key' key expands
+snippets of code depending on the major mode.
With no argument, this command toggles the mode.
positive prefix argument turns on the mode.
Negative prefix argument turns off the mode.
-You can customize the key through `yas/trigger-key'.
+You can customize the key through `yas-trigger-key'.
Key bindings:
-\\{yas/minor-mode-map}"
+\\{yas-minor-mode-map}"
nil
;; The indicator for the mode line.
" yas"
:group 'yasnippet
- (cond (yas/minor-mode
+ (cond (yas-minor-mode
;; Reload the trigger key
;;
- (yas/trigger-key-reload)
+ (yas--trigger-key-reload)
;; Install the direct keymaps in `emulation-mode-map-alists'
;; (we use `add-hook' even though it's not technically a hook,
;; but it works). Then define variables named after modes to
- ;; index `yas/direct-keymaps'.
+ ;; index `yas--direct-keymaps'.
;;
;; Also install the post-command-hook.
;;
- (add-hook 'emulation-mode-map-alists 'yas/direct-keymaps)
- (add-hook 'post-command-hook 'yas/post-command-handler nil t)
- ;; Set the `yas//direct-%s' vars for direct keymap expansion
+ (add-hook 'emulation-mode-map-alists 'yas--direct-keymaps)
+ (add-hook 'post-command-hook 'yas--post-command-handler nil t)
+ ;; Set the `yas--direct-%s' vars for direct keymap expansion
;;
- (dolist (mode (yas/modes-to-activate))
- (let ((name (intern (format "yas//direct-%s" mode))))
+ (dolist (mode (yas--modes-to-activate))
+ (let ((name (intern (format "yas--direct-%s" mode))))
(set-default name nil)
(set (make-local-variable name) t)))
;; Perform JIT loads
;;
- (yas/load-pending-jits))
+ (yas--load-pending-jits))
(t
;; Uninstall the direct keymaps and the post-command hook
;;
- (remove-hook 'post-command-hook 'yas/post-command-handler t)
- (remove-hook 'emulation-mode-map-alists 'yas/direct-keymaps))))
+ (remove-hook 'post-command-hook 'yas--post-command-handler t)
+ (remove-hook 'emulation-mode-map-alists 'yas--direct-keymaps))))
-
-(defvar yas/dont-activate '(minibufferp)
- "If non-nil don't let `yas/minor-mode-on' active yas for this buffer.
+(defvar yas--dont-activate '(minibufferp)
+ "If non-nil don't let `yas-minor-mode-on' active yas for this buffer.
If a function, then its result is used.
If a list of functions, then all functions must return nil to
activate yas for this buffer.
-`yas/minor-mode-on' is usually called by `yas/global-mode' so
+`yas-minor-mode-on' is usually called by `yas-global-mode' so
this effectively lets you define exceptions to the \"global\"
behaviour. Can also be a function of zero arguments.")
-(make-variable-buffer-local 'yas/dont-activate)
+(make-variable-buffer-local 'yas--dont-activate)
-(defun yas/minor-mode-on ()
+(defun yas-minor-mode-on ()
"Turn on YASnippet minor mode.
-Do this unless `yas/dont-activate' is truish "
+Do this unless `yas--dont-activate' is truish "
(interactive)
- (unless (cond ((functionp yas/dont-activate)
- (funcall yas/dont-activate))
- ((consp yas/dont-activate)
- (some #'funcall yas/dont-activate))
- (yas/dont-activate))
+ (unless (cond ((functionp yas--dont-activate)
+ (funcall yas--dont-activate))
+ ((consp yas--dont-activate)
+ (some #'funcall yas--dont-activate))
+ (yas--dont-activate))
;; Load all snippets definitions unless we still don't have a
;; root-directory or some snippets have already been loaded.
;;
- (yas/minor-mode 1)))
+ (yas-minor-mode 1)))
;;;###autoload
-(define-globalized-minor-mode yas/global-mode yas/minor-mode yas/minor-mode-on
+(define-globalized-minor-mode yas-global-mode yas-minor-mode yas-minor-mode-on
:group 'yasnippet
:require 'yasnippet)
-(defadvice yas/global-mode (before yas/reload-with-jit (arg) activate)
- (cond ((and arg
- (numberp arg)
- (> arg 1))
- ;; explicitly enabling
- (yas/reload-all))
- ((not yas/global-mode)
- ;; toggling
- (yas/reload-all))))
+(defun yas--global-mode-reload-with-jit-maybe ()
+ (when yas-global-mode (yas-reload-all)))
+
+(add-hook 'yas-global-mode-hook 'yas--global-mode-reload-with-jit-maybe)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Major mode stuff
;;
-(defvar yas/font-lock-keywords
+(defvar yas--font-lock-keywords
(append '(("^#.*$" . font-lock-comment-face))
lisp-font-lock-keywords
lisp-font-lock-keywords-1
@@ -871,7 +875,7 @@ Do this unless `yas/dont-activate' is truish "
("}"
(0 font-lock-keyword-face)))))
-(defun yas/init-major-keymap ()
+(defun yas--init-major-keymap ()
(let ((map (make-sparse-keymap)))
(easy-menu-define nil
map
@@ -882,18 +886,18 @@ Do this unless `yas/dont-activate' is truish "
(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")))))
+ (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)
+ (yas--init-major-keymap)
"The keymap used when `snippet-mode' is active")
(define-derived-mode snippet-mode text-mode "Snippet"
"A mode for editing yasnippets"
- (setq font-lock-defaults '(yas/font-lock-keywords))
+ (setq font-lock-defaults '(yas--font-lock-keywords))
(set (make-local-variable 'require-final-newline) nil)
(set (make-local-variable 'comment-start) "#")
(set (make-local-variable 'comment-start-skip) "#+[\t ]*"))
@@ -902,7 +906,7 @@ Do this unless `yas/dont-activate' is truish "
;;; Internal structs for template management
-(defstruct (yas/template (:constructor yas/make-blank-template))
+(defstruct (yas--template (:constructor yas--make-blank-template))
"A template for a snippet."
key
content
@@ -914,50 +918,50 @@ Do this unless `yas/dont-activate' is truish "
uuid
menu-binding-pair
group ;; as dictated by the #group: directive or .yas-make-groups
- perm-group ;; as dictated by `yas/define-menu'
+ perm-group ;; as dictated by `yas-define-menu'
table
)
-(defun yas/populate-template (template &rest args)
+(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)))
+ (mapcar #'car (get 'yas--template 'cl-struct-slots)))
(second args))
(setq args (cddr args)))
template))
-(defstruct (yas/table (:constructor yas/make-snippet-table (name)))
+(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'
+`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-extra-modes', for example.
-`yas/table-hash'
+`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.
+ name and TEMPLATE is a `yas--template' object.
-`yas/table-direct-keymap'
+`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'.
+ bindings to `yas-expand-from-keymap'.
-`yas/table-uuidhash'
+`yas--table-uuidhash'
- A hash table mapping snippets uuid's to the same `yas/template'
+ A hash table mapping snippets uuid's to the same `yas--template'
objects. A snippet uuid defaults to the snippet's name.
"
name
@@ -966,21 +970,21 @@ Has the following fields:
(parents nil)
(direct-keymap (make-sparse-keymap)))
-(defun yas/get-template-by-uuid (mode uuid)
+(defun yas--get-template-by-uuid (mode uuid)
"Find the snippet template in MODE by its UUID."
- (let* ((table (gethash mode yas/tables mode)))
+ (let* ((table (gethash mode yas--tables mode)))
(when table
- (gethash uuid (yas/table-uuidhash table)))))
+ (gethash uuid (yas--table-uuidhash table)))))
;; Apropos storing/updating in TABLE, this works in two steps:
;;
-;; 1. `yas/remove-template-by-uuid' removes any
+;; 1. `yas--remove-template-by-uuid' removes any
;; keyhash-namehash-template mappings from TABLE, grabing the
;; snippet by its uuid. Also removes mappings from TABLE's
-;; `yas/table-direct-keymap' (FIXME: and should probably take care
+;; `yas--table-direct-keymap' (FIXME: and should probably take care
;; of potentially stale menu bindings right?.)
;;
-;; 2. `yas/add-template' adds this all over again.
+;; 2. `yas--add-template' adds this all over again.
;;
;; Create a new or add to an existing keyhash-namehash mapping.
;;
@@ -1000,179 +1004,198 @@ Has the following fields:
;; D: # name: Baz
;; # key: baz
;;
-;; keyhash namehashes(3) yas/template structs(4)
+;; keyhash namehashes(3) yas--template structs(4)
;; -----------------------------------------------------
;; __________
;; / \
-;; "foo" ---> "The Foo" ---> [yas/template A] |
-;; "Mrs Foo" ---> [yas/template B] |
+;; "foo" ---> "The Foo" ---> [yas--template A] |
+;; "Mrs Foo" ---> [yas--template B] |
;; |
;; [C-c M-l] ---> "The Foo" -------------------------/
-;; "The Bar" ---> [yas/template C]
+;; "The Bar" ---> [yas--template C]
;;
-;; "baz" ---> "Baz" ---> [yas/template D]
+;; "baz" ---> "Baz" ---> [yas--template D]
;;
;; Additionally, since uuid defaults to the name, we have a
-;; `yas/table-uuidhash' for TABLE
+;; `yas--table-uuidhash' for TABLE
;;
-;; uuidhash yas/template structs
+;; uuidhash yas--template structs
;; -------------------------------
-;; "The Foo" ---> [yas/template A]
-;; "Mrs Foo" ---> [yas/template B]
-;; "The Bar" ---> [yas/template C]
-;; "Baz" ---> [yas/template D]
+;; "The Foo" ---> [yas--template A]
+;; "Mrs Foo" ---> [yas--template B]
+;; "The Bar" ---> [yas--template C]
+;; "Baz" ---> [yas--template D]
;;
;; FIXME: the more I look at this data-structure the more I think I'm
-;; stupid. There has to be an easier way (but beware lots of code depends on this).
+;; stupid. There has to be an easier way (but beware lots of code
+;; depends on this).
;;
-(defun yas/remove-template-by-uuid (table uuid)
+(defun yas--remove-template-by-uuid (table uuid)
"Remove from TABLE a template identified by UUID."
- (let ((template (gethash uuid (yas/table-uuidhash table))))
+ (let ((template (gethash uuid (yas--table-uuidhash table))))
(when template
- (let* ((name (yas/template-name 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)))
+ (eq uuid (yas--template-uuid template)))
(remhash name v)
(when (zerop (hash-table-count v))
(push k empty-keys)))))
- (yas/table-hash table))
+ (yas--table-hash table))
;; Remove the namehash themselves if they've become empty
;;
(dolist (key empty-keys)
(when (vectorp key)
- (define-key (yas/table-direct-keymap table) key nil))
- (remhash key (yas/table-hash table)))
+ (define-key (yas--table-direct-keymap table) key nil))
+ (remhash key (yas--table-hash table)))
;; Finally, remove the uuid from the uuidhash
;;
- (remhash uuid (yas/table-uuidhash table))))))
+ (remhash uuid (yas--table-uuidhash table))))))
-(defun yas/add-template (table template)
+(defun yas--add-template (table template)
"Store in TABLE the snippet template TEMPLATE.
KEY can be a string (trigger key) of a vector (direct
keybinding)."
- (let ((name (yas/template-name template))
- (key (yas/template-key template))
- (keybinding (yas/template-keybinding template))
- (menu-binding-pair (yas/snippet-menu-binding-pair-get-create template)))
+ (let ((name (yas--template-name template))
+ (key (yas--template-key template))
+ (keybinding (yas--template-keybinding template))
+ (menu-binding-pair (yas--template-menu-binding-pair-get-create template)))
(dolist (k (remove nil (list key keybinding)))
(puthash name
template
(or (gethash k
- (yas/table-hash table))
+ (yas--table-hash table))
(puthash k
(make-hash-table :test 'equal)
- (yas/table-hash table))))
+ (yas--table-hash table))))
(when (vectorp k)
- (define-key (yas/table-direct-keymap table) k 'yas/expand-from-keymap)))
+ (define-key (yas--table-direct-keymap table) k 'yas-expand-from-keymap)))
- ;; Update trigger & keybinding in the menu-binding pair
- ;;
- (unless (eq (cdr menu-binding-pair) :none)
- (setf (getf (cdr (car menu-binding-pair)) :keys)
- (or (and keybinding (key-description keybinding))
- (and key (concat key yas/trigger-symbol)))))
+ ;; Update TABLE's `yas--table-uuidhash'
+ (puthash (yas--template-uuid template)
+ template
+ (yas--table-uuidhash table))))
- (puthash (yas/template-uuid template) template (yas/table-uuidhash table))))
-
-(defun yas/update-template (table template)
+(defun yas--update-template (table template)
"Add or update TEMPLATE in TABLE.
Also takes care of adding and updating to the associated menu."
;; Remove from table by uuid
;;
- (yas/remove-template-by-uuid table (yas/template-uuid template))
+ (yas--remove-template-by-uuid table (yas--template-uuid template))
;; Add to table again
;;
- (yas/add-template table template)
+ (yas--add-template table template)
;; Take care of the menu
;;
- (let ((keymap (yas/menu-keymap-get-create table))
- (group (yas/template-group template)))
- (when (and yas/use-menu
- keymap
- (not (cdr (yas/template-menu-binding-pair template))))
+ (when yas-use-menu
+ (yas--update-template-menu table template)))
+
+(defun yas--update-template-menu (table template)
+ "Update every menu-related for TEMPLATE"
+ (let ((menu-binding-pair (yas--template-menu-binding-pair-get-create template))
+ (key (yas--template-key template))
+ (keybinding (yas--template-keybinding template)))
+ ;; The snippet might have changed name or keys, so update
+ ;; user-visible strings
+ ;;
+ (unless (eq (cdr menu-binding-pair) :none)
+ ;; the menu item name
+ ;;
+ (setf (cadar menu-binding-pair) (yas--template-name template))
+ ;; the :keys information (also visible to the user)
+ (setf (getf (cdr (car menu-binding-pair)) :keys)
+ (or (and keybinding (key-description keybinding))
+ (and key (concat key yas-trigger-symbol))))))
+ (unless (yas--template-menu-managed-by-yas-define-menu template)
+ (let ((menu-keymap
+ (yas--menu-keymap-get-create (yas--table-mode table)
+ (mapcar #'yas--table-mode
+ (yas--table-parents table))))
+ (group (yas--template-group template)))
;; Remove from menu keymap
;;
- (yas/delete-from-keymap keymap (yas/template-uuid template))
+ (assert menu-keymap)
+ (yas--delete-from-keymap menu-keymap (yas--template-uuid template))
;; Add necessary subgroups as necessary.
;;
(dolist (subgroup group)
- (let ((subgroup-keymap (lookup-key keymap (vector (make-symbol subgroup)))))
+ (let ((subgroup-keymap (lookup-key menu-keymap (vector (make-symbol subgroup)))))
(unless (and subgroup-keymap
(keymapp subgroup-keymap))
(setq subgroup-keymap (make-sparse-keymap))
- (define-key keymap (vector (make-symbol subgroup))
+ (define-key menu-keymap (vector (make-symbol subgroup))
`(menu-item ,subgroup ,subgroup-keymap)))
- (setq keymap subgroup-keymap)))
+ (setq menu-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))))))
+ (define-key menu-keymap
+ (vector (make-symbol (yas--template-uuid template)))
+ (car (yas--template-menu-binding-pair template))))))
-(defun yas/namehash-templates-alist (namehash)
+(defun yas--namehash-templates-alist (namehash)
(let (alist)
(maphash #'(lambda (k v)
(push (cons k v) alist))
namehash)
alist))
-(defun yas/fetch (table key)
+(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))
+string and TEMPLATE is a `yas--template' structure."
+ (let* ((keyhash (yas--table-hash table))
(namehash (and keyhash (gethash key keyhash))))
(when namehash
- (yas/filter-templates-by-condition (yas/namehash-templates-alist namehash)))))
+ (yas--filter-templates-by-condition (yas--namehash-templates-alist namehash)))))
;;; Filtering/condition logic
-(defun yas/eval-condition (condition)
+(defun yas--eval-condition (condition)
(condition-case err
(save-excursion
(save-restriction
(save-match-data
(eval condition))))
(error (progn
- (yas/message 1 "Error in condition evaluation: %s" (error-message-string err))
+ (yas--message 1 "Error in condition evaluation: %s" (error-message-string err))
nil))))
-(defun yas/filter-templates-by-condition (templates)
+(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.
+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)))
+`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))
+ (yas--template-can-expand-p
+ (yas--template-condition (cdr pair)) requirement))
templates))))
-(defun yas/require-template-specific-condition-p ()
+(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)
+ (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)))
+ (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
@@ -1181,37 +1204,37 @@ conditions to filter out potential expansions."
(symbolp (cdr local-condition))
(cdr local-condition)))))))
-(defun yas/template-can-expand-p (condition requirement)
+(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))))
+ (yas--eval-condition condition))))
(cond ((eq requirement t)
result)
(t
(eq requirement result)))))
-(defun yas/all-parents (mode)
+(defun yas--all-parents (mode)
"Returns a list of all parent modes of MODE"
- (let ((parents (gethash mode yas/parents)))
+ (let ((parents (gethash mode yas--parents)))
(append parents
- (mapcan #'yas/all-parents parents))))
+ (mapcan #'yas--all-parents parents))))
-(defun yas/table-templates (table)
+(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))))
+ (yas--table-hash table))
+ (yas--filter-templates-by-condition acc))))
-(defun yas/current-key ()
+(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)
+ (syntaxes yas-key-syntaxes)
syntax
done
templates)
@@ -1223,8 +1246,8 @@ the template of a snippet in the current snippet-table."
(setq start (point)))
(setq templates
(mapcan #'(lambda (table)
- (yas/fetch table (buffer-substring-no-properties start end)))
- (yas/get-snippet-tables)))
+ (yas--fetch table (buffer-substring-no-properties start end)))
+ (yas--get-snippet-tables)))
(if templates
(setq done t)
(setq start end)))
@@ -1233,30 +1256,33 @@ the template of a snippet in the current snippet-table."
end)))
-(defun yas/table-all-keys (table)
+(defun yas--table-all-keys (table)
(when table
(let ((acc))
(maphash #'(lambda (key namehash)
- (when (yas/filter-templates-by-condition (yas/namehash-templates-alist namehash))
+ (when (yas--filter-templates-by-condition (yas--namehash-templates-alist namehash))
(push key acc)))
- (yas/table-hash table))
+ (yas--table-hash table))
acc)))
-
-;;; Internal functions
+(defun yas--table-mode (table)
+ (intern (yas--table-name table)))
-(defun yas/real-mode? (mode)
+
+;;; 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)))
+ (find mode yas--known-modes)))
-(defun yas/eval-lisp (form)
+(defun yas--eval-lisp (form)
"Evaluate FORM and convert the result to string."
- (let ((retval (catch 'yas/exception
+ (let ((retval (catch 'yas--exception
(condition-case err
(save-excursion
(save-restriction
@@ -1265,24 +1291,24 @@ a list of modes like this to help the judgement."
(let ((result (eval form)))
(when result
(format "%s" result))))))
- (error (if yas/good-grace
- (yas/format "elisp error! %s" (error-message-string err))
- (error (yas/format "elisp error: %s"
+ (error (if yas-good-grace
+ (yas--format "elisp error! %s" (error-message-string err))
+ (error (yas--format "elisp error: %s"
(error-message-string err)))))))))
(when (and (consp retval)
- (eq 'yas/exception (car retval)))
+ (eq 'yas--exception (car retval)))
(error (cdr retval)))
retval))
-(defun yas/eval-lisp-no-saves (form)
+(defun yas--eval-lisp-no-saves (form)
(condition-case err
(eval form)
- (error (if yas/good-grace
- (yas/format "elisp error! %s" (error-message-string err))
- (error (yas/format "elisp error: %s"
+ (error (if yas-good-grace
+ (yas--format "elisp error! %s" (error-message-string err))
+ (error (yas--format "elisp error: %s"
(error-message-string err)))))))
-(defun yas/read-lisp (string &optional nil-on-error)
+(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,
@@ -1292,7 +1318,7 @@ return an expression that when evaluated will issue an error."
(error (and (not nil-on-error)
`(error (error-message-string ,err))))))
-(defun yas/read-keybinding (keybinding)
+(defun yas--read-keybinding (keybinding)
"Read KEYBINDING as a snippet keybinding, return a vector."
(when (and keybinding
(not (string-match "keybinding" keybinding)))
@@ -1302,62 +1328,60 @@ return an expression that when evaluated will issue an error."
(read-kbd-macro keybinding 'need-vector))))
res)
(error
- (yas/message 3 "warning: keybinding \"%s\" invalid since %s."
+ (yas--message 3 "warning: keybinding \"%s\" invalid since %s."
keybinding (error-message-string err))
nil))))
-(defvar yas/extra-modes 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-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)
+(defun yas--table-get-create (mode)
"Get or create the snippet table corresponding to MODE."
(let ((table (gethash mode
- yas/tables)))
+ yas--tables)))
(unless table
- (setq table (yas/make-snippet-table (symbol-name mode)))
- (puthash mode table yas/tables)
- (push (cons (intern (format "yas//direct-%s" mode))
- (yas/table-direct-keymap table))
- yas/direct-keymaps))
+ (setq table (yas--make-snippet-table (symbol-name mode)))
+ (puthash mode table yas--tables)
+ (push (cons (intern (format "yas--direct-%s" mode))
+ (yas--table-direct-keymap table))
+ yas--direct-keymaps))
table))
-(defun yas/get-snippet-tables ()
+(defun yas--get-snippet-tables ()
"Get snippet tables for current buffer.
-Return a list of `yas/table' objects. The list of modes to
-consider is returned by `yas/modes-to-activate'"
+Return a list of `yas--table' objects. The list of modes to
+consider is returned by `yas--modes-to-activate'"
(remove nil
(mapcar #'(lambda (mode-name)
- (gethash mode-name yas/tables))
- (yas/modes-to-activate))))
+ (gethash mode-name yas--tables))
+ (yas--modes-to-activate))))
-(defun yas/menu-keymap-get-create (table)
- "Get or create the main menu keymap correspondong to MODE.
+(defun yas--menu-keymap-get-create (mode &optional parents)
+ "Get or create the menu keymap for MODE and its PARENTS.
This may very well create a plethora of menu keymaps and arrange
-them 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)
+them all in `yas--menu-table'"
+ (let* ((menu-keymap (or (gethash mode yas--menu-table)
+ (puthash mode (make-sparse-keymap) yas--menu-table))))
+ (mapc #'yas--menu-keymap-get-create parents)
+ (define-key yas--minor-mode-menu (vector mode)
`(menu-item ,(symbol-name mode) ,menu-keymap
- :visible (yas/show-menu-p ',mode)))
+ :visible (yas--show-menu-p ',mode)))
menu-keymap))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Template-related and snippet loading functions
-(defun yas/parse-template (&optional file)
+(defun yas--parse-template (&optional file)
"Parse the template in the current buffer.
Optional FILE is the absolute file name of the file being
@@ -1395,7 +1419,7 @@ Here's a list of currently recognized directives:
bound
condition
(group (and file
- (yas/calculate-group file)))
+ (yas--calculate-group file)))
expand-env
binding
uuid)
@@ -1417,11 +1441,11 @@ Here's a list of currently recognized directives:
(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))))
+ (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)
+ (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)))))
@@ -1430,12 +1454,12 @@ Here's a list of currently recognized directives:
(unless (or key binding)
(setq key (and file (file-name-nondirectory file))))
(when (eq type 'command)
- (setq template (yas/read-lisp (concat "(progn" template ")"))))
+ (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)
+(defun yas--calculate-group (file)
"Calculate the group for snippet file path FILE."
(let* ((dominating-dir (locate-dominating-file file
".yas-make-groups"))
@@ -1452,7 +1476,7 @@ Here's a list of currently recognized directives:
(directory-file-name extra-dir)))))
group))
-(defun yas/subdirs (directory &optional filep)
+(defun yas--subdirs (directory &optional filep)
"Return subdirs or files of DIRECTORY according to FILEP."
(remove-if (lambda (file)
(or (string-match "^\\."
@@ -1466,72 +1490,72 @@ Here's a list of currently recognized directives:
(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--make-menu-binding (template)
+ (let ((mode (yas--table-mode (yas--template-table template))))
+ `(lambda () (interactive) (yas--expand-or-visit-from-menu ',mode ,(yas--template-uuid template)))))
-(defun yas/expand-or-visit-from-menu (mode uuid)
- (let* ((table (yas/table-get-create mode))
- (yas/current-template (and table
- (gethash uuid (yas/table-uuidhash table)))))
- (when yas/current-template
- (if yas/visit-from-menu
- (yas/visit-snippet-file-1 yas/current-template)
+(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)
+ (yas-expand-snippet (yas--template-content yas--current-template)
(car where)
(cdr where)
- (yas/template-expand-env yas/current-template)))))))
+ (yas--template-expand-env yas--current-template)))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Popping up for keys and templates
;;
-(defvar yas/x-pretty-prompt-templates nil
+(defvar yas--x-pretty-prompt-templates nil
"If non-nil, attempt to prompt for templates like TextMate.")
-(defun yas/prompt-for-template (templates &optional prompt)
+(defun yas--prompt-for-template (templates &optional prompt)
"Interactively choose a template from the list TEMPLATES.
-TEMPLATES is a list of `yas/template'."
+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)
+ (< (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))))
+ #'yas--template-name))
+ yas-prompt-functions))))
-(defun yas/prompt-for-keys (keys &optional prompt)
+(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)))
+ yas-prompt-functions)))
-(defun yas/prompt-for-table (tables &optional prompt)
+(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)))
+ #'yas--table-name))
+ yas-prompt-functions)))
-(defun yas/x-prompt (prompt choices &optional display-fn)
+(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'
+ ;; 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.
+ ;; up as `yas--all-templates' I think.
;;
(when (and window-system choices)
(let ((chosen
@@ -1554,26 +1578,26 @@ TEMPLATES is a list of `yas/template'."
(or chosen
(keyboard-quit)))))
-(defun yas/x-pretty-prompt-templates (prompt templates)
+(defun yas--x-pretty-prompt-templates (prompt templates)
"Display TEMPLATES, grouping neatly by table name."
(let ((organized (make-hash-table :test #'equal))
menu
more-than-one-table
prefix)
(dolist (tl templates)
- (puthash (yas/template-table tl)
+ (puthash (yas--template-table tl)
(cons tl
- (gethash (yas/template-table tl) organized))
+ (gethash (yas--template-table tl) organized))
organized))
(setq more-than-one-table (> (hash-table-count organized) 1))
(setq prefix (if more-than-one-table
" " ""))
(if more-than-one-table
(maphash #'(lambda (table templates)
- (push (yas/table-name table) menu)
+ (push (yas--table-name table) menu)
(dolist (tl templates)
- (push (cons (concat prefix (yas/template-name tl)) tl) menu))) organized)
- (setq menu (mapcar #'(lambda (tl) (cons (concat prefix (yas/template-name tl)) tl)) templates)))
+ (push (cons (concat prefix (yas--template-name tl)) tl) menu))) organized)
+ (setq menu (mapcar #'(lambda (tl) (cons (concat prefix (yas--template-name tl)) tl)) templates)))
(setq menu (nreverse menu))
(or (x-popup-menu (if (fboundp 'posn-at-point)
@@ -1585,14 +1609,14 @@ TEMPLATES is a list of `yas/template'."
(list prompt (push "title" menu)))
(keyboard-quit))))
-(defun yas/ido-prompt (prompt choices &optional display-fn)
+(defun yas-ido-prompt (prompt choices &optional display-fn)
(when (and (fboundp 'ido-completing-read)
(or (>= emacs-major-version 24)
ido-mode))
- (yas/completing-prompt prompt choices display-fn #'ido-completing-read)))
+ (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)
+(defun yas-dropdown-prompt (prompt choices &optional display-fn)
(when (featurep 'dropdown-list)
(let (formatted-choices
filtered-choices
@@ -1610,7 +1634,7 @@ TEMPLATES is a list of `yas/template'."
(nth n filtered-choices)
(keyboard-quit)))))
-(defun yas/completing-prompt (prompt choices &optional display-fn completion-fn)
+(defun yas-completing-prompt (prompt choices &optional display-fn completion-fn)
(let (formatted-choices
filtered-choices
chosen
@@ -1635,99 +1659,111 @@ TEMPLATES is a list of `yas/template'."
0)))
(nth position filtered-choices))))
-(defun yas/no-prompt (prompt choices &optional display-fn)
+(defun yas-no-prompt (prompt choices &optional display-fn)
(first choices))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Loading snippets from files
;;
-(defun yas/load-yas-setup-file (file)
+(defun yas--load-yas-setup-file (file)
(load file 'noerror))
-(defun yas/load-directory (top-level-dir &optional use-jit)
+(defun yas-load-directory (top-level-dir &optional use-jit)
"Load snippets in directory hierarchy TOP-LEVEL-DIR.
Below TOP-LEVEL-DIR each directory should be a mode name.
Optional USE-JIT use jit-loading of snippets."
(interactive "DSelect the root directory: ")
- (unless yas/snippet-dirs
- (setq yas/snippet-dirs top-level-dir))
- (dolist (dir (yas/subdirs top-level-dir))
- (let* ((major-mode-and-parents (yas/compute-major-mode-and-parents
+ (unless yas-snippet-dirs
+ (setq yas-snippet-dirs top-level-dir))
+ (dolist (dir (yas--subdirs top-level-dir))
+ (let* ((major-mode-and-parents (yas--compute-major-mode-and-parents
(concat dir "/dummy")))
(mode-sym (car major-mode-and-parents))
(parents (cdr major-mode-and-parents)))
- (yas/define-parents mode-sym parents)
- (let ((form `(yas/load-directory-1 ,dir
+ ;; Attention: The parents and the menus are already defined
+ ;; here, even if the snippets are later jit-loaded.
+ ;;
+ ;; * We need to know the parents at this point since entering a
+ ;; given mode should jit load for its parents
+ ;; immediately. This could be reviewed, the parents could be
+ ;; discovered just-in-time-as well
+ ;;
+ ;; * We need to create the menus here to support the `full'
+ ;; option to `yas-use-menu' (all known snippet menus are shown to the user)
+ ;;
+ (yas--define-parents mode-sym parents)
+ (yas--menu-keymap-get-create mode-sym)
+ (let ((form `(yas--load-directory-1 ,dir
',mode-sym
',parents)))
(if use-jit
- (yas/schedule-jit mode-sym form)
+ (yas--schedule-jit mode-sym form)
(eval form)))))
(when (interactive-p)
- (yas/message 3 "Loaded snippets from %s." top-level-dir)))
+ (yas--message 3 "Loaded snippets from %s." top-level-dir)))
-(defun yas/load-directory-1 (directory mode-sym parents &optional no-compiled-snippets)
+(defun yas--load-directory-1 (directory mode-sym parents &optional no-compiled-snippets)
"Recursively load snippet templates from DIRECTORY."
(unless (file-exists-p (concat directory "/" ".yas-skip"))
(if (and (not no-compiled-snippets)
- (progn (yas/message 2 "Loading compiled snippets from %s" directory) t)
- (load (expand-file-name ".yas-compiled-snippets" directory) 'noerror (<= yas/verbosity 3)))
- (yas/message 2 "Loading snippet files from %s" directory)
- (yas/load-directory-2 directory mode-sym))))
+ (progn (yas--message 2 "Loading compiled snippets from %s" directory) t)
+ (load (expand-file-name ".yas-compiled-snippets" directory) 'noerror (<= yas-verbosity 3)))
+ (yas--message 2 "Loading snippet files from %s" directory)
+ (yas--load-directory-2 directory mode-sym))))
-(defun yas/load-directory-2 (directory mode-sym)
+(defun yas--load-directory-2 (directory mode-sym)
;; Load .yas-setup.el files wherever we find them
;;
- (yas/load-yas-setup-file (expand-file-name ".yas-setup" directory))
+ (yas--load-yas-setup-file (expand-file-name ".yas-setup" directory))
(let* ((default-directory directory)
(snippet-defs nil))
;; load the snippet files
;;
(with-temp-buffer
- (dolist (file (yas/subdirs directory 'no-subdirs-just-files))
+ (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)
+ (push (yas--parse-template file)
snippet-defs))))
(when snippet-defs
- (yas/define-snippets mode-sym
+ (yas-define-snippets mode-sym
snippet-defs))
;; now recurse to a lower level
;;
- (dolist (subdir (yas/subdirs directory))
- (yas/load-directory-2 subdir
+ (dolist (subdir (yas--subdirs directory))
+ (yas--load-directory-2 subdir
mode-sym))))
-(defun yas/load-snippet-dirs (&optional nojit)
- "Reload the directories listed in `yas/snippet-dirs' or
+(defun yas--load-snippet-dirs (&optional nojit)
+ "Reload the directories listed in `yas-snippet-dirs' or
prompt the user to select one."
(let (errors)
- (if yas/snippet-dirs
- (dolist (directory (reverse (yas/snippet-dirs)))
+ (if yas-snippet-dirs
+ (dolist (directory (reverse (yas-snippet-dirs)))
(cond ((file-directory-p directory)
- (yas/load-directory directory (not nojit))
+ (yas-load-directory directory (not nojit))
(if nojit
- (yas/message 3 "Loaded %s" directory)
- (yas/message 3 "Prepared just-in-time loading for %s" directory)))
+ (yas--message 3 "Loaded %s" directory)
+ (yas--message 3 "Prepared just-in-time loading for %s" directory)))
(t
- (push (yas/message 0 "Check your `yas/snippet-dirs': %s is not a directory" directory) errors))))
- (call-interactively 'yas/load-directory))
+ (push (yas--message 0 "Check your `yas-snippet-dirs': %s is not a directory" directory) errors))))
+ (call-interactively 'yas-load-directory))
errors))
-(defun yas/reload-all (&optional interactive)
+(defun yas-reload-all (&optional interactive)
"Reload all snippets and rebuild the YASnippet menu.
When called interactively force immediate reload of all known
-snippets under `yas/snippet-dirs', otherwise use just-in-time
+snippets under `yas-snippet-dirs', otherwise use just-in-time
loading."
(interactive "p")
(catch 'abort
(let ((errors)
(snippet-editing-buffers
(remove-if-not #'(lambda (buffer)
- (with-current-buffer buffer yas/editing-template))
+ (with-current-buffer buffer yas--editing-template))
(buffer-list))))
;; Warn if there are buffers visiting snippets, since reloading will break
;; any on-line editing of those buffers.
@@ -1736,56 +1772,55 @@ loading."
(if interactive
(if (y-or-n-p "Some buffers editing live snippets, close them and proceed with reload?")
(mapc #'kill-buffer snippet-editing-buffers)
- (yas/message 1 "Aborted reload...")
+ (yas--message 1 "Aborted reload...")
(throw 'abort nil))
;; in a non-interactive use, at least set
- ;; `yas/editing-template' to nil, make it guess it next time around
- (mapc #'(lambda (buffer) (setq yas/editing-template nil)) (buffer-list))))
+ ;; `yas--editing-template' to nil, make it guess it next time around
+ (mapc #'(lambda (buffer) (setq yas--editing-template nil)) (buffer-list))))
;; Empty all snippet tables, parenting info and all menu tables
;;
- (setq yas/tables (make-hash-table))
- (setq yas/parents (make-hash-table))
- (setq yas/menu-table (make-hash-table))
+ (setq yas--tables (make-hash-table))
+ (setq yas--parents (make-hash-table))
+ (setq yas--menu-table (make-hash-table))
- ;; Cancel all pending 'yas/scheduled-jit-loads'
+ ;; Cancel all pending 'yas--scheduled-jit-loads'
;;
- (setq yas/scheduled-jit-loads (make-hash-table))
+ (setq yas--scheduled-jit-loads (make-hash-table))
- ;; Init the `yas/minor-mode-map', taking care not to break the
+ ;; Init the `yas-minor-mode-map', taking care not to break the
;; menu....
;;
- (setf (cdr yas/minor-mode-map)
- (cdr (yas/init-minor-keymap)))
+ (setcdr yas-minor-mode-map (cdr (yas--init-minor-keymap)))
- ;; Reload the directories listed in `yas/snippet-dirs' or prompt
+ ;; Reload the directories listed in `yas-snippet-dirs' or prompt
;; the user to select one.
;;
- (setq errors (yas/load-snippet-dirs interactive))
+ (setq errors (yas--load-snippet-dirs interactive))
;; Reload the direct keybindings
;;
- (yas/direct-keymaps-reload)
+ (yas-direct-keymaps-reload)
;; Reload the trigger-key (shoudn't be needed, but see issue #237)
;;
- (yas/trigger-key-reload)
+ (yas--trigger-key-reload)
- (yas/message 3 "Reloaded everything%s...%s."
+ (yas--message 3 "Reloaded everything%s...%s."
(if interactive "" " (snippets will load just-in-time)")
(if errors " (some errors, check *Messages*)" "")))))
-(defun yas/load-pending-jits ()
- (when yas/minor-mode
- (dolist (mode (yas/modes-to-activate))
- (let ((forms (gethash mode yas/scheduled-jit-loads)))
+(defun yas--load-pending-jits ()
+ (when yas-minor-mode
+ (dolist (mode (yas--modes-to-activate))
+ (let ((forms (gethash mode yas--scheduled-jit-loads)))
(dolist (form forms)
- (yas/message 3 "Loading for `%s', just-in-time: %s!" mode form)
+ (yas--message 3 "Loading for `%s', just-in-time: %s!" mode form)
(eval form))
- (remhash mode yas/scheduled-jit-loads)))))
+ (remhash mode yas--scheduled-jit-loads)))))
;; (when (<= emacs-major-version 22)
-;; (add-hook 'after-change-major-mode-hook 'yas/load-pending-jits))
+;; (add-hook 'after-change-major-mode-hook 'yas--load-pending-jits))
-(defun yas/quote-string (string)
+(defun yas--quote-string (string)
"Escape and quote STRING.
foo\"bar\\! -> \"foo\\\"bar\\\\!\""
(concat "\""
@@ -1797,17 +1832,17 @@ foo\"bar\\! -> \"foo\\\"bar\\\\!\""
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Snippet compilation function
-(defun yas/initialize ()
- "For backward compatibility, enable `yas/minor-mode' globally"
- (yas/global-mode 1))
+(defun yas--initialize ()
+ "For backward compatibility, enable `yas-minor-mode' globally"
+ (yas-global-mode 1))
-(defun yas/compile-directory (top-level-dir)
+(defun yas-compile-directory (top-level-dir)
"Create .yas-compiled-snippets.el files under subdirs of TOP-LEVEL-DIR.
This works by stubbing a few functions, then calling
-`yas/load-directory'."
+`yas-load-directory'."
(interactive "DTop level snippet directory?")
- (flet ((yas/load-yas-setup-file
+ (flet ((yas--load-yas-setup-file
(file)
(let ((elfile (concat file ".el")))
(when (file-exists-p elfile)
@@ -1815,7 +1850,7 @@ This works by stubbing a few functions, then calling
(insert-file-contents elfile)
(end-of-buffer)
)))
- (yas/define-snippets
+ (yas-define-snippets
(mode snippets)
(insert ";;; Snippet definitions:\n;;;\n")
(let ((literal-snippets (list))
@@ -1840,54 +1875,54 @@ This works by stubbing a few functions, then calling
,binding
,uuid)
literal-snippets)))
- (insert (pp-to-string `(yas/define-snippets ',mode ',literal-snippets)))
+ (insert (pp-to-string `(yas-define-snippets ',mode ',literal-snippets)))
(insert "\n\n")))
- (yas/load-directory-1
+ (yas--load-directory-1
(dir mode parents &rest ignore)
(let ((output-file (concat (file-name-as-directory dir) ".yas-compiled-snippets.el")))
(with-temp-file output-file
(insert (format ";;; Compiled snippets and support files for `%s'\n" mode))
- (yas/load-directory-2 dir mode)
+ (yas--load-directory-2 dir mode)
(insert (format ";;; Do not edit! File generated at %s\n" (current-time-string)))))))
- (yas/load-directory top-level-dir nil)))
+ (yas-load-directory top-level-dir nil)))
-(defun yas/recompile-all ()
- "Compile every dir in `yas/snippet-dirs'."
+(defun yas-recompile-all ()
+ "Compile every dir in `yas-snippet-dirs'."
(interactive)
- (mapc #'yas/compile-directory (yas/snippet-dirs)))
+ (mapc #'yas-compile-directory (yas-snippet-dirs)))
;;; JIT loading
;;;
-(defvar yas/scheduled-jit-loads (make-hash-table)
- "Alist of mode-symbols to forms to be evaled when `yas/minor-mode' kicks in.")
+(defvar yas--scheduled-jit-loads (make-hash-table)
+ "Alist of mode-symbols to forms to be evaled when `yas-minor-mode' kicks in.")
-(defun yas/schedule-jit (mode form)
+(defun yas--schedule-jit (mode form)
(puthash mode
(cons form
- (gethash mode yas/scheduled-jit-loads))
- yas/scheduled-jit-loads))
+ (gethash mode yas--scheduled-jit-loads))
+ yas--scheduled-jit-loads))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Some user level functions
;;;
-(defun yas/about ()
+(defun yas-about ()
(interactive)
(message (concat "yasnippet (version "
- yas/version
+ yas--version
") -- pluskid /joaotavora ")))
-(defun yas/define-parents (mode parents)
+(defun yas--define-parents (mode parents)
"Add PARENTS to the list of MODE's parents"
- (puthash mode-sym (remove-duplicates
- (append parents
- (gethash mode-sym yas/parents)))
- yas/parents))
+ (puthash mode (remove-duplicates
+ (append parents
+ (gethash mode yas--parents)))
+ yas--parents))
-(defun yas/define-snippets (mode snippets)
+(defun yas-define-snippets (mode snippets)
"Define SNIPPETS for MODE.
SNIPPETS is a list of snippet definitions, each taking the
@@ -1901,8 +1936,8 @@ 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.
+been `yas--read-lisp'-ed and will eventually be
+`yas--eval-lisp'-ed.
The remaining elements are strings.
@@ -1912,19 +1947,19 @@ 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
+You can use `yas--parse-template' to return such lists based on
the current buffers contents."
- (let ((snippet-table (yas/table-get-create mode))
+ (let ((snippet-table (yas--table-get-create mode))
(template nil))
(dolist (snippet snippets)
- (setq template (yas/define-snippets-1 snippet
+ (setq template (yas-define-snippets-1 snippet
snippet-table)))
template))
-(defun yas/define-snippets-1 (snippet snippet-table)
- "Helper for `yas/define-snippets'."
+(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'.
+ ;; `yas--parse-template'.
;;
(let* ((file (seventh snippet))
(key (car snippet))
@@ -1933,14 +1968,14 @@ the current buffers contents."
(file-name-directory file))))
(condition (fourth snippet))
(group (fifth snippet))
- (keybinding (yas/read-keybinding (eighth 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))))
+ (template (or (gethash uuid (yas--table-uuidhash snippet-table))
+ (yas--make-blank-template))))
;; X) populate the template object
;;
- (yas/populate-template template
+ (yas--populate-template template
:table snippet-table
:key key
:content (second snippet)
@@ -1955,39 +1990,75 @@ the current buffers contents."
;; also will take care of adding the key indicators in the
;; templates menu entry, if any
;;
- (yas/update-template snippet-table template)
+ (yas--update-template snippet-table template)
;; X) Return the template
;;
;;
template))
-(defun yas/snippet-menu-binding-pair-get-create (template &optional type)
+
+;;; Apropos snippet menu:
+;;
+;; The snippet menu keymaps are store by mode in hash table called
+;; `yas--menu-table'. They are linked to the main menu in
+;; `yas--menu-keymap-get-create' and are initially created empty,
+;; reflecting the table hierarchy.
+;;
+;; They can be populated in two mutually exclusive ways: (1) by
+;; reading `yas--template-group', which in turn is populated by the "#
+;; group:" directives of the snippets or the ".yas-make-groups" file
+;; or (2) by using a separate `yas-define-menu' call, which declares a
+;; menu structure based on snippets uuids.
+;;
+;; Both situations are handled in `yas--update-template-menu', which
+;; uses the predicate `yas--template-menu-managed-by-yas-define-menu'
+;; that can tell between the two situations.
+;;
+;; Note:
+;;
+;; * if `yas-define-menu' is used it must run before
+;; `yas-define-snippets' and the UUIDS must match, otherwise we get
+;; duplicate entries. The `yas--template' objects are created in
+;; `yas-define-menu', holding nothing but the menu entry,
+;; represented by a pair of ((menu-item NAME :keys KEYS) TYPE) and
+;; stored in `yas--template-menu-binding-pair'. The (menu-item ...)
+;; part is then stored in the menu keymap itself which make the item
+;; appear to the user. These limitations could probably be revised.
+;;
+;; * The `yas--template-perm-group' slot is only used in
+;; `yas-describe-tables'.
+;;
+(defun yas--template-menu-binding-pair-get-create (template &optional type)
"Get TEMPLATE's menu binding or assign it a new one.
TYPE may be `:stay', signalling this menu binding should be
static in the menu."
- (or (yas/template-menu-binding-pair template)
- (let ((key (yas/template-key template))
- (keybinding (yas/template-keybinding template)))
- (setf (yas/template-menu-binding-pair template)
- (cons `(menu-item ,(or (yas/template-name template)
- (yas/template-uuid template))
- ,(yas/make-menu-binding template)
+ (or (yas--template-menu-binding-pair template)
+ (let ((key (yas--template-key template))
+ (keybinding (yas--template-keybinding template)))
+ (setf (yas--template-menu-binding-pair template)
+ (cons `(menu-item ,(or (yas--template-name template)
+ (yas--template-uuid template))
+ ,(yas--make-menu-binding template)
:keys ,nil)
type)))))
+(defun yas--template-menu-managed-by-yas-define-menu (template)
+ "Non-nil if TEMPLATE's menu entry was included in a `yas-define-menu' call."
+ (cdr (yas--template-menu-binding-pair template)))
-(defun yas/show-menu-p (mode)
- (cond ((eq yas/use-menu 'abbreviate)
+
+(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
+ (yas--table-mode table))
+ (yas--get-snippet-tables))))
+ ((eq yas-use-menu 'full)
+ t)
+ ((eq yas-use-menu t)
t)))
-(defun yas/delete-from-keymap (keymap uuid)
+(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\"
@@ -1999,7 +2070,7 @@ static in the menu."
(mapc #'(lambda (item)
(when (and (listp (cdr item))
(keymapp (third (cdr item))))
- (yas/delete-from-keymap (third (cdr item)) uuid)))
+ (yas--delete-from-keymap (third (cdr item)) uuid)))
(rest keymap))
;; Set the uuid entry to nil
;;
@@ -2012,83 +2083,86 @@ static in the menu."
(null (cdr (third (cdr item)))))))
(rest keymap))))
-(defun yas/define-menu (mode menu omit-items)
+(defun yas-define-menu (mode menu &optional omit-items)
"Define a snippet menu for MODE according to MENU, ommitting OMIT-ITEMS.
MENU is a list, its elements can be:
-- (yas/item UUID) : Creates an entry the snippet identified with
+- (yas-item UUID) : Creates an entry the snippet identified with
UUID. The menu entry for a snippet thus identified is
permanent, i.e. it will never move (be reordered) in the menu.
-- (yas/separator) : Creates a separator
+- (yas-separator) : Creates a separator
-- (yas/submenu NAME SUBMENU) : Creates a submenu with NAME,
+- (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)
+This function does nothing if `yas-use-menu' is nil.
+"
+ (when yas-use-menu
+ (let* ((table (yas--table-get-create mode))
+ (hash (yas--table-uuidhash table)))
+ (yas--define-menu-1 table
+ (yas--menu-keymap-get-create mode)
+ menu
+ hash)
+ (dolist (uuid omit-items)
+ (let ((template (or (gethash uuid hash)
+ (yas--populate-template (puthash uuid
+ (yas--make-blank-template)
+ hash)
+ :table table
+ :uuid uuid))))
+ (setf (yas--template-menu-binding-pair template) (cons nil :none)))))))
+
+(defun yas--define-menu-1 (table menu-keymap menu uuidhash &optional group-list)
(dolist (e (reverse menu))
- (cond ((eq (first e) 'yas/item)
+ (cond ((eq (first e) 'yas-item)
(let ((template (or (gethash (second e) uuidhash)
- (yas/populate-template (puthash (second e)
- (yas/make-blank-template)
+ (yas--populate-template (puthash (second e)
+ (yas--make-blank-template)
uuidhash)
:table table
:perm-group group-list
:uuid (second e)))))
- (define-key keymap (vector (gensym))
- (car (yas/snippet-menu-binding-pair-get-create template :stay)))))
- ((eq (first e) 'yas/submenu)
+ (define-key menu-keymap (vector (gensym))
+ (car (yas--template-menu-binding-pair-get-create template :stay)))))
+ ((eq (first e) 'yas-submenu)
(let ((subkeymap (make-sparse-keymap)))
- (define-key keymap (vector (gensym))
+ (define-key menu-keymap (vector (gensym))
`(menu-item ,(second e) ,subkeymap))
- (yas/define-menu-1 table
+ (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))
+ ((eq (first e) 'yas-separator)
+ (define-key menu-keymap (vector (gensym))
'(menu-item "----")))
(t
- (yas/message 3 "Don't know anything about menu entry %s" (first e))))))
-
-(defun yas/define (mode key template &optional name condition group)
+ (yas--message 3 "Don't know anything about menu entry %s" (first e))))))
+
+(defun yas--define (mode key template &optional name condition group)
"Define a snippet. Expanding KEY into TEMPLATE.
NAME is a description to this template. Also update the menu if
-`yas/use-menu' is `t'. CONDITION is the condition attached to
+`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
+ (yas-define-snippets mode
(list (list key template name condition group))))
-(defun yas/hippie-try-expand (first-time?)
+(defun yas-hippie-try-expand (first-time?)
"Integrate with hippie expand. Just put this function in
`hippie-expand-try-functions-list'."
- (when yas/minor-mode
+ (when yas-minor-mode
(if (not first-time?)
- (let ((yas/fallback-behavior 'return-nil))
- (yas/expand))
+ (let ((yas-fallback-behavior 'return-nil))
+ (yas-expand))
(undo 1)
nil)))
@@ -2098,8 +2172,8 @@ will only be expanded when the condition evaluated to non-nil."
;;;
;;;
;;;
-(defvar yas/condition-cache-timestamp nil)
-(defmacro yas/define-condition-cache (func doc &rest body)
+(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.
@@ -2109,298 +2183,298 @@ It doesn't make any sense to call FUNC programatically."
(stringp doc))
(concat doc
"\n\nFor use in snippets' conditions. Within each
-snippet-expansion routine like `yas/expand', computes actual
+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)
+ (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))
+ (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)
+(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'.
+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."
+object satisfying `yas--field-p' to restrict the expansion to."
(interactive)
- (setq yas/condition-cache-timestamp (current-time))
+ (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)))
+ (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))))
+ (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)
+ (yas--expand-or-prompt-for-template (first templates-and-pos)
(second templates-and-pos)
(third templates-and-pos))
- (yas/fallback 'trigger-key))))
+ (yas--fallback 'trigger-key))))
-(defun yas/expand-from-keymap ()
- "Directly expand some snippets, searching `yas/direct-keymaps'.
+(defun yas-expand-from-keymap ()
+ "Directly expand some snippets, searching `yas--direct-keymaps'.
If expansion fails, execute the previous binding for this key"
(interactive)
- (setq yas/condition-cache-timestamp (current-time))
- (let* ((yas/prefix current-prefix-arg)
+ (setq yas--condition-cache-timestamp (current-time))
+ (let* ((yas--prefix current-prefix-arg)
(vec (subseq (this-command-keys-vector) (if current-prefix-arg
universal-argument-num-events
0)))
(templates (mapcan #'(lambda (table)
- (yas/fetch table vec))
- (yas/get-snippet-tables))))
+ (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)))))
+ (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)
+(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)))
+`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)
+ (when yas--current-template
+ (yas-expand-snippet (yas--template-content yas--current-template)
start
end
- (yas/template-expand-env yas/current-template)))))
+ (yas--template-expand-env yas--current-template)))))
-(defun yas/fallback (&optional from-trigger-key-p)
+(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)
+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)
+ ((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
+ (keys-2 (and yas-trigger-key
from-trigger-key-p
- (stringp yas/trigger-key)
- (read-kbd-macro yas/trigger-key)))
+ (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.
+ ;; yas-expand* calls.
(command (or (and (symbolp command-1)
- (not (string-match "yas/expand" (symbol-name 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))))
+ (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)))))
+ ((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
+;;; Utils for snippet development:
-(defun yas/all-templates (tables)
+(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))))
+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))))
+ (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))
+ (yas--fetch table key))
tables)))
- (remove-duplicates (mapcan #'yas/table-templates tables)
+ (remove-duplicates (mapcan #'yas--table-templates tables)
:test #'equal))))
-(defun yas/insert-snippet (&optional no-condition)
+(defun yas-insert-snippet (&optional no-condition)
"Choose a snippet to expand, pop-up a list of choices according
-to `yas/prompt-function'.
+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
+ (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
+ 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))
+ (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)
+ (if yas--current-template
+ (yas-expand-snippet (yas--template-content yas--current-template)
(car where)
(cdr where)
- (yas/template-expand-env yas/current-template))
- (yas/message 3 "No snippets can be inserted here!"))))
+ (yas--template-expand-env yas--current-template))
+ (yas--message 3 "No snippets can be inserted here!"))))
-(defun yas/visit-snippet-file ()
- "Choose a snippet to edit, selection like `yas/insert-snippet'.
+(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))
+ (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
+ (or (yas--prompt-for-template templates
"Choose a snippet template to edit: ")
(car templates)))))
(if template
- (yas/visit-snippet-file-1 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)))
+(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))
+ (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)))
+ (switch-to-buffer (format "*%s*"(yas--template-name template)))
(let ((type 'snippet))
- (when (listp (yas/template-content template))
+ (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 (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))))
+ (pp-to-string (yas--template-content template))
+ (yas--template-content template))))
(snippet-mode)
- (set (make-local-variable 'yas/editing-template) template)))))
+ (set (make-local-variable 'yas--editing-template) template)))))
-(defun yas/guess-snippet-directories-1 (table)
+(defun yas--guess-snippet-directories-1 (table)
"Guesses possible snippet subdirectories for TABLE."
- (cons (yas/table-name table)
+ (cons (yas--table-name table)
(mapcan #'(lambda (parent)
- (yas/guess-snippet-directories-1
+ (yas--guess-snippet-directories-1
parent))
- (yas/table-parents table))))
+ (yas--table-parents table))))
-(defun yas/guess-snippet-directories (&optional 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
+`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")))))))
+ (or (first (or (yas-snippet-dirs)
+ (setq yas-snippet-dirs '("~/.emacs.d/snippets")))))))
(tables (or (and table
(list table))
- (yas/get-snippet-tables))))
+ (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)
+ (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))))
+ (yas--guess-snippet-directories-1 table))))
tables)))
-(defun yas/make-directory-maybe (table-and-dirs &optional main-table-string)
+(defun yas--make-directory-maybe (table-and-dirs &optional main-table-string)
"Returns a dir inside TABLE-AND-DIRS, prompts for creation if none exists."
(or (some #'(lambda (dir) (when (file-directory-p dir) dir)) (cdr table-and-dirs))
(let ((candidate (first (cdr table-and-dirs))))
(unless (file-writable-p (file-name-directory candidate))
- (error (yas/format "%s is not writable." candidate)))
+ (error (yas--format "%s is not writable." candidate)))
(if (y-or-n-p (format "Guessed directory (%s) for%s%s table \"%s\" does not exist! Create? "
candidate
- (if (gethash (intern (yas/table-name (car table-and-dirs)))
- yas/tables)
+ (if (gethash (yas--table-mode (car table-and-dirs))
+ yas--tables)
""
" brand new")
(or main-table-string
"")
- (yas/table-name (car table-and-dirs))))
+ (yas--table-name (car table-and-dirs))))
(progn
(make-directory candidate 'also-make-parents)
;; create the .yas-parents file here...
candidate)))))
-(defun yas/new-snippet (&optional no-template)
+(defun yas-new-snippet (&optional no-template)
"Pops a new buffer for writing a snippet.
Expands a snippet-writing snippet, unless the optional prefix arg
NO-TEMPLATE is non-nil."
(interactive "P")
- (let ((guessed-directories (yas/guess-snippet-directories)))
+ (let ((guessed-directories (yas--guess-snippet-directories)))
(switch-to-buffer "*new snippet*")
(erase-buffer)
(kill-all-local-variables)
(snippet-mode)
- (yas/minor-mode 1)
- (set (make-local-variable 'yas/guessed-modes) (mapcar #'(lambda (d)
- (intern (yas/table-name (car d))))
+ (yas-minor-mode 1)
+ (set (make-local-variable 'yas--guessed-modes) (mapcar #'(lambda (d)
+ (yas--table-mode (car d)))
guessed-directories))
- (unless no-template (yas/expand-snippet "\
+ (unless no-template (yas-expand-snippet "\
# -*- mode: snippet -*-
# name: $1
-# key: ${2:${1:$(replace-regexp-in-string \"\\\\\\\\(\\\\\\\\w+\\\\\\\\).*\" \"\\\\\\\\1\" yas/text)}}${3:
+# key: ${2:${1:$(replace-regexp-in-string \"\\\\\\\\(\\\\\\\\w+\\\\\\\\).*\" \"\\\\\\\\1\" yas-text)}}${3:
# binding: ${4:direct-keybinding}}${5:
# expand-env: ((${6:some-var} ${7:some-value}))}${8:
# type: command}
# --
$0"))))
-(defun yas/compute-major-mode-and-parents (file)
+(defun yas--compute-major-mode-and-parents (file)
"Given FILE, find the nearest snippet directory for a given
mode, then return a list (MODE-SYM PARENTS), the mode's symbol and a list
representing one or more of the mode's parents.
@@ -2429,144 +2503,145 @@ neither do the elements of PARENTS."
(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--editing-template nil
+ "Supporting variable for `yas-load-snippet-buffer' and `yas--visit-snippet'")
-(defvar yas/current-template nil
+(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'.")
+(defvar yas--guessed-modes nil
+ "List of guessed modes supporting `yas-load-snippet-buffer'.")
-(defun yas/load-snippet-buffer (&optional kill)
+(defun yas-load-snippet-buffer (&optional kill)
"Parse and load current buffer's snippet definition.
With optional prefix argument KILL quit the window and buffer."
(interactive "P")
(cond
- ;; We have `yas/editing-template', this buffer's
+ ;; 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'
+ (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))))
+ (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
+ (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)
+ (if yas--guessed-modes
+ (first yas--guessed-modes)
"nothing"))
- (mapcar #'symbol-name yas/guessed-modes)
+ (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)
+ (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 iff:
+ ;; Now, offer to save this iff:
;;
- ;; 1) `yas/snippet-dirs' is a list and its first element does not
+ ;; 1) `yas-snippet-dirs' is a list and its first element does not
;; match this template's file (i.e. this is a library snippet, not
;; a user snippet) OR
;;
- ;; 2) yas/editing-template comes from a file that we cannot write to...
+ ;; 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 (or (not (yas--template-file yas--editing-template))
+ (not (file-writable-p (yas--template-file yas--editing-template)))
+ (and (listp yas-snippet-dirs)
+ (second yas-snippet-dirs)
+ (not (string-match (expand-file-name (first yas-snippet-dirs))
+ (yas--template-file yas--editing-template)))))
- (when (y-or-n-p (yas/format "Looks like a library or new snippet. Save to new file? "))
- (let* ((option (first (yas/guess-snippet-directories (yas/template-table yas/editing-template))))
+ (when (y-or-n-p (yas--format "Looks like a library or new snippet. Save to new file? "))
+ (let* ((option (first (yas--guess-snippet-directories (yas--template-table yas--editing-template))))
(chosen (and option
- (yas/make-directory-maybe option))))
+ (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))))
+ (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))))))
+ (setf (yas--template-file yas--editing-template) buffer-file-name))))))
(when kill
(quit-window kill))
- (yas/message 3 "Snippet \"%s\" loaded for %s."
- (yas/template-name yas/editing-template)
- (yas/table-name (yas/template-table yas/editing-template))))
+ (yas--message 3 "Snippet \"%s\" loaded for %s."
+ (yas--template-name yas--editing-template)
+ (yas--table-name (yas--template-table yas--editing-template))))
-(defun yas/tryout-snippet (&optional debug)
+(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))
+ (let* ((major-mode-and-parent (yas--compute-major-mode-and-parents buffer-file-name))
+ (parsed (yas--parse-template))
(test-mode (or (and (car major-mode-and-parent)
(fboundp (car major-mode-and-parent))
(car major-mode-and-parent))
- (first yas/guessed-modes)
- (intern (read-from-minibuffer (yas/format "Please input a mode: ")))))
- (yas/current-template
+ (first yas--guessed-modes)
+ (intern (read-from-minibuffer (yas--format "Please input a mode: ")))))
+ (yas--current-template
(and parsed
(fboundp test-mode)
- (yas/populate-template (yas/make-blank-template)
+ (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))))
+ (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-minor-mode 1)
(setq buffer-read-only nil)
- (yas/expand-snippet (yas/template-content yas/current-template)
+ (yas-expand-snippet (yas--template-content yas--current-template)
(point-min)
(point-max)
- (yas/template-expand-env yas/current-template))
+ (yas--template-expand-env yas--current-template))
(when (and debug
(require 'yasnippet-debug nil t))
- (add-hook 'post-command-hook 'yas/debug-snippet-vars nil t))))
+ (add-hook 'post-command-hook 'yas-debug-snippet-vars nil t))))
(t
- (yas/message 3 "Cannot test snippet for unknown major mode")))))
+ (yas--message 3 "Cannot test snippet for unknown major mode")))))
-(defun yas/template-fine-group (template)
- (car (last (or (yas/template-group template)
- (yas/template-perm-group template)))))
+(defun yas--template-fine-group (template)
+ (car (last (or (yas--template-group template)
+ (yas--template-perm-group template)))))
-(defun yas/describe-tables (&optional choose)
+(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))
+ (active-tables (yas--get-snippet-tables))
(remain-tables (let ((all))
(maphash #'(lambda (k v)
(unless (find v active-tables)
(push v all)))
- yas/tables)
+ yas--tables)
all))
(table-lists (list active-tables remain-tables))
(original-buffer (current-buffer))
(continue t)
- (yas/condition-cache-timestamp (current-time)))
+ (yas--condition-cache-timestamp (current-time)))
(with-current-buffer buffer
(setq buffer-read-only nil)
(erase-buffer)
@@ -2575,68 +2650,68 @@ With optional prefix argument KILL quit the window and buffer."
(while (and table-lists
continue)
(dolist (table (car table-lists))
- (yas/describe-pretty-table table original-buffer))
+ (yas--describe-pretty-table table original-buffer))
(setq table-lists (cdr table-lists))
(when table-lists
- (yas/create-snippet-xrefs)
+ (yas--create-snippet-xrefs)
(display-buffer buffer)
(setq continue (and choose (y-or-n-p "Show also non-active tables? ")))))
- (yas/create-snippet-xrefs)
+ (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)))
+ (insert (format "\nSnippet table `%s':\n\n" (yas--table-name table)))
(let ((keys))
(maphash #'(lambda (k v)
(push k keys))
- (yas/table-hash table))
+ (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)))
+ (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)
+(defun yas--describe-pretty-table (table &optional original-buffer)
(insert (format "\nSnippet table `%s'"
- (yas/table-name table)))
- (if (yas/table-parents table)
+ (yas--table-name table)))
+ (if (yas--table-parents table)
(insert (format " parents: %s\n"
- (mapcar #'yas/table-name
- (yas/table-parents table))))
+ (mapcar #'yas--table-name
+ (yas--table-parents table))))
(insert "\n"))
(insert (make-string 100 ?-) "\n")
(insert "group state name key binding\n")
(let ((groups-hash (make-hash-table :test #'equal)))
(maphash #'(lambda (k v)
- (let ((group (or (yas/template-fine-group v)
+ (let ((group (or (yas--template-fine-group v)
"(top level)")))
- (when (yas/template-name v)
+ (when (yas--template-name v)
(puthash group
(cons v (gethash group groups-hash))
groups-hash))))
- (yas/table-uuidhash table))
+ (yas--table-uuidhash table))
(maphash
#'(lambda (group templates)
(setq group (truncate-string-to-width group 25 0 ? "..."))
(insert (make-string 100 ?-) "\n")
(dolist (p templates)
- (let ((name (truncate-string-to-width (propertize (format "\\\\snippet `%s'" (yas/template-name p))
+ (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)))
+ (condition-string (let ((condition (yas--template-condition p)))
(if (and condition
original-buffer)
(with-current-buffer original-buffer
- (if (yas/eval-condition condition)
+ (if (yas--eval-condition condition)
"(y)"
"(s)"))
"(a)"))))
@@ -2647,9 +2722,9 @@ With optional prefix argument KILL quit the window and buffer."
"'"
" ")
" ")
- (insert (truncate-string-to-width (or (yas/template-key p) "")
+ (insert (truncate-string-to-width (or (yas--template-key p) "")
15 0 ? "...") " ")
- (insert (truncate-string-to-width (key-description (yas/template-keybinding p))
+ (insert (truncate-string-to-width (key-description (yas--template-keybinding p))
15 0 ? "...") " ")
(insert "\n"))))
groups-hash)))
@@ -2658,16 +2733,16 @@ With optional prefix argument KILL quit the window and buffer."
;;; User convenience functions, for using in snippet definitions
-(defvar yas/modified-p nil
+(defvar yas-modified-p nil
"Non-nil if field has been modified by user or transformation.")
-(defvar yas/moving-away-p nil
+(defvar yas-moving-away-p nil
"Non-nil if user is about to exit field.")
-(defvar yas/text nil
+(defvar yas-text nil
"Contains current field text.")
-(defun yas/substr (str pattern &optional subexp)
+(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
@@ -2678,107 +2753,113 @@ If found, the content of subexp group SUBEXP (default 0) is
(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)
+(defun yas-choose-avalue (&rest possibilities)
+ "Prompt for a string in POSSIBILITIES and return it.
+
+The last element of POSSIBILITIES may be a list of strings."
+ (unless (or yas-moving-away-p
+ yas-modified-p)
+ (setq possibilities (nreverse possibilities))
+ (setq possibilities (if (listp (car possibilities))
+ (append (reverse (car possibilities)) (rest possibilities))
+ possibilities))
(some #'(lambda (fn)
(funcall fn "Choose: " possibilities))
- yas/prompt-functions)))
+ yas-prompt-functions)))
-(defun yas/key-to-value (alist)
+(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)
+ (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-throw (text)
+ "Throw a yas--exception with TEXT as the reason."
+ (throw 'yas--exception (cons 'yas--exception text)))
-(defun yas/verify-value (possibilities)
+(defun yas-verify-value (possibilities)
"Verify that the current field value is in POSSIBILITIES
Otherwise throw exception."
- (when (and yas/moving-away-p (notany #'(lambda (pos) (string= pos yas/text)) possibilities))
- (yas/throw (yas/format "Field only allows %s" possibilities))))
+ (when (and yas-moving-away-p (notany #'(lambda (pos) (string= pos yas-text)) possibilities))
+ (yas-throw (yas--format "Field only allows %s" possibilities))))
-(defun yas/field-value (number)
+(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)))
+ (let* ((snippet (car (yas--snippets-at-point)))
(field (and snippet
- (yas/snippet-find-field snippet number))))
+ (yas--snippet-find-field snippet number))))
(when field
- (yas/field-text-for-display 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-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-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
+(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))))
+ (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-default-from-field (number)
+ (unless yas-modified-p
+ (yas-field-value number)))
-(defun yas/inside-string ()
+(defun yas-inside-string ()
(equal 'font-lock-string-face (get-char-property (1- (point)) 'face)))
-(defun yas/unimplemented (&optional missing-feature)
- (if yas/current-template
+(defun yas-unimplemented (&optional missing-feature)
+ (if yas--current-template
(if (y-or-n-p (format "This snippet is unimplemented (missing %s) Visit the snippet definition? "
(or missing-feature
"something")))
- (yas/visit-snippet-file-1 yas/current-template))
+ (yas--visit-snippet-file-1 yas--current-template))
(message "No implementation. Missing %s" (or missing-feature "something"))))
;;; Snippet expansion and field management
-(defvar yas/active-field-overlay nil
+(defvar yas--active-field-overlay nil
"Overlays the currently active field.")
-(defvar yas/field-protection-overlays nil
+(defvar yas--field-protection-overlays nil
"Two overlays protect the current active field ")
-(defconst yas/prefix nil
+(defconst yas--prefix nil
"A prefix argument for expansion direct from keybindings")
-(defvar yas/selected-text nil
+(defvar yas-selected-text nil
"The selected region deleted on the last snippet expansion.")
-(defvar yas/start-column nil
+(defvar yas--start-column nil
"The column where the snippet expansion started.")
-(make-variable-buffer-local 'yas/active-field-overlay)
-(make-variable-buffer-local 'yas/field-protection-overlays)
-(put 'yas/active-field-overlay 'permanent-local t)
-(put 'yas/field-protection-overlays 'permanent-local t)
+(make-variable-buffer-local 'yas--active-field-overlay)
+(make-variable-buffer-local 'yas--field-protection-overlays)
+(put 'yas--active-field-overlay 'permanent-local t)
+(put 'yas--field-protection-overlays 'permanent-local t)
-(defstruct (yas/snippet (:constructor yas/make-snippet ()))
+(defstruct (yas--snippet (:constructor yas--make-snippet ()))
"A snippet.
..."
(fields '())
(exit nil)
- (id (yas/snippet-next-id) :read-only t)
+ (id (yas--snippet-next-id) :read-only t)
(control-overlay nil)
active-field
;; stacked expansion: the `previous-active-field' slot saves the
@@ -2786,7 +2867,7 @@ Use this in primary and mirror transformations to tget."
previous-active-field
force-exit)
-(defstruct (yas/field (:constructor yas/make-field (number start end parent-field)))
+(defstruct (yas--field (:constructor yas--make-field (number start end parent-field)))
"A field."
number
start end
@@ -2796,42 +2877,42 @@ Use this in primary and mirror transformations to tget."
(modified-p nil)
next)
-(defstruct (yas/mirror (:constructor yas/make-mirror (start end transform)))
+(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)))
+(defstruct (yas--exit (:constructor yas--make-exit (marker)))
marker
next)
-(defun yas/apply-transform (field-or-mirror field &optional empty-on-nil-p)
+(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)))
+ (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)))
+ (let ((ret (yas--eval-lisp transform)))
(or ret (and empty-on-nil-p "")))))))
transformed))
-(defsubst yas/replace-all (from to &optional text)
+(defsubst yas--replace-all (from to &optional text)
"Replace all occurance from FROM to TO.
With optional string TEXT do it in that string."
@@ -2841,23 +2922,23 @@ With optional string TEXT do it in that string."
(while (search-forward from nil t)
(replace-match to t t text))))
-(defun yas/snippet-find-field (snippet number)
+(defun yas--snippet-find-field (snippet number)
(find-if #'(lambda (field)
- (eq number (yas/field-number field)))
- (yas/snippet-fields snippet)))
+ (eq number (yas--field-number field)))
+ (yas--snippet-fields snippet)))
-(defun yas/snippet-sort-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)))
+ (setf (yas--snippet-fields snippet)
+ (sort (yas--snippet-fields snippet)
+ #'yas--snippet-field-compare)))
-(defun yas/snippet-field-compare (field1 field2)
+(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)))
+ (let ((n1 (yas--field-number field1))
+ (n2 (yas--field-number field2)))
(if n1
(if n2
(or (zerop n2) (and (not (zerop n1))
@@ -2865,237 +2946,237 @@ have, compare through the field's start point"
(not (zerop n1)))
(if n2
(zerop n2)
- (< (yas/field-start field1)
- (yas/field-start field2))))))
+ (< (yas--field-start field1)
+ (yas--field-start field2))))))
-(defun yas/field-probably-deleted-p (snippet field)
+(defun yas--field-probably-deleted-p (snippet field)
"Guess if SNIPPET's FIELD should be skipped."
(and
;; field must be zero lentgh
;;
- (zerop (- (yas/field-start field) (yas/field-end field)))
+ (zerop (- (yas--field-start field) (yas--field-end field)))
;; skip if:
(or
;; 1) is a nested field and it's been modified
;;
- (and (yas/field-parent-field field)
- (yas/field-modified-p field))
+ (and (yas--field-parent-field field)
+ (yas--field-modified-p field))
;; 2) ends just before the snippet end
;;
- (and (eq field (car (last (yas/snippet-fields snippet))))
- (= (yas/field-start field) (overlay-end (yas/snippet-control-overlay snippet)))))
+ (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)))))
+ (not (zerop (yas--field-number field)))))
-(defun yas/snippets-at-point (&optional all-snippets)
+(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))
+ (overlay-get ov 'yas--snippet))
(if all-snippets
(overlays-in (point-min) (point-max))
(nconc (overlays-at (point)) (overlays-at (1- (point))))))))
#'(lambda (s1 s2)
- (<= (yas/snippet-id s2) (yas/snippet-id s1)))))
+ (<= (yas--snippet-id s2) (yas--snippet-id s1)))))
-(defun yas/next-field-or-maybe-expand ()
+(defun yas-next-field-or-maybe-expand ()
"Try to expand a snippet at a key before point, otherwise
-delegate to `yas/next-field'."
+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)))
+ (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)))
+ (unless (yas-expand-from-trigger-key active-field)
+ (yas-next-field))))
+ (yas-next-field)))
-(defun yas/next-field (&optional arg)
+(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))
+ (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)))
+ (yas--field-probably-deleted-p snippet field)))
+ (yas--snippet-fields snippet)))
(active-field-pos (position active-field live-fields))
(target-pos (and active-field-pos (+ arg active-field-pos)))
(target-field (and target-pos (nth target-pos live-fields))))
;; First check if we're moving out of a field with a transform
;;
(when (and active-field
- (yas/field-transform active-field))
- (let* ((yas/moving-away-p t)
- (yas/text (yas/field-text-for-display active-field))
- (text yas/text)
- (yas/modified-p (yas/field-modified-p active-field)))
+ (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))))
+ (yas--eval-lisp (yas--field-transform active-field))))
;; Now actually move...
(cond ((and target-pos (>= target-pos (length live-fields)))
- (yas/exit-snippet snippet))
+ (yas-exit-snippet snippet))
(target-field
- (yas/move-to-field snippet target-field))
+ (yas--move-to-field snippet target-field))
(t
nil))))
-(defun yas/place-overlays (snippet field)
+(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))
+ (yas--make-move-field-protection-overlays snippet field)
+ (yas--make-move-active-field-overlay snippet field))
-(defun yas/move-to-field (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)))
+ (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)
+ (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)
+ (setf (yas--snippet-active-field snippet) field)
;; primary field transform: first call to snippet transform
- (unless (yas/field-modified-p field)
- (if (yas/field-update-display field snippet)
- (yas/update-mirrors snippet)
- (setf (yas/field-modified-p field) nil))))))
+ (unless (yas--field-modified-p field)
+ (if (yas--field-update-display field snippet)
+ (yas--update-mirrors snippet)
+ (setf (yas--field-modified-p field) nil))))))
-(defun yas/prev-field ()
+(defun yas-prev-field ()
"Navigate to prev field. If there's none, exit the snippet."
(interactive)
- (yas/next-field -1))
+ (yas-next-field -1))
-(defun yas/abort-snippet (&optional snippet)
+(defun yas-abort-snippet (&optional snippet)
(interactive)
(let ((snippet (or snippet
- (car (yas/snippets-at-point)))))
+ (car (yas--snippets-at-point)))))
(when snippet
- (setf (yas/snippet-force-exit snippet) t))))
+ (setf (yas--snippet-force-exit snippet) t))))
-(defun yas/exit-snippet (snippet)
+(defun yas-exit-snippet (snippet)
"Goto exit-marker of SNIPPET."
- (interactive (list (first (yas/snippets-at-point))))
+ (interactive (list (first (yas--snippets-at-point))))
(when snippet
- (setf (yas/snippet-force-exit snippet) t)
- (goto-char (if (yas/snippet-exit snippet)
- (yas/exit-marker (yas/snippet-exit snippet))
- (overlay-end (yas/snippet-control-overlay snippet))))))
+ (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 ()
+(defun yas-exit-all-snippets ()
"Exit all snippets."
(interactive)
(mapc #'(lambda (snippet)
- (yas/exit-snippet snippet)
- (yas/check-commit-snippet))
- (yas/snippets-at-point 'all-snippets)))
+ (yas-exit-snippet snippet)
+ (yas--check-commit-snippet))
+ (yas--snippets-at-point 'all-snippets)))
-;;; Some low level snippet-routines
+;;; Some low level snippet-routines:
-(defmacro yas/inhibit-overlay-hooks (&rest body)
- "Run BODY with `yas/inhibit-overlay-hooks' set to t."
+(defmacro yas--inhibit-overlay-hooks (&rest body)
+ "Run BODY with `yas--inhibit-overlay-hooks' set to t."
(declare (indent 0))
- `(let ((yas/inhibit-overlay-hooks t))
+ `(let ((yas--inhibit-overlay-hooks t))
(progn ,@body)))
-(defvar yas/snippet-beg nil "Beginning position of the last snippet commited.")
-(defvar yas/snippet-end nil "End position of the last snippet commited.")
+(defvar yas-snippet-beg nil "Beginning position of the last snippet commited.")
+(defvar yas-snippet-end nil "End position of the last snippet commited.")
-(defun yas/commit-snippet (snippet)
+(defun yas--commit-snippet (snippet)
"Commit SNIPPET, but leave point as it is. This renders the
snippet as ordinary text."
- (let ((control-overlay (yas/snippet-control-overlay snippet)))
+ (let ((control-overlay (yas--snippet-control-overlay snippet)))
;;
;; Save the end of the moribund snippet in case we need to revive it
;; its original expansion.
;;
(when (and control-overlay
(overlay-buffer control-overlay))
- (setq yas/snippet-beg (overlay-start control-overlay))
- (setq yas/snippet-end (overlay-end control-overlay))
+ (setq yas-snippet-beg (overlay-start control-overlay))
+ (setq yas-snippet-end (overlay-end control-overlay))
(delete-overlay control-overlay))
- (yas/inhibit-overlay-hooks
- (when yas/active-field-overlay
- (delete-overlay yas/active-field-overlay))
- (when yas/field-protection-overlays
- (mapc #'delete-overlay yas/field-protection-overlays)))
+ (yas--inhibit-overlay-hooks
+ (when yas--active-field-overlay
+ (delete-overlay yas--active-field-overlay))
+ (when yas--field-protection-overlays
+ (mapc #'delete-overlay yas--field-protection-overlays)))
;; stacked expansion: if the original expansion took place from a
;; field, make sure we advance it here at least to
- ;; `yas/snippet-end'...
+ ;; `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)))
+ (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)
+ (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)
+ (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)))
+ ;; again from `yas--take-care-of-redo'....
+ (setf (yas--snippet-fields snippet) nil)))
- (yas/message 3 "Snippet %s exited." (yas/snippet-id snippet)))
+ (yas--message 3 "Snippet %s exited." (yas--snippet-id snippet)))
-(defun yas/safely-run-hooks (hook-var)
+(defun yas--safely-run-hooks (hook-var)
(condition-case error
(run-hooks hook-var)
(error
- (yas/message 3 "%s error: %s" hook-var (error-message-string error)))))
+ (yas--message 3 "%s error: %s" hook-var (error-message-string error)))))
-(defun yas/check-commit-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))
+ (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))
+ (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))))
+ (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))
+ (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))))
+ (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)))
+ (yas--move-to-field snippet active-field)
+ (yas--update-mirrors snippet)))
(t
nil))))
(unless (or (null snippets) snippets-left)
(if snippet-exit-transform
- (yas/eval-lisp-no-saves snippet-exit-transform))
- (yas/safely-run-hooks 'yas/after-exit-snippet-hook))))
+ (yas--eval-lisp-no-saves snippet-exit-transform))
+ (yas--safely-run-hooks 'yas-after-exit-snippet-hook))))
;; Apropos markers-to-points:
;;
@@ -3109,65 +3190,65 @@ snippet, if so cleans up the whole snippet up."
;; This shouldn't bring horrible problems with undo/redo, but it
;; you never know
;;
-(defun yas/markers-to-points (snippet)
+(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)))
+ (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)))))))
+ (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)
+(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)))
+ (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)))))))
+ (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)
+(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)))))
+ (and (>= point (yas--field-start field))
+ (<= point (yas--field-end field)))))
-(defun yas/field-text-for-display (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)))
+ (buffer-substring (yas--field-start field) (yas--field-end field)))
-(defun yas/undo-in-progress ()
+(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)
+(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
@@ -3175,108 +3256,108 @@ holds the keymap."
nil
nil
t)))
- (overlay-put overlay 'keymap yas/keymap)
+ (overlay-put overlay 'keymap yas-keymap)
(overlay-put overlay 'priority 100)
- (overlay-put overlay 'yas/snippet snippet)
+ (overlay-put overlay 'yas--snippet snippet)
overlay))
-(defun yas/skip-and-clear-or-delete-char (&optional field)
+(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)))))
+ (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))
+ (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)
+(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)))
+ (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)))
+(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)))))
+ (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)
+(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)
+ (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))))
+ (overlay-put yas--active-field-overlay 'priority 100)
+ (overlay-put yas--active-field-overlay 'face 'yas-field-highlight-face)
+ (overlay-put yas--active-field-overlay 'yas--snippet snippet)
+ (overlay-put yas--active-field-overlay 'modification-hooks '(yas--on-field-overlay-modification))
+ (overlay-put yas--active-field-overlay 'insert-in-front-hooks
+ '(yas--on-field-overlay-modification))
+ (overlay-put yas--active-field-overlay 'insert-behind-hooks
+ '(yas--on-field-overlay-modification))))
-(defvar yas/inhibit-overlay-hooks nil
- "Bind this temporarity to non-nil to prevent running `yas/on-*-modification'.")
+(defvar yas--inhibit-overlay-hooks nil
+ "Bind this temporarity to non-nil to prevent running `yas--on-*-modification'.")
-(defun yas/on-field-overlay-modification (overlay after? beg end &optional length)
+(defun yas--on-field-overlay-modification (overlay after? beg end &optional length)
"Clears the field and updates mirrors, conditionally.
Only clears the field if it hasn't been modified and it point it
at field start. This hook doesn't do anything if an undo is in
progress."
- (unless (or yas/inhibit-overlay-hooks
- (yas/undo-in-progress))
- (let* ((field (overlay-get overlay 'yas/field))
- (number (and field (yas/field-number field)))
- (snippet (overlay-get yas/active-field-overlay 'yas/snippet)))
+ (unless (or yas--inhibit-overlay-hooks
+ (yas--undo-in-progress))
+ (let* ((field (overlay-get overlay 'yas--field))
+ (number (and field (yas--field-number field)))
+ (snippet (overlay-get yas--active-field-overlay 'yas--snippet)))
(cond (after?
- (yas/advance-end-maybe field (overlay-end overlay))
+ (yas--advance-end-maybe field (overlay-end overlay))
(save-excursion
- (yas/field-update-display field snippet))
- (yas/update-mirrors snippet))
+ (yas--field-update-display field snippet))
+ (yas--update-mirrors snippet))
(field
(when (and (not after?)
- (not (yas/field-modified-p field))
- (eq (point) (if (markerp (yas/field-start field))
- (marker-position (yas/field-start field))
- (yas/field-start field))))
- (yas/skip-and-clear field))
- (setf (yas/field-modified-p field) t))))))
+ (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'.
+;; `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.
+;; 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'
@@ -3284,13 +3365,12 @@ progress."
;; blocks all other million modification hooks. This presented some
;; problems with stacked expansion.
;;
-
-(defun yas/make-move-field-protection-overlays (snippet field)
+(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)))
+ (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
@@ -3298,94 +3378,98 @@ Move the overlays, or create them if they do not exit."
;;
(when (< (buffer-size) end)
(save-excursion
- (yas/inhibit-overlay-hooks
+ (yas--inhibit-overlay-hooks
(goto-char (point-max))
(newline))))
;; go on to normal overlay creation/moving
;;
- (cond ((and yas/field-protection-overlays
- (every #'overlay-buffer yas/field-protection-overlays))
- (move-overlay (first yas/field-protection-overlays) (1- start) start)
- (move-overlay (second yas/field-protection-overlays) end (1+ end)))
+ (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
+ (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)
+ (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)))))))
+ (overlay-put ov 'modification-hooks '(yas--on-protection-overlay-modification)))))))
-(defvar yas/protection-violation nil
+(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
+`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)
+(defun yas--on-protection-overlay-modification (overlay after? beg end &optional length)
"Signals a snippet violation, then issues error.
The error should be ignored in `debug-ignored-errors'"
- (unless yas/inhibit-overlay-hooks
+ (unless yas--inhibit-overlay-hooks
(cond ((not (or after?
- (yas/undo-in-progress)))
- (setq yas/protection-violation (point))
+ (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:
+;; Snippet expansion and "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
+;; Stacked expansion is when you try to expand a snippet when already
+;; inside a snippet expansion.
+;;
+;; The parent snippet does not run its fields modification hooks
+;; (`yas--on-field-overlay-modification' and
+;; `yas--on-protection-overlay-modification') while the child snippet
;; is active. This means, among other things, that the mirrors of the
;; parent snippet are not updated, this only happening when one exits
;; the child snippet.
;;
;; Unfortunately, this also puts some ugly (and not fully-tested)
-;; bits of code in `yas/expand-snippet' and
-;; `yas/commit-snippet'. I've tried to mark them with "stacked
+;; 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
+;; `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)
+(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))
+ (run-hooks 'yas-before-expand-snippet-hook)
;;
- (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))
+ (let* ((yas-selected-text (or yas-selected-text
+ (and (region-active-p)
+ (buffer-substring-no-properties (region-beginning)
+ (region-end)))))
+ (start (or start
+ (and (region-active-p)
+ (region-beginning))
+ (point)))
+ (end (or end
+ (and (region-active-p)
+ (region-end))
+ (point)))
+ (to-delete (and start
+ end
+ (buffer-substring-no-properties start end)))
+ snippet)
+ (goto-char start)
+ (setq yas--indent-original-column (current-column))
;; Delete the region to delete, this *does* get undo-recorded.
;;
(when (and to-delete
@@ -3395,7 +3479,7 @@ considered when expanding the snippet."
(cond ((listp content)
;; x) This is a snippet-command
;;
- (yas/eval-lisp-no-saves content))
+ (yas--eval-lisp-no-saves content))
(t
;; x) This is a snippet-snippet :-)
;;
@@ -3413,68 +3497,68 @@ considered when expanding the snippet."
;; might generate errors, so we have to be ready to catch
;; them mostly to make the undo information
;;
- (setq yas/start-column (save-restriction (widen) (current-column)))
- (yas/inhibit-overlay-hooks
+ (setq yas--start-column (save-restriction (widen) (current-column)))
+ (yas--inhibit-overlay-hooks
(setq snippet
(if expand-env
(eval `(let* ,expand-env
(insert content)
- (yas/snippet-create (point-min) (point-max))))
+ (yas--snippet-create (point-min) (point-max))))
(insert content)
- (yas/snippet-create (point-min) (point-max)))))))
+ (yas--snippet-create (point-min) (point-max)))))))
;; stacked-expansion: This checks for stacked expansion, save the
- ;; `yas/previous-active-field' and advance its boudary.
+ ;; `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))))
+ (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))))
+ (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))
+ (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
+ ;; `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
+ ;; 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))))
+ (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)
+ (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))))
+ (let ((first-field (car (yas--snippet-fields snippet))))
(when first-field
(sit-for 0) ;; fix issue 125
- (yas/move-to-field snippet first-field)))
- (yas/message 3 "snippet expanded.")
+ (yas--move-to-field snippet first-field)))
+ (yas--message 3 "snippet expanded.")
t))))
-(defun yas/take-care-of-redo (beg end snippet)
+(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)))
+ (when (yas--snippet-fields snippet)
+ (yas--commit-snippet snippet)))
-(defun yas/snippet-revive (beg end snippet)
+(defun yas--snippet-revive (beg end snippet)
"Revives the SNIPPET and creates a control overlay from BEG to
END.
@@ -3482,39 +3566,39 @@ 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
+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)
+ (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)))))
+ (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)
+ (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)
+ (yas--move-to-field snippet target-field)
- (push `(apply yas/take-care-of-redo ,beg ,end ,snippet)
+ (push `(apply yas--take-care-of-redo ,beg ,end ,snippet)
buffer-undo-list))))
-(defun yas/snippet-create (begin end)
+(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)))
+ (let ((snippet (yas--make-snippet)))
(goto-char begin)
- (yas/snippet-parse-create snippet)
+ (yas--snippet-parse-create snippet)
;; Sort and link each field
- (yas/snippet-sort-fields snippet)
+ (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)))
+ (setf (yas--snippet-control-overlay snippet)
+ (yas--make-control-overlay snippet (point-min) (point-max)))
;; Move to end
(goto-char (point-max))
@@ -3528,11 +3612,11 @@ Returns the newly created snippet."
;; 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.
+;; fields-or-mirrors-or-exit (which I have abbreviated to "fom")
+;; according to their original positions in the buffer.
;;
-;; Then we have operation `yas/advance-end-maybe' and
-;; `yas/advance-start-maybe', which conditionally push the starts and
+;; 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 ",":
@@ -3540,71 +3624,71 @@ Returns the newly created snippet."
;; 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))
+(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))))
+ (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))
+(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))))
+ (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))
+(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))))
+ (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))
+(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)
+(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))
+ (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
+ (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))
+ (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))
+ (dolist (mirror (yas--field-mirrors field))
(push mirror soup)))
(setq soup
(sort soup
- #'yas/compare-fom-begs))
+ #'yas--compare-fom-begs))
(when soup
- (reduce #'yas/link-foms soup)))))
+ (reduce #'yas--link-foms soup)))))
-(defun yas/calculate-mirrors-in-fields (snippet mirror)
+(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
@@ -3612,111 +3696,117 @@ 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)))))
+ (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)
+(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.
+* call `yas--advance-start-maybe' on FOM's next fom.
-* in case FOM is field call `yas/advance-end-maybe' on its parent
+* 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
+`yas--advance-start-maybe' on its next fom. This is beacuse
exit-marker have identical start and end markers.
"
- (cond ((and fom (< (yas/fom-end fom) newend))
- (set-marker (yas/fom-end fom) newend)
- (yas/advance-start-maybe (yas/fom-next fom) newend)
- (yas/advance-end-of-parents-maybe (yas/fom-parent-field fom) newend))
- ((yas/exit-p fom)
- (yas/advance-start-maybe (yas/fom-next fom) newend))))
+ (cond ((and fom (< (yas--fom-end fom) newend))
+ (set-marker (yas--fom-end fom) newend)
+ (yas--advance-start-maybe (yas--fom-next fom) newend)
+ (yas--advance-end-of-parents-maybe (yas--fom-parent-field fom) newend))
+ ((yas--exit-p fom)
+ (yas--advance-start-maybe (yas--fom-next fom) newend))))
-(defun yas/advance-start-maybe (fom newstart)
+(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)))
+If it does, also call `yas--advance-end-maybe' on FOM."
+ (when (and fom (< (yas--fom-start fom) newstart))
+ (set-marker (yas--fom-start fom) newstart)
+ (yas--advance-end-maybe fom newstart)))
-(defun yas/advance-end-of-parents-maybe (field newend)
- "Like `yas/advance-end-maybe' but for parent fields.
+(defun yas--advance-end-of-parents-maybe (field newend)
+ "Like `yas--advance-end-maybe' but for parent fields.
Only works for fields and doesn't care about the start of the
next FOM. Works its way up recursively for parents of parents."
(when (and field
- (< (yas/field-end field) newend))
- (set-marker (yas/field-end field) newend)
- (yas/advance-end-of-parents-maybe (yas/field-parent-field field) newend)))
+ (< (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
+(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)
+(defvar yas--backquote-markers-and-strings nil
+ "List of (MARKER . STRING) marking where the the values
+ from backquoted lisp expressions should be inserted at the end of
+ expansion" )
+
+(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
+ ;; Reset the yas--dollar-regions
;;
- (setq yas/dollar-regions nil)
- ;; protect escaped quote, backquotes and backslashes
+ (setq yas--dollar-regions nil)
+ ;; protect just the backquotes
;;
- (yas/protect-escapes nil `(?\\ ?` ?'))
+ (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
+ (yas--save-backquotes)
+ ;; protect escaped characters
;;
- (goto-char parse-start)
- (yas/protect-escapes)
+ (yas--protect-escapes)
;; parse fields with {}
;;
(goto-char parse-start)
- (yas/field-parse-create snippet)
+ (yas--field-parse-create snippet)
;; parse simple mirrors and fields
;;
(goto-char parse-start)
- (yas/simple-mirror-parse-create snippet)
+ (yas--simple-mirror-parse-create snippet)
;; parse mirror transforms
;;
(goto-char parse-start)
- (yas/transform-mirror-parse-create snippet)
+ (yas--transform-mirror-parse-create snippet)
;; calculate adjacencies of fields and mirrors
;;
- (yas/calculate-adjacencies snippet)
+ (yas--calculate-adjacencies snippet)
;; Delete $-constructs
;;
- (yas/delete-regions yas/dollar-regions)
+ (yas--delete-regions yas--dollar-regions)
+ ;; restore backquoted expression values
+ ;;
+ (yas--restore-backquotes)
;; restore escapes
;;
(goto-char parse-start)
- (yas/restore-escapes)
+ (yas--restore-escapes)
;; update mirrors for the first time
;;
- (yas/update-mirrors snippet)
+ (yas--update-mirrors snippet)
;; indent the best we can
;;
(goto-char parse-start)
- (yas/indent snippet)))
+ (yas--indent snippet)))
-(defun yas/indent-according-to-mode (snippet-markers)
+(defun yas--indent-according-to-mode (snippet-markers)
"Indent current line according to mode, preserving
SNIPPET-MARKERS."
;;; Apropos indenting problems....
@@ -3732,12 +3822,12 @@ SNIPPET-MARKERS."
;;
;; 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
+ ;; (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))
+ (goto-char (yas--real-line-beginning))
(let ((trouble-markers (remove-if-not #'(lambda (marker)
(= marker (point)))
snippet-markers)))
@@ -3745,30 +3835,30 @@ SNIPPET-MARKERS."
(widen)
(condition-case err
(indent-according-to-mode)
- (error (yas/message 3 "Warning: `yas/indent-according-to-mode' having problems running %s" indent-line-function)
+ (error (yas--message 3 "Warning: `yas--indent-according-to-mode' having problems running %s" indent-line-function)
nil)))
(mapc #'(lambda (marker)
(set-marker marker (point)))
trouble-markers)))
-(defvar yas/indent-original-column nil)
-(defun yas/indent (snippet)
- (let ((snippet-markers (yas/collect-snippet-markers snippet)))
+(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))))
+ (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)
+ (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)
+ (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))
+ (indent-first-line-p yas-also-auto-indent-first-line))
(while (and (zerop (if indent-first-line-p
(prog1
(forward-line 0)
@@ -3776,26 +3866,26 @@ SNIPPET-MARKERS."
(forward-line 1)))
(not (eobp))
(<= (point) end))
- (yas/indent-according-to-mode snippet-markers))))
+ (yas--indent-according-to-mode snippet-markers))))
(t
nil)))))
-(defun yas/collect-snippet-markers (snippet)
+(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)))
+ (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)))
+ (marker-buffer (yas--exit-marker snippet-exit)))
+ (push (yas--exit-marker snippet-exit) markers)))
markers))
-(defun yas/real-line-beginning ()
+(defun yas--real-line-beginning ()
(let ((c (char-after (line-beginning-position)))
(n (line-beginning-position)))
(while (or (eql c ?\ )
@@ -3804,10 +3894,10 @@ SNIPPET-MARKERS."
(setq c (char-after n)))
n))
-(defun yas/escape-string (escaped)
+(defun yas--escape-string (escaped)
(concat "YASESCAPE" (format "%d" escaped) "PROTECTGUARD"))
-(defun yas/protect-escapes (&optional text escaped)
+(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."
@@ -3815,13 +3905,13 @@ With optional string TEXT do it in string instead of buffer."
(text-provided-p text))
(mapc #'(lambda (escaped)
(setq changed-text
- (yas/replace-all (concat "\\" (char-to-string escaped))
- (yas/escape-string escaped)
+ (yas--replace-all (concat "\\" (char-to-string escaped))
+ (yas--escape-string escaped)
(when text-provided-p changed-text))))
- (or escaped yas/escaped-characters))
+ (or escaped yas--escaped-characters))
changed-text))
-(defun yas/restore-escapes (&optional text escaped)
+(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."
@@ -3829,36 +3919,55 @@ With optional string TEXT do it in string instead of the buffer."
(text-provided-p text))
(mapc #'(lambda (escaped)
(setq changed-text
- (yas/replace-all (yas/escape-string escaped)
+ (yas--replace-all (yas--escape-string escaped)
(char-to-string escaped)
(when text-provided-p changed-text))))
- (or escaped yas/escaped-characters))
+ (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)
+(defun yas--save-backquotes ()
+ "Save all the \"`(lisp-expression)`\"-style expression
+with their evaluated value into `yas--backquote-markers-and-strings'"
+ (while (re-search-forward yas--backquote-lisp-expression-regexp nil t)
+ (let ((current-string (match-string-no-properties 1)) transformed)
(delete-region (match-beginning 0) (match-end 0))
- (setq transformed (yas/eval-lisp (yas/read-lisp (yas/restore-escapes current-string))))
+ (setq transformed (yas--eval-lisp (yas--read-lisp (yas--restore-escapes current-string '(?`)))))
(goto-char (match-beginning 0))
- (when transformed (insert transformed)))))
+ (when transformed
+ (let ((marker (make-marker)))
+ (insert "Y") ;; quite horrendous, I love it :)
+ (set-marker marker (point))
+ (insert "Y")
+ (push (cons marker transformed) yas--backquote-markers-and-strings))))))
-(defun yas/scan-sexps (from count)
+(defun yas--restore-backquotes ()
+ "Replace all the markers in
+`yas--backquote-markers-and-strings' with their values"
+ (while yas--backquote-markers-and-strings
+ (let* ((marker-and-string (pop yas--backquote-markers-and-strings))
+ (marker (car marker-and-string))
+ (string (cdr marker-and-string)))
+ (save-excursion
+ (goto-char marker)
+ (delete-char -1)
+ (insert string)
+ (delete-char 1)
+ (set-marker marker nil)))))
+
+(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)
+(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)
+(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:
@@ -3866,15 +3975,15 @@ 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'
+ 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))
+ (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
@@ -3887,33 +3996,33 @@ When multiple expressions are found, only the last one counts."
(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))
+ (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)
+ yas--dollar-regions)
(push (cons (match-beginning 0) (match-beginning 2))
- yas/dollar-regions)
- (push brand-new-field (yas/snippet-fields snippet))
+ 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))
+ (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)))))))
+ (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
+ ;; `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)))
+ (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
+ ;; 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
@@ -3923,78 +4032,78 @@ When multiple expressions are found, only the last one counts."
(when (and real-match-end-1
(not (member (cons (match-beginning 0)
real-match-end-1)
- yas/dollar-regions))
+ 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))))
+ (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)))))))
+ yas--dollar-regions)))))))
-(defun yas/transform-mirror-parse-create (snippet)
+(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))
+ (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)))
+ (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
+ (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)))))
+ (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)
+(defun yas--simple-mirror-parse-create (snippet)
"Parse the simple \"$n\" fields/mirrors/exitmarkers."
- (while (re-search-forward yas/simple-mirror-regexp nil t)
+ (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))))
+ (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)
+ (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)))
+ (push (cons (point) (yas--exit-marker (yas--snippet-exit snippet)))
+ yas--dollar-regions)))
(t
- (let ((field (yas/snippet-find-field snippet number)))
+ (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))
+ (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))
+ (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))))
+ (yas--snippet-fields snippet))))
(push (cons (match-beginning 0) (match-end 0))
- yas/dollar-regions))))))
+ yas--dollar-regions))))))
-(defun yas/delete-regions (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)))
@@ -4002,163 +4111,148 @@ When multiple expressions are found, only the last one counts."
#'(lambda (r1 r2)
(>= (car r1) (car r2))))))
-(defun yas/update-mirrors (snippet)
+(defun yas--update-mirrors (snippet)
"Updates all the mirrors of SNIPPET."
(save-excursion
- (let* ((fields (copy-list (yas/snippet-fields snippet)))
+ (let* ((fields (copy-list (yas--snippet-fields snippet)))
(field (car fields)))
(while field
- (dolist (mirror (yas/field-mirrors field))
- (let ((mirror-parent-field (yas/mirror-parent-field mirror)))
+ (dolist (mirror (yas--field-mirrors field))
+ (let ((mirror-parent-field (yas--mirror-parent-field mirror)))
;; updatte this mirror
;;
- (yas/mirror-update-display mirror field)
+ (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
+ ;; `yas--place-overlays' is needed if the active field and
;; protected overlays have been changed because of insertions
- ;; in `yas/mirror-update-display'
+ ;; in `yas--mirror-update-display'
;;
- (when (eq field (yas/snippet-active-field snippet))
- (yas/place-overlays snippet field))))
+ (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)
+(defun yas--mirror-update-display (mirror field)
"Update MIRROR according to FIELD (and mirror transform)."
- (let* ((mirror-parent-field (yas/mirror-parent-field mirror))
+ (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)))))
+ (yas--field-modified-p mirror-parent-field)))
+ (or (yas--apply-transform mirror field 'empty-on-nil)
+ (yas--field-text-for-display field)))))
(when (and reflection
- (not (string= reflection (buffer-substring-no-properties (yas/mirror-start mirror)
- (yas/mirror-end mirror)))))
- (goto-char (yas/mirror-start mirror))
- (yas/inhibit-overlay-hooks
+ (not (string= reflection (buffer-substring-no-properties (yas--mirror-start mirror)
+ (yas--mirror-end mirror)))))
+ (goto-char (yas--mirror-start mirror))
+ (yas--inhibit-overlay-hooks
(insert reflection))
- (if (> (yas/mirror-end mirror) (point))
- (delete-region (point) (yas/mirror-end mirror))
- (set-marker (yas/mirror-end mirror) (point))
- (yas/advance-start-maybe (yas/mirror-next mirror) (point))
+ (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))))))
+ (yas--advance-end-of-parents-maybe mirror-parent-field (point))))))
-(defun yas/field-update-display (field snippet)
- "Much like `yas/mirror-update-display', but for fields"
- (when (yas/field-transform field)
- (let ((transformed (and (not (eq (yas/field-number field) 0))
- (yas/apply-transform field field)))
+(defun yas--field-update-display (field snippet)
+ "Much like `yas--mirror-update-display', but for fields"
+ (when (yas--field-transform field)
+ (let ((transformed (and (not (eq (yas--field-number field) 0))
+ (yas--apply-transform field field)))
(point (point)))
(when (and transformed
- (not (string= transformed (buffer-substring-no-properties (yas/field-start field)
- (yas/field-end field)))))
- (setf (yas/field-modified-p field) t)
- (goto-char (yas/field-start field))
- (yas/inhibit-overlay-hooks
+ (not (string= transformed (buffer-substring-no-properties (yas--field-start field)
+ (yas--field-end field)))))
+ (setf (yas--field-modified-p field) t)
+ (goto-char (yas--field-start field))
+ (yas--inhibit-overlay-hooks
(insert transformed)
- (if (> (yas/field-end field) (point))
- (delete-region (point) (yas/field-end field))
- (set-marker (yas/field-end field) (point))
- (yas/advance-start-maybe (yas/field-next field) (point)))
+ (if (> (yas--field-end field) (point))
+ (delete-region (point) (yas--field-end field))
+ (set-marker (yas--field-end field) (point))
+ (yas--advance-start-maybe (yas--field-next field) (point)))
t)))))
-;;; Post-command hooks:
+;;; Post-command hook:
-(defvar yas/post-command-runonce-actions nil
- "List of actions to run once in `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/post-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 (yas/message 3 "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))
+ (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)))
+ (let* ((snippet (car (yas--snippets-at-point)))
(target-field (and snippet
(find-if-not #'(lambda (field)
- (yas/field-probably-deleted-p snippet field))
+ (yas--field-probably-deleted-p snippet field))
(remove nil
- (cons (yas/snippet-active-field snippet)
- (yas/snippet-fields snippet)))))))
+ (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))
+ (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))))
+ (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'."
+;;
+;; The docstrings for some functions are generated dynamically
+;; depending on the context.
+;;
+(put 'yas-expand 'function-documentation
+ '(yas--expand-from-trigger-key-doc))
+(defun yas--expand-from-trigger-key-doc ()
+ "A doc synthethizer for `yas--expand-from-trigger-key-doc'."
(let ((fallback-description
- (cond ((eq yas/fallback-behavior 'call-other-command)
- (let* ((yas/minor-mode nil)
- (fallback (key-binding (read-kbd-macro yas/trigger-key))))
+ (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)
+ ((eq yas-fallback-behavior 'return-nil)
", do nothing.")
(t
- ", defer to `yas/fallback-behaviour' :-)"))))
+ ", 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.")))
+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)
+(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)
+ (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)
+ (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)
+(defun yas--template-pretty-list (templates)
(let ((acc)
- (yas/buffer-local-condition 'always))
+ (yas-buffer-local-condition 'always))
(dolist (plate templates)
(setq acc (concat acc "\n*) "
(propertize (concat "\\\\snippet `" (car plate) "'")
@@ -4167,15 +4261,15 @@ object satisfying `yas/field-p' to restrict the expansion to.")))
(define-button-type 'help-snippet-def
:supertype 'help-xref
- 'help-function (lambda (template) (yas/visit-snippet-file-1 template))
+ '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 ()
+(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))
+ (yas--create-snippet-xrefs)
+ (remove-hook 'temp-buffer-show-hook 'yas--snippet-description-finish-runonce))
-(defun yas/create-snippet-xrefs ()
+(defun yas--create-snippet-xrefs ()
(save-excursion
(goto-char (point-min))
(while (search-forward-regexp "\\\\\\\\snippet[ \s\t]+`\\([^']+\\)'" nil t)
@@ -4186,35 +4280,37 @@ object satisfying `yas/field-p' to restrict the expansion to.")))
(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)
+(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)))))
+Remaining args as in `yas-expand-snippet'."
+ (let* ((table (gethash mode-symbol yas--tables))
+ (yas--current-template (and table
+ (gethash uuid (yas--table-uuidhash table)))))
+ (when yas--current-template
+ (yas-expand-snippet (yas--template-content yas--current-template)))))
;;; Utils
-;;;
-(defvar yas/verbosity 4
- "Log level for `yas/message' 4 means trace most anything, 0 means nothing.")
-(defun yas/message (level message &rest args)
- (when (> yas/verbosity level)
- (message (apply #'yas/format message args))))
+(defvar yas-verbosity 4
+ "Log level for `yas--message' 4 means trace most anything, 0 means nothing.")
-(defun yas/format (format-control &rest format-args)
+(defun yas--message (level message &rest args)
+ (when (> yas-verbosity level)
+ (message (apply #'yas--format message args))))
+
+(defun yas--format (format-control &rest format-args)
(apply #'format (concat "[yas] " format-control) format-args))
;;; Some hacks:
-;;;
+;;
+;; The functions
+;;
;; `locate-dominating-file'
;; `region-active-p'
;;
-;; added for compatibility in emacs < 23
+;; added for compatibility in emacsen < 23
(unless (>= emacs-major-version 23)
(unless (fboundp 'region-active-p)
(defun region-active-p () (and transient-mark-mode mark-active)))
@@ -4282,7 +4378,7 @@ and return the directory. Return nil if not found."
;; # type inside `<>`
(defadvice c-neutralize-syntax-in-CPP
- (around yas-mp/c-neutralize-syntax-in-CPP activate)
+ (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."
@@ -4294,9 +4390,130 @@ handle the end-of-buffer error fired in it by calling
(add-hook 'c-mode-common-hook
'(lambda ()
(dolist (k '(":" ">" ";" "<" "{" "}"))
- (define-key (symbol-value (make-local-variable 'yas/keymap))
+ (define-key (symbol-value (make-local-variable 'yas-keymap))
k 'self-insert-command))))
+
+;;; Backward compatibility to to yasnippet <= 0.7
+(defvar yas--exported-syms '(;; `defcustom's
+ ;;
+ yas-snippet-dirs
+ yas-prompt-functions
+ yas-indent-line
+ yas-also-auto-indent-first-line
+ yas-snippet-revival
+ yas-trigger-key
+ yas-next-field-key
+ yas-prev-field-key
+ yas-skip-and-clear-key
+ yas-triggers-in-field
+ yas-fallback-behavior
+ yas-choose-keys-first
+ yas-choose-tables-first
+ yas-use-menu
+ yas-trigger-symbol
+ yas-wrap-around-region
+ yas-good-grace
+ yas-visit-from-menu
+ yas-expand-only-for-last-commands
+ yas-field-highlight-face
+ ;; these vars can be customized as well
+ ;;
+ yas-keymap
+ yas-verbosity
+ yas-extra-modes
+ yas-key-syntaxes
+ yas-after-exit-snippet-hook
+ yas-before-expand-snippet-hook
+ yas-buffer-local-condition
+
+ ;; prompting functions
+ ;;
+ yas-x-prompt
+ yas-ido-prompt
+ yas-no-prompt
+ yas-completing-prompt
+ yas-dropdown-prompt
+
+ ;; interactive functions
+ ;;
+ yas-expand
+ yas-minor-mode
+ yas-global-mode
+ yas-direct-keymaps-reload
+ yas-minor-mode-on
+ yas-load-directory
+ yas-reload-all
+ yas-compile-directory
+ yas-recompile-all
+ yas-about
+ yas-expand-from-trigger-key
+ yas-expand-from-keymap
+ yas-insert-snippet
+ yas-visit-snippet-file
+ yas-new-snippet
+ yas-load-snippet-buffer
+ yas-tryout-snippet
+ yas-describe-tables
+ yas-next-field-or-maybe-expand
+ yas-next-field
+ yas-prev-field
+ yas-abort-snippet
+ yas-exit-snippet
+ yas-exit-all-snippets
+ yas-skip-and-clear-or-delete-char
+
+ ;; symbols that I "exported" for use
+ ;; in snippets and hookage
+ ;;
+ yas-expand-snippet
+ yas-define-snippets
+ yas-define-menu
+ yas-snippet-beg
+ yas-snippet-end
+ yas-modified-p
+ yas-moving-away-p
+ yas-text
+ yas-substr
+ yas-choose-value
+ yas-key-to-value
+ yas-throw
+ yas-verify-value
+ yas-field-value
+ yas-text
+ yas-selected-text
+ yas-default-from-field
+ yas-inside-string
+ yas-unimplemented
+ yas-define-condition-cache
+ yas-hippie-try-expand
+
+ ;; debug definitions
+ ;; yas-debug-snippet-vars
+ ;; yas-exterminate-package
+ ;; yas-debug-test
+
+ ;; testing definitions
+ ;; yas-should-expand
+ ;; yas-should-not-expand
+ ;; yas-mock-insert
+ ;; yas-make-file-or-dirs
+ ;; yas-variables
+ ;; yas-saving-variables
+ ;; yas-call-with-snippet-dirs
+ ;; yas-with-snippet-dirs
+))
+
+(dolist (sym yas--exported-syms)
+ (let ((backported (intern (replace-regexp-in-string "^yas-" "yas/" (symbol-name sym)))))
+ (when (boundp sym)
+ (make-obsolete-variable backported sym "yasnippet 0.8")
+ (defvaralias backported sym))
+ (when (fboundp sym)
+ (make-obsolete backported sym "yasnippet 0.8")
+ (defalias backported sym))))
+
+
(provide 'yasnippet)
;;; yasnippet.el ends here