mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-25 04:18:08 +01:00
Add functions notmuch-show-get-(bcc, cc, date, from, subject, to).
Return the corresponding header field for the current message as a string. These are thin wrappers around notmuch-show-get-header, which means they each cause a full parse of the RFC822 header. The main idea is to fix an api.
This commit is contained in:
parent
e6c6bf3250
commit
1137ce11e1
1 changed files with 32 additions and 0 deletions
32
notmuch.el
32
notmuch.el
|
@ -225,6 +225,38 @@ Unlike builtin `previous-line' this version accepts no arguments."
|
||||||
(re-search-forward notmuch-show-tags-regexp)
|
(re-search-forward notmuch-show-tags-regexp)
|
||||||
(split-string (buffer-substring (match-beginning 1) (match-end 1)))))
|
(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 ()
|
(defun notmuch-show-get-header ()
|
||||||
"Retrieve and parse the header from the current message. Returns an alist with of (header . value)
|
"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
|
where header is a symbol and value is a string. The summary from notmuch-show is returned as the
|
||||||
|
|
Loading…
Reference in a new issue