GNU bug report logs - #21071
Gnus message flags must be set before expiration, not afterwards

Previous Next

Packages: emacs, gnus;

Reported by: Nikolaus Rath <Nikolaus <at> rath.org>

Date: Thu, 16 Jul 2015 00:15:02 UTC

Severity: minor

Tags: fixed

Merged with 28331

Found in versions 5.130014, 5.13

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 21071 in the body.
You can then email your comments to 21071 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to ding <at> gnus.org, emacs-devel <at> gnu.org, bugs <at> gnus.org:
bug#21071; Package gnus. (Thu, 16 Jul 2015 00:15:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nikolaus Rath <Nikolaus <at> rath.org>:
New bug report received and forwarded. Copy sent to ding <at> gnus.org, emacs-devel <at> gnu.org, bugs <at> gnus.org. (Thu, 16 Jul 2015 00:15:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Nikolaus Rath <Nikolaus <at> rath.org>
To: submit <at> debbugs.gnu.org
Subject: Gnus message flags must be set before expiration, not afterwards
Date: Wed, 15 Jul 2015 17:14:47 -0700
Package: gnus

Hello,

If you perform the following steps:

1. Enter an nnimap group with expiry-target set to another nnimap group,
   and expiry-wait 'immediate.
2. Select an unread article, mark it as read
3. Also mark the article for expiry
4. Leave the group

.. then the article will be in the target group, but it will still be
unread.

As far as I can tell, this is because Gnus is running
nn*-request-expire-articles *before* nn*-request-set-mark rather than
the other way around.


Best,
-Nikolaus


-- 
GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F
Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«




Information forwarded to bugs <at> gnus.org:
bug#21071; Package gnus. (Thu, 16 Jul 2015 00:23:02 GMT) Full text and rfc822 format available.

Message #8 received at 21071 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Nikolaus Rath <Nikolaus <at> rath.org>
Cc: ding <at> gnus.org, 21071 <at> debbugs.gnu.org, emacs-devel <at> gnu.org
Subject: Re: bug#21071: Gnus message flags must be set before expiration,
 not afterwards
Date: Wed, 15 Jul 2015 20:21:43 -0400
You don't need to x-debbugs-cc every bug report you make to emacs-devel
and ding <at> gnus.org, thus sending it to 3 (including gnus-bug) separate
mailing lists. Just the bug list is fine.




Information forwarded to bugs <at> gnus.org:
bug#21071; Package gnus. (Tue, 06 Oct 2015 21:04:02 GMT) Full text and rfc822 format available.

Message #11 received at 21071 <at> debbugs.gnu.org (full text, mbox):

From: Nikolaus Rath <Nikolaus <at> rath.org>
To: 21071 <at> debbugs.gnu.org
Cc: ding <ding <at> gnus.org>, emacs-devel <emacs-devel <at> gnu.org>
Subject: Re: bug#21071: Gnus message flags must be set before expiration,
 not afterwards
Date: Tue, 06 Oct 2015 14:03:12 -0700
Hello,

This issue is caused by article expiry being done in
gnus-summary-prepare-exit-hook. gnus-summary-exit calls this hook before
calling gnus-update-read-articles (which sets the read mark).

A trivial patch is to invert the order:

#V+
diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el
index 37a707e..56406d0 100644
--- a/lisp/gnus-sum.el
+++ b/lisp/gnus-sum.el
@@ -7252,7 +7252,6 @@ If FORCE (the prefix), also save the .newsrc file(s)."
        (gnus-score-adaptive))
       (when gnus-use-scoring
        (gnus-score-save)))
-    (gnus-run-hooks 'gnus-summary-prepare-exit-hook)
     (when gnus-use-cache
       (gnus-cache-possibly-remove-articles)
       (gnus-cache-save-buffers))
@@ -7269,6 +7268,7 @@ If FORCE (the prefix), also save the .newsrc file(s)."
     (unless quit-config
       (gnus-run-hooks 'gnus-exit-group-hook)
       (gnus-summary-update-info))
+    (gnus-run-hooks 'gnus-summary-prepare-exit-hook)
     (gnus-close-group group)
     ;; Make sure where we were, and go to next newsgroup.
     (when (buffer-live-p (get-buffer gnus-group-buffer))
#V-

I did not find any specific guarantees on when
gnus-summary-prepare-exit-hook is called in the documentation, but that
doesn't mean that people are not relying on the current calling
order. Would a change like that nevertheless be acceptable?


Alternatively, is what do people think about removing
gnus-summary-expire-articles from the default value of
gnus-summary-prepare-exit-hook and explicitly calling
gnus-summary-expire-articles from gnus-summary-exit?


Best,
-Nikolaus

-- 
GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F
Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«




Information forwarded to bugs <at> gnus.org:
bug#21071; Package gnus. (Thu, 26 Jan 2017 19:46:02 GMT) Full text and rfc822 format available.

Message #14 received at 21071 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: 21071 <at> debbugs.gnu.org
Cc: Nikolaus Rath <Nikolaus <at> rath.org>, ding <ding <at> gnus.org>
Subject: Re: bug#21071: Gnus message flags must be set before expiration,
 not afterwards
Date: Thu, 26 Jan 2017 20:43:53 +0100
Nikolaus Rath <Nikolaus <at> rath.org> writes:

> I did not find any specific guarantees on when
> gnus-summary-prepare-exit-hook is called in the documentation, but that
> doesn't mean that people are not relying on the current calling
> order. Would a change like that nevertheless be acceptable?
>
> Alternatively, is what do people think about removing
> gnus-summary-expire-articles from the default value of
> gnus-summary-prepare-exit-hook and explicitly calling
> gnus-summary-expire-articles from gnus-summary-exit?

I don't know why that function is in that hook by default; it seems
kinda messy.  But removing things from hooks isn't that easy since
people add things, or set values explicitly.

But we could call gnus-summary-expire-articles in the natural place
unless it's in that hook, perhaps?  And then remove it from the default
value and hope for the best.

Patches welcome.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug reassigned from package 'gnus' to 'emacs,gnus'. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 26 Jan 2017 19:46:03 GMT) Full text and rfc822 format available.

Forcibly Merged 21071 28331. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 12 Apr 2018 16:44:01 GMT) Full text and rfc822 format available.

Removed tag(s) moreinfo. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 09 Jan 2019 19:39:02 GMT) Full text and rfc822 format available.

Forcibly Merged 21071 28331 33232. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 23 Jun 2019 13:02:01 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 21071 <at> debbugs.gnu.org and Nikolaus Rath <Nikolaus <at> rath.org> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 23 Jun 2019 13:03:02 GMT) Full text and rfc822 format available.

Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 23 Jun 2019 13:03:02 GMT) Full text and rfc822 format available.

Disconnected #33232 from all other report(s). Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 23 Jun 2019 13:04:02 GMT) Full text and rfc822 format available.

Removed tag(s) wontfix. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 29 Jul 2019 22:29:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#21071; Package emacs,gnus. (Fri, 27 Sep 2019 16:06:01 GMT) Full text and rfc822 format available.

Message #33 received at 21071 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: 21071 <at> debbugs.gnu.org
Cc: ding <ding <at> gnus.org>
Subject: Re: bug#21071: Gnus message flags must be set before expiration,
 not afterwards
Date: Fri, 27 Sep 2019 18:04:53 +0200
Nikolaus Rath <Nikolaus <at> rath.org> writes:

> This issue is caused by article expiry being done in
> gnus-summary-prepare-exit-hook. gnus-summary-exit calls this hook before
> calling gnus-update-read-articles (which sets the read mark).
>
> A trivial patch is to invert the order:
>
> #V+
> diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el
> index 37a707e..56406d0 100644
> --- a/lisp/gnus-sum.el
> +++ b/lisp/gnus-sum.el
> @@ -7252,7 +7252,6 @@ If FORCE (the prefix), also save the .newsrc file(s)."
>         (gnus-score-adaptive))
>        (when gnus-use-scoring
>         (gnus-score-save)))
> -    (gnus-run-hooks 'gnus-summary-prepare-exit-hook)
>      (when gnus-use-cache
>        (gnus-cache-possibly-remove-articles)
>        (gnus-cache-save-buffers))
> @@ -7269,6 +7268,7 @@ If FORCE (the prefix), also save the .newsrc file(s)."
>      (unless quit-config
>        (gnus-run-hooks 'gnus-exit-group-hook)
>        (gnus-summary-update-info))
> +    (gnus-run-hooks 'gnus-summary-prepare-exit-hook)
>      (gnus-close-group group)
>      ;; Make sure where we were, and go to next newsgroup.
>      (when (buffer-live-p (get-buffer gnus-group-buffer))
> #V-

Staring at the change some more, I think it should be safe-ish.  Nothing
really visible that should affect the functions in that hook happens
between the old and new place (except the marks stuff), so I've applied
it.

If this leads to regressions in somebody's setup, we'll have to revert
it, though.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 27 Sep 2019 16:06:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 21071 <at> debbugs.gnu.org and Nikolaus Rath <Nikolaus <at> rath.org> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 27 Sep 2019 16:06:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 26 Oct 2019 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 234 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.