emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] feature/gnus-select2 5868104 30/32: Allow automatic scanni


From: Andrew G Cohen
Subject: [Emacs-diffs] feature/gnus-select2 5868104 30/32: Allow automatic scanning of nnselect groups
Date: Sun, 16 Dec 2018 06:54:05 -0500 (EST)

branch: feature/gnus-select2
commit 5868104a46328425708c1b6fecb27a372d7b3cfe
Author: Andrew G Cohen <address@hidden>
Commit: Andrew G Cohen <address@hidden>

    Allow automatic scanning of nnselect groups
    
    * 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 |  2 +-
 lisp/gnus/nnselect.el   | 27 ++++++++++++++++++++-------
 2 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index f15d645..381e89c 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -1835,7 +1835,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.
diff --git a/lisp/gnus/nnselect.el b/lisp/gnus/nnselect.el
index 132f9dd..5a566c3 100644
--- a/lisp/gnus/nnselect.el
+++ b/lisp/gnus/nnselect.el
@@ -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:
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]