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

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

[elpa] master dc098cf 25/40: Fix yas--message verbosity levels


From: Noam Postavsky
Subject: [elpa] master dc098cf 25/40: Fix yas--message verbosity levels
Date: Wed, 26 Oct 2016 23:06:33 +0000 (UTC)

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

    Fix yas--message verbosity levels
    
    The yas--message function was comparing with `>' instead of `>=', which
    meant it was quieter than intended (i.e., level 3 message were being
    suppressed by defualt).  Also push the "Snippet %d exited" message up to
    level 4, so the net effect should actually be quieter than before for
    normal usage (the only level 3 messages are now for loading and saving
    snippets).
    
    * yasnippet.el (yas--message): Fix off-by-1 error.
    (yas--load-snippet-dirs): Lowest yas--message level should be 1, not 0.
    (yas--commit-snippet): "Snippet %d exited" is more of a debug message,
    put it at level 4.
---
 yasnippet.el |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/yasnippet.el b/yasnippet.el
index d7e780b..1dfadb2 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -1836,7 +1836,7 @@ prompt the user to select one."
                    (yas--message 4 "Loaded %s" directory)
                  (yas--message 4 "Prepared just-in-time loading for %s" 
directory)))
               (t
-               (push (yas--message 0 "Check your `yas-snippet-dirs': %s is not 
a directory" directory) errors)))))
+               (push (yas--message 1 "Check your `yas-snippet-dirs': %s is not 
a directory" directory) errors)))))
     errors))
 
 (defun yas-reload-all (&optional no-jit interactive)
@@ -3215,7 +3215,7 @@ This renders the snippet as ordinary text."
       ;; again from `yas--take-care-of-redo'....
       (setf (yas--snippet-fields snippet) nil)))
 
-  (yas--message 3 "Snippet %s exited." (yas--snippet-id snippet)))
+  (yas--message 4 "Snippet %s exited." (yas--snippet-id snippet)))
 
 (defun yas--safely-run-hooks (hook-var)
   (condition-case error
@@ -4432,8 +4432,8 @@ object satisfying `yas--field-p' to restrict the 
expansion to.")))
   "Log level for `yas--message' 4 means trace most anything, 0 means nothing.")
 
 (defun yas--message (level message &rest args)
-  "When LEVEL is above `yas-verbosity-level', log MESSAGE and ARGS."
-  (when (> yas-verbosity level)
+  "When LEVEL is at or below `yas-verbosity-level', log MESSAGE and ARGS."
+  (when (>= yas-verbosity level)
     (message "%s" (apply #'yas--format message args))))
 
 (defun yas--warning (format-control &rest format-args)



reply via email to

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