From: Andrew G Cohen Date: Wed, 16 Oct 2019 05:25:57 +0000 (+0800) Subject: ; merge master X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bcbcb8c619d9997fcb61750fff9fbe72c099a7d3;p=emacs.git ; merge master --- bcbcb8c619d9997fcb61750fff9fbe72c099a7d3 diff --cc lisp/gnus/gnus-msg.el index 52e1a1bd01b,10793455a52..5666796a90b --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el @@@ -413,11 -391,12 +391,11 @@@ only affect the Gcc copy, but not the o (defun gnus-inews-make-draft (articles) `(lambda () (gnus-inews-make-draft-meta-information - ,(gnus-group-decoded-name gnus-newsgroup-name) ',articles))) + ,gnus-newsgroup-name ',articles))) -(autoload 'nnir-article-number "nnir" nil nil 'macro) -(autoload 'nnir-article-group "nnir" nil nil 'macro) -(autoload 'gnus-nnir-group-p "nnir") - +(autoload 'nnselect-article-number "nnselect" nil nil 'macro) +(autoload 'nnselect-article-group "nnselect" nil nil 'macro) +(autoload 'gnus-nnselect-group-p "nnselect") (defvar gnus-article-reply nil) (defmacro gnus-setup-message (config &rest forms) diff --cc lisp/gnus/gnus-start.el index 381e89c9f28,e142c438ee0..98199a467e0 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el @@@ -1835,21 -1802,27 +1802,27 @@@ backend check whether the group actuall ;; 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. (defun gnus-make-hashtable-from-newsrc-alist () + "Create a hash table from `gnus-newsrc-alist'. + The keys are group names, and values are a cons of (unread info), + where unread is an integer count of calculated unread + messages (or nil), and info is a regular gnus info entry. + + The info element is shared with the same element of + `gnus-newrc-alist', so as to conserve space." (let ((alist gnus-newsrc-alist) (ohashtb gnus-newsrc-hashtb) - prev info method rest methods) - (setq gnus-newsrc-hashtb (gnus-make-hashtable (length alist))) + info method gname rest methods) + (setq gnus-newsrc-hashtb (gnus-make-hashtable (length alist)) + gnus-group-list nil) (setq alist - (setq prev (setq gnus-newsrc-alist - (if (equal (caar gnus-newsrc-alist) - "dummy.group") - gnus-newsrc-alist - (cons (list "dummy.group" 0 nil) alist))))) + (setq gnus-newsrc-alist + (if (equal (caar gnus-newsrc-alist) + "dummy.group") + gnus-newsrc-alist + (cons (list "dummy.group" 0 nil) alist)))) (while alist (setq info (car alist)) ;; Make the same select-methods identical Lisp objects. diff --cc lisp/gnus/gnus-sum.el index 9f58a33efde,b5d744843f0..e6329ac2ded --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@@ -9044,14 -9121,14 +9135,14 @@@ Return the number of articles fetched. result)) (defun gnus-summary-refer-thread (&optional limit) - "Fetch all articles in the current thread. For backends -that know how to search for threads (currently only 'nnimap) -a non-numeric prefix arg will use nnir to search the entire + "Fetch all articles in the current thread. For backends that +know how to search for threads (currently only 'nnimap) a +non-numeric prefix arg will search the entire server; without a prefix arg only the current group is -searched. If the variable `gnus-refer-thread-use-nnir' is -non-nil the prefix arg has the reverse meaning. If no +searched. If the variable `gnus-refer-thread-use-search' is +non-nil the prefix arg has the reverse meaning. If no backend-specific 'request-thread function is available fetch - LIMIT (the numerical prefix) old headers. If LIMIT is + LIMIT (the numerical prefix) old headers. If LIMIT is non-numeric or nil fetch the number specified by the `gnus-refer-thread-limit' variable." (interactive "P") diff --cc lisp/gnus/nnimap.el index 2b32fceae83,d4681e2b436..7a0c495feee --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@@ -1845,13 -1854,11 +1854,11 @@@ If LIMIT, first try to limit the searc (declare-function gnus-fetch-headers "gnus-sum" (articles &optional limit force-new dependencies)) -(autoload 'nnir-search-thread "nnir") +(autoload 'nnselect-search-thread "nnselect") (deffoo nnimap-request-thread (header &optional group server) - (when group - (setq group (nnimap-decode-gnus-group group))) - (if gnus-refer-thread-use-nnir - (nnir-search-thread header) + (if gnus-refer-thread-use-search + (nnselect-search-thread header) (when (nnimap-change-group group server) (let* ((cmd (nnimap-make-thread-query header)) (result (with-current-buffer (nnimap-buffer) diff --cc lisp/gnus/nnir.el index 03d909c44aa,1041373a05f..ae47d90497f --- a/lisp/gnus/nnir.el +++ b/lisp/gnus/nnir.el @@@ -162,10 -179,17 +162,10 @@@ ;;; Internal Variables: -(defvar nnir-memo-query nil - "Internal: stores current query.") - -(defvar nnir-memo-server nil - "Internal: stores current server.") - -(defvar nnir-artlist nil - "Internal: stores search result.") +(defvar gnus-inhibit-demon) (defvar nnir-search-history () - "Internal: the history for querying search options in nnir") + "Internal: the history for querying search options in nnir.") (defconst nnir-tmp-buffer " *nnir*" "Internal: temporary buffer.") @@@ -193,8 -216,19 +193,8 @@@ email header field." ;;; Helper macros -;; Data type article list. - -(defmacro nnir-artlist-length (artlist) - "Return number of articles in artlist." - `(length ,artlist)) - -(defmacro nnir-artlist-article (artlist n) - "Return from ARTLIST the Nth artitem (counting starting at 1)." - `(when (> ,n 0) - (elt ,artlist (1- ,n)))) - (defmacro nnir-artitem-group (artitem) - "Returns the group from the ARTITEM." + "Return the group from the ARTITEM." `(elt ,artitem 0)) (defmacro nnir-artitem-number (artitem) @@@ -202,9 -236,55 +202,9 @@@ `(elt ,artitem 1)) (defmacro nnir-artitem-rsv (artitem) - "Returns the Retrieval Status Value (RSV, score) from the ARTITEM." + "Return the Retrieval Status Value (RSV, score) from the ARTITEM." `(elt ,artitem 2)) -(defmacro nnir-article-group (article) - "Return the group for ARTICLE." - `(nnir-artitem-group (nnir-artlist-article nnir-artlist ,article))) - -(defmacro nnir-article-number (article) - "Return the number for ARTICLE." - `(nnir-artitem-number (nnir-artlist-article nnir-artlist ,article))) - -(defmacro nnir-article-rsv (article) - "Return the rsv for ARTICLE." - `(nnir-artitem-rsv (nnir-artlist-article nnir-artlist ,article))) - -(defsubst nnir-article-ids (article) - "Return the pair `(nnir id . real id)' of ARTICLE." - (cons article (nnir-article-number article))) - -(defmacro nnir-categorize (sequence keyfunc &optional valuefunc) - "Sort a SEQUENCE into categories and returns a list of the form -`((key1 (element11 element12)) (key2 (element21 element22))'. -The category key for a member of the sequence is obtained -as `(KEYFUNC member)' and the corresponding element is just -`member'. If VALUEFUNC is non-nil, the element of the list -is `(VALUEFUNC member)'." - `(unless (null ,sequence) - (let (value) - (mapc - (lambda (member) - (let ((y (,keyfunc member)) - (x ,(if valuefunc - `(,valuefunc member) - 'member))) - (if (assoc y value) - (push x (cadr (assoc y value))) - (push (list y (list x)) value)))) - ,sequence) - value))) - -;;; Finish setup: - -(require 'gnus-sum) - -(nnoo-declare nnir) -(nnoo-define-basics nnir) - -(gnus-declare-backend "nnir" 'mail 'virtual) - ;;; User Customizable Variables: @@@ -219,11 -299,37 +219,10 @@@ be skipped when searching. :type '(regexp) :group 'nnir) -(defcustom nnir-summary-line-format nil - "The format specification of the lines in an nnir summary buffer. - -All the items from `gnus-summary-line-format' are available, along -with three items unique to nnir summary buffers: - -%Z Search retrieval score value (integer) -%G Article original full group name (string) -%g Article original short group name (string) - -If nil this will use `gnus-summary-line-format'." - :version "24.1" - :type '(choice (const :tag "gnus-summary-line-format" nil) string) - :group 'nnir) - -(defcustom nnir-retrieve-headers-override-function nil - "If non-nil, a function that accepts an article list and group -and populates the `nntp-server-buffer' with the retrieved -headers. Must return either 'nov or 'headers indicating the -retrieved header format. - -If this variable is nil, or if the provided function returns nil for -a search result, `gnus-retrieve-headers' will be called instead." - :version "24.1" - :type '(choice (const :tag "gnus-retrieve-headers" nil) function) - :group 'nnir) -- (defcustom nnir-imap-default-search-key "whole message" - "The default IMAP search key for an nnir search. Must be one of - the keys in `nnir-imap-search-arguments'. To use raw imap queries - by default set this to \"imap\"." + "The default IMAP search key for an nnir search. Must be one of + the keys in `nnir-imap-search-arguments'. To use raw imap queries + by default set this to \"imap\"." :version "24.1" :type `(choice ,@(mapcar (lambda (elem) (list 'const (car elem))) nnir-imap-search-arguments)) @@@ -1237,9 -1702,14 +1240,9 @@@ construct path: search terms (see the v ;;; Util Code: -(defun gnus-nnir-group-p (group) - "Say whether GROUP is nnir or not." - (if (gnus-group-prefixed-p group) - (eq 'nnir (car (gnus-find-method-for-group group))) - (and group (string-match "^nnir" group)))) (defun nnir-read-parms (nnir-search-engine) - "Reads additional search parameters according to `nnir-engines'." + "Read additional search parameters according to `nnir-engines'." (let ((parmspec (nth 2 (assoc nnir-search-engine nnir-engines)))) (mapcar #'nnir-read-parm parmspec)))