summaryrefslogtreecommitdiff
path: root/lisp/mail/mail-utils.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1998-05-09 06:40:53 +0000
committerRichard M. Stallman <rms@gnu.org>1998-05-09 06:40:53 +0000
commitee019c842f1d9fa06f7977e1bd1d9842e69088c7 (patch)
treec00ade929d6de0d92d57e9f7f2c0f5f3dcb63b25 /lisp/mail/mail-utils.el
parentfd88fe732dd5335b371e8005b2e5e36db273112a (diff)
downloademacs-ee019c842f1d9fa06f7977e1bd1d9842e69088c7.tar.gz
(mail-strip-quoted-names):
Delete comments, then delete leading/trailing whitespace.
Diffstat (limited to 'lisp/mail/mail-utils.el')
-rw-r--r--lisp/mail/mail-utils.el13
1 files changed, 7 insertions, 6 deletions
diff --git a/lisp/mail/mail-utils.el b/lisp/mail/mail-utils.el
index 6fae8509a11..849fb517c62 100644
--- a/lisp/mail/mail-utils.el
+++ b/lisp/mail/mail-utils.el
@@ -112,12 +112,6 @@ Return a modified address list."
(progn (require 'rfc822)
(mapconcat 'identity (rfc822-addresses address) ", "))
(let (pos)
- (string-match "\\`[ \t\n]*" address)
- ;; strip surrounding whitespace
- (setq address (substring address
- (match-end 0)
- (string-match "[ \t\n]*\\'" address
- (match-end 0))))
;; Detect nested comments.
(if (string-match "[ \t]*(\\([^)\\]\\|\\\\.\\|\\\\\n\\)*(" address)
@@ -149,6 +143,13 @@ Return a modified address list."
(mail-string-delete address
pos (match-end 0)))))
+ ;; strip surrounding whitespace
+ (string-match "\\`[ \t\n]*" address)
+ (setq address (substring address
+ (match-end 0)
+ (string-match "[ \t\n]*\\'" address
+ (match-end 0))))
+
;; strip `quoted' names (This is supposed to hack `"Foo Bar" <bar@host>')
(setq pos 0)
(while (setq pos (string-match