File: reportbug.el

package info (click to toggle)
reportbug 3.31%2Betch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 716 kB
  • ctags: 346
  • sloc: python: 5,506; makefile: 56; sh: 37; lisp: 23
file content (27 lines) | stat: -rw-r--r-- 892 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
;; 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."
  (message-narrow-to-head)
  (goto-char (point-min))
  (search-forward (format "%s: " header) (point-max) t)
  (insert value)
  (widen))

(defun tfheen-reportbug-insert-template ()
  (interactive)
  (require 'gnus)
  (find-file (getenv "REPORTBUG"))
  (let ((subject (message-fetch-field "Subject"))
        (toaddr (or (message-fetch-field "To") "submit@bugs.debian.org")))
    (gnus-narrow-to-body)
    (let ((body (or (buffer-string) "")))
      (gnus-summary-mail-other-window)
      (tfheen-set-header "Subject" subject)
      (tfheen-set-header "To" toaddr)
      (gnus-narrow-to-body)
      (insert body)
      (widen)))
  (kill-buffer (find-buffer-visiting (getenv "REPORTBUG"))))