X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=emacs%2Fnotmuch.el;h=1e617752ad3174ec081bb4935999b376bf30a126;hp=270f9833bd0e437a527255de73a5eaf03d445153;hb=a74ec0edd65f46eca097fd7784aaaef88801267e;hpb=e3260d025389c2e98dbda58cff1c214497813bc2 diff --git a/emacs/notmuch.el b/emacs/notmuch.el index 270f9833..1e617752 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -164,16 +164,23 @@ For a mouse binding, return nil." "\t" (notmuch-documentation-first-line action)))))) -(defalias 'notmuch-substitute-one-command-key - (apply-partially 'notmuch-substitute-one-command-key-with-prefix nil)) +(defun notmuch-substitute-command-keys-one (key) + ;; A `keymap' key indicates inheritance from a parent keymap - the + ;; inherited mappings follow, so there is nothing to print for + ;; `keymap' itself. + (when (not (eq key 'keymap)) + (notmuch-substitute-one-command-key-with-prefix nil key))) (defun notmuch-substitute-command-keys (doc) "Like `substitute-command-keys' but with documentation, not function names." (let ((beg 0)) (while (string-match "\\\\{\\([^}[:space:]]*\\)}" doc beg) - (let ((map (substring doc (match-beginning 1) (match-end 1)))) - (setq doc (replace-match (mapconcat 'notmuch-substitute-one-command-key - (cdr (symbol-value (intern map))) "\n") 1 1 doc))) + (let* ((keymap-name (substring doc (match-beginning 1) (match-end 1))) + (keymap (symbol-value (intern keymap-name)))) + (setq doc (replace-match + (mapconcat #'notmuch-substitute-command-keys-one + (cdr keymap) "\n") + 1 1 doc))) (setq beg (match-end 0))) doc)) @@ -438,7 +445,7 @@ Complete list of currently available key bindings: "*") 32 nil nil t)) crypto-switch) - (error "End of search results")))) + (message "End of search results.")))) (defun notmuch-search-reply-to-thread (&optional prompt-for-sender) "Begin composing a reply to the entire current thread in a new buffer." @@ -646,9 +653,9 @@ This function advances the next thread when finished." Here is an example of how to color search results based on tags. (the following text would be placed in your ~/.emacs file): - (setq notmuch-search-line-faces '((\"delete\" . '(:foreground \"red\" - :background \"blue\")) - (\"unread\" . '(:foreground \"green\")))) + (setq notmuch-search-line-faces '((\"delete\" . (:foreground \"red\" + :background \"blue\")) + (\"unread\" . (:foreground \"green\")))) The attributes defined for matching tags are merged, with later attributes overriding earlier. A message having both \"delete\"