Noam Postavsky [Sun, 15 May 2016 01:46:12 +0000 (21:46 -0400)]
Rename yas-backport-obsolete-alias
* 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.
Noam Postavsky [Sat, 14 May 2016 11:18:38 +0000 (07:18 -0400)]
Extra measures to prevent premature yas-minor-mode
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.
Noam Postavsky [Thu, 12 May 2016 09:41:08 +0000 (05:41 -0400)]
Don't use major-mode syntax-propertize-function
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.
Noam Postavsky [Thu, 12 May 2016 08:57:08 +0000 (04:57 -0400)]
Fix field transform application in yas-next-field
* 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.
Noam Postavsky [Tue, 10 May 2016 16:21:14 +0000 (12:21 -0400)]
Fix outdated and misformatted docs
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.
Andrew Hyatt [Tue, 10 May 2016 03:21:15 +0000 (23:21 -0400)]
Version 1.6, mostly fixes for fragmented headers.
* websocket.el (websocket-verify-response-code, websocket-outer-filter):
Fix handling of fragmented headers.
* websocket.el (websocket-server): Accept host for listening on.
* websocket-functional-test.el: Stop stopping the listener process on
Windows.
Noam Postavsky [Sun, 8 May 2016 19:32:20 +0000 (15:32 -0400)]
Document $> and fix escaping
* 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.
Noam Postavsky [Wed, 4 May 2016 16:35:48 +0000 (12:35 -0400)]
Don't indent empty lines in snippet expansion
* yasnippet.el (yas--indent-region): Indent only non-empty lines.
* yasnippet-tests.el (basic-indentation): Add empy and non-empty (but
blank) lines in test snippet.
Daniel Landau [Wed, 4 May 2016 11:35:55 +0000 (14:35 +0300)]
Change warning message to not conflict with spec
The ECMAScript spec says
(http://www.ecma-international.org/ecma-262/5.1/#sec-10.5) that
declaring an already declared variable is silently ignored, so claiming
it's a TypeError is not correct. It should still be highlighted as a
warning because it's not something that any program should do and with
let redeclaration actually is a TypeError.
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.