Function: gnus-summary-limit-to-bodies

gnus-summary-limit-to-bodies is an interactive and byte-compiled function defined in gnus-sum.el.gz.

Signature

(gnus-summary-limit-to-bodies MATCH &optional REVERSE HEADERSP)

Documentation

Limit the summary buffer to articles that have bodies that match MATCH.

If REVERSE (the prefix), limit to articles that don't match.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-sum.el.gz
(defun gnus-summary-limit-to-bodies (match &optional reverse headersp)
  "Limit the summary buffer to articles that have bodies that match MATCH.
If REVERSE (the prefix), limit to articles that don't match."
  (interactive "sMatch body (regexp): \nP" gnus-summary-mode)
  (let ((articles nil)
	(gnus-select-article-hook nil)	;Disable hook.
	(gnus-article-prepare-hook nil)
	(gnus-use-article-prefetch nil)
	(gnus-keep-backlog nil)
	(gnus-break-pages nil)
	(gnus-summary-display-arrow nil)
	(gnus-updated-mode-lines nil)
	(gnus-auto-center-summary nil)
	(gnus-display-mime-function nil))
    (dolist (data gnus-newsgroup-data)
      (let (gnus-mark-article-hook)
	(gnus-summary-select-article t t nil (gnus-data-number data)))
      (with-current-buffer gnus-article-buffer
	(article-goto-body)
	(let* ((case-fold-search t)
	       (found (if headersp
			  (re-search-backward match nil t)
			(re-search-forward match nil t))))
	  (when (or (and found
			 (not reverse))
		    (and (not found)
			 reverse))
	    (push (gnus-data-number data) articles)))))
    (if (not articles)
	(message "No messages matched")
      (gnus-summary-limit articles)))
  (gnus-summary-position-point))