[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 10ecde1 132/177: Pass start point to yas-key-syntaxes func
From: |
João Távora |
Subject: |
[elpa] master 10ecde1 132/177: Pass start point to yas-key-syntaxes functions |
Date: |
Sat, 28 Mar 2015 15:41:26 +0000 |
branch: master
commit 10ecde158e5efae11186aa4c261aaec6261e8e51
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>
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.
---
yasnippet-tests.el | 2 +-
yasnippet.el | 18 +++++++++---------
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/yasnippet-tests.el b/yasnippet-tests.el
index 8a845dc..12ca615 100644
--- a/yasnippet-tests.el
+++ b/yasnippet-tests.el
@@ -337,7 +337,7 @@ TODO: correct this bug!"
(let ((yas--foobarbaz t))
(yas-should-expand '(("foo-barbaz" . "OKfoo-barbazOK"))))
(let ((yas-key-syntaxes
- (cons #'(lambda ()
+ (cons #'(lambda (_start-point)
(unless (looking-back "-")
(backward-char)
'again))
diff --git a/yasnippet.el b/yasnippet.el
index e006d52..93eceb2 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -395,15 +395,15 @@ the trigger key itself."
Each element in this list specifies how to skip buffer positions
backwards and look for the start of a trigger key.
-Each element can be either a string or a functino of no
-arguments. A string element is simply passed to
-`skip-syntax-backward' whereas a function element is called with
-no arguments and should also place point before the original
+Each element can be either a string or a function receiving the
+original point as an argument. A string element is simply passed
+to `skip-syntax-backward' whereas a function element is called
+with no arguments and should also place point before the original
position.
The string between the resulting buffer position and the original
-point.in the is matched against the trigger keys in the active
-snippet tables.
+point is matched against the trigger keys in the active snippet
+tables.
If no expandable snippets are found, the next element is the list
is tried, unless a function element returned the symbol `again',
@@ -1239,7 +1239,7 @@ Returns (TEMPLATES START END). This function respects
(skip-syntax-backward method)
(setq methods (cdr methods)))
((functionp method)
- (unless (eq (funcall method)
+ (unless (eq (funcall method original)
'again)
(setq methods (cdr methods))))
(t
@@ -2729,7 +2729,7 @@ and `kill-buffer' instead."
;;; User convenience functions, for using in `yas-key-syntaxes'
-(defun yas-try-key-from-whitespace ()
+(defun yas-try-key-from-whitespace (_start-point)
"Go back to nearest whitespace.
A newline will be considered whitespace even if the mode syntax
@@ -2737,7 +2737,7 @@ marks it as something else (typically comment ender). Use
as
element of `yas-key-syntaxes'."
(skip-chars-backward "^[:space:]\n"))
-(defun yas-shortest-key-until-whitespace ()
+(defun yas-shortest-key-until-whitespace (_start-point)
"Return `again' until at whitespace.
A newline will be considered whitespace even if the mode syntax
- [elpa] master e53ec1e 124/177: Make snippets submodule track master, update it, (continued)
- [elpa] master e53ec1e 124/177: Make snippets submodule track master, update it, João Távora, 2015/03/28
- [elpa] master f98c527 123/177: Replace text -> yas-text in documentation, João Távora, 2015/03/28
- [elpa] master 763f5fa 122/177: Closes #474: fix more cc-mode font-lock conflicts, João Távora, 2015/03/28
- [elpa] master 2b24aea 126/177: Merge pull request #493 from npostavs/ijit, João Távora, 2015/03/28
- [elpa] master 280ece2 131/177: Add yas-shortest-key-until-whitespace, João Távora, 2015/03/28
- [elpa] master 0b7b34a 127/177: Closes #492, closes #494: Consider defalias when calculating parent modes, João Távora, 2015/03/28
- [elpa] master 7761dee 128/177: Closes #497: Allow functions as elements in yas-key-syntaxes, João Távora, 2015/03/28
- [elpa] master faed106 129/177: * yasnippet.el (yas-key-syntaxes): Improve documentation., João Távora, 2015/03/28
- [elpa] master de34d91 130/177: Closes #470, handle non-whitespace newlines, João Távora, 2015/03/28
- [elpa] master 6b04dad 120/177: Document type directive, João Távora, 2015/03/28
- [elpa] master 10ecde1 132/177: Pass start point to yas-key-syntaxes functions,
João Távora <=
- [elpa] master 47a3d5f 134/177: Fix yas-key-syntaxes example functions docstrings., João Távora, 2015/03/28
- [elpa] master d982b70 135/177: Fix edge case in yas-longest-key-from-whitespace, João Távora, 2015/03/28
- [elpa] master 5d10b5d 133/177: Add yas-longest-key-from-whitespace, João Távora, 2015/03/28
- [elpa] master f7ef023 137/177: Prevent disabling errors from recent `yas-current-syntaxes` logic, João Távora, 2015/03/28
- [elpa] master 1d4618b 138/177: Closes #504: Correctly discover buffers needing snippets immediately, João Távora, 2015/03/28
- [elpa] master e60e8b5 136/177: Merge pull request #503 from npostavs/key-syntaxes, João Távora, 2015/03/28
- [elpa] master 5b59b80 139/177: Closes #495: Allow symbols as aliases in `yas-snippet-dirs', João Távora, 2015/03/28
- [elpa] master be2f815 140/177: Closes #508: Ensure original point when evaluating conditions, João Távora, 2015/03/28
- [elpa] master 241465c 141/177: move eof footer to the actual eof, João Távora, 2015/03/28
- [elpa] master 70de821 143/177: enforce use of spaces for indentation, João Távora, 2015/03/28