summaryrefslogtreecommitdiff
path: root/lisp/gnus/gnus-cache.el
diff options
context:
space:
mode:
authorAndrew G Cohen <cohen@andy.bu.edu>2020-09-09 17:01:44 +0800
committerAndrew G Cohen <cohen@andy.bu.edu>2020-09-09 17:01:44 +0800
commit7bd6dd065b7a63ed800fab1993ecb8052f3924b4 (patch)
tree9a57bd11e0aeb2692363e1db4a6ca4146732ef06 /lisp/gnus/gnus-cache.el
parentc50643cebd762ca77c6f2bc90264e4ef04dcb43d (diff)
downloademacs-7bd6dd065b7a63ed800fab1993ecb8052f3924b4.tar.gz
Make Gnus cache work with nnselect
* lisp/gnus/gnus-cache.el (gnus-cache-possibly-enter-article) (gnus-cache-possibly-remove-articles) (gnus-cache-possibly-remove-article): Use originating article info for nnselect groups.
Diffstat (limited to 'lisp/gnus/gnus-cache.el')
-rw-r--r--lisp/gnus/gnus-cache.el28
1 files changed, 22 insertions, 6 deletions
diff --git a/lisp/gnus/gnus-cache.el b/lisp/gnus/gnus-cache.el
index 7ca3bf1ce1c..c31d97d41cd 100644
--- a/lisp/gnus/gnus-cache.el
+++ b/lisp/gnus/gnus-cache.el
@@ -93,6 +93,8 @@ it's not cached."
(autoload 'nnml-generate-nov-databases-directory "nnml")
(autoload 'nnvirtual-find-group-art "nnvirtual")
+(autoload 'nnselect-article-group "nnselect")
+(autoload 'nnselect-article-number "nnselect")
@@ -158,8 +160,12 @@ it's not cached."
(file-name-coding-system nnmail-pathname-coding-system))
;; If this is a virtual group, we find the real group.
(when (gnus-virtual-group-p group)
- (let ((result (nnvirtual-find-group-art
- (gnus-group-real-name group) article)))
+ (let ((result (if (gnus-nnselect-group-p group)
+ (with-current-buffer gnus-summary-buffer
+ (cons (nnselect-article-group article)
+ (nnselect-article-number article)))
+ (nnvirtual-find-group-art
+ (gnus-group-real-name group) article))))
(setq group (car result)
number (cdr result))))
(when (and number
@@ -232,8 +238,14 @@ it's not cached."
(let ((arts gnus-cache-removable-articles)
ga)
(while arts
- (when (setq ga (nnvirtual-find-group-art
- (gnus-group-real-name gnus-newsgroup-name) (pop arts)))
+ (when (setq ga
+ (if (gnus-nnselect-group-p gnus-newsgroup-name)
+ (with-current-buffer gnus-summary-buffer
+ (let ((article (pop arts)))
+ (cons (nnselect-article-group article)
+ (nnselect-article-number article))))
+ (nnvirtual-find-group-art
+ (gnus-group-real-name gnus-newsgroup-name) (pop arts))))
(let ((gnus-cache-removable-articles (list (cdr ga)))
(gnus-newsgroup-name (car ga)))
(gnus-cache-possibly-remove-articles-1)))))
@@ -467,8 +479,12 @@ Returns the list of articles removed."
(file-name-coding-system nnmail-pathname-coding-system))
;; If this is a virtual group, we find the real group.
(when (gnus-virtual-group-p group)
- (let ((result (nnvirtual-find-group-art
- (gnus-group-real-name group) article)))
+ (let ((result (if (gnus-nnselect-group-p group)
+ (with-current-buffer gnus-summary-buffer
+ (cons (nnselect-article-group article)
+ (nnselect-article-number article)))
+ (nnvirtual-find-group-art
+ (gnus-group-real-name group) article))))
(setq group (car result)
number (cdr result))))
(setq file (gnus-cache-file-name group number))