Function: gnus-search-thread

gnus-search-thread is a byte-compiled function defined in gnus-search.el.gz.

Signature

(gnus-search-thread HEADER)

Documentation

Make an nnselect group based on the thread containing the article header. The current server will be searched. If the registry is installed, the server that the registry reports the current article came from is also searched.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-search.el.gz
(defun gnus-search-thread (header)
  "Make an nnselect group based on the thread containing the article
header. The current server will be searched. If the registry is
installed, the server that the registry reports the current
article came from is also searched."
  (let* ((ids (cons (mail-header-id header)
		    (split-string
		     (or (mail-header-references header)
			 ""))))
	 (query
	  (list (cons 'query (mapconcat (lambda (i)
					  (format "id:%s" i))
					ids " or "))
		(cons 'thread t)))
	 (server
	  (list (list (gnus-method-to-server
		       (gnus-find-method-for-group gnus-newsgroup-name)))))
	 (registry-group (and
			  (bound-and-true-p gnus-registry-enabled)
			  (car (gnus-registry-get-id-key
				(mail-header-id header) 'group))))
	 (registry-server
	  (and registry-group
	       (gnus-method-to-server
		(gnus-find-method-for-group registry-group)))))
    (when registry-server
      (cl-pushnew (list registry-server) server :test #'equal))
    (gnus-group-make-search-group nil (list
				       (cons 'search-query-spec query)
				       (cons 'search-group-spec server)))
    (gnus-summary-goto-subject (gnus-id-to-article (mail-header-id header)))))