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

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

[elpa] master c3a9447 43/63: Fix condition timestamps in key filter func


From: Noam Postavsky
Subject: [elpa] master c3a9447 43/63: Fix condition timestamps in key filter functions
Date: Mon, 17 Jul 2017 22:54:17 -0400 (EDT)

branch: master
commit c3a94478b461d99c0c99493a20ec5bd902254062
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    Fix condition timestamps in key filter functions
    
    * yasnippet.el (yas--maybe-expand-key-filter):
    (yas--maybe-expand-from-keymap-filter): Let-bind
    `yas--condition-cache-timestamp' to the current time.
---
 yasnippet.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/yasnippet.el b/yasnippet.el
index b4b4df5..b618f73 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -580,7 +580,9 @@ conditions.
   "Holds the YASnippet menu.")
 
 (defun yas--maybe-expand-key-filter (cmd)
-  (if (yas--templates-for-key-at-point) cmd))
+  (when (let ((yas--condition-cache-timestamp (current-time)))
+          (yas--templates-for-key-at-point))
+    cmd))
 
 (defconst yas-maybe-expand
   '(menu-item "" yas-expand :filter yas--maybe-expand-key-filter)
@@ -2230,7 +2232,8 @@ object satisfying `yas--field-p' to restrict the 
expansion to."
       (yas--fallback))))
 
 (defun yas--maybe-expand-from-keymap-filter (cmd)
-  (let* ((vec (cl-subseq (this-command-keys-vector)
+  (let* ((yas--condition-cache-timestamp (current-time))
+         (vec (cl-subseq (this-command-keys-vector)
                          (if current-prefix-arg
                              (length (this-command-keys))
                            0)))



reply via email to

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