Gnus development mailing list
 help / color / mirror / Atom feed
From: Alan Shutko <ats@acm.org>
Cc: ding@gnus.org
Subject: Re: Followup to names with commas
Date: 09 Jan 1999 09:47:15 -0600	[thread overview]
Message-ID: <m3ogo8mosc.fsf@hubert.wuh.wustl.edu> (raw)
In-Reply-To: Anders Melchiorsen's message of "09 Jan 1999 00:02:54 +0100"

>>>>> "A" == Anders Melchiorsen <postmaster@and.nospam.kampsax.k-net.dk> writes:

A> I just received a mail with approximately the following To:
A> header...  To: "Melchiorsen, Anders" <and@campsax.dtu.dk>

Iirc, that was a bug in rmail-dont-reply-to, and should be fixed in
recent Emacsen.  The patch probably didn't filter back to XEmacs.  Try
putting this somewhere and using it (current one from Emacs).  Someone
should probably mention this to the XEmacs people.

(defun rmail-dont-reply-to (userids)
  "Returns string of mail addresses USERIDS sans any recipients
that start with matches for `rmail-dont-reply-to-names'.
Usenet paths ending in an element that matches are removed also."
  (if (null rmail-dont-reply-to-names)
      (setq rmail-dont-reply-to-names
	    (concat (if rmail-default-dont-reply-to-names
			(concat rmail-default-dont-reply-to-names "\\|")
		        "")
		    (concat (regexp-quote (user-login-name))
			    "\\>"))))
  (let ((match (concat "\\(^\\|,\\)[ \t\n]*"
		       ;; Can anyone figure out what this is for?
		       ;; Is it an obsolete remnant of another way of
		       ;; handling Foo Bar <foo@machine>?
		       "\\([^,\n]*[!<]\\|\\)"
		       "\\("
			     rmail-dont-reply-to-names
		       "\\|"
		             ;; Include the human name that precedes <foo@bar>.
			     "\\([^\,.<\"]\\|\"[^\"]*\"\\)*"
			     "<\\(" 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 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)))))
    ;; get rid of any trailing commas
    (if (setq pos (string-match "[ ,\t\n]*\\'" userids))
	(setq userids (substring userids 0 pos)))
    ;; remove leading spaces. they bother me.
    (if (string-match "\\s *" userids)
	(substring userids (match-end 0))
      userids)))

-- 
Alan Shutko <ats@acm.org> - By consent of the corrupted
Love means nothing to a tennis player.


      parent reply	other threads:[~1999-01-09 15:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-08 23:02 Anders Melchiorsen
1999-01-09 15:38 ` Kai.Grossjohann
1999-01-09 15:51   ` Anders Melchiorsen
1999-01-10 16:34     ` Kai.Grossjohann
1999-01-09 15:47 ` Alan Shutko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3ogo8mosc.fsf@hubert.wuh.wustl.edu \
    --to=ats@acm.org \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).