Gnus development mailing list
 help / color / mirror / Atom feed
From: Sven Joachim <svenjoac@gmx.de>
To: ding@gnus.org
Subject: Re: expirable mark lost in nnfolder groups
Date: Tue, 21 Dec 2010 17:00:37 +0100	[thread overview]
Message-ID: <87ipynnmje.fsf@turtle.gmx.de> (raw)
In-Reply-To: <8739prpekz.fsf@turtle.gmx.de> (Sven Joachim's message of "Tue, 21 Dec 2010 12:09:32 +0100")

On 2010-12-21 12:09 +0100, Sven Joachim wrote:

> Hi,
>
> expiration seems to be broken (at least) in nnfolder groups.  I can mark
> an article as expirable (or set auto-expire to t in the group
> parameters), but upon leaving and re-entering the group, all expirable
> marks are lost. :-( Anyone else seeing this?

Bisecting shows that commit 06eeefe0 is the first "bad" one, fully cited
(with "git show") below.

Sven


commit 06eeefe0c892fd77f7a79493fa4f1db0f8058761
Author: Lars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Date:   Thu Dec 16 18:58:19 2010 +0100

    Clear up nnml expiry target performance regressions.
    
    Fix previous fix by having nnfolder save all its buffers
    explicitly.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9036447..bac3f9e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,14 @@
+2010-12-16  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* nnfolder.el (nnfolder-save-all-buffers): Refactor out into its own
+	function.
+	(nnfolder-request-expire-articles): Save all the buffers after doing
+	expiry.
+
+	* nnmail.el (nnmail-expiry-target-group): Revert the "all articles are
+	the last article", since that led to serious performance regressions
+	when expiring nnml groups.
+
 2010-12-16  Andrew Cohen  <cohen@andy.bu.edu>
 
 	* nnir.el: Improve customizations.
diff --git a/lisp/nnfolder.el b/lisp/nnfolder.el
index 5de8653..f0a21c5 100644
--- a/lisp/nnfolder.el
+++ b/lisp/nnfolder.el
@@ -322,20 +322,20 @@ the group.  Then the marks file will be regenerated properly by Gnus.")
   (when nnfolder-get-new-mail
     (nnfolder-possibly-change-group group server)
     (nnmail-get-new-mail
-     'nnfolder
-     (lambda ()
-       (let ((bufs nnfolder-buffer-alist))
-	 (save-excursion
-	   (while bufs
-	     (if (not (gnus-buffer-live-p (nth 1 (car bufs))))
-		 (setq nnfolder-buffer-alist
-		       (delq (car bufs) nnfolder-buffer-alist))
-	       (set-buffer (nth 1 (car bufs)))
-	       (nnfolder-save-buffer)
-	       (kill-buffer (current-buffer)))
-	     (setq bufs (cdr bufs))))))
-     nnfolder-directory
-     group)))
+     'nnfolder 'nnfolder-save-all-buffers
+     nnfolder-directory group)))
+
+(defun nnfolder-save-all-buffers ()
+  (let ((bufs nnfolder-buffer-alist))
+    (save-excursion
+      (while bufs
+	(if (not (gnus-buffer-live-p (nth 1 (car bufs))))
+	    (setq nnfolder-buffer-alist
+		  (delq (car bufs) nnfolder-buffer-alist))
+	  (set-buffer (nth 1 (car bufs)))
+	  (nnfolder-save-buffer)
+	  (kill-buffer (current-buffer)))
+	(setq bufs (cdr bufs))))))
 
 ;; Don't close the buffer if we're not shutting down the server.  This way,
 ;; we can keep the buffer in the group buffer cache, and not have to grovel
@@ -488,7 +488,8 @@ the group.  Then the marks file will be regenerated properly by Gnus.")
       (nnfolder-save-buffer)
       (nnfolder-adjust-min-active newsgroup)
       (nnfolder-save-active nnfolder-group-alist nnfolder-active-file)
-      (gnus-sorted-difference articles (nreverse deleted-articles)))))
+      (gnus-sorted-difference articles (nreverse deleted-articles)))
+    (nnfolder-save-all-buffers)))
 
 (deffoo nnfolder-request-move-article (article group server accept-form
 					       &optional last move-is-internal)
diff --git a/lisp/nnmail.el b/lisp/nnmail.el
index 06b464c..c86e96b 100644
--- a/lisp/nnmail.el
+++ b/lisp/nnmail.el
@@ -1915,7 +1915,7 @@ If TIME is nil, then return the cutoff time for oldness instead."
     (unless (eq target 'delete)
       (when (or (gnus-request-group target)
 		(gnus-request-create-group target))
-	(let ((group-art (gnus-request-accept-article target nil t t)))
+	(let ((group-art (gnus-request-accept-article target nil nil t)))
 	  (when (and (consp group-art)
 		     (cdr group-art))
 	    (gnus-group-mark-article-read target (cdr group-art))))))))



  reply	other threads:[~2010-12-21 16:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-21 11:09 Sven Joachim
2010-12-21 16:00 ` Sven Joachim [this message]
2011-01-02  6:51   ` Lars Magne Ingebrigtsen

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=87ipynnmje.fsf@turtle.gmx.de \
    --to=svenjoac@gmx.de \
    --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).