]> git.eshelyaron.com Git - emacs.git/commitdiff
Clarify mail-header address parsing doc strings
authorLars Ingebrigtsen <larsi@gnus.org>
Sat, 30 Jul 2022 11:40:59 +0000 (13:40 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sat, 30 Jul 2022 11:40:59 +0000 (13:40 +0200)
* lisp/mail/mail-parse.el (mail-header-parse-address-lax):
* lisp/mail/ietf-drums.el (ietf-drums-parse-address): Clarify what
these functions do (bug#56824).

lisp/mail/ietf-drums.el
lisp/mail/mail-parse.el

index d1ad671b160c490a8b83c4d0a9b0841d33527a53..b7d96a1053de3c5b1ac3b00f70d2f7df13c0404f 100644 (file)
@@ -189,6 +189,19 @@ the Content-Transfer-Encoding header of a mail."
 
 (defun ietf-drums-parse-address (string &optional decode)
   "Parse STRING and return a MAILBOX / DISPLAY-NAME pair.
+STRING here is supposed to be an RFC822(bis) mail address, and
+will commonly look like, for instance:
+
+  \"=?utf-8?Q?Andr=C3=A9?= <andre@example.com>\"
+
+If you have an already-decoded address, like
+
+  \"AndrĂ© <andre@example.com>\"
+
+this function can't be used to parse that.  Instead, use
+`mail-header-parse-address-lax' to make a guess at what's the
+name and what's the address.
+
 If DECODE, the DISPLAY-NAME will have RFC2047 decoding performed
 (that's the \"=?utf...q...=?\") stuff."
   (when decode
index ec719850e2ed4eae2c1329a444163c933cede725..d28b8b58438052ac13da2467c6f538316ba90793 100644 (file)
@@ -85,10 +85,10 @@ The return value is a list with mail/name pairs."
   "Parse STRING as a mail address.
 Returns a mail/name pair.
 
-This function will first try to parse STRING as a
-standards-compliant address string, and if that fails, try to use
-heuristics to determine the email address and the name in the
-string."
+This function uses heuristics to determine the email address and
+the name in the string.  If you have an RFC822(bis)
+standards-compliant STRING, use `mail-header-parse-address'
+instead."
   (with-temp-buffer
     (insert (string-clean-whitespace string))
     ;; Find the bit with the @ and guess that that's the mail.