From 9bb49968d384f88e13ff1a40d62c639f6de52e65 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Mon, 27 Sep 2010 20:34:52 +0200 Subject: [PATCH] Allow setting the partial fetch per server instead of globally. --- lisp/ChangeLog | 8 ++++++++ lisp/gnus-art.el | 16 ---------------- lisp/gnus-sum.el | 14 +++++++++++--- lisp/nnimap.el | 13 ++++++++++--- 4 files changed, 29 insertions(+), 22 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cbbaff37a..69f68fcc6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,13 @@ 2010-09-27 Lars Magne Ingebrigtsen + * gnus-sum.el (gnus-summary-show-complete-article): Bind the server + variable instead of the Gnus variable. + + * nnimap.el (nnimap-find-wanted-parts-1): Use it. + + * gnus-art.el (gnus-fetch-partial-articles): Moved back to nnimap + again. + * nnimap.el (nnimap-request-accept-article): Remove the "." at the end, since some servers don't like it. (nnimap-open-connection): Forget credentials if the server says the diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 221af8c06..6e5cd4d8d 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -257,22 +257,6 @@ This can also be a list of the above values." (regexp :value ".*")) :group 'gnus-article-signature) -(defcustom gnus-fetch-partial-articles nil - "If non-nil, Gnus will fetch partial articles. -If t, nnimap will fetch only the first part. If a string, it -will fetch all parts that have types that match that string. A -likely value would be \"text/\" to automatically fetch all -textual parts. - -Currently only the nnimap backend actually supports partial -article fetching. If the backend doesn't support it, it has no -effect." - :version "24.1" - :type '(choice (const nil) - (const t) - (regexp)) - :group 'gnus-article) - (defcustom gnus-hidden-properties '(invisible t intangible t) "Property list to use for hiding text." :type 'sexp diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index fbda260c9..02a098e73 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -9360,9 +9360,17 @@ article currently." (let ((gnus-keep-backlog nil) (gnus-use-cache nil) (gnus-agent nil) - (gnus-fetch-partial-articles nil)) - (gnus-flush-original-article-buffer) - (gnus-summary-show-article))) + (variable (format "%s-fetch-partial-articles" + (car (gnus-find-method-for-group + gnus-newsgroup-name)))) + old-val) + (unwind-protect + (progn + (setq old-val (symbol-value variable)) + (set variable nil) + (gnus-flush-original-article-buffer) + (gnus-summary-show-article)) + (set variable old-val)))) (defun gnus-summary-show-article (&optional arg) "Force redisplaying of the current article. diff --git a/lisp/nnimap.el b/lisp/nnimap.el index 7a065ccaf..a78300a21 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -85,6 +85,13 @@ some servers.") (defvoo nnimap-current-infos nil) +(defvoo nnimap-fetch-partial-articles nil + "If non-nil, Gnus will fetch partial articles. +If t, nnimap will fetch only the first part. If a string, it +will fetch all parts that have types that match that string. A +likely value would be \"text/\" to automatically fetch all +textual parts.") + (defvar nnimap-process nil) (defvar nnimap-status-string "") @@ -414,8 +421,8 @@ some servers.") (erase-buffer) (with-current-buffer (nnimap-buffer) (erase-buffer) - (when gnus-fetch-partial-articles - (if (eq gnus-fetch-partial-articles t) + (when nnimap-fetch-partial-articles + (if (eq nnimap-fetch-partial-articles t) (setq parts '(1)) (nnimap-command "UID FETCH %d (BODYSTRUCTURE)" article) (goto-char (point-min)) @@ -544,7 +551,7 @@ some servers.") (number-to-string num) (format "%s.%s" prefix num)))) (setcar (nthcdr 9 sub) id) - (when (string-match gnus-fetch-partial-articles type) + (when (string-match nnimap-fetch-partial-articles type) (push id parts)))) (incf num))) (nreverse parts))) -- 2.25.1