From: David Bremner Date: Fri, 12 Feb 2010 03:01:07 +0000 (-0400) Subject: notmuch.el: convert sparse keymap to a list in notmuch-substitute-one-command-key... X-Git-Tag: 0.1~87 X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=commitdiff_plain;h=b20bc7028dbc413d270122d187e6afffbee008e5 notmuch.el: convert sparse keymap to a list in notmuch-substitute-one-command-key-with-prefix The previous version would crash when a key was bound to a sparse keymap, since apparently these are not straightforward lists. The usage of map-keymap is a bit obscure: it only has side-effects, no return value. --- diff --git a/notmuch.el b/notmuch.el index 342ce6ab..82471b57 100644 --- a/notmuch.el +++ b/notmuch.el @@ -1000,8 +1000,12 @@ For a mouse binding, return nil." (if (mouse-event-p key) nil (if (keymapp action) - (let ((substitute (apply-partially 'notmuch-substitute-one-command-key-with-prefix (notmuch-prefix-key-description key)))) - (mapconcat substitute (cdr action) "\n")) + (let ((substitute (apply-partially 'notmuch-substitute-one-command-key-with-prefix (notmuch-prefix-key-description key))) + (as-list)) + (map-keymap (lambda (a b) + (push (cons a b) as-list)) + action) + (mapconcat substitute as-list "\n")) (concat prefix (format-kbd-macro (vector key)) "\t" (notmuch-documentation-first-line action))))))