* snippet.el (snippet--field-overlay): Make buffer-local and permanent-local.
(snippet--field-protection-overlays): New variable.
(snippet--move-to-field): Also move protection overlays.
(snippet--field-overlay-changed): Don't do anything if undo in
progress or snippet being exited.
(snippet--field-protection-violated): new function.
(snippet--protection-overlay-face): New debug-only face.
(snippet-exit): Rename from `snippet-exit-snippet'
(snippet--exiting-p): New function
(snippet--activate-snippet): Create protection overlays.
(snippet--cleanup): New function.
(snippet--post-command-hook): Use `snippet--exiting-p' and
`snippet--cleanup'.
(snippet--debug-snippet): Consider that `snippet--field-overlay'
is now buffer-local.
(with-static-snippet, with-dynamic-snippet)
(snippet--activate-snippet): Update use of `snippet--make-object'.
(snippet--make-object): Don't take `prev' arg.
* snippet.el (snippet--object-<): New function.
(snippet--make-object): Replace `cl-assert' with ordinary error.
(snippet--open-object, snippet--with-current-object): Remove #'
prefix from lambda.
(snippet-next-field): Exiting is moving to the exit field.
(snippet--activate-snippet): Create exit field here if not created
yet.
(snippet--debug-snippet): Use `snippet--object-<'.
* snippet.el (with-static-snippet): Dummy param in lambda to
`snippet--make-and-insert-field'.
(with-dynamic-snippet): Use `snippet--make-and-insert-field' and
`snippet-make-and-insert-mirror'
(snippet--make-and-insert-field): Call function with field.
* snippet-tests.el (cl-lib): require it
(snippet--fixtures): Renamed from
`snippet--test-snippets-alist'. Add dynamic versions to all tests.
(snippet--get-fixture): Use `snippet--fixtures'
* snippet.el (with-dynamic-snippet): Relax syntax restrictions.
(&mirror): Update edebug spec.
(snippet--call-with-inserting-object): Don't try to set the start
of an object to its previous object's end, if that object hasn't
got an end yet.
(snippet--call-with-inserting-object): Fix previous bugfix.
* snippet.el (define-static-snippet): Fix bug.
(snippet--activate-snippet): Must use `cl-copy-list'
(snippet--describe-object): Changed to generic function.
(snippet--describe-exit, snippet--describe-mirror)
(snippet--describe-field): Part of the generic.
(snippet--debug-snippet): Uses `snippet--describe-object'
* snippet-tests.el (snippet--test-snippets-alist): Add static and
dynamic version of snippet to fixture.
(snippet--insert-test-snippet): Aware of dynamic snippets.
(sprintf-variation): Reintegrated deleted `snippet--test-sprintf-snippet'
(snippet--test-sprintf-snippet): Deleted.
(snippet-tests): Provide it.
* snippet.el: Better documentation.
(with-static-snippet): Renamed from `snippet--define-body'.
(define-dynamic-snippet): Renamed from `define-snippet'.
(with-dynamic-snippet): New macro.
* snippet-tests.el (macro-test): Dummy test for
`snippet-defmacro'.
* snippet.el (eieio): require 'eieio
(snippet--define-body, snippet--make-and-insert-mirror)
(snippet--make-and-insert-exit): Use `make-instance'
(snippet--field-overlay-changed): Use `snippet--object-start'
(snippet--field-skip-p): Use `snippet--object-parent'
(snippet--object, snippet--field, snippet--mirror)
(snippet--exit): Use `defclass'
(snippet-defmacro): New broken macro.
(&mirror, &field): New edebug specs.
When debugging snippets after M-x toggle-debug-on-error, errors in the
`post-command-hook' might cause `yas--post-command-handler' to be
removed. That's OK, always check that it's there before attempting any
`yas-expand-snippet' calls, since it is essential to check snippet
movement.
* yasnippet.el (yas-expand-snippet): Assert `yas-minor-mode' and
`yas--post-command-handler' active.
* yasnippet.el (yas--field-probably-deleted-p): Protect against
nil `yas--field-number'.
* yasnippet-tests.el (delete-numberless-inner-snippet-issue-562): New test
The main thrust is to get rid of the use of the `cl-struct-slots'
property which doesn't exist in Emacs-25 any more.
* yasnippet.el: Update copyright
(yas--template): Change constructor name from
`yas--make-blank-template' to `yas--make-template'
(yas--populate-template): Remove.
(yas--define-snippets-1): Use `yas--make-template'
(yas--define-snippets-1): Use `setf's
(yas-define-menu, yas--define-menu-1, yas-tryout-snippet): Use
`yas--make-template'
Collect some conventions about contributing to Yasnippet (which have
been scattered amongst various issues/pull request) into a single file.
* CONTRIBUTING.md: New File.
Clarify what happens with yas-new-snippet.
Added more detail about how yas-new-snippet behaves,
particularly how it guesses a directory to save in.
* doc/snippet-development.org (Quickly finding snippets):
enhance section.
* yasnippet.el (yas--fallback): let-bind yas-fallback-behavior to
'yas--fallback before actually doing the fallback. Signal an error if
it's 'yas--fallback (indicating we're in an infinte loop).