]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow `mail-header-parse-address' to decode encoded words
authorLars Ingebrigtsen <larsi@gnus.org>
Sun, 15 Apr 2018 17:42:10 +0000 (19:42 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 15 Apr 2018 17:42:10 +0000 (19:42 +0200)
* lisp/mail/ietf-drums.el (ietf-drums-parse-address): Take an
optional parameter to decode the display name.

lisp/mail/ietf-drums.el

index 83042b42e87c887d7015fcff3aab4ffe01a0db98..9bdb9457428e92a679a4f5eddc75bfc8cd18c807 100644 (file)
@@ -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.