Previously notmuch-help would show two entries for keys in a parent
keymap that were over-ridden in the local keymap.  This keeps track of
which keys have been seen and thus avoids these spurious duplicate
entries.

Currently only pick does this but I think we might easily have the
problem elsewhere in the future.

Since most of the diff is indentation I include a word-diff below
(which is why there is a cover letter and single patch).


Best wishes

Mark



Mark Walters (1):
  emacs: don't show duplicate keys in help.

 emacs/notmuch.el |   45 ++++++++++++++++++++++++---------------------
 1 files changed, 24 insertions(+), 21 deletions(-)

word-diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index c47c6b5..4f4e2e7 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -150,8 +150,11 @@ for an overview of how this documentation is extracted.
 UA-KEYS should be a key sequence bound to `universal-argument'.
 It will be used to describe bindings of commands that support a
 prefix argument.  PREFIX and TAIL are used internally."
+  (let (keys-seen)
   (map-keymap
    (lambda (key binding)
+       (unless (memq key keys-seen)
+        (push key keys-seen)
      (cond ((mouse-event-p key) nil)
           ((keymapp binding)
            (setq tail
@@ -169,8 +172,8 @@ prefix argument.  PREFIX and TAIL are used internally."
            (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)))))
+     keymap))
   tail)
 
 (defun notmuch-substitute-command-keys (doc)




-- 
1.7.9.1

_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch

Reply via email to