* lisp/emacs-lisp/lisp-mnt.el (lm-crack-address): Right-trim name.

The addresses might be aligned in which case we have to trim the
extra whitespace at the end of the names.
This commit is contained in:
Jonas Bernoulli 2021-05-22 21:58:53 +02:00
parent 1439e9bfad
commit 0e3668b233

View file

@ -360,10 +360,10 @@ Return argument is of the form (\"HOLDER\" \"YEAR1\" ... \"YEARN\")"
"Split up an email address X into full name and real email address.
The value is a cons of the form (FULLNAME . ADDRESS)."
(cond ((string-match "\\(.+\\) [(<]\\(\\S-+@\\S-+\\)[>)]" x)
(cons (match-string 1 x)
(cons (string-trim-right (match-string 1 x))
(match-string 2 x)))
((string-match "\\(\\S-+@\\S-+\\) [(<]\\(.*\\)[>)]" x)
(cons (match-string 2 x)
(cons (string-trim-right (match-string 2 x))
(match-string 1 x)))
((string-match "\\S-+@\\S-+" x)
(cons nil x))