aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1998-05-09 06:40:53 +0000
committerRichard M. Stallman1998-05-09 06:40:53 +0000
commitee019c842f1d9fa06f7977e1bd1d9842e69088c7 (patch)
treec00ade929d6de0d92d57e9f7f2c0f5f3dcb63b25
parentfd88fe732dd5335b371e8005b2e5e36db273112a (diff)
downloademacs-ee019c842f1d9fa06f7977e1bd1d9842e69088c7.tar.gz
emacs-ee019c842f1d9fa06f7977e1bd1d9842e69088c7.zip
(mail-strip-quoted-names):
Delete comments, then delete leading/trailing whitespace.
-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."
112 (progn (require 'rfc822) 112 (progn (require 'rfc822)
113 (mapconcat 'identity (rfc822-addresses address) ", ")) 113 (mapconcat 'identity (rfc822-addresses address) ", "))
114 (let (pos) 114 (let (pos)
115 (string-match "\\`[ \t\n]*" address)
116 ;; strip surrounding whitespace
117 (setq address (substring address
118 (match-end 0)
119 (string-match "[ \t\n]*\\'" address
120 (match-end 0))))
121 115
122 ;; Detect nested comments. 116 ;; Detect nested comments.
123 (if (string-match "[ \t]*(\\([^)\\]\\|\\\\.\\|\\\\\n\\)*(" address) 117 (if (string-match "[ \t]*(\\([^)\\]\\|\\\\.\\|\\\\\n\\)*(" address)
@@ -149,6 +143,13 @@ Return a modified address list."
149 (mail-string-delete address 143 (mail-string-delete address
150 pos (match-end 0))))) 144 pos (match-end 0)))))
151 145
146 ;; strip surrounding whitespace
147 (string-match "\\`[ \t\n]*" address)
148 (setq address (substring address
149 (match-end 0)
150 (string-match "[ \t\n]*\\'" address
151 (match-end 0))))
152
152 ;; strip `quoted' names (This is supposed to hack `"Foo Bar" <bar@host>') 153 ;; strip `quoted' names (This is supposed to hack `"Foo Bar" <bar@host>')
153 (setq pos 0) 154 (setq pos 0)
154 (while (setq pos (string-match 155 (while (setq pos (string-match