From: Gerd Moellmann Date: Thu, 27 Jan 2000 16:53:17 +0000 (+0000) Subject: (rmail-dont-reply-to): Replace matched X-Git-Tag: emacs-pretest-21.0.90~5234 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a0b796e3ede0f72979ab63d99cac04eb6a73c732;p=emacs.git (rmail-dont-reply-to): Replace matched userids differently. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7be61485f1b..58cfe239096 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2000-01-27 Gerd Moellmann + * mail/mail-utils.el (rmail-dont-reply-to): Replace matched + userids differently. + * progmodes/ebnf2ps.el, progmodes/ebnf-bnf.el, progmodes/ebnf-iso.el, progmodes/ebnf-otz.el, 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." ;; Include the human name that precedes . "\\([^\,.<\"]\\|\"[^\"]*\"\\)*" "<\\(" rmail-dont-reply-to-names "\\)" - "\\)")) + "\\)[^,]*")) (case-fold-search t) pos epos) (while (setq pos (string-match match userids pos)) - (if (> pos 0) (setq pos (match-beginning 2))) - (setq epos - ;; Delete thru the next comma, plus whitespace after. - (if (string-match ",[ \t\n]*" userids (match-end 0)) - (match-end 0) - (length userids))) - ;; Count the double-quotes since the beginning of the list. - ;; Reject this match if it is inside a pair of doublequotes. - (let (quote-pos inside-quotes) - (while (and (setq quote-pos (string-match "\"" userids quote-pos)) - (< quote-pos pos)) - (setq quote-pos (1+ quote-pos)) - (setq inside-quotes (not inside-quotes))) + ;; If there's a match, it starts at the beginning of the string, + ;; or with `,'. We must delete from that position to the + ;; end of the user-id which starts at match-beginning 2. + (let (inside-quotes quote-pos) + (save-match-data + (while (and (setq quote-pos (string-match "\"" userids quote-pos)) + (< quote-pos pos)) + (setq quote-pos (1+ quote-pos)) + (setq inside-quotes (not inside-quotes)))) (if inside-quotes ;; Advance to next even-parity quote, and scan from there. (setq pos (string-match "\"" userids pos)) - (setq userids - (mail-string-delete - userids pos epos))))) + (setq userids (replace-match "" nil nil userids))))) ;; get rid of any trailing commas (if (setq pos (string-match "[ ,\t\n]*\\'" userids)) (setq userids (substring userids 0 pos))) @@ -256,6 +250,7 @@ Usenet paths ending in an element that matches are removed also." (if (string-match "\\s *" userids) (substring userids (match-end 0)) userids))) + ;;;###autoload (defun mail-fetch-field (field-name &optional last all list)