Gnus development mailing list
 help / color / mirror / Atom feed
From: Paul Stodghill <stodghil@CS.Cornell.EDU>
Cc: Simon Josefsson <jas@pdc.kth.se>, "'ding@gnus.org'" <ding@gnus.org>
Subject: Re: message archiving + spaces in group names?
Date: 25 Jun 2000 11:04:36 -0400	[thread overview]
Message-ID: <m3og4ppzsr.fsf@MILHOUSE.cs.cornell.edu> (raw)
In-Reply-To: Kai.Grossjohann@CS.Uni-Dortmund.DE's message of "Sun, 25 Jun 2000 16:24:40 +0200"

> Maybe gnus-inews-do-gcc shouldn't use message-tokenize-header to split
> the header, or it should remove double quotes if present.

How about this:

--- message.el.ORIG	Sun Jun 25 10:55:40 2000
+++ message.el	Sun Jun 25 10:56:05 2000
@@ -1029,9 +1029,12 @@
   `(delete-region (progn (beginning-of-line) (point))
 		  (progn (forward-line ,(or n 1)) (point))))
 
-(defun message-tokenize-header (header &optional separator)
+(defun message-tokenize-header (header &optional separator
+				       remove-quotes)
   "Split HEADER into a list of header elements.
-\",\" is used as the separator."
+SEPARATOR is a string of characters to be used as separators.
+\",\" is used by default. If REMOVE-QUOTES is true then remove 
+double quotes (\") from the resulting tokens."
   (if (not header)
       nil
     (let ((regexp (format "[%s]+" (or separator ",")))
@@ -1061,7 +1064,19 @@
 		((and (eq (char-after) ?\))
 		      (not quoted))
 		 (setq paren nil))))
-	(nreverse elems)))))
+	(setq elems (nreverse elems))
+	(if remove-quotes
+	    (setq elems
+		  (mapcar
+		   (lambda (item)
+		     (let (ind)
+		       (while (setq ind (string-match "\"" item))
+			 (setq item (concat
+				     (substring item 0 ind)
+				     (substring item (+ ind 1)))))
+		       item))
+		   elems)))
+	elems))))
 
 (defun message-mail-file-mbox-p (file)
   "Say whether FILE looks like a Unix mbox file."
--- gnus-msg.el.ORIG	Sun Jun 25 10:56:48 2000
+++ gnus-msg.el	Sun Jun 25 10:59:28 2000
@@ -1021,7 +1021,7 @@
 	  (when gcc
 	    (message-remove-header "gcc")
 	    (widen)
-	    (setq groups (message-tokenize-header gcc " ,"))
+	    (setq groups (message-tokenize-header gcc " ," t))
 	    ;; Copy the article over to some group(s).
 	    (while (setq group (pop groups))
 	      (gnus-check-server
--- nnimap.el.ORIG	Mon Apr 24 15:01:43 2000
+++ nnimap.el	Sun Jun 25 10:59:21 2000
@@ -737,7 +737,7 @@
 (deffoo nnimap-request-post (&optional server)
   (let ((success t))
     (dolist  (mbx (message-tokenize-header
-		   (message-fetch-field "Newsgroups")) success)
+		   (message-fetch-field "Newsgroups") nil t) success)
       (let ((to-newsgroup (gnus-group-prefixed-name mbx gnus-command-method)))
 	(or (gnus-active to-newsgroup)
 	    (gnus-activate-group to-newsgroup)




  reply	other threads:[~2000-06-25 15:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-06-25 14:12 Paul Stodghill
2000-06-25 14:24 ` Kai Großjohann
2000-06-25 15:04   ` Paul Stodghill [this message]
2000-06-26  9:52     ` Simon Josefsson
  -- strict thread matches above, loose matches on Subject: below --
2000-06-25 13:48 Paul Stodghill
2000-06-25 14:04 ` Kai Großjohann
2000-06-21 17:58 Paul Stodghill
2000-06-24 10:13 ` Simon Josefsson

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=m3og4ppzsr.fsf@MILHOUSE.cs.cornell.edu \
    --to=stodghil@cs.cornell.edu \
    --cc=ding@gnus.org \
    --cc=jas@pdc.kth.se \
    /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).