[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] feature/gnus-select2 e5ea691 17/32: Use gnus-newsgroup-sel
From: |
Andrew G Cohen |
Subject: |
[Emacs-diffs] feature/gnus-select2 e5ea691 17/32: Use gnus-newsgroup-selection instead of nnselect-artlist |
Date: |
Sun, 16 Dec 2018 06:54:03 -0500 (EST) |
branch: feature/gnus-select2
commit e5ea691ee20a262733c651474f89503605239bfb
Author: Andrew G Cohen <address@hidden>
Commit: Andrew G Cohen <address@hidden>
Use gnus-newsgroup-selection instead of nnselect-artlist
* lisp/gnus/nnselect.el (nnselect-retrieve-headers):
(nnselect-request-thread):
(nnselect-retrieve-headers):
(nnselect-close-group): Use the summary local variable
gnus-newsgroup-selection rather than the internal nnselect-artlist
variable.
(nnselect-request-group):
(nnselect-request-move-article):
(nnselect-request-expire-articles):
(nnselect-warp-to-article):
(nnselect-request-set-mark):
(nnselect-request-thread): Don't unnecessarily retrieve the
nnselect-artlist value.
---
lisp/gnus/nnselect.el | 49 ++++++++++++++++++++++++++-----------------------
1 file changed, 26 insertions(+), 23 deletions(-)
diff --git a/lisp/gnus/nnselect.el b/lisp/gnus/nnselect.el
index b8aa941..ea0687d 100644
--- a/lisp/gnus/nnselect.el
+++ b/lisp/gnus/nnselect.el
@@ -182,10 +182,8 @@ If this variable is nil, or if the provided function
returns nil,
(deffoo nnselect-open-server (server &optional definitions)
;; Just set the server variables appropriately.
- (let ((backend (car (gnus-server-to-method server))))
- (if backend
- (nnoo-change-server backend server definitions)
- (nnoo-change-server 'nnselect server definitions))))
+ (let ((backend (or (car (gnus-server-to-method server)) 'nnselect)))
+ (nnoo-change-server backend server definitions)))
(deffoo nnselect-request-group (group &optional server dont-check _info)
(let ((group (nnselect-possibly-change-group group server))
@@ -212,7 +210,7 @@ If this variable is nil, or if the provided function
returns nil,
nnselect-artlist)
(deffoo nnselect-retrieve-headers (articles &optional _group _server fetch-old)
- (setq gnus-newsgroup-selection nnselect-artlist)
+ (setq gnus-newsgroup-selection (or gnus-newsgroup-selection
nnselect-artlist))
(let ((gnus-inhibit-demon t)
(gartids (ids-by-group articles))
headers)
@@ -309,9 +307,10 @@ If this variable is nil, or if the provided function
returns nil,
(gnus-request-article (cdr group-art) (car group-art)))
group-art)))
-(deffoo nnselect-request-move-article (article group server accept-form
- &optional last _internal-move-group)
- (nnselect-possibly-change-group group server)
+(deffoo nnselect-request-move-article
+ (article _group _server accept-form &optional last _internal-move-group)
+ ;; is this necessary?
+ ;; (nnselect-possibly-change-group group server)
(let* ((artgroup (nnselect-article-group article))
(artnumber (nnselect-article-number article))
(to-newsgroup (nth 1 accept-form))
@@ -332,8 +331,10 @@ If this variable is nil, or if the provided function
returns nil,
(gnus-group-real-name to-newsgroup)))))
-(deffoo nnselect-request-expire-articles (articles group &optional server
force)
- (nnselect-possibly-change-group group server)
+(deffoo nnselect-request-expire-articles
+ (articles _group &optional _server force)
+ ;; is this necessary?
+ ;; (nnselect-possibly-change-group group server)
(if force
(let (not-expired)
(pcase-dolist (`(,artgroup ,artids) (ids-by-group articles))
@@ -352,7 +353,8 @@ If this variable is nil, or if the provided function
returns nil,
articles))
(deffoo nnselect-warp-to-article ()
- (nnselect-possibly-change-group gnus-newsgroup-name)
+ ;; is this necessary?
+;; (nnselect-possibly-change-group gnus-newsgroup-name)
(let* ((cur (if (> (gnus-summary-article-number) 0)
(gnus-summary-article-number)
(error "Can't warp to a pseudo-article")))
@@ -388,8 +390,9 @@ If this variable is nil, or if the provided function
returns nil,
(setq gmark gnus-expirable-mark))
gmark))
-(deffoo nnselect-request-set-mark (group actions &optional server)
- (nnselect-possibly-change-group group server)
+(deffoo nnselect-request-set-mark (_group actions &optional _server)
+ ;; is this necessary?
+;; (nnselect-possibly-change-group group server)
(mapc
(lambda (request) (gnus-request-set-mark (car request) (cadr request)))
(nnselect-categorize
@@ -444,7 +447,7 @@ If this variable is nil, or if the provided function
returns nil,
gnus-newsgroup-selection)))))
(deffoo nnselect-request-thread (header &optional group server)
- (let ((group (nnselect-possibly-change-group group server))
+ (let ((group (nnselect-possibly-change-group group server)) ;; necessary?
;; find the best group for the originating article. if its a
;; psuedo-article look for real articles in the same thread
;; and see where they come from.
@@ -474,7 +477,7 @@ If this variable is nil, or if the provided function
returns nil,
(query-spec
(list (cons 'query (nnimap-make-thread-query header))
(cons 'criteria "")))
- (last (nnselect-artlist-length nnselect-artlist))
+ (last (nnselect-artlist-length gnus-newsgroup-selection))
(first (1+ last))
(new-nnselect-artlist
(nnir-run-query
@@ -493,21 +496,21 @@ If this variable is nil, or if the provided function
returns nil,
#'(lambda (article)
(if
(setq seq
- (cl-position article nnselect-artlist :test 'equal))
+ (cl-position article
+ gnus-newsgroup-selection :test 'equal))
(push (1+ seq) old-arts)
- (setq nnselect-artlist
- (vconcat nnselect-artlist (vector article)))
+ (setq gnus-newsgroup-selection
+ (vconcat gnus-newsgroup-selection (vector article)))
(cl-incf last)))
new-nnselect-artlist)
(setq headers
(gnus-fetch-headers
(append (sort old-arts '<)
- (gnus-uncompress-range (cons first last))) nil t))
+ (number-sequence first last)) nil t))
(gnus-group-set-parameter
group
'nnselect-artlist
- nnselect-artlist)
-
+ gnus-newsgroup-selection)
(when (>= last first)
(let (new-marks)
(pcase-dolist (`(,artgroup ,artids)
@@ -527,10 +530,10 @@ If this variable is nil, or if the provided function
returns nil,
(car (rassq type gnus-article-mark-lists)))))
new-marks)))))
(setq gnus-newsgroup-active
- (cons 1 (nnselect-artlist-length nnselect-artlist)))
+ (cons 1 (nnselect-artlist-length gnus-newsgroup-selection)))
(gnus-set-active
group
- (cons 1 (nnselect-artlist-length nnselect-artlist))))
+ (cons 1 (nnselect-artlist-length gnus-newsgroup-selection))))
headers)
;; If not an imap backend just warp to the original article
;; group and punt back to gnus-summary-refer-thread.
- [Emacs-diffs] feature/gnus-select2 94fedc1 03/32: ; Clean up parameter input for nnselect groups, (continued)
- [Emacs-diffs] feature/gnus-select2 94fedc1 03/32: ; Clean up parameter input for nnselect groups, Andrew G Cohen, 2018/12/16
- [Emacs-diffs] feature/gnus-select2 40f356a 02/32: ; Silence byte-compiler, Andrew G Cohen, 2018/12/16
- [Emacs-diffs] feature/gnus-select2 a9cb4e9 13/32: Use fetch-old-headers group parameter in nnselect, Andrew G Cohen, 2018/12/16
- [Emacs-diffs] feature/gnus-select2 0df0f5a 14/32: Remove obsolete variable nnselect-summary-line-format, Andrew G Cohen, 2018/12/16
- [Emacs-diffs] feature/gnus-select2 f3fd674 06/32: Restore article retrieval by message-id in nnselect, Andrew G Cohen, 2018/12/16
- [Emacs-diffs] feature/gnus-select2 b51a495 07/32: Restore article retrieval by message-id in nnselect, Andrew G Cohen, 2018/12/16
- [Emacs-diffs] feature/gnus-select2 8e7635b 05/32: Fix requesting sparse articles in gnus, Andrew G Cohen, 2018/12/16
- [Emacs-diffs] feature/gnus-select2 5be0d2a 12/32: Disable nnselect-server-opened check, Andrew G Cohen, 2018/12/16
- [Emacs-diffs] feature/gnus-select2 f43d8d8 23/32: * lisp/gnus/nnselect.el (nnselect-request-group): Don't close group., Andrew G Cohen, 2018/12/16
- [Emacs-diffs] feature/gnus-select2 c1c5b4b 08/32: Introduce summary-local variable gnus-newsgroup-selection, Andrew G Cohen, 2018/12/16
- [Emacs-diffs] feature/gnus-select2 e5ea691 17/32: Use gnus-newsgroup-selection instead of nnselect-artlist,
Andrew G Cohen <=
- [Emacs-diffs] feature/gnus-select2 1388539 11/32: Improve nnselect-request-article, Andrew G Cohen, 2018/12/16
- [Emacs-diffs] feature/gnus-select2 7df041f 10/32: Remove unnecessary check gnus-nnselect-group-p, Andrew G Cohen, 2018/12/16
- [Emacs-diffs] feature/gnus-select2 c87252e 15/32: New gnus summary sorting functions on rsv, Andrew G Cohen, 2018/12/16
- [Emacs-diffs] feature/gnus-select2 514f0cb 04/32: Temporary function to ease search group creation, Andrew G Cohen, 2018/12/16
- [Emacs-diffs] feature/gnus-select2 3444486 16/32: Fix pushing marks on nnselect exit, Andrew G Cohen, 2018/12/16
- [Emacs-diffs] feature/gnus-select2 fde0e40 21/32: Restore accidentally remove gnus-summary-make-search-group, Andrew G Cohen, 2018/12/16
- [Emacs-diffs] feature/gnus-select2 d2e0389 19/32: Improve group-info handling in nnselect, Andrew G Cohen, 2018/12/16
- [Emacs-diffs] feature/gnus-select2 6111aa1 09/32: Don't stomp on local variables in gnus-msg, Andrew G Cohen, 2018/12/16
- [Emacs-diffs] feature/gnus-select2 c9c16c9 22/32: * lisp/gnus/nnselect.el (nnselect-server-opened): Just return t., Andrew G Cohen, 2018/12/16
- [Emacs-diffs] feature/gnus-select2 2174d0f 20/32: Improve nnselect-request-article, Andrew G Cohen, 2018/12/16