Gnus development mailing list
 help / color / mirror / Atom feed
From: Didier Verna <verna@inf.enst.fr>
Subject: [PATCH] split group names with "\\n" in them
Date: 12 Apr 1999 15:49:46 +0200	[thread overview]
Message-ID: <qyju2um2bk5.fsf@metheny.enst.fr> (raw)


        I've found the problem that I reported earlier (where groups
containing \\n in their names generated a bogus mail:n group). The reason is
that nnmail-article-group passes non expanded group names to the functions
that update the active file. The following patch fixes it.


1999-04-12  Didier Verna  <verna@inf.enst.fr>

	* nnmail.el (nnmail-article-group): in case of a group name
	containing "\\n" constructs, be sure to pass the expanded value to 
	nn*-save-mail.

--- nnmail.el.old	Mon Apr 12 15:37:58 1999
+++ nnmail.el	Mon Apr 12 15:30:35 1999
@@ -856,7 +856,7 @@
   (let ((methods nnmail-split-methods)
 	(obuf (current-buffer))
 	(beg (point-min))
-	end group-art method regrepp)
+	end group-art method grp)
     (if (and (sequencep methods)
 	     (= (length methods) 1))
 	;; If there is only just one group to put everything in, we
@@ -923,25 +923,24 @@
 			  (not group-art)))
 	    (goto-char (point-max))
 	    (setq method (pop methods)
-		  regrepp nil)
+		  grp (car method))
 	    (if (or methods
 		    (not (equal "" (nth 1 method))))
 		(when (and
 		       (ignore-errors
 			 (if (stringp (nth 1 method))
-			     (progn
-			       (setq regrepp
-				     (string-match "\\\\[0-9&]" (car method)))
-			       (re-search-backward (cadr method) nil t))
+			     (let ((expand (string-match "\\\\[0-9&]" grp))
+				   (pos (re-search-backward (cadr method)
+							    nil t)))
+			       (and expand
+				    (setq grp (nnmail-expand-newtext grp)))
+			       pos)
 			   ;; Function to say whether this is a match.
-			   (funcall (nth 1 method) (car method))))
+			   (funcall (nth 1 method) grp)))
 		       ;; Don't enter the article into the same
 		       ;; group twice.
-		       (not (assoc (car method) group-art)))
-		  (push (cons (if regrepp
-				  (nnmail-expand-newtext (car method))
-				(car method))
-			      (funcall func (car method)))
+		       (not (assoc grp group-art)))
+		  (push (cons grp (funcall func grp))
 			group-art))
 	      ;; This is the final group, which is used as a
 	      ;; catch-all.
@@ -1375,9 +1374,9 @@
 				 (list
 				  :predicate
 				  `(lambda (file)
-				     (string-match 
+				     (string-match
 				      ,(concat
-					(regexp-quote (concat group suffix)) 
+					(regexp-quote (concat group suffix))
 					"$")
 				      file)))))))
 	(when nnmail-fetched-sources


-- 
    /     /   _   _       Didier Verna        http://www.inf.enst.fr/~verna/
 - / / - / / /_/ /      E.N.S.T. INF C201.1      mailto:verna@inf.enst.fr
/_/ / /_/ / /__ /        46 rue Barrault        Tel.   (33) 01 45 81 73 46
                      75634 Paris  cedex 13     Fax.   (33) 01 45 81 31 19


                 reply	other threads:[~1999-04-12 13:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=qyju2um2bk5.fsf@metheny.enst.fr \
    --to=verna@inf.enst.fr \
    /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).