diff options
| author | Gerd Moellmann | 2000-01-27 16:53:17 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-01-27 16:53:17 +0000 |
| commit | a0b796e3ede0f72979ab63d99cac04eb6a73c732 (patch) | |
| tree | d57daae259ea6d7fd36352d6ecbef1d13db691a7 | |
| parent | ffe0bcd1bb1aea4fbb37a91b9a855ffd23a5e589 (diff) | |
| download | emacs-a0b796e3ede0f72979ab63d99cac04eb6a73c732.tar.gz emacs-a0b796e3ede0f72979ab63d99cac04eb6a73c732.zip | |
(rmail-dont-reply-to): Replace matched
userids differently.
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/mail/mail-utils.el | 29 |
2 files changed, 15 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7be61485f1b..58cfe239096 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2000-01-27 Gerd Moellmann <gerd@gnu.org> | 1 | 2000-01-27 Gerd Moellmann <gerd@gnu.org> |
| 2 | 2 | ||
| 3 | * mail/mail-utils.el (rmail-dont-reply-to): Replace matched | ||
| 4 | userids differently. | ||
| 5 | |||
| 3 | * progmodes/ebnf2ps.el, progmodes/ebnf-bnf.el, | 6 | * progmodes/ebnf2ps.el, progmodes/ebnf-bnf.el, |
| 4 | progmodes/ebnf-iso.el, progmodes/ebnf-otz.el, | 7 | progmodes/ebnf-iso.el, progmodes/ebnf-otz.el, |
| 5 | progmodes/ebnf-yac.el: New files. | 8 | progmodes/ebnf-yac.el: New files. |
diff --git a/lisp/mail/mail-utils.el b/lisp/mail/mail-utils.el index f5409512068..870f4ba1001 100644 --- a/lisp/mail/mail-utils.el +++ b/lisp/mail/mail-utils.el | |||
| @@ -226,29 +226,23 @@ Usenet paths ending in an element that matches are removed also." | |||
| 226 | ;; Include the human name that precedes <foo@bar>. | 226 | ;; Include the human name that precedes <foo@bar>. |
| 227 | "\\([^\,.<\"]\\|\"[^\"]*\"\\)*" | 227 | "\\([^\,.<\"]\\|\"[^\"]*\"\\)*" |
| 228 | "<\\(" rmail-dont-reply-to-names "\\)" | 228 | "<\\(" rmail-dont-reply-to-names "\\)" |
| 229 | "\\)")) | 229 | "\\)[^,]*")) |
| 230 | (case-fold-search t) | 230 | (case-fold-search t) |
| 231 | pos epos) | 231 | pos epos) |
| 232 | (while (setq pos (string-match match userids pos)) | 232 | (while (setq pos (string-match match userids pos)) |
| 233 | (if (> pos 0) (setq pos (match-beginning 2))) | 233 | ;; If there's a match, it starts at the beginning of the string, |
| 234 | (setq epos | 234 | ;; or with `,'. We must delete from that position to the |
| 235 | ;; Delete thru the next comma, plus whitespace after. | 235 | ;; end of the user-id which starts at match-beginning 2. |
| 236 | (if (string-match ",[ \t\n]*" userids (match-end 0)) | 236 | (let (inside-quotes quote-pos) |
| 237 | (match-end 0) | 237 | (save-match-data |
| 238 | (length userids))) | 238 | (while (and (setq quote-pos (string-match "\"" userids quote-pos)) |
| 239 | ;; Count the double-quotes since the beginning of the list. | 239 | (< quote-pos pos)) |
| 240 | ;; Reject this match if it is inside a pair of doublequotes. | 240 | (setq quote-pos (1+ quote-pos)) |
| 241 | (let (quote-pos inside-quotes) | 241 | (setq inside-quotes (not inside-quotes)))) |
| 242 | (while (and (setq quote-pos (string-match "\"" userids quote-pos)) | ||
| 243 | (< quote-pos pos)) | ||
| 244 | (setq quote-pos (1+ quote-pos)) | ||
| 245 | (setq inside-quotes (not inside-quotes))) | ||
| 246 | (if inside-quotes | 242 | (if inside-quotes |
| 247 | ;; Advance to next even-parity quote, and scan from there. | 243 | ;; Advance to next even-parity quote, and scan from there. |
| 248 | (setq pos (string-match "\"" userids pos)) | 244 | (setq pos (string-match "\"" userids pos)) |
| 249 | (setq userids | 245 | (setq userids (replace-match "" nil nil userids))))) |
| 250 | (mail-string-delete | ||
| 251 | userids pos epos))))) | ||
| 252 | ;; get rid of any trailing commas | 246 | ;; get rid of any trailing commas |
| 253 | (if (setq pos (string-match "[ ,\t\n]*\\'" userids)) | 247 | (if (setq pos (string-match "[ ,\t\n]*\\'" userids)) |
| 254 | (setq userids (substring userids 0 pos))) | 248 | (setq userids (substring userids 0 pos))) |
| @@ -256,6 +250,7 @@ Usenet paths ending in an element that matches are removed also." | |||
| 256 | (if (string-match "\\s *" userids) | 250 | (if (string-match "\\s *" userids) |
| 257 | (substring userids (match-end 0)) | 251 | (substring userids (match-end 0)) |
| 258 | userids))) | 252 | userids))) |
| 253 | |||
| 259 | 254 | ||
| 260 | ;;;###autoload | 255 | ;;;###autoload |
| 261 | (defun mail-fetch-field (field-name &optional last all list) | 256 | (defun mail-fetch-field (field-name &optional last all list) |