* CONTRIBUTING.md:
* NEWS:
* README.mdown:
* doc/index.org:
* doc/nav-menu.html.inc:
* yasnippet.el: Since the new repo destination is now under
`joaotavora', fix all the stale links to point to the new destination.
Copyright-paperwork-exempt: yes
`buffer-file-name' is a permanent buffer-local variable, so if we reuse
the "*new snippet*" buffer, we could end up visiting the last new
snippet's file.
* yasnippet.el (yas-load-snippet-buffer-and-close): Rename the "*new
snippet*" buffer when making it visit a file.
* .travis.yml (install): Set warnings to (not cl-functions) if cl-lib
needs to be downloaded. Since the downloaded cl-lib just aliases cl.el
functions, trying to use cl- prefixed functions would cause compile
warnings otherwise.
* Rakefile: Pass environment variable `warnings' as
`byte-compile-warnings' value when compiling.
* yasnippet.el: Replace calls to cl functions with cl- prefixed cl-lib
equivalents. Use #' to quote function symbols.
(yas-snippet-dirs, yas-new-snippet-default, yas-prompt-functions):
(yas-indent-line, yas-also-auto-indent-first-line):
(yas-snippet-revival, 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, yas--field-debug-face): Remove redundant
:group.
(yas-snippet-dirs, yas-global-mode): Remove :require. The :set value
for yas-snippet-dirs checks if yas-reload-all is fbound, and the
autoload cookie on yas-global-mode makes :require redundant.
These symbols were overlooked in backporting because they're not bound
or fbound.
* yasnippet.el (yas--define-menu-1): Rewrite with `cl-loop', and support
yas/ prefixed symbols.
The yas--message function was comparing with `>' instead of `>=', which
meant it was quieter than intended (i.e., level 3 message were being
suppressed by defualt). Also push the "Snippet %d exited" message up to
level 4, so the net effect should actually be quieter than before for
normal usage (the only level 3 messages are now for loading and saving
snippets).
* yasnippet.el (yas--message): Fix off-by-1 error.
(yas--load-snippet-dirs): Lowest yas--message level should be 1, not 0.
(yas--commit-snippet): "Snippet %d exited" is more of a debug message,
put it at level 4.
Two significant changes:
1. The criteria for offering to save in upon
`yas-load-snippet-buffer-and-close' is much simplified, and relies
on `buffer-modified-p' solely.
2. C-x C-s snippet after `yas-new-snippet' or `yas-visit-snippet'
suggests at least a sensible directory.
Still missing in this commit is the suggestion for loading upon
saving. The `after-save-hook' could be used for something like that.
* yasnippet.el (yas-new-snippet): Set `default-directory' based on
result of `yas--guess-snippet-directories'.
(yas-load-snippet-buffer): Return template object.
(yas-load-snippet-buffer-and-close): Simplify.
(yas--visit-snippet-file-1): Also set `default-directory' here.
(yas--guess-snippet-directories-1): Return directory names, i.e., ending
in slash.
Most of these are minor issues involving, e.g., quoting `like this'
instead of 'like this'. A few involve escaping ` and ' with a
preceding \= when the characters should not be turned into curved single
quotes.
* yasnippet.el (yas--find-next-field): For negative N, actually give the
Nth previous field, not the 1st field.
* yasnippet-tests.el (field-navigation): Add a 3rd field, and test
calling `yas-prev-field' while on it.
Fixes#722.
Since modification hooks run just after any function that changes buffer
contents, it's important to save the match data, or else the code doing
the modification can become really confused. See also Emacs bugs #23917
and #23869.
* yasnippet.el (yas--on-field-overlay-modification): Wrap main body in
`save-match-data'.
"Don't indent first line of mirrors" had the drawback that sometimes
we *want* to indent the first line of mirrors. So we fix the underlying
problem in a different way and add a test to make sure we don't lose
this behaviour again.
This changes the strategy for fixing #712 to a simpler alternative,
which doesn't remove the benefits of indenting single line mirrors.
It reverts the functional parts of commit
351c1e3dcbb73e3154aae0755d5b7016f1561ebc, while keeping the tests.
* yasnippet.el (yas--update-mirrors): Sort mirrors to be updated by
start position.
* yasnippet.el (yas--mirror-update-display): Don't indent the first line
of mirror output (meaning no indentation happens if there is a single
line).
* yasnippet-tests.el (single-line-multi-mirror-indentation): New test.
(snippet-with-multiline-mirrors-issue-665): Renamed from
navigate-a-snippet-with-multiline-mirrors-issue-665, test for precise
indentation in addition to navigation (this was already implemented,
contrary to its obsolete docstring).
Fixes#712
* yasnippet-tests.el (complicated-yas-key-syntaxes): Avoid looking-back.
* yasnippet.el (yas--font-lock-keywords): Escape $, even if first in the
regexp.
(yas--indent): Remove unused var `end'.
(yas--indent-parse-create): Remove unused arg `snippet'. Update caller.
This reverts commit e21420a497c1d79edc6b36ffb1f3bf1bb70f6227. This
breaks existing snippets which use side-effecting functions inside
backquotes to insert data instead of return the string to insert. This
usage will be deprecated, but we still need to support it for at least
another release.
* yasnippet.el (yas--save-backquotes): Go back to interleaved parsing
and evaluating of backquoted lisp forms.
* yasnippet.el (yas-describe-table-by-namehash): new function.
(yas-describe-tables): remove query for by-namehash variant, replace
query for non-active tables with prefix arg.
After the Github acocunt name change (capitaomorte -> joaotavora),
most links to repositories are redirected excpect Travis CI and
Github Pages (documentation).
* README.mdown: Fix documentation and Travis badge links
* yasnippet.el (yas-alias-to-yas/prefix-p): Rename from
yas-backport-obsolete-alias.
(yas/root-directory): Only define if yas-alias-to-yas/prefix-p is
non-nil. Mark obsolete.
The user's hooks may try to enable yas-minor-mode before yasnippet.el
has finished loading. In [1], we catch and ignore the errors arising
from this, but it's better if we can avoid hitting the error in the
first place.
This means we have 3 separate measures to avoid the problem, but since
this bug can leave Emacs unusable due to a failing post-command-hook,
a bit of redundant safety is not a bad thing.
* yasnippet.el (yas-minor-mode): Only turn on if yasnippet is fully
loaded.
(yas--font-lock-keywords): Disable user hooks.
[1]: "Avoid potential problems with user's hooks"
4c6064ce1aff07fe4481b5e2d987c8a7f044c207
during snippet creation. The snippet creation manipulates the
syntax-table which can lead to conflicts (see also
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23443).
* yasnippet.el (yas-expand-snippet): Let-bind syntax-propertize-function
to nil and then call syntax-ppss-flush-cache afterwards.
* yasnippet.el (yas--apply-transform): Don't let-bind yas-moving-away-p
to nil, it's nil by default.
(yas-next-field): Call `yas--field-update-display' instead of only
calling `yas--eval-lisp' so that the result of the transform is inserted
into the buffer.
yas-find-snippets was removed by [1].
* doc/snippet-development.org: Add keybindings on same line as command
names, fixup intra document links, and remove mention of non-existent
command yas-find-snippets.
* yasnippet.el (yas-load-snippet-buffer):
(yas-load-snippet-buffer-and-close): Fix docstring formatting.
[1]: "cleanup: remove `yas/find-snippets\', complicated and no one seems
to use it anyway" 29 May, 2012 433c93746534ebb062afe4dbc7690f736be72d42.
* doc/snippet-development.org: New "Indentation markers" section.
* yasnippet-tests.el (indentation-markers): New test.
* yasnippet.el (yas--indent-markers): New variable.
(yas--indent): Use it instead of searching for $> directly.
(yas--indent-parse-create): New function, records occurences of $> into
`yas--indent-markers'.
(yas--snippet-parse-create): Call it.