aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2018-04-15 19:42:10 +0200
committerLars Ingebrigtsen2018-04-15 19:42:10 +0200
commita38f79a8fd9c48b8911cad34159a64e97811a0ee (patch)
treeb1a0ace567a00bf20a699b49cfec816287b14b33
parenta3a9d5434d56f8736cc47e379a1d011d4c779b7c (diff)
downloademacs-a38f79a8fd9c48b8911cad34159a64e97811a0ee.tar.gz
emacs-a38f79a8fd9c48b8911cad34159a64e97811a0ee.zip
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.
-rw-r--r--lisp/mail/ietf-drums.el6
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
185the Content-Transfer-Encoding header of a mail." 185the Content-Transfer-Encoding header of a mail."
186 (ietf-drums-remove-garbage (inline (ietf-drums-strip string)))) 186 (ietf-drums-remove-garbage (inline (ietf-drums-strip string))))
187 187
188(defun ietf-drums-parse-address (string) 188(defun ietf-drums-parse-address (string &optional decode)
189 "Parse STRING and return a MAILBOX / DISPLAY-NAME pair." 189 "Parse STRING and return a MAILBOX / DISPLAY-NAME pair."
190 (with-temp-buffer 190 (with-temp-buffer
191 (let (display-name mailbox c display-string) 191 (let (display-name mailbox c display-string)
@@ -236,7 +236,9 @@ the Content-Transfer-Encoding header of a mail."
236 (cons 236 (cons
237 (mapconcat 'identity (nreverse display-name) "") 237 (mapconcat 'identity (nreverse display-name) "")
238 (ietf-drums-get-comment string))) 238 (ietf-drums-get-comment string)))
239 (cons mailbox display-string))))) 239 (cons mailbox (if decode
240 (rfc2047-decode-string display-string)
241 display-string))))))
240 242
241(defun ietf-drums-parse-addresses (string &optional rawp) 243(defun ietf-drums-parse-addresses (string &optional rawp)
242 "Parse STRING and return a list of MAILBOX / DISPLAY-NAME pairs. 244 "Parse STRING and return a list of MAILBOX / DISPLAY-NAME pairs.