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

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

[elpa] master 555c5c1 13/21: Demote errors in which-key--process-define-


From: Justin Burkett
Subject: [elpa] master 555c5c1 13/21: Demote errors in which-key--process-define-key-args
Date: Mon, 8 Jan 2018 22:46:56 -0500 (EST)

branch: master
commit 555c5c1da8942b24d457578d0fc23564de07fb17
Author: Justin Burkett <address@hidden>
Commit: Justin Burkett <address@hidden>

    Demote errors in which-key--process-define-key-args
---
 which-key.el | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/which-key.el b/which-key.el
index 15b599a..fdef15b 100644
--- a/which-key.el
+++ b/which-key.el
@@ -913,15 +913,16 @@ If AT-ROOT is non-nil the binding is also placed at the 
root of MAP."
 to `which-key-replacement-alist' so that this binding is replaced
 in which-key with DESCRIPTION. This function is meant to be used
 as :before advice for `define-key'."
-  (when (and (consp def)
-             (stringp (car def))
-             (symbolp (cdr def)))
-    (let ((key-desc (regexp-quote (key-description key))))
-      (push (cons (cons (format "%s\\'" key-desc)
-                        (when (cdr def)
-                          (format "\\`%s\\'" (symbol-name (cdr def)))))
-                  (cons nil (car def)))
-            which-key-replacement-alist))))
+  (with-demoted-errors "Which-key extended define-key error: %s"
+    (when (and (consp def)
+               (stringp (car def))
+               (symbolp (cdr def)))
+      (let ((key-desc (regexp-quote (key-description key))))
+        (push (cons (cons (format "%s\\'" key-desc)
+                          (when (cdr def)
+                            (format "\\`%s\\'" (symbol-name (cdr def)))))
+                    (cons nil (car def)))
+              which-key-replacement-alist)))))
 
 (when which-key-enable-extended-define-key
   (advice-add #'define-key :before #'which-key--process-define-key-args))



reply via email to

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