]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow automatic scanning of nnselect groups
authorAndrew G Cohen <cohen@andy.bu.edu>
Mon, 5 Mar 2018 20:57:22 +0000 (04:57 +0800)
committerAndrew G Cohen <cohen@andy.bu.edu>
Mon, 5 Mar 2018 20:57:22 +0000 (04:57 +0800)
* lisp/gnus/gnus-start.el (gnus-read-active-for-groups): Scan when
  activating virtual groups.

* lisp/gnus/nnselect.el (nnselect-request-group): Rescan only if no
  artlist is present.
  (nnselect-request-group-scan): New function to rescan a group.
  (nnselect-request-scan): If called with a group arg rescan that
  group.

lisp/gnus/gnus-start.el
lisp/gnus/nnselect.el

index 2a7a303408e61a178c7b50dea96bfc1232922020..50bbdf0d5763aaa188786d30cdd3293b3feddaaa 100644 (file)
@@ -1836,7 +1836,7 @@ backend check whether the group actually exists."
      ;; by one.
      (t
       (dolist (info infos)
-       (gnus-activate-group (gnus-info-group info) nil nil method t))))))
+       (gnus-activate-group (gnus-info-group info) t nil method t))))))
 
 ;; Create a hash table out of the newsrc alist.  The `car's of the
 ;; alist elements are used as keys.
index 132f9dd49dc4828f6f322d3b5d2596c780277eac..5a566c3c3a9f6fd6c64a12e824d99e7a7ab2c364 100644 (file)
@@ -220,12 +220,12 @@ If this variable is nil, or if the provided function returns nil,
   t)
 
 
-(deffoo nnselect-request-group (group &optional server dont-check info)
+(deffoo nnselect-request-group (group &optional server _dont-check info)
   (let ((group (nnselect-possibly-change-group group server))
        length)
     ;; Check for cached select result or run the selection and cache
     ;; the result.
-    (unless (and nnselect-artlist dont-check)
+    (unless nnselect-artlist
       (gnus-group-set-parameter
        group 'nnselect-artlist
        (setq nnselect-artlist
@@ -617,15 +617,28 @@ If this variable is nil, or if the provided function returns nil,
 (deffoo nnselect-request-rename-group (_group _new-name &optional _server)
   t)
 
-(deffoo nnselect-request-scan (_group _method)
-  t)
+(deffoo nnselect-request-scan (group _method)
+  (when (and group
+            (gnus-group-get-parameter
+             (gnus-group-prefixed-name
+              (gnus-group-short-name group)
+              '(nnselect "nnselect")) 'nnselect-rescan t))
+    (nnselect-request-group-scan group)))
 
-(deffoo nnselect-request-list (&optional _server)
-  t)
+
+(deffoo nnselect-request-group-scan (group &optional server info)
+  (let ((group (nnselect-possibly-change-group group server)))
+       (gnus-group-set-parameter
+        group 'nnselect-artlist
+        (setq nnselect-artlist
+              (nnselect-run
+               (gnus-group-get-parameter group 'nnselect-specs t))))
+       (nnselect-request-update-info
+        group (or info (gnus-get-info group)))))
 
 ;; Add any undefined required backend functions
 
-(nnoo-define-skeleton nnselect)
+;; (nnoo-define-skeleton nnselect)
 
 ;;; Util Code: