[PATCH 1/4] emacs: help: check for nil key binding
Mark Walters
markwalters1009 at gmail.com
Sat Oct 26 14:04:36 PDT 2013
A standard way to unset a key binding is local-unset-key which is equivalent to
(define-key (current-local-map) key nil)
Currently notmuch-help gives an error and fails if a user has done this.
To fix this we check for a nil binding before adding a help line.
---
emacs/notmuch.el | 25 +++++++++++++------------
1 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 6081245..f98f8cf 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -158,18 +158,19 @@ prefix argument. PREFIX and TAIL are used internally."
(notmuch-describe-keymap
binding ua-keys (notmuch-prefix-key-description key) tail)))
(t
- (when (and ua-keys (symbolp binding)
- (get binding 'notmuch-prefix-doc))
- ;; Documentation for prefixed command
- (let ((ua-desc (key-description ua-keys)))
- (push (concat ua-desc " " prefix (format-kbd-macro (vector key))
- "\t" (get binding 'notmuch-prefix-doc))
- tail)))
- ;; Documentation for command
- (push (concat prefix (format-kbd-macro (vector key)) "\t"
- (or (and (symbolp binding) (get binding 'notmuch-doc))
- (notmuch-documentation-first-line binding)))
- tail))))
+ (unless (not binding)
+ (when (and ua-keys (symbolp binding)
+ (get binding 'notmuch-prefix-doc))
+ ;; Documentation for prefixed command
+ (let ((ua-desc (key-description ua-keys)))
+ (push (concat ua-desc " " prefix (format-kbd-macro (vector key))
+ "\t" (get binding 'notmuch-prefix-doc))
+ tail)))
+ ;; Documentation for command
+ (push (concat prefix (format-kbd-macro (vector key)) "\t"
+ (or (and (symbolp binding) (get binding 'notmuch-doc))
+ (notmuch-documentation-first-line binding)))
+ tail)))))
keymap)
tail)
--
1.7.9.1
More information about the notmuch
mailing list