diff options
| -rw-r--r-- | lisp/mail/mail-utils.el | 13 |
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 |