all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#21071: Gnus message flags must be set before expiration, not afterwards
@ 2015-07-16  0:14 Nikolaus Rath
  2015-07-16  0:21 ` Glenn Morris
  0 siblings, 1 reply; 4+ messages in thread
From: Nikolaus Rath @ 2015-07-16  0:14 UTC (permalink / raw
  To: 21071; +Cc: ding, emacs-devel

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.«





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: bug#21071: Gnus message flags must be set before expiration, not afterwards
  2015-07-16  0:14 bug#21071: Gnus message flags must be set before expiration, not afterwards Nikolaus Rath
@ 2015-07-16  0:21 ` Glenn Morris
       [not found]   ` <87fv4p2b9n.fsf@vostro.rath.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Glenn Morris @ 2015-07-16  0:21 UTC (permalink / raw
  To: Nikolaus Rath; +Cc: ding, 21071, emacs-devel


You don't need to x-debbugs-cc every bug report you make to emacs-devel
and ding@gnus.org, thus sending it to 3 (including gnus-bug) separate
mailing lists. Just the bug list is fine.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: bug#21071: Gnus message flags must be set before expiration, not afterwards
       [not found]   ` <87fv4p2b9n.fsf@vostro.rath.org>
@ 2015-10-06 21:03     ` Nikolaus Rath
  2019-09-27 16:04       ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Nikolaus Rath @ 2015-10-06 21:03 UTC (permalink / raw
  To: 21071; +Cc: ding, emacs-devel

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.«



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#21071: Gnus message flags must be set before expiration, not afterwards
  2015-10-06 21:03     ` Nikolaus Rath
@ 2019-09-27 16:04       ` Lars Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2019-09-27 16:04 UTC (permalink / raw
  To: 21071; +Cc: ding

Nikolaus Rath <Nikolaus@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





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-09-27 16:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-16  0:14 bug#21071: Gnus message flags must be set before expiration, not afterwards Nikolaus Rath
2015-07-16  0:21 ` Glenn Morris
     [not found]   ` <87fv4p2b9n.fsf@vostro.rath.org>
2015-10-06 21:03     ` Nikolaus Rath
2019-09-27 16:04       ` Lars Ingebrigtsen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.