Function: gnus-summary-execute-command

gnus-summary-execute-command is an interactive and byte-compiled function defined in gnus-sum.el.gz.

Signature

(gnus-summary-execute-command HEADER REGEXP COMMAND &optional BACKWARD)

Documentation

Search forward for an article whose HEADER matches REGEXP and execute COMMAND.

If HEADER is an empty string (or nil), the match is done on the entire article. If BACKWARD (the prefix) is non-nil, search backward instead.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-sum.el.gz
(defun gnus-summary-execute-command (header regexp command &optional backward)
  "Search forward for an article whose HEADER matches REGEXP and execute COMMAND.
If HEADER is an empty string (or nil), the match is done on the entire
article.  If BACKWARD (the prefix) is non-nil, search backward instead."
  (interactive
   (list
    (let ((completion-ignore-case t))
      (gnus-completing-read
       "Header name"
       (mapcar #'symbol-name
	       (append
		'(Number Subject From Lines Date Message-ID
			 Xref References Body)
		gnus-extra-headers))
       'require-match))
    (read-string "Regexp: ")
    (read-key-sequence "Command: ")
    current-prefix-arg)
   gnus-summary-mode)
  (when (equal header "Body")
    (setq header ""))
  ;; Hidden thread subtrees must be searched as well.
  (gnus-summary-show-all-threads)
  ;; We don't want to change current point nor window configuration.
  (save-excursion
    (save-window-excursion
      (let (gnus-visual
	    gnus-treat-strip-trailing-blank-lines
	    gnus-treat-strip-leading-blank-lines
	    gnus-treat-strip-multiple-blank-lines
	    gnus-treat-hide-boring-headers
	    gnus-treat-fold-newsgroups
	    gnus-article-prepare-hook)
	(gnus-message 6 "Executing %s..." (key-description command))
	;; We'd like to execute COMMAND interactively so as to give arguments.
	(gnus-execute header regexp
		      `(call-interactively ',(key-binding command))
		      backward)
	(gnus-message 6 "Executing %s...done" (key-description command))))))