Function: bug-reference-try-setup-from-rmail

bug-reference-try-setup-from-rmail is a byte-compiled function defined in bug-reference.el.gz.

Signature

(bug-reference-try-setup-from-rmail)

Documentation

Try setting up bug-reference-mode(var)/bug-reference-mode(fun) from the current rmail mail.

Guesses suitable bug-reference-bug-regexp and bug-reference-url-format values by matching the current Rmail file's name against GROUP-REGEXP and the values of List-Id, To, From, and Cc against HEADER-REGEXP in bug-reference-setup-from-mail-alist.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/bug-reference.el.gz
(defun bug-reference-try-setup-from-rmail ()
  "Try setting up `bug-reference-mode' from the current rmail mail.
Guesses suitable `bug-reference-bug-regexp' and
`bug-reference-url-format' values by matching the current Rmail
file's name against GROUP-REGEXP and the values of List-Id, To,
From, and Cc against HEADER-REGEXP in
`bug-reference-setup-from-mail-alist'."
  (when (and bug-reference-mode
             (derived-mode-p 'rmail-mode))
    (let (header-values)
      (save-excursion
        (goto-char (point-min))
        (dolist (field '("list-id" "to" "from" "cc"))
          (let ((val (mail-fetch-field field)))
            (when val
              (push val header-values)))))
      (bug-reference-maybe-setup-from-mail
       (buffer-file-name) header-values))))