Function: gnus-uu-find-articles-matching

gnus-uu-find-articles-matching is a byte-compiled function defined in gnus-uu.el.gz.

Signature

(gnus-uu-find-articles-matching &optional SUBJECT ONLY-UNREAD DO-NOT-TRANSLATE)

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-uu.el.gz
(defun gnus-uu-find-articles-matching
  (&optional subject only-unread do-not-translate)
  ;; Finds all articles that matches the regexp SUBJECT.  If it is
  ;; nil, the current article name will be used.  If ONLY-UNREAD is
  ;; non-nil, only unread articles are chosen.  If DO-NOT-TRANSLATE is
  ;; non-nil, article names are not equalized before sorting.
  (let ((subject (or subject
		     (gnus-uu-reginize-string (gnus-summary-article-subject))))
	list-of-subjects)
    (save-excursion
      (when subject
	;; Collect all subjects matching subject.
	(let ((case-fold-search t)
	      (data gnus-newsgroup-data)
	      subj mark d)
	  (while data
	    (setq d (pop data))
	    (and (not (gnus-data-pseudo-p d))
		 (or (not only-unread)
		     (= (setq mark (gnus-data-mark d))
			gnus-unread-mark)
		     (= mark gnus-ticked-mark)
		     (= mark gnus-dormant-mark))
		 (setq subj (mail-header-subject (gnus-data-header d)))
		 (string-match subject subj)
		 (push (cons subj (gnus-data-number d))
		       list-of-subjects))))

	;; Expand numbers, sort, and return the list of article
	;; numbers.
	(mapcar #'cdr
		(sort (gnus-uu-expand-numbers
		       list-of-subjects
		       (not do-not-translate))
		      #'gnus-uu-string<))))))