emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master be2f815 140/177: Closes #508: Ensure original point when e


From: João Távora
Subject: [elpa] master be2f815 140/177: Closes #508: Ensure original point when evaluating conditions
Date: Sat, 28 Mar 2015 15:41:29 +0000

branch: master
commit be2f815c43deb74e0f809ed47debc4aa2e67ea1e
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>

    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.
---
 yasnippet.el |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/yasnippet.el b/yasnippet.el
index c25d78d..f26cc3f 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -1257,11 +1257,13 @@ Returns (TEMPLATES START END). This function respects
                  (setq methods (cdr methods))))
               (t
                (yas--warning "Warning invalid element %s in 
`yas-key-syntaxes'" method)))
-        (setq templates
-              (mapcan #'(lambda (table)
-                          (yas--fetch table (buffer-substring-no-properties 
(point)
-                                                                            
original)))
-                      (yas--get-snippet-tables))))
+        (let ((possible-key (buffer-substring-no-properties (point) original)))
+          (save-excursion
+            (goto-char original)
+            (setq templates
+                  (mapcan #'(lambda (table)
+                              (yas--fetch table possible-key))
+                          (yas--get-snippet-tables))))))
       (when templates
         (list templates (point) original)))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]