Make sure output that occurs in normal use goes to verbosity levels 3 or
higher, and level 2 and below are reserved for something unexpected
happening. Level 3 (the new default) should be a reasonably quiet but
informative level.
* yasnippet.el (yas--read-keybinding, yas--safely-run-hooks):
(yas--on-protection-overlay-modification): Put warnings at verbosity
level 2.
(yas--load-yas-setup-file, yas-load-directory):
(yas--load-directory-1, yas--load-snippet-dirs):
(yas-expand-snippet, yas--load-pending-jits): Put per-file loading and
other debug messages at level 4.
(yas-load-snippet-buffer, yas--template-get-file, yas-reload-all): Put
top level loading messages at level 3 (or 2 if there were errors).
(yas--define-menu-1, yas-insert-snippet, yas-tryout-snippet): Put error
messages at level 1.
(yas-verbosity): Reduce default verbosity to level 3.
Noam Postavsky [Sun, 1 May 2016 02:29:57 +0000 (22:29 -0400)]
Fix some doc formatting
* doc/snippet-development.org (Template Syntax):
(Placeholder fields, Mirrors): Text inside dedicated target <<angle
brackets>> does not show up in output, so duplicate it. Add
descriptions to avoid getting numbers instead of names in links.
Noam Postavsky [Sun, 1 May 2016 02:11:49 +0000 (22:11 -0400)]
Support htmlize.el in Rakefile doc target
Htmlized output can now be produced by
rake doc[/path/to/htmlize/]
* Rakefile (doc): Add htmlize argument.
* doc/yas-doc-helper.el (yas--generate-html-batch): Tell org to use css
selectors only when exporting htmlized faces.
* doc/stylesheets/manual.css: Add styles for faces used by org export.
When inserting text due to a non-nil yas-wrap-around-region and the
snippet had fields occuring later in the buffer than $0, the insertion
of the text was shifting the location of later fields, thus invalidating
the calculation of yas--dollar-regions.
* yasnippet.el (yas--simple-mirror-parse-create): Don't insert text fo
yas-wrap-around-region here.
(yas--snippet-parse-create): Do it here, after deleting
`yas--dollar-regions`, instead.
Disabling this for trigger key introduced an inconsistency that is more
complicated to implement and document than simply fixing region wrapping
for trigger key expanded snippets.
Noam Postavsky [Thu, 10 Dec 2015 04:15:39 +0000 (23:15 -0500)]
Add register option for yas-wrap-around-region
Replace `cua' setting with more general behaviour that can use any given
register. A `cua' setting is converted to ?0 for backwards
compatibility.
* yasnippet.el (yas--simple-mirror-parse-create): Use contents of any
register depending on `yas-wrap-around-region' value.
(yas-wrap-around-region): Update docstring.
João Távora [Fri, 4 Mar 2016 17:34:40 +0000 (17:34 +0000)]
Indent multi-line output from mirrors
* yasnippet.el (yas--indent-region): Adapted and redesigned from
`yas--indent-according-to-mode'
(yas--indent-according-to-mode): Deleted.
(yas--indent): Use `yas--indent-region'.
(yas--real-line-beginning): Deleted.
(yas--update-mirrors): Always re-place active field overlay if it
exists. Pass the snippet to `yas--mirror-update-display'.
(yas--mirror-update-display): Indent the mirror text after
inserting the reflection.
* dired-async.el (dired-async-operation): Removed no more needed.
(dired-async-failures): New face.
(dired-async-mode-line-message): Use one more arg FACE.
(dired-async-after-file-create): Handle failures.
(dired-async-create-files): Pass failures args to callback.
Remove code that is now never called since when the mode is turned off
and we are no more async the job is delegated again to old dired function.
* async-bytecomp.el (async-byte-recompile-directory): Do it.
* dired-async.el (dired-async-create-files): Do it.
* smtpmail-async.el (async-smtpmail-send-it): Do it.
cc-mode fill paragraph narrows to the paragraph being filled. This
causes problems if there is a mirror needing to be updated outside of
the current paragraph.
* yasnippet-tests.el: New test.
* yasnippet.el (yas--update-mirrors): Widen while updating the mirrors.
(ampc-current-playlist-mode): Set font-lock-defaults instead.
(ampc-item-mode): Remove broken highlight rule.
(ampc-handle-status): Use font-lock-flush when available.
Stefan Monnier [Wed, 27 Apr 2016 13:39:46 +0000 (09:39 -0400)]
* debbugs: Use cl-lib. Use lexical-binding when available
* debbugs-gnu.el: Only require subr-x at compile time. Use cl-lib.
(debbugs-gnu-print-entry): Remove unused var `title-length'.
(debbugs-gnu-sort-title): Mark `s2' as unused.
* debbugs-org.el (debbugs-gnu): Use cl-lib.
* debbugs.el: Add `cl-lib' as dependency. Use cl-lib.
(debbugs-soap-invoke-async): Mark `args' as unused.
* packages/debbugs/debbugs-gnu.el (debbugs-gnu-patches): New command.
(debbugs-gnu-get-bugs): Remove the "user tags" cond -- it didn't
allow us to search for bugs with specific tags.
* packages/debbugs/debbugs-gnu.el (debbugs-gnu-insert-changelog):
When handling git-formatted patches, get all the info from the
patches automatically.
* .travis.yml: Don't use sudo, submodules.
(env): Test with additional Emacs versions.
(install): Get Emacs binaries from
https://github.com/npostavs/emacs-travis/releases. Download ert and
cl-lib if needed.
(script): Split compilation and testing into separate steps.
* Rakefile: Use batch-byte-compile. Treat compilation warnings as
errors.
In [1] we started deciding clearing based on a command's
delete-selection property, but it turns out that some commands perform
insertion, and optionally use the region's contents. So these commands
should have a nil delete-selection property, but they still ought to
clear a snippet field when used.
To achieve this, we now check if the command has inserted text in the
post-change hook of the field overlay.
* yasnippet.el (yas--skip-and-clear): Add optional FROM paramter. Only
clear non-empty fields.
(yas--skip-and-clear-field-p): Check the change start and length
instead of current command delete-selection property.
(yas--on-field-overlay-modification): Perform field clearing on the
post-change call.
[1]: acf2cdd "Decide field clearing commands based on delsel"
* dired-async.el (dired-async-create-files):
When using a file-creator named 'backup-file, files are
copied to destination without overwriting existing files,
making a versionned copy of original files.
Oleh Krehel [Fri, 22 Apr 2016 08:39:08 +0000 (10:39 +0200)]
Add a couple tests for ivy-read with alists
* ivy-test.el (ivy-read): Add tests.
To summarize how it works:
1. Only the keys of the alist are offered for completion, not the values
- this is the standard Emacs behavior.
2. `ivy-read' will return the selected key, not the value or the cons
cell.
3. When :action is specified, it will be called with the value
corresponding to the selected key. Not the key, and not the cons.
This allows keys to work as aliases for the actual data, and :action
arguments to be simple functions that deal with data (i.e. not having to
deal with the `cdr' of the passed argument).