mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-16 10:50:49 -08:00
Revert "nnimap.el: support additional expunge options"
This reverts commit 4e9baea6ab.
The patch broke fetching new mail:
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))))
This commit is contained in:
parent
4e9baea6ab
commit
f580ea195b
3 changed files with 40 additions and 73 deletions
|
|
@ -14273,19 +14273,9 @@ specific login method to be used, you can set this variable to either
|
||||||
@code{plain} or @code{cram-md5}.
|
@code{plain} or @code{cram-md5}.
|
||||||
|
|
||||||
@item nnimap-expunge
|
@item nnimap-expunge
|
||||||
When to expunge deleted messages. If @code{never}, deleted articles
|
If non-@code{nil}, expunge articles after deleting them. This is always done
|
||||||
are marked with the IMAP @code{\\Delete} flag but not automatically
|
if the server supports UID EXPUNGE, but it's not done by default on
|
||||||
expunged. If @code{immediately}, deleted articles are immediately expunged
|
servers that doesn't support that command.
|
||||||
(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
|
@item nnimap-streaming
|
||||||
Virtually all @acronym{IMAP} server support fast streaming of data.
|
Virtually all @acronym{IMAP} server support fast streaming of data.
|
||||||
|
|
|
||||||
10
etc/NEWS
10
etc/NEWS
|
|
@ -80,16 +80,6 @@ for '--daemon'.
|
||||||
|
|
||||||
* Changes in Emacs 26.1
|
* 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 new function 'mapbacktrace' applies a function to all frames of
|
||||||
the current stack trace.
|
the current stack trace.
|
||||||
|
|
|
||||||
|
|
@ -92,21 +92,10 @@ Uses the same syntax as `nnmail-split-methods'.")
|
||||||
Possible choices are nil (use default methods), `anonymous',
|
Possible choices are nil (use default methods), `anonymous',
|
||||||
`login', `plain' and `cram-md5'.")
|
`login', `plain' and `cram-md5'.")
|
||||||
|
|
||||||
(defvoo nnimap-expunge 'on-exit
|
(defvoo nnimap-expunge t
|
||||||
"When to expunge deleted messages.
|
"If non-nil, expunge articles after deleting them.
|
||||||
If 'never, deleted articles are marked with the IMAP \\Delete
|
This is always done if the server supports UID EXPUNGE, but it's
|
||||||
flag but not automatically expunged. If 'immediately, deleted
|
not done by default on servers that doesn't support that command.")
|
||||||
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
|
(defvoo nnimap-streaming t
|
||||||
"If non-nil, try to use streaming commands with IMAP servers.
|
"If non-nil, try to use streaming commands with IMAP servers.
|
||||||
|
|
@ -921,12 +910,8 @@ textual parts.")
|
||||||
articles)))
|
articles)))
|
||||||
(nreverse articles)))
|
(nreverse articles)))
|
||||||
|
|
||||||
(deffoo nnimap-close-group (_group &optional server)
|
(deffoo nnimap-close-group (_group &optional _server)
|
||||||
(when (eq nnimap-expunge 'on-exit)
|
t)
|
||||||
(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
|
(deffoo nnimap-request-move-article (article group server accept-form
|
||||||
&optional _last
|
&optional _last
|
||||||
|
|
@ -975,7 +960,8 @@ textual parts.")
|
||||||
articles)
|
articles)
|
||||||
((and force
|
((and force
|
||||||
(eq nnmail-expiry-target 'delete))
|
(eq nnmail-expiry-target 'delete))
|
||||||
(nnimap-delete-article (gnus-compress-sequence articles))
|
(unless (nnimap-delete-article (gnus-compress-sequence articles))
|
||||||
|
(nnheader-message 7 "Article marked for deletion, but not expunged."))
|
||||||
nil)
|
nil)
|
||||||
(t
|
(t
|
||||||
(let ((deletable-articles
|
(let ((deletable-articles
|
||||||
|
|
@ -1098,38 +1084,21 @@ If LIMIT, first try to limit the search to the N last articles."
|
||||||
(when (and limit number-of-article)
|
(when (and limit number-of-article)
|
||||||
(nnimap-find-article-by-message-id group server message-id))))))))
|
(nnimap-find-article-by-message-id group server message-id))))))))
|
||||||
|
|
||||||
(defun nnimap-delete-article (articles &optional sync)
|
(defun nnimap-delete-article (articles)
|
||||||
"Delete ARTICLES.
|
|
||||||
|
|
||||||
If sync is non-nil, wait for server response."
|
|
||||||
(with-current-buffer (nnimap-buffer)
|
(with-current-buffer (nnimap-buffer)
|
||||||
(nnimap-command "UID STORE %s +FLAGS.SILENT (\\Deleted)"
|
(nnimap-command "UID STORE %s +FLAGS.SILENT (\\Deleted)"
|
||||||
(nnimap-article-ranges articles))
|
(nnimap-article-ranges articles))
|
||||||
(let ((sequence
|
|
||||||
(cond
|
(cond
|
||||||
((eq nnimap-expunge '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 '(on-exit never)) nil)
|
|
||||||
|
|
||||||
((nnimap-capability "UIDPLUS")
|
((nnimap-capability "UIDPLUS")
|
||||||
(nnimap-command "UID EXPUNGE %s"
|
(nnimap-command "UID EXPUNGE %s"
|
||||||
(nnimap-article-ranges articles)))
|
(nnimap-article-ranges articles))
|
||||||
|
t)
|
||||||
(nnimap-expunge
|
(nnimap-expunge
|
||||||
(nnimap-command "EXPUNGE"))
|
(nnimap-command "EXPUNGE")
|
||||||
|
t)
|
||||||
(t
|
(t (gnus-message 7 (concat "nnimap: nnimap-expunge is not set and the "
|
||||||
(nnheader-message
|
"server doesn't support UIDPLUS, so we won't "
|
||||||
7 "Article marked for deletion, but not expunged.")))))
|
"delete this article now"))))))
|
||||||
|
|
||||||
(if (and sync sequence)
|
|
||||||
(nnimap-wait-for-response sequence)))))
|
|
||||||
|
|
||||||
(deffoo nnimap-request-scan (&optional group server)
|
(deffoo nnimap-request-scan (&optional group server)
|
||||||
(when group
|
(when group
|
||||||
|
|
@ -2149,9 +2118,27 @@ Return the server's response to the SELECT or EXAMINE command."
|
||||||
(nnimap-wait-for-response (caar sequences))
|
(nnimap-wait-for-response (caar sequences))
|
||||||
;; And then mark the successful copy actions as deleted,
|
;; And then mark the successful copy actions as deleted,
|
||||||
;; and possibly expunge them.
|
;; and possibly expunge them.
|
||||||
(nnimap-delete-article
|
(nnimap-mark-and-expunge-incoming
|
||||||
(nnimap-parse-copied-articles sequences) t))
|
(nnimap-parse-copied-articles sequences)))
|
||||||
(nnimap-delete-article junk-articles t)))))))
|
(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))))
|
||||||
|
|
||||||
(defun nnimap-parse-copied-articles (sequences)
|
(defun nnimap-parse-copied-articles (sequences)
|
||||||
(let (sequence copied range)
|
(let (sequence copied range)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue