Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Does gnus-summary-move-article need to clear the marks?
@ 2023-01-10 20:22 Kevin Boulain
  0 siblings, 0 replies; only message in thread
From: Kevin Boulain @ 2023-01-10 20:22 UTC (permalink / raw)
  To: info-gnus-english


I'm trying out Gnus and the IMAP server from which I'm getting my emails
is running a Sieve script that takes some actions, including setting a
bunch of IMAP keywords/flags ('client' ones, not the system ones like
\Seen as per

When an email with these custom flags is marked as read (via 'd',
gnus-summary-mark-as-read-forward) and moved to another IMAP folder (via
'B m', gnus-summary-move-article) it loses its flags.

In the IMAP log (that I got with nnimap-record-commands) I can see:

A quick Edebug breakpoint on nnimap-request-set-mark (where the magic
seems to happen) gives the following backtrace:
  nnimap-request-set-mark("INBOX" (((65) set (read)) ((65) del (unexist seen forward unsend download cache save score dormant bookmark killed expire reply tick))) "$SERVER")
  gnus-request-set-mark("nnimap+$SERVER:INBOX" (((65) set (read)) ((65) del (unexist seen forward unsend download cache save score dormant bookmark killed expire reply tick))))
  funcall-interactively(gnus-summary-move-article nil)

So the issue appears to be that gnus-summary-push-marks-to-backend calls
gnus-request-set-mark with 'set:

Should it be 'add instead, which should preserve the set of flags?

Similarly to what marking as read does:
From around here:

This patch appears to work but I'm not familiar with the code:
diff --git i/lisp/gnus/gnus-sum.el w/lisp/gnus/gnus-sum.el
index 3f350bffb3..a13777cd95 100644
--- i/lisp/gnus/gnus-sum.el
+++ w/lisp/gnus/gnus-sum.el
@@ -10390 +10390 @@ ACTION can be either `move' (the default), `crosspost' or `copy'."
-    (gnus-request-set-mark gnus-newsgroup-name `(((,article) set ,set)
+    (gnus-request-set-mark gnus-newsgroup-name `(((,article) add ,set)

PS: I sent a similar email to a few days ago but it
doesn't look like it went through. Apologies if it ends up duplicated.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-10 21:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-10 20:22 Does gnus-summary-move-article need to clear the marks? Kevin Boulain

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