From ee8b4562de9073df3c52acf8e4e78d4536103630 Mon Sep 17 00:00:00 2001 From: Madhu Date: Sun, 4 Oct 2020 14:24:06 +0530 Subject: [PATCH] Fix "Don't eagerly store articles in the Agent by default" * lisp/gnus/gnus.el: (gnus-agent-eagerly-store-articles-by-default) new variable. When gnus-agent is non-NIL and when reading an agentized newsgroup, +automatically cache the article in the agent cache * lisp/gnus/gnus-art.el: (gnus-request-article-this-buffer, gnus-async-article-callback): use it. fixes def34a20766ea5179afd5e5ed090a2b86fcccb5e which was reverted in e2ece082732323738e56046a7bd667e5f9126ced http://debbugs.gnu.org/cgi/bugreport.cgi?bug=39977 --- lisp/gnus/gnus-art.el | 1 + lisp/gnus/gnus-async.el | 1 + lisp/gnus/gnus.el | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 1e9e459fe7..5fbb47fb75 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -7095,6 +7095,7 @@ gnus-request-article-this-buffer (gnus-backlog-enter-article group article (current-buffer))) (when (and gnus-agent + gnus-agent-eagerly-store-articles-by-default (gnus-agent-group-covered-p group)) (gnus-agent-store-article article group))) (setq result 'article)) diff --git a/lisp/gnus/gnus-async.el b/lisp/gnus/gnus-async.el index e3e81c8bbc..fd5e5437cc 100644 --- a/lisp/gnus/gnus-async.el +++ b/lisp/gnus/gnus-async.el @@ -227,6 +227,7 @@ gnus-async-article-callback (narrow-to-region mark (point-max)) ;; Put the articles into the agent, if they aren't already. (when (and gnus-agent + gnus-agent-eagerly-store-articles-by-default (gnus-agent-group-covered-p group)) (save-restriction (narrow-to-region mark (point-max)) diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index cb534260a6..c93a15f01a 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -2285,6 +2285,10 @@ gnus-user-agent (gnus-message 1 "Edit your init file to make this change permanent.") (sit-for 2))) +(defvar gnus-agent-eagerly-store-articles-by-default nil + "When gnus-agent is non-NIL and when reading an agentized newsgroup, +automatically cache the article in the agent cache") + ;;; Internal variables -- 2.25.1