From e7d6eb625f3f17d75ea7682e84f6627cb41f4c46 Mon Sep 17 00:00:00 2001 From: Andrew G Cohen Date: Tue, 6 Mar 2018 04:57:22 +0800 Subject: [PATCH] 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 2a7a303408e..50bbdf0d576 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el @@ -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. diff --git a/lisp/gnus/nnselect.el b/lisp/gnus/nnselect.el index 132f9dd49dc..5a566c3c3a9 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: -- 2.39.2