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

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

[elpa] master f7ef023 137/177: Prevent disabling errors from recent `yas


From: João Távora
Subject: [elpa] master f7ef023 137/177: Prevent disabling errors from recent `yas-current-syntaxes` logic
Date: Sat, 28 Mar 2015 15:41:27 +0000

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

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

diff --git a/yasnippet.el b/yasnippet.el
index ea5fe33..821e748 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -1243,7 +1243,7 @@ Returns (TEMPLATES START END). This function respects
                            'again)
                  (setq methods (cdr methods))))
               (t
-               (error "[yas] invalid element in `yas-key-syntaxes'")))
+               (yas--warning "Warning invalid element %s in 
`yas-key-syntaxes'" method)))
         (setq templates
               (mapcan #'(lambda (table)
                           (yas--fetch table (buffer-substring-no-properties 
(point)
@@ -4366,6 +4366,11 @@ object satisfying `yas--field-p' to restrict the 
expansion to.")))
   (when (> yas-verbosity level)
     (message "%s" (apply #'yas--format message args))))
 
+(defun yas--warning (format-control &rest format-args)
+  (let ((msg (apply #'format format-control format-args)))
+    (display-warning 'yasnippet msg :warning)
+    (yas--message 1 msg)))
+
 (defun yas--format (format-control &rest format-args)
   (apply #'format (concat "[yas] " format-control) format-args))
 



reply via email to

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