Function: gnus-article-add-buttons
gnus-article-add-buttons is an autoloaded, interactive and
byte-compiled function defined in gnus-art.el.gz.
Signature
(gnus-article-add-buttons)
Documentation
Find external references in the article and make buttons of them.
"External references" are things like Message-IDs and URLs, as
specified by gnus-button-alist.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/gnus/gnus-art.el.gz
(defun gnus-article-add-buttons ()
"Find external references in the article and make buttons of them.
\"External references\" are things like Message-IDs and URLs, as
specified by `gnus-button-alist'."
(interactive nil gnus-article-mode gnus-summary-mode)
(gnus-with-article-buffer
(let ((case-fold-search t)
(alist gnus-button-alist)
beg entry regexp)
;; We skip the headers.
(article-goto-body)
(setq beg (point))
(while (setq entry (pop alist))
(setq regexp (eval (car entry) t))
(goto-char beg)
(while (re-search-forward regexp nil t)
(let ((start (match-beginning (nth 1 entry)))
(end (match-end (nth 1 entry)))
(from (match-beginning 0)))
(when (and (eval (nth 2 entry) t)
(not (gnus-button-in-region-p
start end 'gnus-callback)))
;; That optional form returned non-nil, so we add the
;; button.
(setq from (set-marker (make-marker) from))
(unless (and (eq (car entry) 'gnus-button-url-regexp)
(gnus-article-extend-url-button from start end))
(gnus-article-add-button start end
'gnus-button-push (list from entry))
(put-text-property
start end
'gnus-string (buffer-substring-no-properties
start end))))))))))