X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch.el;h=82471b57dc9b4cabb7271e73b61e4a80a4ada3a9;hp=977ee2786631f182288100afc18f174d7b9bf6d4;hb=b20bc7028dbc413d270122d187e6afffbee008e5;hpb=e6c6bf3250475ead63a8306342d3af1d2d48e18a diff --git a/notmuch.el b/notmuch.el index 977ee278..82471b57 100644 --- a/notmuch.el +++ b/notmuch.el @@ -225,6 +225,38 @@ Unlike builtin `previous-line' this version accepts no arguments." (re-search-forward notmuch-show-tags-regexp) (split-string (buffer-substring (match-beginning 1) (match-end 1))))) +(defun notmuch-show-get-bcc () + "Return BCC address(es) of current message" + (notmuch-show-get-header-field 'bcc)) + +(defun notmuch-show-get-cc () + "Return CC address(es) of current message" + (notmuch-show-get-header-field 'cc)) + +(defun notmuch-show-get-date () + "Return Date of current message" + (notmuch-show-get-header-field 'date)) + +(defun notmuch-show-get-from () + "Return From address of current message" + (notmuch-show-get-header-field 'from)) + +(defun notmuch-show-get-subject () + "Return Subject of current message" + (notmuch-show-get-header-field 'subject)) + +(defun notmuch-show-get-to () + "Return To address(es) of current message" + (notmuch-show-get-header-field 'to)) + +(defun notmuch-show-get-header-field (name) + "Retrieve the header field NAME from the current message. +NAME should be a symbol, in lower case, as returned by +mail-header-extract-no-properties" + (let* ((result (assoc name (notmuch-show-get-header))) + (val (and result (cdr result)))) + val)) + (defun notmuch-show-get-header () "Retrieve and parse the header from the current message. Returns an alist with of (header . value) where header is a symbol and value is a string. The summary from notmuch-show is returned as the @@ -968,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))))))