1 ;;; gccbug.el --- forward bug reports to gnats
2 ;; (C) 2000 Free Software Foundation
3 ;; Written by Martin v. Löwis
5 ;; In rmail, bind a key to rmail-gccbug-reply, e.g.
8 ;; (define-key rmail-mode-map "R" 'rmail-gccbug-reply)
9 ;; Then, when reviewing a report, type R to create a gnats-formatted
14 (defun gccbug-reply ()
16 (let ((orig-yank-prefix mail-yank-prefix
))
17 (insert ">Submitter-Id: net\n")
18 (insert ">Originator: \n")
19 (insert ">Confidential: no\n")
20 (insert ">Synopsis: ")
24 (re-search-backward "Re: ")
25 (copy-region-as-kill (match-end 0) stop
)))
28 (insert ">Severity: serious\n")
29 (insert ">Priority: medium\n")
30 (insert ">Category: \n")
32 ;(insert ">State: analyzed\n")
33 (insert ">Release: 2.95.2\n")
34 (insert ">Environment:\n")
35 (insert ">Description:\n")
36 (set 'mail-yank-prefix nil
)
37 (set 'mail-yank-ignored-headers
38 "^via:\\|^mail-from:\\|^origin:\\|^status:\\|^remailed\\|^received:\\|^summary-line:\\|^to:\\|^subject:\\|^in-reply-to:\\|^return-path:\\|^X-.*:\\|^User-Agent:\\|^MIME-Version:\\|^Content-.*:\\|^List-.*:\\|C[Cc]:\\|^Precedence:\\|^Sender:\\|^Mailing-List:\\|^Delivered-To:\\|^>From")
39 (mail-yank-original t
)
40 (set 'mail-yank-prefix orig-yank-prefix
)
41 ; Copy From: field to Originator:
42 (re-search-backward "From: ")
43 (let ((beg (match-end 0)))
45 (kill-region beg
(point)))
46 (re-search-backward ">Originator: ")
47 (goto-char (match-end 0))
50 (re-search-forward "From:")
53 ; Replace Message-ID: with Original-Message-ID
55 (re-search-forward "Message-ID: .*")
56 (replace-match "Original-\\&")
57 ; Replace To: line, adding recipient to Notify list
59 (re-search-backward "To: ")
60 (replace-match "To: gcc-gnats@gcc.gnu.org\nX-GNATS-Notify: ")
61 ; add additional fields
63 (insert ">How-To-Repeat: \n>Fix: \n")
64 ; See whether an Organization: is present
65 (let ((org (re-search-backward "Organization:.*" nil t
)))
68 (kill-region (point) (match-end 0))
69 (re-search-backward ">Confidential")
73 ; This kills CC: lines, but rmail-reply below won't create any
79 (defun rmail-gccbug-reply ()
81 (rmail-toggle-header 0)