Function: gnus-article-add-buttons-to-head

gnus-article-add-buttons-to-head is an interactive and byte-compiled function defined in gnus-art.el.gz.

Signature

(gnus-article-add-buttons-to-head)

Documentation

Add buttons to the head of the article.

Probably introduced at or before Emacs version 19.32.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-art.el.gz
;; Add buttons to the head of an article.
(defun gnus-article-add-buttons-to-head ()
  "Add buttons to the head of the article."
  (interactive nil gnus-article-mode gnus-summary-mode)
  (gnus-with-article-headers
    (let (beg end)
      (dolist (entry gnus-header-button-alist)
	;; Each alist entry.
	(goto-char (point-min))
	(while (re-search-forward (car entry) nil t)
	  ;; Each header matching the entry.
	  (setq beg (match-beginning 0))
	  (setq end (or (and (re-search-forward "^[^ \t]" nil t)
			     (match-beginning 0))
			(point-max)))
	  (goto-char beg)
	  (while (re-search-forward (eval (nth 1 entry) t) end t)
	    ;; Each match within a header.
	    (let* ((entry (cdr entry))
		   (start (match-beginning (nth 1 entry)))
		   (end (match-end (nth 1 entry)))
		   (form (nth 2 entry)))
	      (goto-char (match-end 0))
	      (when (eval form t)
		(gnus-article-add-button
		 start end (nth 3 entry)
		 (buffer-substring (match-beginning (nth 4 entry))
				   (match-end (nth 4 entry)))))))
	  (goto-char end))))))