]> code.delx.au - gnu-emacs-elpa/log
gnu-emacs-elpa
8 years agoCloses #632: Use `user-emacs-directory' instead of hardcoded "~/emacs.d"
João Távora [Thu, 26 Nov 2015 13:18:16 +0000 (13:18 +0000)]
Closes #632: Use `user-emacs-directory' instead of hardcoded "~/emacs.d"

* yasnippet.el (yas--default-user-snippets-dir): New defconst.
(yas-snippet-dirs, yas--guess-snippet-directories): Use it.

8 years agoIgnore trailing spaces in snippet definitions
Sharif Nassar [Sun, 8 Nov 2015 18:28:16 +0000 (10:28 -0800)]
Ignore trailing spaces in snippet definitions

Probably nobody wants a snippet `key` with a trailing space. It can
be hard to differentiate from a `key` without trailing space. The
default `<TAB>` behavior of yasnippet will never expand these.

* yasnippet.el (yas--parse-template): Ignore trailing spaces in snippet
  definitions.
* yasnippet-tests.el (deftest ignore-trailing-whitespace): New test for
  new behavior.

Copyright-paperwork-exempt: yes

8 years agoM-x delete-trailing-whitespace
Sharif Nassar [Sun, 8 Nov 2015 18:14:51 +0000 (10:14 -0800)]
M-x delete-trailing-whitespace

* yasnippet.el: delete-trailing-whitespace
* yasnippet-tests.el: delete-trailing-whitespace

Copyright-paperwork-exempt: yes (trivial)

8 years ago* CONTRIBUTING.md: Add note about changelog only messages.
Noam Postavsky [Sat, 7 Nov 2015 13:54:08 +0000 (08:54 -0500)]
* CONTRIBUTING.md: Add note about changelog only messages.

8 years agoFix #607; avoid Emacs bug #21824
Noam Postavsky [Wed, 4 Nov 2015 03:16:17 +0000 (22:16 -0500)]
Fix #607; avoid Emacs bug #21824

See also
- https://github.com/capitaomorte/yasnippet/issues/607
- http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21824

* yasnippet.el (yas--on-field-overlay-modification): Do nothing if
  yas--active-field-overlay is not an overlay.

8 years ago* README.mdown (Use `yas-minor-mode`): Reword.
Noam Postavsky [Sun, 1 Nov 2015 23:10:29 +0000 (18:10 -0500)]
* README.mdown (Use `yas-minor-mode`): Reword.

Close #623.

8 years agoActivate extra and major modes first
Noam Postavsky [Sat, 31 Oct 2015 19:54:33 +0000 (15:54 -0400)]
Activate extra and major modes first

This prevents snippets from a parent mode from overriding those of the
major-mode's (or yas--extra-modes).  Snippets of ancestor modes may
still override snippets of some other ancestor modes, but hopefully this
won't cause much trouble in practice.

See [1] and subsequent comments.

[1]: https://github.com/capitaomorte/yasnippet/issues/619#issuecomment-149127150

* yasnippet.el (yas--modes-to-activate): Reverse result, so that parents
  of yas--extra-modes and major are later in the list.
* yasnippet-tests.el (loading-with-cyclic-parenthood)
(extra-modes-parenthood): Test it.

Close #626.

8 years agoAvoid double snippet loading messages
Noam Postavsky [Sat, 31 Oct 2015 21:10:25 +0000 (17:10 -0400)]
Avoid double snippet loading messages

* yasnippet.el (yas--load-directory-1): Message about loading compiled
  snippets only after successfully doing so.

Close #627.

8 years agoFix #617; ensure point is visible before x prompt
Noam Postavsky [Wed, 21 Oct 2015 22:39:40 +0000 (18:39 -0400)]
Fix #617; ensure point is visible before x prompt

* yasnippet.el (yas-x-prompt): Call redisplay.

8 years agoSimplify string matching.
Noam Postavsky [Mon, 12 Oct 2015 01:23:36 +0000 (21:23 -0400)]
Simplify string matching.

* yasnippet.el (yas--field-parse-create): Use string-match-p to instead
  of save-match-data, anchor regexp with \` (start of string) to instead
  of (eq ... 0)

8 years agoFix #618; save match data in yas--scan-sexps
Noam Postavsky [Mon, 12 Oct 2015 01:18:52 +0000 (21:18 -0400)]
Fix #618; save match data in yas--scan-sexps

* yasnippet.el (yas--scan-sexps): Save match data.

8 years ago* yasnippet.el (yas--scan-sexps): Use ignore-errors.
Noam Postavsky [Mon, 12 Oct 2015 01:17:50 +0000 (21:17 -0400)]
* yasnippet.el (yas--scan-sexps): Use ignore-errors.

8 years agoMerge pull request #621 from npostavs/dfs-extra-modes2
Noam Postavsky [Sun, 11 Oct 2015 18:51:56 +0000 (14:51 -0400)]
Merge pull request #621 from npostavs/dfs-extra-modes2

find parents for extra-modes too (v2)

8 years agoFix #619; find parents for extra-modes too
Noam Postavsky [Sun, 11 Oct 2015 16:55:47 +0000 (12:55 -0400)]
Fix #619; find parents for extra-modes too

* yasnippet.el (yas--modes-to-activate): Call dfs on yas--extra-modes as
  well.

8 years agoBuild a single `explored' list.
Noam Postavsky [Sun, 11 Oct 2015 16:40:17 +0000 (12:40 -0400)]
Build a single `explored' list.

* yasnippet.el (yas--modes-to-activate): Make helper dfs function
  produce the list of modes only by updating a single `explored' list,
  instead of building up the list by value and having to remove
  duplicated after.

8 years agoAdd (failing) yas--modes-to-activate test
Noam Postavsky [Sun, 11 Oct 2015 16:25:20 +0000 (12:25 -0400)]
Add (failing) yas--modes-to-activate test

* yasnippet-tests.el (extra-modes-parenthood): New (failing) test.
(loading-with-cyclic-parenthood): Use equal + sort instead of set
operation + length.

8 years agoUpdate snippets module
George Balatsouras [Sun, 4 Oct 2015 23:57:27 +0000 (02:57 +0300)]
Update snippets module

8 years agoFix invalid yas-key-syntaxes element warning
Noam Postavsky [Mon, 28 Sep 2015 00:16:28 +0000 (20:16 -0400)]
Fix invalid yas-key-syntaxes element warning

* yasnippet.el (yas--templates-for-key-at-point): Fix infinite loop and
  remove redundant "Warning" in the bad element warning.

8 years ago* doc/snippet-organization.org (.yas-skip): Add info.
Noam Postavsky [Fri, 25 Sep 2015 01:12:30 +0000 (21:12 -0400)]
* doc/snippet-organization.org (.yas-skip): Add info.

8 years ago* yasnippet.el (yas--define-snippets-2): Use file-name-NONdirectory.
Noam Postavsky [Sat, 12 Sep 2015 20:30:01 +0000 (16:30 -0400)]
* yasnippet.el (yas--define-snippets-2): Use file-name-NONdirectory.

8 years ago* yasnippet-tests.el (string-suffix-p): Define for older Emacsen.
Noam Postavsky [Sat, 5 Sep 2015 20:20:04 +0000 (16:20 -0400)]
* yasnippet-tests.el (string-suffix-p): Define for older Emacsen.

8 years agoTest visiting compiled snippets
Noam Postavsky [Sat, 5 Sep 2015 19:13:09 +0000 (15:13 -0400)]
Test visiting compiled snippets

* yasnippet-tests.el (visiting-compiled-snippets): New Test.
* yasnippet.el (yas--lookup-snippet-1, yas-lookup-snippet): Split new
  function yas--lookup-snippet-1 from yas-lookup-snippet.

8 years agoAccept documented snippet list formats
Noam Postavsky [Sat, 5 Sep 2015 17:41:12 +0000 (13:41 -0400)]
Accept documented snippet list formats

yas-define-snippets was making assumptions that happended to be true for
its current calls, but could fail if given differently formatted snippet
lists that still meet the docstring description.

* yasnippet.el (yas-define-snippets): Handle incomplete snippet lists.

8 years agoFix #597; use SAVE-FILE to visit compiled snippets
Noam Postavsky [Sat, 5 Sep 2015 00:19:52 +0000 (20:19 -0400)]
Fix #597; use SAVE-FILE to visit compiled snippets

Rename the existing FILE field to LOAD-FILE, and add a new SAVE-FILE to
yas--template struct.  Normally they will be the same, but compiled
snippets have only SAVE-FILE because they are loaded by "compiled" code.

* yasnippet.el (yas--template): Remove field file, add load-file and
  save-file.
(yas--parse-template): Update snippet-definition list in docstrings.
(yas-define-snippets): Move LOAD-FILE value to SAVE-FILE when compiling.
(yas--template-get-file): New function.
(yas--visit-snippet-file-1, yas-load-snippet-buffer,
yas-load-snippet-buffer-and-close): Use yas--template-load-file,
yas--template-save-file, or yas--template-get-file, as appropriate.
* doc/snippet-organization.org (The =.yas-compiled-snippet.el= file):
  Remove caveat that is no longer relevant.

8 years agoReorganize snippet construction from list code
Noam Postavsky [Fri, 4 Sep 2015 22:33:44 +0000 (18:33 -0400)]
Reorganize snippet construction from list code

* yasnippet.el (yas--template): New yas--define-snippets-2 constructor
  with arguments matching yas-define-snippets format.
(yas--define-snippets-1): Use it.
(yas--update-template): Return TEMPLATE argument.

8 years agoCloses #601: updated snippets submodule
João Távora [Tue, 11 Aug 2015 19:22:10 +0000 (20:22 +0100)]
Closes #601: updated snippets submodule

8 years agoMerge pull request #599 from zmwangx/snippet-compilation-doc
João Távora [Tue, 4 Aug 2015 23:51:40 +0000 (00:51 +0100)]
Merge pull request #599 from zmwangx/snippet-compilation-doc

Add documentation for snippet compilation

8 years agoAdd documentation for snippet compilation
Zhiming Wang [Tue, 4 Aug 2015 21:39:36 +0000 (14:39 -0700)]
Add documentation for snippet compilation

Specifically, fill in the section about .yas-compiled-snippet.el, which
was previously labelled as TODO.

* doc/snippet-organization.org (The =.yas-compiled-snippet.el= file):
  Fill in section.

8 years agoSimplify some code
Noam Postavsky [Tue, 4 Aug 2015 18:20:29 +0000 (14:20 -0400)]
Simplify some code

* yasnippet.el (yas-define-snippets): Modify the list instead of
  reconstructing it.
  (yas-load-snippet-buffer-and-close): Replace listp and second with
  cdr-safe.  Use string-prefix-p rather than string-match-p.

8 years agoMerge pull request #596 from npostavs/lookup-snippet
João Távora [Mon, 3 Aug 2015 18:24:27 +0000 (19:24 +0100)]
Merge pull request #596 from npostavs/lookup-snippet

Add yas-lookup-snippet

8 years agoAdd new function yas-lookup-snippet
Noam Postavsky [Mon, 3 Aug 2015 14:36:46 +0000 (10:36 -0400)]
Add new function yas-lookup-snippet

* yasnippet.el (yas-lookup-snippet): New function.
(yas--get-snippet-tables, yas--modes-to-activate): Add optional mode
parameter.
* yasnippet-tests.el (snippet-lookup): New test for yas-lookup-snippet.
* doc/snippet-expansion.org (Expanding from emacs-lisp code): Mention
  yas-lookup-snippet.

8 years agoMinor doc fixes
Noam Postavsky [Mon, 3 Aug 2015 14:29:42 +0000 (10:29 -0400)]
Minor doc fixes

* doc/snippet-expansion.org (Expanding from emacs-lisp code): Fix typo.
* doc/snippet-menu.org (Controlling indenting, Prompting method): Remove
  incorrect whitespace.

9 years agoMerge pull request #578 from aluaces/patch-1
Noam Postavsky [Mon, 18 May 2015 17:12:18 +0000 (13:12 -0400)]
Merge pull request #578 from aluaces/patch-1

Fix "invalid function: quote"

9 years agoFix "invalid function: quote"
Alberto Luaces [Fri, 15 May 2015 21:30:37 +0000 (23:30 +0200)]
Fix "invalid function: quote"

On emacs24, Debian, HTML doc generation finishes with this error.

9 years agoCloses #549: Adjust `load' verbosity to `yas-verbosity'
João Távora [Wed, 15 Apr 2015 09:43:03 +0000 (10:43 +0100)]
Closes #549: Adjust `load' verbosity to `yas-verbosity'

* yasnippet.el (yas--load-yas-setup-file): Be verbose on `load'
according to `yas-verbosity'

9 years agoMerge pull request #571 from PhilHudson/master
João Távora [Mon, 13 Apr 2015 21:03:58 +0000 (22:03 +0100)]
Merge pull request #571 from PhilHudson/master

Replaced 'shadow' with 'override' throughout documentation

9 years agoReplaced 'shadow' with 'override' throughout documentation
Phil Hudson [Mon, 13 Apr 2015 14:08:24 +0000 (15:08 +0100)]
Replaced 'shadow' with 'override' throughout documentation

It is hoped that this will add clarity.

* yasnippet.el, doc/snippet-organization.org (documentation):
  Replaced 'shadow' with 'override' globally.

9 years agoUpdate README.mdown
João Távora [Sun, 5 Apr 2015 22:34:01 +0000 (23:34 +0100)]
Update README.mdown

* README.mdown (Intro): There hasn't been a downloadable demo
in a long time.

9 years agoMerge pull request #569 from npostavs/doc-obsolete
João Távora [Sun, 5 Apr 2015 22:26:37 +0000 (23:26 +0100)]
Merge pull request #569 from npostavs/doc-obsolete

README fixes, mark yas-initialize as obsolete

9 years agoyasnippet.el (yas-initialize): Mark obsolete
Noam Postavsky [Sun, 5 Apr 2015 22:05:07 +0000 (18:05 -0400)]
yasnippet.el (yas-initialize): Mark obsolete

9 years agoREADME.mdown (per-buffer): Remove needless lambda
Noam Postavsky [Sun, 5 Apr 2015 21:59:18 +0000 (17:59 -0400)]
README.mdown (per-buffer): Remove needless lambda

9 years agoREADME.mdown (el-get): Remove obsolete information
Noam Postavsky [Sun, 5 Apr 2015 21:57:46 +0000 (17:57 -0400)]
README.mdown (el-get): Remove obsolete information

9 years ago`yas-minor-mode' assertion broke a test. Good. Fix it.
João Távora [Mon, 23 Mar 2015 10:21:12 +0000 (10:21 +0000)]
`yas-minor-mode' assertion broke a test. Good. Fix it.

* yasnippet-tests.el
(be-careful-when-escaping-in-yas-selected-text-2): Add
`yas-minor-mode'.

9 years agoAdd useful development assertion
João Távora [Mon, 23 Mar 2015 10:10:56 +0000 (10:10 +0000)]
Add useful development assertion

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.

9 years agoCloses #562: Deleting inner numberless snippet causes error
João Távora [Mon, 23 Mar 2015 09:50:54 +0000 (09:50 +0000)]
Closes #562: Deleting inner numberless snippet causes error

* yasnippet.el (yas--field-probably-deleted-p): Protect against
nil `yas--field-number'.

* yasnippet-tests.el (delete-numberless-inner-snippet-issue-562): New test

9 years agoGetting rid of low-level assumptions in yasnippet
Stefan Monnier [Fri, 20 Mar 2015 10:34:33 +0000 (10:34 +0000)]
Getting rid of low-level assumptions in yasnippet

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'

9 years agoMerge pull request #568 from npostavs/contrib
João Távora [Thu, 19 Mar 2015 11:30:25 +0000 (11:30 +0000)]
Merge pull request #568 from npostavs/contrib

Add a CONTRIBUTING.md file

9 years agoAdd a CONTRIBUTING.md file
Noam Postavsky [Wed, 18 Mar 2015 19:59:28 +0000 (15:59 -0400)]
Add a CONTRIBUTING.md file

Collect some conventions about contributing to Yasnippet (which have
been scattered amongst various issues/pull request) into a single file.

* CONTRIBUTING.md: New File.

9 years agoImplements #566: Remove dead major modes code
Vasilij Schneidermann [Wed, 18 Mar 2015 10:48:44 +0000 (11:48 +0100)]
Implements #566: Remove dead major modes code

* yasnippet.el (yas--known-modes, yas--real-mode?): Removed

9 years agoMerge pull request #559 from mineo/patch-1
João Távora [Thu, 12 Feb 2015 10:40:33 +0000 (10:40 +0000)]
Merge pull request #559 from mineo/patch-1

* yasnippet.el (yas-expand-snippet): improve docstring

9 years agoyas-expand-snippet: Clarify EXPAND-ENV
Wieland Hoffmann [Thu, 12 Feb 2015 01:25:56 +0000 (02:25 +0100)]
yas-expand-snippet: Clarify EXPAND-ENV

9 years agoMerge pull request #552 from treese/master
João Távora [Sat, 10 Jan 2015 15:56:45 +0000 (15:56 +0000)]
Merge pull request #552 from treese/master

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.

9 years agoClarify what happens with yas-new-snippet.
Win Treese [Sat, 10 Jan 2015 15:04:18 +0000 (10:04 -0500)]
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.

9 years agoCloses #546: backport `yas-initialize' and provide `yas/initialize'
João Távora [Tue, 23 Dec 2014 11:02:44 +0000 (11:02 +0000)]
Closes #546: backport `yas-initialize' and provide `yas/initialize'

* yasnippet.el (yas-initialize): Renamed from `yas--initialize'.
(yas--backported-syms): Add `yas-initialize'

9 years agoMerge pull request #542 from tarsius/nosearch
João Távora [Tue, 9 Dec 2014 12:08:19 +0000 (12:08 +0000)]
Merge pull request #542 from tarsius/nosearch

Add file doc/.nosearch

9 years agoAdd file doc/.nosearch
Jonas Bernoulli [Mon, 8 Dec 2014 13:47:20 +0000 (14:47 +0100)]
Add file doc/.nosearch

This keeps `normal-top-level-add-subdirs-to-load-path'
from adding the directory to the `load-path'.

9 years agoUpdate README.mdown
João Távora [Sun, 23 Nov 2014 12:23:15 +0000 (12:23 +0000)]
Update README.mdown

Fix misspellings

9 years agoClean up previous change
João Távora [Mon, 17 Nov 2014 11:27:30 +0000 (11:27 +0000)]
Clean up previous change

* yasnippet.el: Update comment.
(yas--protection-violation): Removed.
(yas--on-protection-overlay-modification): Simplified.
(yas--post-command-handler): No longer reference
`yas--protection-violation'

9 years agoCloses #537: Be lenient to extensions operating on snippet fields
João Távora [Tue, 4 Nov 2014 08:27:34 +0000 (08:27 +0000)]
Closes #537: Be lenient to extensions operating on snippet fields

* yasnippet.el (yas--on-protection-overlay-modification): Commit the
snippets being destroyed instead of signalling a protection violation.

9 years agoCloses #536: Fix navigation to zero-length fields at snippet end
João Távora [Sun, 2 Nov 2014 23:53:11 +0000 (23:53 +0000)]
Closes #536: Fix navigation to zero-length fields at snippet end

* yasnippet.el (yas--field-probably-deleted-p): A deleted field
was probably modified before, so enforce that condition.

9 years agoUpdate snippets submodule
Noam Postavsky [Fri, 17 Oct 2014 14:36:08 +0000 (10:36 -0400)]
Update snippets submodule

9 years agoUpdate README.mdown
João Távora [Sat, 11 Oct 2014 21:27:48 +0000 (22:27 +0100)]
Update README.mdown

9 years agoTweak README.mdown to simplify bug reporting paragraph
João Távora [Sat, 11 Oct 2014 13:57:49 +0000 (14:57 +0100)]
Tweak README.mdown to simplify bug reporting paragraph

9 years agoCloses #527: Unbreak case where yas-fallback-behaviour is a list
João Távora [Thu, 9 Oct 2014 06:16:36 +0000 (07:16 +0100)]
Closes #527: Unbreak case where yas-fallback-behaviour is a list

* yasnippet.el (yas--fallback): Extract interesting values from
`yas-fallback-behaviour' before rebinding.

9 years agoCloses #525, closes #526: Prevent some keybinding fallback loops
João Távora [Tue, 7 Oct 2014 13:57:23 +0000 (14:57 +0100)]
Closes #525, closes #526: Prevent some keybinding fallback loops

* yasnippet.el (yas--keybinding-beyond-yasnippet): Add docstring.
(yas--fallback): Also let-bind `yas-minor-mode' to nil when
falling back.

9 years agoMerge pull request #524 from npostavs/fallback-loop
João Távora [Sun, 5 Oct 2014 08:24:34 +0000 (09:24 +0100)]
Merge pull request #524 from npostavs/fallback-loop

Signal an error on recursive yas--fallback calls

9 years agoSignal an error on recursive yas--fallback calls
Noam Postavsky [Sun, 5 Oct 2014 00:52:58 +0000 (20:52 -0400)]
Signal an error on recursive yas--fallback calls

* 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).

9 years agoMerge pull request #519 from syohex/use-cl-macro
João Távora [Mon, 29 Sep 2014 09:40:07 +0000 (10:40 +0100)]
Merge pull request #519 from syohex/use-cl-macro

9 years agoUse cl-incf instead of cl
Syohei YOSHIDA [Mon, 29 Sep 2014 03:25:01 +0000 (12:25 +0900)]
Use cl-incf instead of cl

* yasnippet.el (yas--snippet-next-id, yas--real-line-beginning):
Use `cl-incf'.

9 years agoMerge pull request #518 from rnkn/master
João Távora [Mon, 22 Sep 2014 21:02:00 +0000 (22:02 +0100)]
Merge pull request #518 from rnkn/master

Compatibility with custom-unlispify-remove-prefixes

9 years agoCompatibility with custom-unlispify-remove-prefixes
Paul Rankin [Sat, 20 Sep 2014 14:53:29 +0000 (00:53 +1000)]
Compatibility with custom-unlispify-remove-prefixes

9 years agoUpdate snippets submodule
João Távora [Thu, 11 Sep 2014 10:12:19 +0000 (11:12 +0100)]
Update snippets submodule

9 years agoMerge pull request #514 from tarsius/master
João Távora [Tue, 9 Sep 2014 19:50:56 +0000 (20:50 +0100)]
Merge pull request #514 from tarsius/master

Cosmetic fixes and quiet byte-compiler

9 years agoenforce use of spaces for indentation
Jonas Bernoulli [Sun, 7 Sep 2014 12:08:30 +0000 (14:08 +0200)]
enforce use of spaces for indentation

9 years agoyasnippet-debug.el: quiet byte-compiler
Jonas Bernoulli [Sat, 6 Sep 2014 23:42:27 +0000 (01:42 +0200)]
yasnippet-debug.el: quiet byte-compiler

9 years agomove eof footer to the actual eof
Jonas Bernoulli [Sat, 6 Sep 2014 23:41:16 +0000 (01:41 +0200)]
move eof footer to the actual eof

9 years agoCloses #508: Ensure original point when evaluating conditions
João Távora [Thu, 21 Aug 2014 07:38:46 +0000 (08:38 +0100)]
Closes #508: Ensure original point when evaluating conditions

* yasnippet.el (yas--templates-for-key-at-point): Call
`yas--fetch', and hence condition system, with point in the
original position.

9 years agoCloses #495: Allow symbols as aliases in `yas-snippet-dirs'
João Távora [Wed, 20 Aug 2014 20:48:41 +0000 (21:48 +0100)]
Closes #495: Allow symbols as aliases in `yas-snippet-dirs'

* yasnippet.el (yas-installed-snippets-dir): New parameter. Set at
load time from `load-file-name'.
(yas--load-file-name): Removed.
(yas-snippet-dirs): Update docstring. Default value has symbol
`yas-installed-snippets-dir' as an alias to any bundled snippets.
(yas-snippet-dirs): Redesign for new `yas-snippet-dirs' semantics.

9 years agoCloses #504: Correctly discover buffers needing snippets immediately
João Távora [Wed, 20 Aug 2014 20:29:32 +0000 (21:29 +0100)]
Closes #504: Correctly discover  buffers needing snippets immediately

* yasnippet-tests.el (issue-504-tricky-jit): New test.

* yasnippet.el (yas-load-directory): Use a new `impatient-buffers'
local and call `yas--load-pending-juts' in all those at the end.

* yasnippet.el (cl-lib): Don't need `eval-and-compile'.

9 years agoPrevent disabling errors from recent `yas-current-syntaxes` logic
João Távora [Wed, 20 Aug 2014 19:23:00 +0000 (20:23 +0100)]
Prevent disabling errors from recent `yas-current-syntaxes` logic

* yasnippet.el (yas--templates-for-key-at-point): Don't error
since this function is called very frequently on TAB. Use new
`yas--warning'.
(yas--warning): New function.

9 years agoMerge pull request #503 from npostavs/key-syntaxes
João Távora [Sun, 10 Aug 2014 23:26:29 +0000 (00:26 +0100)]
Merge pull request #503 from npostavs/key-syntaxes

More yas-key-syntaxes functions

9 years agoFix edge case in yas-longest-key-from-whitespace
Noam Postavsky [Sun, 10 Aug 2014 17:29:25 +0000 (13:29 -0400)]
Fix edge case in yas-longest-key-from-whitespace

* yasnippet.el (yas-longest-key-from-whitespace): don't try again if
  start-point is on whitespace.
* yasnippet-tests.el (complicated-yas-key-syntaxes): check edge case.

9 years agoFix yas-key-syntaxes example functions docstrings.
Noam Postavsky [Sun, 10 Aug 2014 17:13:45 +0000 (13:13 -0400)]
Fix yas-key-syntaxes example functions docstrings.

* yasnippet.el (yas-try-key-from-whitespace),
  (yas-shortest-key-until-whitespace),
  (yas-longest-key-from-whitespace): docstring describes the effect, not
  implementation.

9 years agoAdd yas-longest-key-from-whitespace
Noam Postavsky [Sun, 10 Aug 2014 17:07:43 +0000 (13:07 -0400)]
Add yas-longest-key-from-whitespace

Example yas-key-syntaxes function.

* yasnippet.el (yas-longest-key-from-whitespace): new function.
* yasnippet-tests.el (complicated-yas-key-syntaxes): test it.

9 years agoPass start point to yas-key-syntaxes functions
Noam Postavsky [Sun, 10 Aug 2014 16:52:52 +0000 (12:52 -0400)]
Pass start point to yas-key-syntaxes functions

* yasnippet-tests.el (complicated-yas-key-syntaxes): accept argument.
* yasnippet.el (yas-try-key-from-whitespace): accept argument.
  (yas-shortest-key-until-whitespace): accept argument.
  (yas--templates-for-key-at-point): pass start point the methods.
  (yas-key-syntaxes): update docstring.

9 years agoAdd yas-shortest-key-until-whitespace
Noam Postavsky [Sun, 10 Aug 2014 16:47:22 +0000 (12:47 -0400)]
Add yas-shortest-key-until-whitespace

Example yas-key-syntaxes function.

* yasnippet.el (yas-shortest-key-until-whitespace): new function.
* yasnippet-tests.el (complicated-yas-key-syntaxes): test it.

9 years agoCloses #470, handle non-whitespace newlines
Noam Postavsky [Sun, 10 Aug 2014 16:21:47 +0000 (12:21 -0400)]
Closes #470, handle non-whitespace newlines

Many modes put newlines in comment ender class because they have line
comments.

* yasnippet.el (yas-try-key-from-whitespace): new function.
(yas-key-syntaxes): use it in place of "^ ".
* yasnippet-tests.el (complicated-yas-key-syntaxes): test it.

9 years ago* yasnippet.el (yas-key-syntaxes): Improve documentation.
João Távora [Tue, 29 Jul 2014 19:40:09 +0000 (20:40 +0100)]
* yasnippet.el (yas-key-syntaxes): Improve documentation.

9 years agoCloses #497: Allow functions as elements in yas-key-syntaxes
João Távora [Tue, 29 Jul 2014 00:19:58 +0000 (01:19 +0100)]
Closes #497: Allow functions as elements in yas-key-syntaxes

* yasnippet.el (yas--templates-for-key-at-point): Renamed from
`yas--current-key'.
(yas-key-syntaxes): Overhaul documentation.
(yas-expand-from-trigger-key): Use
`yas--templates-for-key-at-point'.

* yasnippet-tests.el (complicated-yas-key-syntaxes): New test.
(yas-should-expand, yas-should-not-expand): Friendlier failure
message.

9 years agoCloses #492, closes #494: Consider defalias when calculating parent modes
João Távora [Mon, 28 Jul 2014 10:37:46 +0000 (11:37 +0100)]
Closes #492, closes #494: Consider defalias when calculating parent modes

* yasnippet-tests.el (issue-492-and-494): New test.

* yasnippet.el (yas--modes-to-activate): Consider each mode's
symbol-function as a neighbour in case it's a symbol as well.

9 years agoMerge pull request #493 from npostavs/ijit
João Távora [Sun, 20 Jul 2014 22:34:00 +0000 (23:34 +0100)]
Merge pull request #493 from npostavs/ijit

Allow jit loading interactively

9 years agoAllow jit loading interactively
Noam Postavsky [Sat, 19 Jul 2014 14:47:48 +0000 (10:47 -0400)]
Allow jit loading interactively

* yasnippet.el (yas-reload-all, yas-load-directory): let a prefix
  argument indicate jit loading.

9 years agoMake snippets submodule track master, update it
Noam Postavsky [Tue, 17 Jun 2014 23:40:55 +0000 (19:40 -0400)]
Make snippets submodule track master, update it

This should let us update the submodule just by running
    git submodule update --remote
rather than having to cd into it, and then pull.

9 years agoReplace text -> yas-text in documentation
Noam Postavsky [Tue, 17 Jun 2014 23:21:22 +0000 (19:21 -0400)]
Replace text -> yas-text in documentation

* doc/snippet-development.org: replace text -> yas-text

10 years agoCloses #474: fix more cc-mode font-lock conflicts
Noam Postavsky [Wed, 14 May 2014 23:49:11 +0000 (19:49 -0400)]
Closes #474: fix more cc-mode font-lock conflicts

* yasnippet-tests.el (example-for-issue-474): Don't call insert from
  within backquotes, it's redundant and prevents proper testing of
  backquote expansion.

* yasnippet.el (yas--restore-backquotes, yas--save-backquotes): Ensure
  the buffer isn't narrowed while modifying it to avoid conflicting with
  cc-mode fontification.

10 years agoFix publishing with org 7.9
Noam Postavsky [Sun, 11 May 2014 20:58:01 +0000 (16:58 -0400)]
Fix publishing with org 7.9

* doc/yas-doc-helper.el: Only use org-html-publish-to-html when it's
  fbound.

10 years agoDocument type directive
Noam Postavsky [Sat, 10 May 2014 22:51:45 +0000 (18:51 -0400)]
Document type directive

* doc/snippet-development.org: Add type to directive list.

10 years agoDocument uuid directive
Noam Postavsky [Sat, 10 May 2014 20:28:09 +0000 (16:28 -0400)]
Document uuid directive

* doc/snippet-development.org: Mention uuid in directive list.
* yasnippet.el (yas-define-snippets): Fix docstring grammar.

10 years agoRestore backquotes lost in rst -> org translation
Noam Postavsky [Sat, 10 May 2014 18:07:58 +0000 (14:07 -0400)]
Restore backquotes lost in rst -> org translation

* doc/snippet-development.org: Re-add lost `s.

10 years agoRemove type, expand-env from new snippet value
Noam Postavsky [Sat, 10 May 2014 22:48:37 +0000 (18:48 -0400)]
Remove type, expand-env from new snippet value

They are seldom used, and can cause errors if left in.

* yasnippet.el (yas-new-snippet-default): Remove type and expand-env
  directives.