]> git.eshelyaron.com Git - emacs.git/commitdiff
Make Gnus cache work with nnselect
authorAndrew G Cohen <cohen@andy.bu.edu>
Wed, 9 Sep 2020 09:01:44 +0000 (17:01 +0800)
committerAndrew G Cohen <cohen@andy.bu.edu>
Wed, 9 Sep 2020 09:01:44 +0000 (17:01 +0800)
* 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.

lisp/gnus/gnus-cache.el

index 7ca3bf1ce1c714d20d2e3f4bb95311ff54fd36d6..c31d97d41cd30464e7223b253204349d089519b4 100644 (file)
@@ -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")
 
 \f
 
@@ -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))