]> git.eshelyaron.com Git - emacs.git/commitdiff
(mail-strip-quoted-names):
authorRichard M. Stallman <rms@gnu.org>
Sat, 9 May 1998 06:40:53 +0000 (06:40 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 9 May 1998 06:40:53 +0000 (06:40 +0000)
Delete comments, then delete leading/trailing whitespace.

lisp/mail/mail-utils.el

index 6fae8509a116364a9cde82c7c8c200c1e5752fd4..849fb517c625ef7ecd3a0e9105f616ddea5074be 100644 (file)
@@ -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