diff options
author | loewis <loewis@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-05-01 11:15:22 +0000 |
---|---|---|
committer | loewis <loewis@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-05-01 11:15:22 +0000 |
commit | fc188cd061f8d07e4acaccaf9848c315e0d80a9e (patch) | |
tree | 4135adfd8b9621f2e3afbf3a4707bd5ffde778cc /contrib/gccbug.el | |
parent | 1add6d42999331d8e31a7084ee94a937f75900ae (diff) | |
download | gcc-fc188cd061f8d07e4acaccaf9848c315e0d80a9e.tar.gz |
New file
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33566 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'contrib/gccbug.el')
-rw-r--r-- | contrib/gccbug.el | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/contrib/gccbug.el b/contrib/gccbug.el new file mode 100644 index 00000000000..55821e5e6c5 --- /dev/null +++ b/contrib/gccbug.el @@ -0,0 +1,84 @@ +;;; gccbug.el --- forward bug reports to gnats +;; (C) 2000 Free Software Foundation +;; Written by Martin v. Löwis +;; Usage: +;; In rmail, bind a key to rmail-gccbug-reply, e.g. +;; (require 'rmail) +;; (require 'gccbug) +;; (define-key rmail-mode-map "R" 'rmail-gccbug-reply) +;; Then, when reviewing a report, type R to create a gnats-formatted +;; message. + +(provide 'gccbug) + +(defun gccbug-reply () + (interactive) + (let ((orig-yank-prefix mail-yank-prefix)) + (insert ">Submitter-Id: net\n") + (insert ">Originator: \n") + (insert ">Confidential: no\n") + (insert ">Synopsis: ") + (save-excursion + (mail-subject) + (let ((stop (point))) + (re-search-backward "Re: ") + (copy-region-as-kill (match-end 0) stop))) + (yank) + (insert "\n") + (insert ">Severity: serious\n") + (insert ">Priority: medium\n") + (insert ">Category: \n") + (insert ">Class: \n") + ;(insert ">State: analyzed\n") + (insert ">Release: 2.95.2\n") + (insert ">Environment:\n") + (insert ">Description:\n") + (set 'mail-yank-prefix nil) + (set 'mail-yank-ignored-headers + "^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") + (mail-yank-original t) + (set 'mail-yank-prefix orig-yank-prefix) + ; Copy From: field to Originator: + (re-search-backward "From: ") + (let ((beg (match-end 0))) + (end-of-line) + (kill-region beg (point))) + (re-search-backward ">Originator: ") + (goto-char (match-end 0)) + (yank) + ; Kill From: line + (re-search-forward "From:") + (beginning-of-line) + (kill-line 1) + ; Replace Message-ID: with Original-Message-ID + (beginning-of-buffer) + (re-search-forward "Message-ID: .*") + (replace-match "Original-\\&") + ; Replace To: line, adding recipient to Notify list + (mail-to) + (re-search-backward "To: ") + (replace-match "To: gcc-gnats@gcc.gnu.org\nX-GNATS-Notify: ") + ; add additional fields + (end-of-buffer) + (insert ">How-To-Repeat: \n>Fix: \n") + ; See whether an Organization: is present + (let ((org (re-search-backward "Organization:.*" nil t))) + (if org + (progn + (kill-region (point) (match-end 0)) + (re-search-backward ">Confidential") + (insert ">") + (yank) + (insert "\n")))) +; This kills CC: lines, but rmail-reply below won't create any +; (mail-cc) +; (beginning-of-line) +; (kill-line 1) + )) + +(defun rmail-gccbug-reply () + (interactive) + (rmail-toggle-header 0) + (rmail-reply t) + (gccbug-reply)) + |