GNU bug report logs - #20670
[PATCH] nnimap: enable additional expunge options

Previous Next

Packages: emacs, gnus;

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

Date: Wed, 27 May 2015 03:24:01 UTC

Severity: normal

Tags: fixed, patch

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 20670 in the body.
You can then email your comments to 20670 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 help-debbugs <at> gnu.org:
bug#20670; Package debbugs.gnu.org. (Wed, 27 May 2015 03:24:01 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 help-debbugs <at> gnu.org. (Wed, 27 May 2015 03:24:02 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: [PATCH] nnimap: enable additional expunge options
Date: Tue, 26 May 2015 20:23:17 -0700
[Message part 1 (text/plain, inline)]
[ Apologies for the duplicate messages, I've confused bugs <at> gnus.org with
submit <at> debbugs.gnu.org ]

Hello,

If the IMAP server supports the UID EXPUNGE command, the nnimap backend
currently always expunges deleted articles.

If the IMAP server does not support this command, articles are either
not expunged at all (nnimap-expunge is nil), or ALL articles that are
currently flagged as deleted will be expunged when any one article is
deleted in Gnus.

The attached patch introduces three new settings for nnimap-expunge:

 * If nnimap-expunge is 'never, deleted articles are marked with the
   IMAP \\Delete flag but not automatically expunged.

 * If nnimap-expunge is 'immediately, deleted articles are immediately
   expunged (this requires the server to support the UID EXPUNGE
   command).

 * If nnimap-expunge is 'on-exit, deleted articles are flagged, and all
   flagged articles are expunged when the group is closed.

Note that none of these behaviors is available with the current settings
(nil / non-nil).

The 'on-exit setting is mostly useful as a safe-guard: as long as the
group is not closed, article deletions are reversal (either by using a
different IMAP client, or by exiting Gnus without updating the summary
buffer).

The 'never setting is not (yet) very useful because Gnus does not
distinguish between deleted articles and regular articles in the summary
buffer. However, this will be addressed by a separate patch.

I hope these patches will improve interoperability of Gnus with other
IMAP mail clients.

Thanks for considering.

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

[nnimap_expunge.diff (text/x-patch, attachment)]

Information forwarded to bugs <at> gnus.org:
bug#20670; Package gnus. (Fri, 03 Jul 2015 02:11:02 GMT) Full text and rfc822 format available.

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

From: Nikolaus Rath <Nikolaus <at> rath.org>
To: 20670 <at> debbugs.gnu.org, ding <at> gnus.org
Subject: [PATCH] nnimap: enable additional expunge options
Date: Thu, 02 Jul 2015 19:10:24 -0700
[Message part 1 (text/plain, inline)]
Hello,

If the IMAP server supports the UID EXPUNGE command, the nnimap backend
currently always expunges deleted articles.

If the IMAP server does not support this command, articles are either
not expunged at all (nnimap-expunge is nil), or ALL articles that are
currently flagged as deleted will be expunged when any one article is
deleted in Gnus.

The attached patch introduces three new settings for nnimap-expunge:

 * If nnimap-expunge is 'never, deleted articles are marked with the
   IMAP \\Delete flag but not automatically expunged.

 * If nnimap-expunge is 'immediately, deleted articles are immediately
   expunged (this requires the server to support the UID EXPUNGE
   command).

 * If nnimap-expunge is 'on-exit, deleted articles are flagged, and all
   flagged articles are expunged when the group is closed.

Note that none of these behaviors is available with the current settings
(nil / non-nil).

The 'on-exit setting is mostly useful as a safe-guard: as long as the
group is not closed, article deletions are reversal (either by using a
different IMAP client, or by exiting Gnus without updating the summary
buffer).

The 'never setting is not (yet) very useful because Gnus does not
distinguish between deleted articles and regular articles in the summary
buffer. However, this will be addressed by a separate patch.


Changes since v1:

 * Made first line of docstring a complete sentence.


Thanks for considering,
-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.«
[nnimap_expunge_v2.diff (text/x-diff, inline)]
diff --git a/nnimap.el b/nnimap.el
--- a/nnimap.el
+++ b/nnimap.el
@@ -103,10 +103,21 @@
 Possible choices are nil (use default methods), `anonymous',
 `login', `plain' and `cram-md5'.")
 
-(defvoo nnimap-expunge t
-  "If non-nil, expunge articles after deleting them.
-This is always done if the server supports UID EXPUNGE, but it's
-not done by default on servers that doesn't support that command.")
+(defvoo nnimap-expunge 'on-exit
+  "When to expunge deleted messages.
+If 'never, deleted articles are marked with the IMAP \\Delete
+flag but not automatically expunged. If 'immediately, deleted
+articles are immediately expunged (this requires the server to
+support the UID EXPUNGE command). If 'on-exit, deleted articles
+are flagged, and all flagged articles are expunged when the
+group is closed.
+
+For backwards compatibility, this variable may also be set to t
+or nil. If the server supports UID EXPUNGE, both t and nil are
+equivalent to 'immediately. If the server does not support UID
+EXPUNGE nil is equivalent to 'never, while t will immediately
+expunge ALL articles that are currently flagged as deleted
+(i.e., potentially not only the article that was just deleted).")
 
 (defvoo nnimap-streaming t
   "If non-nil, try to use streaming commands with IMAP servers.
@@ -865,7 +876,11 @@
     (nreverse articles)))
 
 (deffoo nnimap-close-group (group &optional server)
-  t)
+  (if (eq nnimap-expunge 'on-exit)
+      (with-current-buffer (nnimap-buffer)
+        (nnimap-wait-for-response
+         (nnimap-send-command "EXPUNGE")))
+    t))
 
 (deffoo nnimap-request-move-article (article group server accept-form
 					     &optional last internal-move-group)
@@ -910,8 +925,7 @@
     articles)
    ((and force
 	 (eq nnmail-expiry-target 'delete))
-    (unless (nnimap-delete-article (gnus-compress-sequence articles))
-      (nnheader-message 7 "Article marked for deletion, but not expunged."))
+    (nnimap-delete-article (gnus-compress-sequence articles))
     nil)
    (t
     (let ((deletable-articles
@@ -1027,21 +1041,36 @@
             (when (and limit number-of-article)
               (nnimap-find-article-by-message-id group server message-id))))))))
 
-(defun nnimap-delete-article (articles)
+(defun nnimap-delete-article (articles &optional sync)
+  "Delete ARTICLES.
+
+If sync is non-nil, wait for server response."
   (with-current-buffer (nnimap-buffer)
     (nnimap-command "UID STORE %s +FLAGS.SILENT (\\Deleted)"
 		    (nnimap-article-ranges articles))
+    (let ((sequence
     (cond
-     ((nnimap-capability "UIDPLUS")
+            ((eq nnimap-expunge 'immediately)
+             (if (nnimap-capability "UIDPLUS")
       (nnimap-command "UID EXPUNGE %s"
 		      (nnimap-article-ranges articles))
-      t)
+               (nnheader-message 3 (concat "nnimap-expunge set to 'immediately, but "
+                                           "server doesn't support UIDPLUS"))))
+
+            ((memq nnimap-expunge '(on-exit never)) nil)
+
+            ((nnimap-capability "UIDPLUS")
+             (nnimap-command "UID EXPUNGE %s"
+                             (nnimap-article-ranges articles)))
+
      (nnimap-expunge
-      (nnimap-command "EXPUNGE")
-      t)
-     (t (gnus-message 7 (concat "nnimap: nnimap-expunge is not set and the "
-                                "server doesn't support UIDPLUS, so we won't "
-                                "delete this article now"))))))
+             (nnimap-command "EXPUNGE"))
+
+            (t
+             (nnheader-message 7 "Article marked for deletion, but not expunged.")))))
+
+      (if (and sync sequence)
+          (nnimap-wait-for-response sequence)))))
 
 (deffoo nnimap-request-scan (&optional group server)
   (when group
@@ -2043,27 +2072,9 @@
 	      (nnimap-wait-for-response (caar sequences))
 	      ;; And then mark the successful copy actions as deleted,
 	      ;; and possibly expunge them.
-	      (nnimap-mark-and-expunge-incoming
-	       (nnimap-parse-copied-articles sequences)))
-            (nnimap-mark-and-expunge-incoming junk-articles)))))))
-
-(defun nnimap-mark-and-expunge-incoming (range)
-  (when range
-    (setq range (nnimap-article-ranges range))
-    (erase-buffer)
-    (let ((sequence
-	   (nnimap-send-command
-	    "UID STORE %s +FLAGS.SILENT (\\Deleted)" range)))
-      (cond
-       ;; If the server supports it, we now delete the message we have
-       ;; just copied over.
-       ((nnimap-capability "UIDPLUS")
-	(setq sequence (nnimap-send-command "UID EXPUNGE %s" range)))
-       ;; If it doesn't support UID EXPUNGE, then we only expunge if the
-       ;; user has configured it.
-       (nnimap-expunge
-	(setq sequence (nnimap-send-command "EXPUNGE"))))
-      (nnimap-wait-for-response sequence))))
+              (nnimap-delete-article
+               (nnimap-parse-copied-articles sequences) t))
+            (nnimap-delete-article junk-articles t)))))))
 
 (defun nnimap-parse-copied-articles (sequences)
   (let (sequence copied range)

Information forwarded to bugs <at> gnus.org:
bug#20670; Package gnus. (Sat, 04 Jul 2015 03:29:01 GMT) Full text and rfc822 format available.

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

From: Nikolaus Rath <Nikolaus <at> rath.org>
To: 20670 <at> debbugs.gnu.org, ding <at> gnus.org
Subject: [PATCH] nnimap: enable additional expunge options (v3)
Date: Fri, 03 Jul 2015 20:28:32 -0700
[Message part 1 (text/plain, inline)]
If the IMAP server supports the UID EXPUNGE command, the nnimap backend
currently always expunges deleted articles.

If the IMAP server does not support this command, articles are either
not expunged at all (nnimap-expunge is nil), or ALL articles that are
currently flagged as deleted will be expunged when any one article is
deleted in Gnus.

This patch introduces three new settings for nnimap-expunge:

 * If nnimap-expunge is 'never, deleted articles are marked with the
   IMAP \\Delete flag but not automatically expunged.

 * If nnimap-expunge is 'immediately, deleted articles are immediately
   expunged (this requires the server to support the UID EXPUNGE
   command).

 * If nnimap-expunge is 'on-exit, deleted articles are flagged, and all
   flagged articles are expunged when the group is closed.

Note that none of these behaviors is available with the current settings
(nil / non-nil).

The 'on-exit setting is mostly useful as a safe-guard: as long as the
group is not closed, article deletions are reversal (either by using a
different IMAP client, or by exiting Gnus without updating the summary
buffer).

The 'never setting is not (yet) very useful because Gnus does not
distinguish between deleted articles and regular articles in the summary
buffer. However, this will be addressed by a separate patch.

Changes in v2:

  * Made first line of docstring a complete sentence.

Changes in v3:

  * Correctly handle multiple active nnimap backends.

Thanks for considering,
-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.«
[nnimap_expunge_v3.diff (text/x-diff, inline)]
diff --git a/nnimap.el b/nnimap.el
--- a/nnimap.el
+++ b/nnimap.el
@@ -103,10 +103,21 @@
 Possible choices are nil (use default methods), `anonymous',
 `login', `plain' and `cram-md5'.")
 
-(defvoo nnimap-expunge t
-  "If non-nil, expunge articles after deleting them.
-This is always done if the server supports UID EXPUNGE, but it's
-not done by default on servers that doesn't support that command.")
+(defvoo nnimap-expunge 'on-exit
+  "When to expunge deleted messages.
+If 'never, deleted articles are marked with the IMAP \\Delete
+flag but not automatically expunged. If 'immediately, deleted
+articles are immediately expunged (this requires the server to
+support the UID EXPUNGE command). If 'on-exit, deleted articles
+are flagged, and all flagged articles are expunged when the
+group is closed.
+
+For backwards compatibility, this variable may also be set to t
+or nil. If the server supports UID EXPUNGE, both t and nil are
+equivalent to 'immediately. If the server does not support UID
+EXPUNGE nil is equivalent to 'never, while t will immediately
+expunge ALL articles that are currently flagged as deleted
+(i.e., potentially not only the article that was just deleted).")
 
 (defvoo nnimap-streaming t
   "If non-nil, try to use streaming commands with IMAP servers.
@@ -865,7 +876,11 @@
     (nreverse articles)))
 
 (deffoo nnimap-close-group (group &optional server)
-  t)
+  (when (eq nnimap-expunge 'on-exit)
+    (nnoo-change-server 'nnimap server nil)
+    (with-current-buffer (nnimap-buffer)
+      (nnimap-wait-for-response
+       (nnimap-send-command "EXPUNGE")))))
 
 (deffoo nnimap-request-move-article (article group server accept-form
 					     &optional last internal-move-group)
@@ -910,8 +925,7 @@
     articles)
    ((and force
 	 (eq nnmail-expiry-target 'delete))
-    (unless (nnimap-delete-article (gnus-compress-sequence articles))
-      (nnheader-message 7 "Article marked for deletion, but not expunged."))
+    (nnimap-delete-article (gnus-compress-sequence articles))
     nil)
    (t
     (let ((deletable-articles
@@ -1027,21 +1041,36 @@
             (when (and limit number-of-article)
               (nnimap-find-article-by-message-id group server message-id))))))))
 
-(defun nnimap-delete-article (articles)
+(defun nnimap-delete-article (articles &optional sync)
+  "Delete ARTICLES.
+
+If sync is non-nil, wait for server response."
   (with-current-buffer (nnimap-buffer)
     (nnimap-command "UID STORE %s +FLAGS.SILENT (\\Deleted)"
 		    (nnimap-article-ranges articles))
+    (let ((sequence
     (cond
-     ((nnimap-capability "UIDPLUS")
+            ((eq nnimap-expunge 'immediately)
+             (if (nnimap-capability "UIDPLUS")
       (nnimap-command "UID EXPUNGE %s"
 		      (nnimap-article-ranges articles))
-      t)
+               (nnheader-message 3 (concat "nnimap-expunge set to 'immediately, but "
+                                           "server doesn't support UIDPLUS"))))
+
+            ((memq nnimap-expunge '(on-exit never)) nil)
+
+            ((nnimap-capability "UIDPLUS")
+             (nnimap-command "UID EXPUNGE %s"
+                             (nnimap-article-ranges articles)))
+
      (nnimap-expunge
-      (nnimap-command "EXPUNGE")
-      t)
-     (t (gnus-message 7 (concat "nnimap: nnimap-expunge is not set and the "
-                                "server doesn't support UIDPLUS, so we won't "
-                                "delete this article now"))))))
+             (nnimap-command "EXPUNGE"))
+
+            (t
+             (nnheader-message 7 "Article marked for deletion, but not expunged.")))))
+
+      (if (and sync sequence)
+          (nnimap-wait-for-response sequence)))))
 
 (deffoo nnimap-request-scan (&optional group server)
   (when group
@@ -2043,27 +2072,9 @@
 	      (nnimap-wait-for-response (caar sequences))
 	      ;; And then mark the successful copy actions as deleted,
 	      ;; and possibly expunge them.
-	      (nnimap-mark-and-expunge-incoming
-	       (nnimap-parse-copied-articles sequences)))
-            (nnimap-mark-and-expunge-incoming junk-articles)))))))
-
-(defun nnimap-mark-and-expunge-incoming (range)
-  (when range
-    (setq range (nnimap-article-ranges range))
-    (erase-buffer)
-    (let ((sequence
-	   (nnimap-send-command
-	    "UID STORE %s +FLAGS.SILENT (\\Deleted)" range)))
-      (cond
-       ;; If the server supports it, we now delete the message we have
-       ;; just copied over.
-       ((nnimap-capability "UIDPLUS")
-	(setq sequence (nnimap-send-command "UID EXPUNGE %s" range)))
-       ;; If it doesn't support UID EXPUNGE, then we only expunge if the
-       ;; user has configured it.
-       (nnimap-expunge
-	(setq sequence (nnimap-send-command "EXPUNGE"))))
-      (nnimap-wait-for-response sequence))))
+              (nnimap-delete-article
+               (nnimap-parse-copied-articles sequences) t))
+            (nnimap-delete-article junk-articles t)))))))
 
 (defun nnimap-parse-copied-articles (sequences)
   (let (sequence copied range)

Information forwarded to bugs <at> gnus.org:
bug#20670; Package gnus. (Tue, 24 Jan 2017 19:36:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: 20670 <at> debbugs.gnu.org
Cc: ding <at> gnus.org
Subject: Re: bug#20670: [PATCH] nnimap: enable additional expunge options (v3)
Date: Tue, 24 Jan 2017 20:35:28 +0100
Nikolaus Rath <Nikolaus <at> rath.org> writes:

> If the IMAP server supports the UID EXPUNGE command, the nnimap backend
> currently always expunges deleted articles.
>
> If the IMAP server does not support this command, articles are either
> not expunged at all (nnimap-expunge is nil), or ALL articles that are
> currently flagged as deleted will be expunged when any one article is
> deleted in Gnus.
>
> This patch introduces three new settings for nnimap-expunge:

Looks good.  Two minor comments:

+               (nnheader-message 3 (concat "nnimap-expunge set to 'immediately, but "
+                                           "server doesn't support UIDPLUS"))))
+

You've probably done this to make the lines short enough, but the first
one is still more than 80 chars wide.

+             (nnheader-message 7 "Article marked for deletion, but not expunged.")))))

And so is this.  It's probably better to just reflow by breaking the
line after `nnheader-message'.

This change should also be documented in the "Customizing the IMAP
Connection" node in the Gnus manual, and get an entry in the NEWS file.

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




Information forwarded to bugs <at> gnus.org:
bug#20670; Package gnus. (Tue, 24 Jan 2017 19:40:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: bug#20670 <20670 <at> debbugs.gnu.org>
Subject: Re: Status: [PATCH] nnimap: enable additional expunge options
Date: Tue, 24 Jan 2017 20:39:29 +0100
reassign 20670 emacs,gnus
thanks

bug#20670 <20670 <at> debbugs.gnu.org> writes:

> retitle 20670 [PATCH] nnimap: enable additional expunge options
> reassign 20670 gnus

And part of the reason I hadn't seen the patch before is this.  I wasn't
aware that there were Gnus-only bugs?  All the ones I'm seeing are marked

reassing <foo> emacs,gnus

*gulp*  Perhaps there's a gazillion Gnus-only bug reports?

-- 
(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. (Tue, 24 Jan 2017 19:48:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#20670; Package emacs,gnus. (Tue, 24 Jan 2017 19:51:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: bug#20670 <20670 <at> debbugs.gnu.org>
Subject: Re: bug#20670: Status: [PATCH] nnimap: enable additional expunge
 options
Date: Tue, 24 Jan 2017 20:50:20 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> reassign 20670 emacs,gnus
> thanks
>
> bug#20670 <20670 <at> debbugs.gnu.org> writes:
>
>> retitle 20670 [PATCH] nnimap: enable additional expunge options
>> reassign 20670 gnus
>
> And part of the reason I hadn't seen the patch before is this.  I wasn't
> aware that there were Gnus-only bugs?  All the ones I'm seeing are marked
>
> reassing <foo> emacs,gnus
>
> *gulp*  Perhaps there's a gazillion Gnus-only bug reports?

Indeed.  There were about 100 Gnus-only bug reports, so I've never seen
them before.  *sigh*

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




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#20670; Package emacs,gnus. (Tue, 24 Jan 2017 19:56:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: bug#20670 <20670 <at> debbugs.gnu.org>
Subject: Re: bug#20670: Status: [PATCH] nnimap: enable additional expunge
 options
Date: Tue, 24 Jan 2017 20:55:18 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Indeed.  There were about 100 Gnus-only bug reports, so I've never seen
> them before.  *sigh*

Would anybody mind if I reassigned them all back to emacs,gnus?  So they
don't get "lost" again?

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




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#20670; Package emacs,gnus. (Tue, 24 Jan 2017 23:11:02 GMT) Full text and rfc822 format available.

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

From: Nikolaus Rath <Nikolaus <at> rath.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: bug#20670 <20670 <at> debbugs.gnu.org>
Subject: Re: bug#20670: Status: [PATCH] nnimap: enable additional expunge
 options
Date: Tue, 24 Jan 2017 15:10:03 -0800
On Jan 24 2017, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>
>> Indeed.  There were about 100 Gnus-only bug reports, so I've never seen
>> them before.  *sigh*
>
> Would anybody mind if I reassigned them all back to emacs,gnus?  So they
> don't get "lost" again?

I certainly don't mind. But I think there's some other issues with the
bug tracker. I only see your last three messages by accident when using
the web interface. They were not send to me by email, despite my being
the submitter.


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 bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#20670; Package emacs,gnus. (Tue, 24 Jan 2017 23:17:02 GMT) Full text and rfc822 format available.

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

From: Nikolaus Rath <Nikolaus <at> rath.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: bug#20670 <20670 <at> debbugs.gnu.org>
Subject: Re: Status: [PATCH] nnimap: enable additional expunge options
Date: Tue, 24 Jan 2017 15:09:08 -0800
On Jan 24 2017, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
> reassign 20670 emacs,gnus
> thanks
>
> bug#20670 <20670 <at> debbugs.gnu.org> writes:
>
>> retitle 20670 [PATCH] nnimap: enable additional expunge options
>> reassign 20670 gnus
>
> And part of the reason I hadn't seen the patch before is this.  I wasn't
> aware that there were Gnus-only bugs?

I think that is what M-x gnus-bug produces by default (or at least used
to produce).


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 bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#20670; Package emacs,gnus. (Tue, 24 Jan 2017 23:23:02 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: bug#20670 <20670 <at> debbugs.gnu.org>
Subject: Re: bug#20670: Status: [PATCH] nnimap: enable additional expunge
 options
Date: Tue, 24 Jan 2017 18:21:59 -0500
Lars Ingebrigtsen wrote:

> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>
>> Indeed.  There were about 100 Gnus-only bug reports, so I've never seen
>> them before.  *sigh*
>
> Would anybody mind if I reassigned them all back to emacs,gnus?  So they
> don't get "lost" again?

Personally I don't care what you do with them. :)
I like to discourage the use of packages as glorified tags, so perhaps
get rid of the "gnus" package altogether, and instead use a usertag or
just add "gnus" to the subject.

But it sounds like maybe the history here has been forgotten:

Gnus always had its own dedicated bug list, and some time ago [1]
we set things up so that would redirect to a "gnus" package at
debbugs.gnu.org. "emacs,gnus" was not appropriate, since eg these
reports might be about gnus with XEmacs or other issues irrelevant to
gnus-as-shipped with Emacs. See gnus-bug-package in gnus.el.

Anyway, that was the reasoning at the time.

[1] https://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00598.html




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#20670; Package emacs,gnus. (Tue, 24 Jan 2017 23:27:03 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: bug#20670 <20670 <at> debbugs.gnu.org>
Subject: Re: bug#20670: Status: [PATCH] nnimap: enable additional expunge
 options
Date: Wed, 25 Jan 2017 00:26:02 +0100
Glenn Morris <rgm <at> gnu.org> writes:

> I like to discourage the use of packages as glorified tags, so perhaps
> get rid of the "gnus" package altogether, and instead use a usertag or
> just add "gnus" to the subject.

Sure, sounds good to me.

> But it sounds like maybe the history here has been forgotten:
>
> Gnus always had its own dedicated bug list, and some time ago [1]
> we set things up so that would redirect to a "gnus" package at
> debbugs.gnu.org. "emacs,gnus" was not appropriate, since eg these
> reports might be about gnus with XEmacs or other issues irrelevant to
> gnus-as-shipped with Emacs. See gnus-bug-package in gnus.el.
>
> Anyway, that was the reasoning at the time.

I'm sure it made sense at the time, but these days there is no Gnus
outside of Emacs, so I think it would be nice to roll them back into the
Emacs bug tracker.

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




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#20670; Package emacs,gnus. (Tue, 24 Jan 2017 23:27:03 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Nikolaus Rath <Nikolaus <at> rath.org>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, bug#20670 <20670 <at> debbugs.gnu.org>
Subject: Re: bug#20670: Status: [PATCH] nnimap: enable additional expunge
 options
Date: Tue, 24 Jan 2017 18:26:37 -0500
Nikolaus Rath wrote:

> bug tracker. I only see your last three messages by accident when using
> the web interface. They were not send to me by email, despite my being
> the submitter.

The system is working as designed.
People should use reply-to-all on GNU mailing lists, but sometimes they
only reply-to-list.




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#20670; Package emacs,gnus. (Tue, 24 Jan 2017 23:28:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Nikolaus Rath <Nikolaus <at> rath.org>
Cc: bug#20670 <20670 <at> debbugs.gnu.org>
Subject: Re: Status: [PATCH] nnimap: enable additional expunge options
Date: Wed, 25 Jan 2017 00:27:41 +0100
Nikolaus Rath <Nikolaus <at> rath.org> writes:

> I think that is what M-x gnus-bug produces by default (or at least used
> to produce).

Ah, so it does:

X-Debbugs-Version: 5.13
X-Debbugs-Package: gnus

I'll fix that...

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




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#20670; Package emacs,gnus. (Tue, 24 Jan 2017 23:38:02 GMT) Full text and rfc822 format available.

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

From: Nikolaus Rath <Nikolaus <at> rath.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: ding <at> gnus.org, 20670 <at> debbugs.gnu.org
Subject: Re: bug#20670: [PATCH] nnimap: enable additional expunge options (v3)
Date: Tue, 24 Jan 2017 15:37:29 -0800
[Message part 1 (text/plain, inline)]
On Jan 24 2017, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
> Nikolaus Rath <Nikolaus <at> rath.org> writes:
>
>> If the IMAP server supports the UID EXPUNGE command, the nnimap backend
>> currently always expunges deleted articles.
>>
>> If the IMAP server does not support this command, articles are either
>> not expunged at all (nnimap-expunge is nil), or ALL articles that are
>> currently flagged as deleted will be expunged when any one article is
>> deleted in Gnus.
>>
>> This patch introduces three new settings for nnimap-expunge:
>
> Looks good.  Two minor comments:
>
> +               (nnheader-message 3 (concat "nnimap-expunge set to 'immediately, but "
> +                                           "server doesn't support UIDPLUS"))))
> +
>
> You've probably done this to make the lines short enough, but the first
> one is still more than 80 chars wide.
>
> +             (nnheader-message 7 "Article marked for deletion, but not expunged.")))))
>
> And so is this.  It's probably better to just reflow by breaking the
> line after `nnheader-message'.
>
> This change should also be documented in the "Customizing the IMAP
> Connection" node in the Gnus manual, and get an entry in the NEWS
> file.

Thanks! Attached is an updated patch.

Btw, is there any way to generate the list of affected functions in the
commit message automatically? Doing this by hand is rather cumbersome...


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.«
[0001-nnimap.el-support-additional-expunge-options.patch (text/x-diff, inline)]
From 3421d2b8c8d3eb20052432d1ba331be886d812a6 Mon Sep 17 00:00:00 2001
From: Nikolaus Rath <Nikolaus <at> rath.org>
Date: Tue, 24 Jan 2017 15:31:46 -0800
Subject: [PATCH] nnimap.el: support additional expunge options

* lisp/gnus/nnimap.el (nnimap-close-group,
nnimap-request-expire-articles, nnimap-delete-article,
nnimap-request-scan): add new 'never, 'immediate, and 'on-exit
settings for nnimap-expunge.
---
 doc/misc/gnus.texi  | 16 ++++++++--
 etc/NEWS            | 10 +++++++
 lisp/gnus/nnimap.el | 85 ++++++++++++++++++++++++++++++-----------------------
 3 files changed, 72 insertions(+), 39 deletions(-)

diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index 05159..e8524 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -14273,9 +14273,19 @@ Customizing the IMAP Connection
 @code{plain} or @code{cram-md5}.
 
 @item nnimap-expunge
-If non-@code{nil}, expunge articles after deleting them.  This is always done
-if the server supports UID EXPUNGE, but it's not done by default on
-servers that doesn't support that command.
+When to expunge deleted messages.  If @code{never}, deleted articles
+are marked with the IMAP @code{\\Delete} flag but not automatically
+expunged. If @code{immediately}, deleted articles are immediately expunged
+(this requires the server to support the UID EXPUNGE command). If
+@code{on-exit}, deleted articles are flagged, and all flagged articles are
+expunged when the group is closed.
+
+For backwards compatibility, this variable may also be set to t
+or nil. If the server supports UID EXPUNGE, both t and nil are
+equivalent to @code{immediately}. If the server does not support UID
+EXPUNGE nil is equivalent to @code{never}, while t will immediately
+expunge ALL articles that are currently flagged as deleted
+(i.e., potentially not only the article that was just deleted).
 
 @item nnimap-streaming
 Virtually all @acronym{IMAP} server support fast streaming of data.
diff --git a/etc/NEWS b/etc/NEWS
index ca66d..e5ee4 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -81,6 +81,16 @@ for '--daemon'.
 * Changes in Emacs 26.1
 
 +++
+** The Gnus user variable 'nnimap-expunge' supports three new values:
+'never' for never expunging messages, 'immediately' for immediately
+expunging deleted messages, and 'on-exit' to expunge deleted articles
+when exiting the group's summary buffer. Setting 'nnimap-expunge' to
+'nil' or 't' is still supported but not recommended, since it may
+result in Gnus expunging all messages that have been flagged as
+deleted by any IMAP client (rather than just those that have been
+deleted by Gnus).
+
++++
 ** The new function 'mapbacktrace' applies a function to all frames of
 the current stack trace.
 
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 700e86..e7e64 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -92,10 +92,21 @@ nnimap-authenticator
 Possible choices are nil (use default methods), `anonymous',
 `login', `plain' and `cram-md5'.")
 
-(defvoo nnimap-expunge t
-  "If non-nil, expunge articles after deleting them.
-This is always done if the server supports UID EXPUNGE, but it's
-not done by default on servers that doesn't support that command.")
+(defvoo nnimap-expunge 'on-exit
+  "When to expunge deleted messages.
+If 'never, deleted articles are marked with the IMAP \\Delete
+flag but not automatically expunged. If 'immediately, deleted
+articles are immediately expunged (this requires the server to
+support the UID EXPUNGE command). If 'on-exit, deleted articles
+are flagged, and all flagged articles are expunged when the
+group is closed.
+
+For backwards compatibility, this variable may also be set to t
+or nil. If the server supports UID EXPUNGE, both t and nil are
+equivalent to 'immediately. If the server does not support UID
+EXPUNGE nil is equivalent to 'never, while t will immediately
+expunge ALL articles that are currently flagged as deleted
+(i.e., potentially not only the article that was just deleted).")
 
 (defvoo nnimap-streaming t
   "If non-nil, try to use streaming commands with IMAP servers.
@@ -911,7 +922,11 @@ nnimap-get-flags
     (nreverse articles)))
 
 (deffoo nnimap-close-group (_group &optional _server)
-  t)
+  (when (eq nnimap-expunge 'on-exit)
+    (nnoo-change-server 'nnimap server nil)
+    (with-current-buffer (nnimap-buffer)
+      (nnimap-wait-for-response
+       (nnimap-send-command "EXPUNGE")))))
 
 (deffoo nnimap-request-move-article (article group server accept-form
 					     &optional _last
@@ -960,8 +975,7 @@ nnimap-request-expire-articles
     articles)
    ((and force
 	 (eq nnmail-expiry-target 'delete))
-    (unless (nnimap-delete-article (gnus-compress-sequence articles))
-      (nnheader-message 7 "Article marked for deletion, but not expunged."))
+    (nnimap-delete-article (gnus-compress-sequence articles))
     nil)
    (t
     (let ((deletable-articles
@@ -1084,21 +1098,38 @@ nnimap-find-article-by-message-id
             (when (and limit number-of-article)
               (nnimap-find-article-by-message-id group server message-id))))))))
 
-(defun nnimap-delete-article (articles)
+(defun nnimap-delete-article (articles &optional sync)
+  "Delete ARTICLES.
+
+If sync is non-nil, wait for server response."
   (with-current-buffer (nnimap-buffer)
     (nnimap-command "UID STORE %s +FLAGS.SILENT (\\Deleted)"
 		    (nnimap-article-ranges articles))
+    (let ((sequence
     (cond
-     ((nnimap-capability "UIDPLUS")
+            ((eq nnimap-expunge 'immediately)
+             (if (nnimap-capability "UIDPLUS")
       (nnimap-command "UID EXPUNGE %s"
 		      (nnimap-article-ranges articles))
-      t)
+      (nnheader-message
+       3 (concat "nnimap-expunge set to 'immediately, but "
+                 "server doesn't support UIDPLUS"))))
+
+            ((memq nnimap-expunge '(on-exit never)) nil)
+
+            ((nnimap-capability "UIDPLUS")
+             (nnimap-command "UID EXPUNGE %s"
+                             (nnimap-article-ranges articles)))
+
      (nnimap-expunge
-      (nnimap-command "EXPUNGE")
-      t)
-     (t (gnus-message 7 (concat "nnimap: nnimap-expunge is not set and the "
-                                "server doesn't support UIDPLUS, so we won't "
-                                "delete this article now"))))))
+             (nnimap-command "EXPUNGE"))
+
+            (t
+             (nnheader-message
+              7 "Article marked for deletion, but not expunged.")))))
+
+      (if (and sync sequence)
+          (nnimap-wait-for-response sequence)))))
 
 (deffoo nnimap-request-scan (&optional group server)
   (when group
@@ -2118,27 +2149,9 @@ nnimap-split-incoming-mail
 	      (nnimap-wait-for-response (caar sequences))
 	      ;; And then mark the successful copy actions as deleted,
 	      ;; and possibly expunge them.
-	      (nnimap-mark-and-expunge-incoming
-	       (nnimap-parse-copied-articles sequences)))
-            (nnimap-mark-and-expunge-incoming junk-articles)))))))
-
-(defun nnimap-mark-and-expunge-incoming (range)
-  (when range
-    (setq range (nnimap-article-ranges range))
-    (erase-buffer)
-    (let ((sequence
-	   (nnimap-send-command
-	    "UID STORE %s +FLAGS.SILENT (\\Deleted)" range)))
-      (cond
-       ;; If the server supports it, we now delete the message we have
-       ;; just copied over.
-       ((nnimap-capability "UIDPLUS")
-	(setq sequence (nnimap-send-command "UID EXPUNGE %s" range)))
-       ;; If it doesn't support UID EXPUNGE, then we only expunge if the
-       ;; user has configured it.
-       (nnimap-expunge
-	(setq sequence (nnimap-send-command "EXPUNGE"))))
-      (nnimap-wait-for-response sequence))))
+              (nnimap-delete-article
+               (nnimap-parse-copied-articles sequences) t))
+            (nnimap-delete-article junk-articles t)))))))
 
 (defun nnimap-parse-copied-articles (sequences)
   (let (sequence copied range)
-- 
2.1.4


Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#20670; Package emacs,gnus. (Tue, 24 Jan 2017 23:39:02 GMT) Full text and rfc822 format available.

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

From: Nikolaus Rath <Nikolaus <at> rath.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, bug#20670 <20670 <at> debbugs.gnu.org>
Subject: Re: bug#20670: Status: [PATCH] nnimap: enable additional expunge
 options
Date: Tue, 24 Jan 2017 15:38:50 -0800
On Jan 24 2017, Glenn Morris <rgm <at> gnu.org> wrote:
> Nikolaus Rath wrote:
>
>> bug tracker. I only see your last three messages by accident when using
>> the web interface. They were not send to me by email, despite my being
>> the submitter.
>
> The system is working as designed.

Well, in that case I think its badly designed, because...

> People should use reply-to-all on GNU mailing lists, but sometimes they
> only reply-to-list.

..this then leads to messages being lost without anyone noticing.

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 bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#20670; Package emacs,gnus. (Tue, 24 Jan 2017 23:47:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: 20670 <at> debbugs.gnu.org
Cc: ding <at> gnus.org
Subject: Re: bug#20670: [PATCH] nnimap: enable additional expunge options (v3)
Date: Wed, 25 Jan 2017 00:46:46 +0100
Nikolaus Rath <Nikolaus <at> rath.org> writes:

> Thanks! Attached is an updated patch.

Thanks; applied.

> Btw, is there any way to generate the list of affected functions in the
> commit message automatically? Doing this by hand is rather cumbersome...

I don't know of any such functionality...

-- 
(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. (Tue, 24 Jan 2017 23:48:01 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 20670 <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. (Tue, 24 Jan 2017 23:48:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#20670; Package emacs,gnus. (Tue, 24 Jan 2017 23:49:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 20670 <at> debbugs.gnu.org
Subject: Re: bug#20670: Status: [PATCH] nnimap: enable additional expunge
 options
Date: Wed, 25 Jan 2017 00:48:00 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Glenn Morris <rgm <at> gnu.org> writes:
>
>> I like to discourage the use of packages as glorified tags, so perhaps
>> get rid of the "gnus" package altogether, and instead use a usertag or
>> just add "gnus" to the subject.
>
> Sure, sounds good to me.

Do you have some magic you could do on your side?  :-)  Otherwise I can
script something that sends "reassign" messages to the about 100 bug
reports in question...

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




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#20670; Package emacs,gnus. (Wed, 25 Jan 2017 00:19:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: 20670 <at> debbugs.gnu.org
Cc: Nikolaus Rath <Nikolaus <at> rath.org>, ding <at> gnus.org
Subject: Re: bug#20670: [PATCH] nnimap: enable additional expunge options (v3)
Date: Wed, 25 Jan 2017 01:18:08 +0100
(The reason you call out of the mail headers is because you have a

  Mail-Copies-To: never

in the mails you send out.  So you're never Cc'd.)

There was a bug in the patch, so I've reverted it for now.

Here's the backtrace:

Debugger entered--Lisp error: (error "Format specifier doesn’t match argument type")
  format("%d .*\n" (t ("OK" ("HIGHESTMODSEQ" "914696") "Expunge" "completed.") ("VANISHED" "1825937") ("0" "RECENT")))
  (looking-at (format "%d .*\n" sequence))
  (not (looking-at (format "%d .*\n" sequence)))
  (progn (while (and (not (bobp)) (progn (forward-line -1) (looking-at "\\*\\|[0-9]+ OK NOOP")))) (not (looking-at (format "%d .*\n" sequence))))
  (and (setq openp (memq (process-status process) (quote (open run)))) (progn (while (and (not (bobp)) (progn (forward-line -1) (looking-at "\\*\\|[0-9]+ OK NOOP")))) (not (looking-at (format "%d .*\n" sequence)))))
  (while (and (setq openp (memq (process-status process) (quote (open run)))) (progn (while (and (not (bobp)) (progn (forward-line -1) (looking-at "\\*\\|[0-9]+ OK NOOP")))) (not (looking-at (format "%d .*\n" sequence))))) (if messagep (progn (nnheader-message-maybe 7 "nnimap read %dk from %s%s" (/ (buffer-size) 1000) nnimap-address (if (not (= 0 (progn "Access slot \"initial-resync\" of `nnimap' struct CL-X." nil ... ...))) (format " (initial sync of %d group%s; please wait)" (progn "Access slot \"initial-resync\" of `nnimap' struct CL-X." nil (or ... ...) (aref nnimap-object 12)) (if (= ... 1) "" "s")) "")))) (nnheader-accept-process-output process) (goto-char (point-max)))
  (progn (goto-char (point-max)) (while (and (setq openp (memq (process-status process) (quote (open run)))) (progn (while (and (not (bobp)) (progn (forward-line -1) (looking-at "\\*\\|[0-9]+ OK NOOP")))) (not (looking-at (format "%d .*\n" sequence))))) (if messagep (progn (nnheader-message-maybe 7 "nnimap read %dk from %s%s" (/ (buffer-size) 1000) nnimap-address (if (not (= 0 ...)) (format " (initial sync of %d group%s; please wait)" (progn "Access slot \"initial-resync\" of `nnimap' struct CL-X." nil ... ...) (if ... "" "s")) "")))) (nnheader-accept-process-output process) (goto-char (point-max))) (progn "Access slot \"initial-resync\" of `nnimap' struct CL-X." nil (or (and (memq (aref nnimap-object 0) cl-struct-nnimap-tags)) (signal (quote wrong-type-argument) (list (quote nnimap) nnimap-object))) (let* ((v nnimap-object)) (aset v 12 0))) openp)
  (condition-case nil (progn (goto-char (point-max)) (while (and (setq openp (memq (process-status process) (quote (open run)))) (progn (while (and (not ...) (progn ... ...))) (not (looking-at (format "%d .*\n" sequence))))) (if messagep (progn (nnheader-message-maybe 7 "nnimap read %dk from %s%s" (/ (buffer-size) 1000) nnimap-address (if (not ...) (format " (initial sync of %d group%s; please wait)" ... ...) "")))) (nnheader-accept-process-output process) (goto-char (point-max))) (progn "Access slot \"initial-resync\" of `nnimap' struct CL-X." nil (or (and (memq (aref nnimap-object 0) cl-struct-nnimap-tags)) (signal (quote wrong-type-argument) (list (quote nnimap) nnimap-object))) (let* ((v nnimap-object)) (aset v 12 0))) openp) (quit (if debug-on-quit (progn (debug "Quit"))) (delete-process process) nil))
  (let ((process (get-buffer-process (current-buffer))) openp) (condition-case nil (progn (goto-char (point-max)) (while (and (setq openp (memq (process-status process) (quote ...))) (progn (while (and ... ...)) (not (looking-at ...)))) (if messagep (progn (nnheader-message-maybe 7 "nnimap read %dk from %s%s" (/ ... 1000) nnimap-address (if ... ... "")))) (nnheader-accept-process-output process) (goto-char (point-max))) (progn "Access slot \"initial-resync\" of `nnimap' struct CL-X." nil (or (and (memq (aref nnimap-object 0) cl-struct-nnimap-tags)) (signal (quote wrong-type-argument) (list (quote nnimap) nnimap-object))) (let* ((v nnimap-object)) (aset v 12 0))) openp) (quit (if debug-on-quit (progn (debug "Quit"))) (delete-process process) nil)))
  nnimap-wait-for-response((t ("OK" ("HIGHESTMODSEQ" "914696") "Expunge" "completed.") ("VANISHED" "1825937") ("0" "RECENT")))
  (if (and sync sequence) (nnimap-wait-for-response sequence))
  (let ((sequence (cond ((eq nnimap-expunge (quote immediately)) (if (nnimap-capability "UIDPLUS") (nnimap-command "UID EXPUNGE %s" (nnimap-article-ranges articles)) (nnheader-message 3 (concat "nnimap-expunge set to 'immediately, but " "server doesn't support UIDPLUS")))) ((memq nnimap-expunge (quote (on-exit never))) nil) ((nnimap-capability "UIDPLUS") (nnimap-command "UID EXPUNGE %s" (nnimap-article-ranges articles))) (nnimap-expunge (nnimap-command "EXPUNGE")) (t (nnheader-message 7 "Article marked for deletion, but not expunged."))))) (if (and sync sequence) (nnimap-wait-for-response sequence)))
  (save-current-buffer (set-buffer (nnimap-buffer)) (nnimap-command "UID STORE %s +FLAGS.SILENT (\\Deleted)" (nnimap-article-ranges articles)) (let ((sequence (cond ((eq nnimap-expunge (quote immediately)) (if (nnimap-capability "UIDPLUS") (nnimap-command "UID EXPUNGE %s" ...) (nnheader-message 3 ...))) ((memq nnimap-expunge (quote ...)) nil) ((nnimap-capability "UIDPLUS") (nnimap-command "UID EXPUNGE %s" (nnimap-article-ranges articles))) (nnimap-expunge (nnimap-command "EXPUNGE")) (t (nnheader-message 7 "Article marked for deletion, but not expunged."))))) (if (and sync sequence) (nnimap-wait-for-response sequence))))
  nnimap-delete-article((1825937) t)

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





Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#20670; Package emacs,gnus. (Wed, 25 Jan 2017 00:23:02 GMT) Full text and rfc822 format available.

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

From: Nikolaus Rath <Nikolaus <at> rath.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: ding <at> gnus.org, 20670 <at> debbugs.gnu.org
Subject: Re: bug#20670: [PATCH] nnimap: enable additional expunge options (v3)
Date: Tue, 24 Jan 2017 16:22:02 -0800
On Jan 25 2017, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
> (The reason you call out of the mail headers is because you have a
>
>   Mail-Copies-To: never
>
> in the mails you send out.  So you're never Cc'd.)

Oh. That's intended to avoid Cc's when people are repyling to mailing
list messages. Is debbugs considering itself a mailing list? That would
explain it..

> There was a bug in the patch, so I've reverted it for now.
>
> Here's the backtrace:
>
> Debugger entered--Lisp error: (error "Format specifier doesn’t match argument type")
>   format("%d .*\n" (t ("OK" ("HIGHESTMODSEQ" "914696") "Expunge"
> "completed.") ("VANISHED" "1825937") ("0" "RECENT")))
>   (looking-at (format "%d .*\n" sequence))
>   (not (looking-at (format "%d .*\n" sequence)))
>   (progn (while (and (not (bobp)) (progn (forward-line -1) (looking-at
[...]

Can you tell me how to reproduce it? As I've said, it's been working
fine here for over a year.


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 bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#20670; Package emacs,gnus. (Wed, 25 Jan 2017 00:24:01 GMT) Full text and rfc822 format available.

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

From: npostavs <at> users.sourceforge.net
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Nikolaus <at> rath.org, ding <at> gnus.org, 20670 <at> debbugs.gnu.org
Subject: Re: bug#20670: [PATCH] nnimap: enable additional expunge options (v3)
Date: Tue, 24 Jan 2017 19:24:09 -0500
Nikolaus Rath <Nikolaus <at> rath.org> writes:

>
> Btw, is there any way to generate the list of affected functions in the
> commit message automatically? Doing this by hand is rather cumbersome...

See "Generating ChangeLog entries" in CONTRIBUTE.  If you think it's not
good enough, see also https://github.com/magit/magit/issues/2931 and
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=16301.




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#20670; Package emacs,gnus. (Wed, 25 Jan 2017 00:24:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: 20670 <at> debbugs.gnu.org
Cc: Nikolaus Rath <Nikolaus <at> rath.org>, ding <at> gnus.org
Subject: Re: bug#20670: [PATCH] nnimap: enable additional expunge options (v3)
Date: Wed, 25 Jan 2017 01:23:23 +0100
Nikolaus Rath <Nikolaus <at> rath.org> writes:

> On Jan 25 2017, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
>> (The reason you call out of the mail headers is because you have a
>>
>>   Mail-Copies-To: never
>>
>> in the mails you send out.  So you're never Cc'd.)
>
> Oh. That's intended to avoid Cc's when people are repyling to mailing
> list messages. Is debbugs considering itself a mailing list? That would
> explain it..
>
>> There was a bug in the patch, so I've reverted it for now.
>>
>> Here's the backtrace:
>>
>> Debugger entered--Lisp error: (error "Format specifier doesn’t match
>> argument type")
>>   format("%d .*\n" (t ("OK" ("HIGHESTMODSEQ" "914696") "Expunge"
>> "completed.") ("VANISHED" "1825937") ("0" "RECENT")))
>>   (looking-at (format "%d .*\n" sequence))
>>   (not (looking-at (format "%d .*\n" sequence)))
>>   (progn (while (and (not (bobp)) (progn (forward-line -1) (looking-at
> [...]
>
> Can you tell me how to reproduce it? As I've said, it's been working
> fine here for over a year.

I just hit `g'.  Whenever there's a new email that's split, it fails.

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




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#20670; Package emacs,gnus. (Wed, 25 Jan 2017 00:26:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: npostavs <at> users.sourceforge.net
Cc: Nikolaus <at> rath.org, ding <at> gnus.org, 20670 <at> debbugs.gnu.org
Subject: Re: bug#20670: [PATCH] nnimap: enable additional expunge options (v3)
Date: Wed, 25 Jan 2017 01:25:21 +0100
npostavs <at> users.sourceforge.net writes:

> Nikolaus Rath <Nikolaus <at> rath.org> writes:
>
>>
>> Btw, is there any way to generate the list of affected functions in the
>> commit message automatically? Doing this by hand is rather cumbersome...
>
> See "Generating ChangeLog entries" in CONTRIBUTE. 

Didn't see anything there to put all changed functions into a ChangeLog
automatically?

> If you think it's not
> good enough, see also https://github.com/magit/magit/issues/2931 and
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=16301.

So ... the answer is no?  :-)

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




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#20670; Package emacs,gnus. (Wed, 25 Jan 2017 00:33:02 GMT) Full text and rfc822 format available.

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

From: Nikolaus Rath <Nikolaus <at> rath.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>,20670 <at> debbugs.gnu.org
Cc: ding <at> gnus.org
Subject: Re: bug#20670: [PATCH] nnimap: enable additional expunge options (v3)
Date: Tue, 24 Jan 2017 16:32:06 -0800

On January 24, 2017 4:23:23 PM PST, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
>>> There was a bug in the patch, so I've reverted it for now.
>>>
>>> Here's the backtrace:
>>>
>>> Debugger entered--Lisp error: (error "Format specifier doesn’t match
>>> argument type")
>>>   format("%d .*\n" (t ("OK" ("HIGHESTMODSEQ" "914696") "Expunge"
>>> "completed.") ("VANISHED" "1825937") ("0" "RECENT")))
>>>   (looking-at (format "%d .*\n" sequence))
>>>   (not (looking-at (format "%d .*\n" sequence)))
>>>   (progn (while (and (not (bobp)) (progn (forward-line -1)
>(looking-at
>> [...]
>>
>> Can you tell me how to reproduce it? As I've said, it's been working
>> fine here for over a year.
>
>I just hit `g'.  Whenever there's a new email that's split, it fails.

Uh, OK. That's gonna take me a while to understand and fix. If you or anyone else feels like fixing this up, I will not be offended. I hate the way Gnus represents a "parsed" server response.

Best,
Nikolaus

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#20670; Package emacs,gnus. (Wed, 25 Jan 2017 16:57:03 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Nikolaus Rath <Nikolaus <at> rath.org>
Cc: ding <at> gnus.org, 20670 <at> debbugs.gnu.org
Subject: Re: bug#20670: [PATCH] nnimap: enable additional expunge options (v3)
Date: Wed, 25 Jan 2017 17:45:59 +0100
Nikolaus Rath <Nikolaus <at> rath.org> writes:

> On January 24, 2017 4:23:23 PM PST, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
>>>> There was a bug in the patch, so I've reverted it for now.
>>>>
>>>> Here's the backtrace:
>>>>
>>>> Debugger entered--Lisp error: (error "Format specifier doesnt match
>>>> argument type")
>>>>   format("%d .*\n" (t ("OK" ("HIGHESTMODSEQ" "914696") "Expunge"
>>>> "completed.") ("VANISHED" "1825937") ("0" "RECENT")))
>>>>   (looking-at (format "%d .*\n" sequence))
>>>>   (not (looking-at (format "%d .*\n" sequence)))
>>>>   (progn (while (and (not (bobp)) (progn (forward-line -1)
>>(looking-at
>>> [...]
>>>
>>> Can you tell me how to reproduce it? As I've said, it's been working
>>> fine here for over a year.
>>
>>I just hit `g'.  Whenever there's a new email that's split, it fails.
>
> Uh, OK. That's gonna take me a while to understand and fix. If you or
> anyone else feels like fixing this up, I will not be offended. I hate
> the way Gnus represents a "parsed" server response.

Well, I would guess that your change doesn't pass in the right numerical
parameter to the waiting function because my IMAP server (Dovecot)
outputs a different response than you're used to.

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




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. (Wed, 25 Jan 2017 23:10:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#20670; Package emacs,gnus. (Thu, 26 Sep 2019 23:42:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: 20670 <at> debbugs.gnu.org
Cc: Nikolaus Rath <Nikolaus <at> rath.org>, ding <at> gnus.org
Subject: Re: bug#20670: [PATCH] nnimap: enable additional expunge options (v3)
Date: Fri, 27 Sep 2019 01:41:42 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Here's the backtrace:
>
> Debugger entered--Lisp error: (error "Format specifier doesn’t match
> argument type")
>   format("%d .*\n" (t ("OK" ("HIGHESTMODSEQ" "914696") "Expunge"
> "completed.") ("VANISHED" "1825937") ("0" "RECENT")))
>   (looking-at (format "%d .*\n" sequence))

I've now re-applied the patch and debugged a bit.  It was basically
nnimap-delete-article having some code paths that can't have been
exercised.  The function had an optional SYNC parameter, but
nnimap-command was called (which is not asynchronous and does not return
any sequence numbers), and then these non-sequences were being waited
for.

I've now pushed the patch to the trunk, I've used it and send and
received some messages, and things seem to work fine.

-- 
(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. (Thu, 26 Sep 2019 23:42:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 20670 <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. (Thu, 26 Sep 2019 23:42: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. (Fri, 25 Oct 2019 11:24:08 GMT) Full text and rfc822 format available.

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

Previous Next


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