]> git.notmuchmail.org Git - notmuch/commitdiff
emacs: help: add base-keymap
authorMark Walters <markwalters1009@gmail.com>
Tue, 12 Nov 2013 20:10:57 +0000 (20:10 +0000)
committerDavid Bremner <david@tethera.net>
Thu, 14 Nov 2013 01:46:39 +0000 (21:46 -0400)
To support key remapping in emacs help we need to know the base keymap
when looking at the remapping. keep track of this while we recurse
down the sub-keymaps in help.

emacs/notmuch-lib.el

index 065645c88234d7091e3b256153e6a01110583be9..3eedd7103bc20e8beb02045e17aad45194a11833 100644 (file)
@@ -260,7 +260,7 @@ It does not prepend if ACTUAL-KEY is already listed in TAIL."
            tail)))
     tail)
 
-(defun notmuch-describe-keymap (keymap ua-keys &optional prefix tail)
+(defun notmuch-describe-keymap (keymap ua-keys base-keymap &optional prefix tail)
   "Return a list of cons cells, each describing one binding in KEYMAP.
 
 Each cons cell consists of a string giving a human-readable
@@ -277,7 +277,7 @@ prefix argument.  PREFIX and TAIL are used internally."
           ((keymapp binding)
            (setq tail
                  (notmuch-describe-keymap
-                  binding ua-keys (notmuch-prefix-key-description key) tail)))
+                  binding ua-keys base-keymap (notmuch-prefix-key-description key) tail)))
           (binding
            (setq tail (notmuch-describe-key (vector key) binding prefix ua-keys tail)))))
    keymap)
@@ -292,7 +292,7 @@ prefix argument.  PREFIX and TAIL are used internally."
               (let* ((keymap-name (substring doc (match-beginning 1) (match-end 1)))
                      (keymap (symbol-value (intern keymap-name)))
                      (ua-keys (where-is-internal 'universal-argument keymap t))
-                     (desc-alist (notmuch-describe-keymap keymap ua-keys))
+                     (desc-alist (notmuch-describe-keymap keymap ua-keys keymap))
                      (desc-list (mapcar (lambda (arg) (concat (car arg) "\t" (cdr arg))) desc-alist)))
                 (mapconcat #'identity desc-list "\n")))))
        (setq doc (replace-match desc 1 1 doc)))