Gnus development mailing list
 help / color / mirror / Atom feed
From: Josh Huber <huber@alum.wpi.edu>
Subject: nnmail-cache-insert fixes
Date: Mon, 13 May 2002 16:29:12 -0400	[thread overview]
Message-ID: <87vg9rn65j.fsf@alum.wpi.edu> (raw)

This is with regards to the nnmail-cache-insert cleanup Kai and I
talked about a few days ago.

This is a first attempt, and since I'm touching a bunch of backends
(or was that back ends? ;)  I'd like to make sure everyone gets to see
what's going on.

Everywhere nnmail-cache-insert was called it seems as though the group
is available (I previously has thought otherwise):

$> grep nnmail-cache-insert *.el | grep -v defun
nnbabyl.el:	 (nnmail-cache-insert (nnmail-fetch-field "message-id") group))
nnbabyl.el:	   (nnmail-cache-insert (nnmail-fetch-field "message-id") group))
nndiary.el:	(nnmail-cache-insert (nnmail-fetch-field "message-id") group))
nnfolder.el:	  (nnmail-cache-insert (nnmail-fetch-field "message-id") group))
nnimap.el:			     (nnmail-cache-insert (nnmail-fetch-field
nnimap.el:		      (nnmail-cache-insert (nnmail-fetch-field "message-id")
nnmail.el:      (nnmail-cache-insert message-id (caar group-art)))
nnmbox.el:	 (nnmail-cache-insert (nnmail-fetch-field "message-id") group))
nnmh.el:    (nnmail-cache-insert (nnmail-fetch-field "message-id") group))
nnml.el:      (nnmail-cache-insert (nnmail-fetch-field "message-id") group))

How does the following diff look?

Index: lisp/nnbabyl.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/nnbabyl.el,v
retrieving revision 6.8
diff -u -b -r6.8 nnbabyl.el
--- lisp/nnbabyl.el	2002/02/20 00:15:32	6.8
+++ lisp/nnbabyl.el	2002/05/13 20:36:01
@@ -349,7 +349,7 @@
 	 (while (re-search-backward "^X-Gnus-Newsgroup: " beg t)
 	   (delete-region (point) (progn (forward-line 1) (point)))))
        (when nnmail-cache-accepted-message-ids
-	 (nnmail-cache-insert (nnmail-fetch-field "message-id")))
+	 (nnmail-cache-insert (nnmail-fetch-field "message-id") group))
        (setq result
 	     (if (stringp group)
 		 (list (cons group (nnbabyl-active-number group)))
@@ -365,7 +365,7 @@
        (insert-buffer-substring buf)
        (when last
 	 (when nnmail-cache-accepted-message-ids
-	   (nnmail-cache-insert (nnmail-fetch-field "message-id")))
+	   (nnmail-cache-insert (nnmail-fetch-field "message-id") group))
 	 (save-buffer)
 	 (nnmail-save-active nnbabyl-group-alist nnbabyl-active-file))
        result))))
Index: lisp/nndiary.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/nndiary.el,v
retrieving revision 1.5
diff -u -b -r1.5 nndiary.el
--- lisp/nndiary.el	2001/11/06 15:06:21	1.5
+++ lisp/nndiary.el	2002/05/13 20:36:01
@@ -759,7 +759,7 @@
   (when (nndiary-schedule)
     (let (result)
       (when nnmail-cache-accepted-message-ids
-	(nnmail-cache-insert (nnmail-fetch-field "message-id")))
+	(nnmail-cache-insert (nnmail-fetch-field "message-id") group))
       (if (stringp group)
 	  (and
 	   (nnmail-activate 'nndiary)
Index: lisp/nnfolder.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/nnfolder.el,v
retrieving revision 6.40
diff -u -b -r6.40 nnfolder.el
--- lisp/nnfolder.el	2002/05/01 00:26:33	6.40
+++ lisp/nnfolder.el	2002/05/13 20:36:01
@@ -489,7 +489,7 @@
 	(while (re-search-backward (concat "^" nnfolder-article-marker) nil t)
 	  (delete-region (point) (progn (forward-line 1) (point))))
 	(when nnmail-cache-accepted-message-ids
-	  (nnmail-cache-insert (nnmail-fetch-field "message-id")))
+	  (nnmail-cache-insert (nnmail-fetch-field "message-id") group))
 	(setq result (if (stringp group)
 			 (list (cons group (nnfolder-active-number group)))
 		       (setq art-group
Index: lisp/nnimap.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/nnimap.el,v
retrieving revision 6.32
diff -u -b -r6.32 nnimap.el
--- lisp/nnimap.el	2002/05/01 20:25:59	6.32
+++ lisp/nnimap.el	2002/05/13 20:36:02
@@ -1381,7 +1381,8 @@
 		    (while (search-forward "\n" nil t)
 		      (replace-match "\r\n"))
 		    (when nnmail-cache-accepted-message-ids
-		      (nnmail-cache-insert (nnmail-fetch-field "message-id"))))
+		      (nnmail-cache-insert (nnmail-fetch-field "message-id")
+					   group)))
 		  (when (and last nnmail-cache-accepted-message-ids)
 		    (nnmail-cache-close))
 		  ;; this 'or' is for Cyrus server bug
Index: lisp/nnmail.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/nnmail.el,v
retrieving revision 6.40
diff -u -b -r6.40 nnmail.el
--- lisp/nnmail.el	2002/05/07 15:32:17	6.40
+++ lisp/nnmail.el	2002/05/13 20:36:02
@@ -1466,27 +1466,28 @@
     ;; which has an argument GROUP-ART which is a list of pairs, and
     ;; the car of a pair is a group name.  Should we check that the
     ;; length of the list is equal to 1? -- kai
-    (let ((g nil))
-      (cond (grp
-	     (setq g grp))
-	    ((and (boundp 'group-art) group-art (listp group-art))
-	     (setq g (caar group-art)))
-	    ((and (boundp 'group) group)
-	     (setq g group))
-	    ((and (boundp 'group-art-list) group-art-list
-		  (listp group-art-list))
-	     (setq g (caar group-art-list)))
-	    (t (setq g "")))
+;     (let ((g nil))
+;       (cond (grp
+; 	     (setq g grp))
+; 	    ((and (boundp 'group-art) group-art (listp group-art))
+; 	     (setq g (caar group-art)))
+; 	    ((and (boundp 'group) group)
+; 	     (setq g group))
+; 	    ((and (boundp 'group-art-list) group-art-list
+; 		  (listp group-art-list))
+; 	     (setq g (caar group-art-list)))
+; 	    (t (setq g "")))
       (unless (gnus-buffer-live-p nnmail-cache-buffer)
 	(nnmail-cache-open))
       (save-excursion
 	(set-buffer nnmail-cache-buffer)
 	(goto-char (point-max))
-	(if (and g (not (string= "" g))
+      (if (and grp (not (string= "" grp))
 		 (gnus-methods-equal-p gnus-command-method
 				       (nnmail-cache-primary-mail-backend)))
-	    (insert id "\t" g "\n")
-	  (insert id "\n"))))))
+	  (insert id "\t" grp "\n")
+	(insert id "\n")))))
+; )
 
 (defun nnmail-cache-primary-mail-backend ()
   (let ((be-list (cons gnus-select-method gnus-secondary-select-methods))
@@ -1588,7 +1589,7 @@
      ((not duplication)
       (funcall func (setq group-art
 			  (nreverse (nnmail-article-group artnum-func))))
-      (nnmail-cache-insert message-id))
+      (nnmail-cache-insert message-id (caar group-art)))
      ((eq action 'delete)
       (setq group-art nil))
      ((eq action 'warn)
Index: lisp/nnmbox.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/nnmbox.el,v
retrieving revision 6.13
diff -u -b -r6.13 nnmbox.el
--- lisp/nnmbox.el	2002/04/12 11:51:01	6.13
+++ lisp/nnmbox.el	2002/05/13 20:36:02
@@ -332,7 +332,7 @@
        (while (re-search-backward "^X-Gnus-Newsgroup: " nil t)
 	 (delete-region (point) (progn (forward-line 1) (point))))
        (when nnmail-cache-accepted-message-ids
-	 (nnmail-cache-insert (nnmail-fetch-field "message-id")))
+	 (nnmail-cache-insert (nnmail-fetch-field "message-id") group))
        (setq result (if (stringp group)
 			(list (cons group (nnmbox-active-number group)))
 		      (nnmail-article-group 'nnmbox-active-number)))
Index: lisp/nnmh.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/nnmh.el,v
retrieving revision 6.8
diff -u -b -r6.8 nnmh.el
--- lisp/nnmh.el	2002/02/20 00:15:32	6.8
+++ lisp/nnmh.el	2002/05/13 20:36:02
@@ -316,7 +316,7 @@
   (nnmh-possibly-change-directory group server)
   (nnmail-check-syntax)
   (when nnmail-cache-accepted-message-ids
-    (nnmail-cache-insert (nnmail-fetch-field "message-id")))
+    (nnmail-cache-insert (nnmail-fetch-field "message-id") group))
   (nnheader-init-server-buffer)
   (prog1
       (if (stringp group)

-- 
Josh Huber



             reply	other threads:[~2002-05-13 20:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-13 20:29 Josh Huber [this message]
     [not found] <1526678368.1021321742728.JavaMail.root@monkey>
2002-05-13 20:47 ` Rory Molinari
2002-05-13 20:48 ` Rory Molinari

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=87vg9rn65j.fsf@alum.wpi.edu \
    --to=huber@alum.wpi.edu \
    /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).