Function: gnus-group-read-ephemeral-search-group

gnus-group-read-ephemeral-search-group is an interactive and byte-compiled function defined in gnus-group.el.gz.

Signature

(gnus-group-read-ephemeral-search-group NO-PARSE &optional SPECS)

Documentation

Read an nnselect group based on a search.

Prompt for a search query and determine the groups to search as follows: if called from the *Server* buffer search all groups belonging to the server on the current line; if called from the
*Group* buffer search any marked groups, or the group on the
current line, or all the groups under the current topic. A prefix arg NO-PARSE means that Gnus should not parse the search query before passing it to the underlying search engine. A non-nil SPECS arg must be an alist with search-query-spec and search-group-spec keys, and skips all prompting.

Probably introduced at or before Emacs version 28.1.

Key Bindings

Aliases

gnus-group-make-nnir-group (obsolete since 28.1)

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-group.el.gz
(defun gnus-group-read-ephemeral-search-group (no-parse &optional specs)
  "Read an nnselect group based on a search.
Prompt for a search query and determine the groups to search as
follows: if called from the *Server* buffer search all groups
belonging to the server on the current line; if called from the
*Group* buffer search any marked groups, or the group on the
current line, or all the groups under the current topic.  A
prefix arg NO-PARSE means that Gnus should not parse the search
query before passing it to the underlying search engine.  A
non-nil SPECS arg must be an alist with `search-query-spec' and
`search-group-spec' keys, and skips all prompting."
  (interactive "P" gnus-group-mode)
  (let* ((group-spec
	  (or (cdr (assq 'search-group-spec specs))
	      (cdr (assq 'nnir-group-spec specs))
	      (if (gnus-server-server-name)
		  (list (list (gnus-server-server-name)))
		(seq-group-by
                 (lambda (elt)
                   (if (gnus-group-native-p elt)
                       (gnus-group-server elt)
                     (gnus-method-to-server
                      (gnus-find-method-for-group elt))))
		 (or gnus-group-marked
		     (if (gnus-group-group-name)
			 (list (gnus-group-group-name))
		       (mapcar #'caadr
				(gnus-topic-find-groups
				 (gnus-group-topic-name)
				 nil 'all nil t))))))))
	 (query-spec
	  (or (cdr (assq 'search-query-spec specs))
	      (cdr (assq 'nnir-query-spec specs))
	      (gnus-search-make-spec no-parse))))
    ;; If our query came via an old call to nnir, we know not to parse
    ;; the query.
    (when (assq 'nnir-query-spec specs)
      (setf (alist-get 'raw query-spec) t))
    (gnus-group-read-ephemeral-group
     (concat "nnselect-" (message-unique-id))
     (list 'nnselect "nnselect")
     nil
     (cons (current-buffer) gnus-current-window-configuration)
     nil nil
     (list
      (cons 'nnselect-specs
	    (list
	     (cons 'nnselect-function 'gnus-search-run-query)
	     (cons 'nnselect-args
		   (list (cons 'search-query-spec query-spec)
			 (cons 'search-group-spec group-spec)))))
      (cons 'nnselect-artlist nil)))))