unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#44981: 28.0.50; Restore nnimap-split-download-body?
@ 2020-12-01  4:12 Eric Abrahamsen
  2020-12-02 10:28 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Eric Abrahamsen @ 2020-12-01  4:12 UTC (permalink / raw)
  To: 44981

[-- Attachment #1: Type: text/plain, Size: 1228 bytes --]


When splitting IMAP messages in Gnus' nnimap, there is a defvar called
`nnimap-split-download-body-default', which is consulted to decide
whether to download the whole message body during splitting, or only
consider its headers.

It appears that there used to be a defcustom called
`nnimap-split-download-body', which was advertised to the user, and this
defvar was used to hold... its default? It's odd.

In 2010, in commit 20a673b2d, a bunch of external Gnus code was merged
in, changing a lot of nnimap.el, and in the course of that the defcustom
was deleted. The defvar still remains, and is still effective. The
manual still refers to the customization option.

This looks unintentional, and I'd like to apply the attached diff,
restoring `nnimap-split-download-body' as a user option, and getting rid
of the default variable, which seems unnecessary. If this seems okay
I'll do up a proper commit, and make sure the documentation is all
accurate.

The same user who reported this also expressed a desire to be able to
download message bodies conditionally, based on the headers, only if
a split rule required it. I'm not at all sure about the feasibility of
that, but wanted to see if anyone else had an opinion.

Eric



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: nnimap-split-body.diff --]
[-- Type: text/x-patch, Size: 968 bytes --]

diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 7984998d21..1a1e13a23a 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -146,13 +146,16 @@ nnimap-request-articles-find-limit
   :version "24.4"
   :group 'nnimap)
 
+(defcustom nnimap-split-download-body nil
+  "If non-nil, splitting may also consider message bodies.
+This requires downloading the full message from the IMAP server
+during splitting, which may be slow."
+  :type 'boolean)
+
 (defvar nnimap-process nil)
 
 (defvar nnimap-status-string "")
 
-(defvar nnimap-split-download-body-default nil
-  "Internal variable with default value for `nnimap-split-download-body'.")
-
 (defvar nnimap-keepalive-timer nil)
 (defvar nnimap-process-buffers nil)
 
@@ -2100,7 +2103,7 @@ nnimap-fetch-inbox
 		 "BODY.PEEK"
 	       "RFC822.PEEK"))
 	    (cond
-	     (nnimap-split-download-body-default
+	     (nnimap-split-download-body
 	      "[]")
 	     ((nnimap-ver4-p)
 	      "[HEADER]")

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

end of thread, other threads:[~2020-12-06 12:06 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-01  4:12 bug#44981: 28.0.50; Restore nnimap-split-download-body? Eric Abrahamsen
2020-12-02 10:28 ` Lars Ingebrigtsen
2020-12-02 21:01   ` Basil L. Contovounesios
2020-12-02 21:18     ` Eric Abrahamsen
2020-12-03  8:03       ` Lars Ingebrigtsen
2020-12-02 23:56   ` Eric Abrahamsen
2020-12-03  8:10     ` Lars Ingebrigtsen
2020-12-03 18:20       ` Eric Abrahamsen
2020-12-04 10:45         ` Basil L. Contovounesios
2020-12-04 18:39           ` Eric Abrahamsen
2020-12-05 15:57             ` Basil L. Contovounesios
2020-12-05 19:48               ` Eric Abrahamsen
2020-12-06 12:06                 ` Basil L. Contovounesios

Code repositories for project(s) associated with this public inbox

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

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 read-only IMAP folder(s) and NNTP newsgroup(s).