summaryrefslogtreecommitdiff
path: root/lisp/gnus/gnus-int.el
diff options
context:
space:
mode:
authorAndrew G Cohen <cohen@andy.bu.edu>2020-09-11 09:02:09 +0800
committerAndrew G Cohen <cohen@andy.bu.edu>2020-09-11 09:02:09 +0800
commit206cff84bda2a7dd204a0da19e29abf389643f6b (patch)
tree0112326661429ed7a45b3e9ab5b9529a0beee3dc /lisp/gnus/gnus-int.el
parentf7be259400b9e31704560d137562e6e9cbf2a0be (diff)
downloademacs-206cff84bda2a7dd204a0da19e29abf389643f6b.tar.gz
Clean up group-finding in Gnus nnir search
This is part of removing code from nnir.el that isn't related to searching backends and therefore belongs somewhere else. * lisp/gnus/gnus-group.el (gnus-group-make-search-group) (gnus-group-read-ephemeral-search-group): Put the logic for determining the groups to search here, rather than in nnir. Improve documentation. * lisp/gnus/gnus-int.el (gnus-server-get-active): Renamed from 'nnir-get-active. * lisp/gnus/nnir.el (nnir-run-imap, nnir-run-find-grep): Use it. (nnir-get-active): Remove. (nnir-make-specs): Make obsolete. * lisp/gnus/nnselect.el (nnselect-group-server): Make obsolete in favor of 'gnus-group-server.
Diffstat (limited to 'lisp/gnus/gnus-int.el')
-rw-r--r--lisp/gnus/gnus-int.el42
1 files changed, 42 insertions, 0 deletions
diff --git a/lisp/gnus/gnus-int.el b/lisp/gnus/gnus-int.el
index da385a18023..b8be766c84f 100644
--- a/lisp/gnus/gnus-int.el
+++ b/lisp/gnus/gnus-int.el
@@ -365,6 +365,48 @@ If it is down, start it up (again)."
(funcall (gnus-get-function gnus-command-method 'request-list)
(nth 1 gnus-command-method)))
+(defun gnus-server-get-active (server &optional ignored)
+ "Return the active list for SERVER.
+Groups matching the IGNORED regexp are excluded."
+ (let ((method (gnus-server-to-method server))
+ groups)
+ (gnus-request-list method)
+ (with-current-buffer nntp-server-buffer
+ (let ((cur (current-buffer)))
+ (goto-char (point-min))
+ (unless (or (null ignored)
+ (string= ignored ""))
+ (delete-matching-lines ignored))
+ (if (eq (car method) 'nntp)
+ (while (not (eobp))
+ (ignore-errors
+ (push (gnus-group-full-name
+ (buffer-substring
+ (point)
+ (progn
+ (skip-chars-forward "^ \t")
+ (point)))
+ method)
+ groups))
+ (forward-line))
+ (while (not (eobp))
+ (ignore-errors
+ (push (if (eq (char-after) ?\")
+ (gnus-group-full-name (read cur) method)
+ (let ((p (point)) (name ""))
+ (skip-chars-forward "^ \t\\\\")
+ (setq name (buffer-substring p (point)))
+ (while (eq (char-after) ?\\)
+ (setq p (1+ (point)))
+ (forward-char 2)
+ (skip-chars-forward "^ \t\\\\")
+ (setq name (concat name (buffer-substring
+ p (point)))))
+ (gnus-group-full-name name method)))
+ groups))
+ (forward-line)))))
+ groups))
+
(defun gnus-finish-retrieve-group-infos (gnus-command-method infos data)
"Read and update infos from GNUS-COMMAND-METHOD."
(when (stringp gnus-command-method)