diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2018-04-15 19:42:10 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2018-04-15 19:42:10 +0200 |
commit | a38f79a8fd9c48b8911cad34159a64e97811a0ee (patch) | |
tree | b1a0ace567a00bf20a699b49cfec816287b14b33 /lisp/mail/ietf-drums.el | |
parent | a3a9d5434d56f8736cc47e379a1d011d4c779b7c (diff) | |
download | emacs-a38f79a8fd9c48b8911cad34159a64e97811a0ee.tar.gz |
Allow `mail-header-parse-address' to decode encoded words
* lisp/mail/ietf-drums.el (ietf-drums-parse-address): Take an
optional parameter to decode the display name.
Diffstat (limited to 'lisp/mail/ietf-drums.el')
-rw-r--r-- | lisp/mail/ietf-drums.el | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/mail/ietf-drums.el b/lisp/mail/ietf-drums.el index 83042b42e87..9bdb9457428 100644 --- a/lisp/mail/ietf-drums.el +++ b/lisp/mail/ietf-drums.el @@ -185,7 +185,7 @@ STRING is assumed to be a string that is extracted from the Content-Transfer-Encoding header of a mail." (ietf-drums-remove-garbage (inline (ietf-drums-strip string)))) -(defun ietf-drums-parse-address (string) +(defun ietf-drums-parse-address (string &optional decode) "Parse STRING and return a MAILBOX / DISPLAY-NAME pair." (with-temp-buffer (let (display-name mailbox c display-string) @@ -236,7 +236,9 @@ the Content-Transfer-Encoding header of a mail." (cons (mapconcat 'identity (nreverse display-name) "") (ietf-drums-get-comment string))) - (cons mailbox display-string))))) + (cons mailbox (if decode + (rfc2047-decode-string display-string) + display-string)))))) (defun ietf-drums-parse-addresses (string &optional rawp) "Parse STRING and return a list of MAILBOX / DISPLAY-NAME pairs. |