* snippets:
* yasmate: Remove.
* README.mdown: Suggest yasnippet-snippets and yasmate as possible
things to download rather than submodules.
* yasnippet.el (yas-installed-snippets-dirn): Mark obsolete.
(yas-snippet-dirs): Remove `yas-installed-snippets-dir' from
default value.
* yasnippet-tests.el (yas-test-expand-and-undo): New helper function.
(undo-indentation-1, undo-indentation-2, undo-indentation-multiline-1)
(undo-indentation-multiline-2): Use it.
* yasnippet.el (yas--first-indent-undo, yas--get-indent-undo-pos):
Remove.
(yas-expand-snippet): Move undo-related code from here...
(yas--snippet-create): ... to here. Collect undo information from
yas--indent in the normal, unsuppressed way.
(yas--indent-region): Don't collect undo information specially.
(yas--take-care-of-redo): Remove unused parameters.
* yasnippet-tests.el (undo-indentation-1): Rename from
undo-indentation.
(undo-indentation-2): New test.
(undo-indentation-multiline-1): Rename from
undo-indentation-multiline.
(undo-indentation-multiline-2): New test.
* yasnippet.el (yas-expand-snippet): Since the actual insertion must
happen with modification hooks inhibited, we can't rely on that
mechanism to clear the field. Call yas--skip-and-clear-field-p on the
active field.
* yasnippet.el (yas-new-snippet-buffer-name): New constant, holds the
name of new snippet buffers. Change it to "+new-snippet+" to avoid
the leading "*" from fooling whitespace-global-mode into thinking it
shouldn't activate.
(yas-new-snippet):
* yasnippet-tests.el (snippet-save): Use the constant instead of
hardcoding the literal string.
* yasnippet.el (yas-also-auto-indent-first-line): New option.
(yas--indent-region): Also indent empty lines if it's set.
* yasnippet-tests.el (yas-also-indent-empty-lines): New test.
* Rakefile (.elc): Set byte-compile-force-lexical-warnings when
compiling.
(:compile_all): New target that compiles yasnippet-debug.el and
yasnippet-tests.el too.
* .travis.yml (script): Use it instead of `compile'. Update cl-lib to
0.6.1. Don't error on warnings for Emacs 24.3 on yasnippet-tests.el.
* yasnippet-debug.el: Don't use `yas--loaddir' if it's not
bound (e.g., when compiling). Require `color' and `edebug' at
toplevel. Check if `subr-x' defines `when-let'.
(yas-debug-snippet-vars): Remove, it was unused and broken.
* yasnippet-tests.el (yas-with-snippet-dirs, (yas-should-expand)
(yas--collect-menu-items, yas-should-not-expand, yas-mock-insert)
(yas-mock-yank, yas--key-binding, yas-make-file-or-dirs)
(yas-variables, yas-call-with-saving-variables)
(yas-call-with-snippet-dirs, special-mode, string-suffix-p): Move to
top section.
(yas-tests--ran-exit-hook): Rename from yas--ran-exit-hook, and move
to top-level.
* yasnippet.el (yas--letenv): Evaluate the FORMs of ENV.
* yasnippet-debug.el (yas--condition-cache-timestamp): Move it before first use.
(yas-debug-live-marker, yas-debug-live-range, yas-debug-snippet-vars)
(yas-debug-process-command-line): Remove or mark unused
variable/parameters.
(yas--letenv): Use `cl-progv'.
(yas--mirror-update-display): Remove unused SNIPPET parameter, update
caller.
Avoid `yas--auto-fill' call to `yas--update-mirrors' without setting
the snippet environment.
* yasnippet.el (yas--auto-fill): Reinstate snippet environment before
calling `yas--update-mirrors'.
* NEWS: Update for 0.12 changes.
* snippets/: Update to latest.
* yasnippet-debug.el:
* yasnippet-tests.el:
* yasnippet.el: Update copright years. Update version number to
0.12.0.
* README.mdown: Note that bugs can be submitted to main Emacs list.
* CONTRIBUTING.md: Fix double spacing, remove carriage returns.
Tighten up commit message example.
* yasnippet-debug.el (yas-debug-undo): New variable.
(yas-toggle-debug-undo): New command.
(yas-debug-snippets): Print undo list if `yas-debug-undo' is non-nil.
* yasnippet-debug.el (yas-debug-live-marker)
(yas-debug-ov-fom-start, yas-debug-ov-fom-end)
(yas-debug-live-range, yas--debug-format-fom-concise): Don't assume
snippet has markers, it could have been converted to integer position.
yasnippet-debug.el can now be used to quickly test and debug a snippet
in a file.
* Rakefile (itests): New target, runs tests interactively.
* yasnippet-debug.el: Set lexical binding.
(when-let): Backwards compabtility definition.
(yas-debug-live-indicators, yas-debug-live-colors)
(yas-debug-recently-live-indicators, yas-debug-get-live-indicator)
(yas-debug-live-marker, yas-debug-ov-fom-start, yas-debug-ov-fom-end)
(yas-debug-live-range, yas-debug-with-tracebuf, yas-debug-snippet)
(yas-debug-target-buffer, yas-debug-target-snippets)
(yas-debug-snippets, yas-debug-process-command-line): New functions
and variables.
(yas-debug-test): Remove.
* yasnippet.el (yas--snippet-revive): List snippet identifier in debug
message.
(yas--post-command-handler): Allow the debugger to run.
* yasnippet.el (yas--get-indent-undo-pos): Renamed from
yas--return-first-indent-undo.
(yas-expand-snippet): Bind it to line beginning of snippet expansion
position.
* yasnippet-tests.el (undo-indentation, undo-indentation-multiline):
New tests for this and previous fix.
* yasnippet.el (yas--first-indent-undo)
(yas--return-first-indent-undo): New variables.
(yas-expand-snippet): Use them to collect the exact undo info from
indenting the first snippet line, rather than trying to reconstruct
it.
(yas--indent-region): Put undo info from indenting snippet's first
line into `yas--first-indent-undo' if `yas--return-first-indent-undo'
is non-nil.
* yasnippet.el (yas--commit-snippet): Remove overlay object after
deleting it.
(yas--markers-to-points): Drop marker object.
(yas--points-to-markers): Create a new marker object.
* yasnippet-tests.el (auto-fill-with-multiparagraph): New test.
* yasnippet.el (yas--auto-fill): Don't snapshot markers outside of
current paragraph.
(yas--goto-saved-location, yas--snapshot-marker-location): Count
newlines as whitespace (even if mode marks them as non-whitespace
syntax, e.g., comment end).
(yas--snapshot-overlay-location, yas--restore-overlay-location): Don't
snapshot overlay position which is outside of BEG .. END.
* yasnippet.el (yas--loaddir): New constant.
(yas-installed-snippets-dir): Use it to compute value.
(yas-about): Get version from git or `package' if available.
Save and restore all snippet marker and overlays in the current
paragraph around auto-fill calls. Extend the marker/overlay snapshot
and restore mechanisms to work in multiline regions.
* yasnippet.el (yas-minor-mode): Install our auto-fill function around
the default one.
(yas--original-auto-fill-function): New variable.
(yas--auto-fill): New function, saves snippet markers & overlays,
calls original auto-fill-function, then restores markers and overlays.
(yas--snapshot-marker-location): Take new optional parameters BEG END,
allow for newlines in whitespace sequences (even if newline doesn't
have whitespace syntax).
(yas--snapshot-overlay-location): New function, takes BEG END,
produced non-line based location snapshots.
(yas--snapshot-overlay-line-location): Renamed from old
`yas--snapshot-overlay-location' function.
(yas--restore-overlay-line-location): Renamed from old
`yas--restore-overlay-location' function, narrow to line before calling
`yas--goto-saved-location'.
(yas--goto-saved-location): Use whole narrowed buffer instead of
assuming current line.
(yas--restore-overlay-location): New function, assume whole narrowed
buffer may be used.
(yas--prepare-snippets-for-move, yas--finish-moving-snippets):
(yas--indent-region): Adjust callers.
* yasnippet.el (yas--snippet-live-p): New function.
(yas--on-field-overlay-modification): Use it to avoid updating a dead
snippet, give a warning instead.
* yasnippet.el (yas--on-field-overlay-modification): Bind
inhibit-modification-hooks to nil so that other packages' hooks can
run, yas--inhibit-overlay-hooks so that we won't run recursively.