You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
892 B

;; Vague implementation of needed code to invoke GNUS from reportbug
;; by Tollef Fog Heen
(require 'gnus-load)
(defun tfheen-set-header (header value)
"Insert a string at the beginning of a header."
(goto-char (point-min))
(search-forward (format "%s: " header) (point-max) t)
(insert value)
(defun tfheen-reportbug-insert-template ()
(require 'gnus)
(find-file (getenv "REPORTBUG"))
(let ((subject (message-fetch-field "Subject"))
(toaddr (or (message-fetch-field "To") "")))
(let ((body (or (buffer-string) "")))
(tfheen-set-header "Subject" subject)
(tfheen-set-header "To" toaddr)
(insert body)
(kill-buffer (find-buffer-visiting (getenv "REPORTBUG"))))