[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Making "problem report #FOO" mails easier to scan.
From: |
Reiner Steib |
Subject: |
Re: Making "problem report #FOO" mails easier to scan. |
Date: |
Mon, 01 Dec 2008 21:33:44 +0100 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/22.1 (gnu/linux) |
On Mon, Dec 01 2008, Dan Nicolaescu wrote:
> If someone wants to write a gnus hook to fill in the Subject, I
> could use it.
HTH...
--8<---------------cut here---------------start------------->8---
(defvar rs-message-coverity-header
"== Problem report from coverity, see end of message for more information ==")
(defvar rs-message-coverity-footer
"----------
Footnote: This problem report was created by scan.coverity.com.
Anyone can register and read the reports, ...")
(defun rs-message-coverity ()
"Insert suitable Subject, header and footer for a Coverity report.
This command should be called from a message buffer which must
contain the content of the report, including the pseudo
header (CID, Function, ...)."
(interactive)
(save-excursion
(message-goto-body)
(when rs-message-coverity-header
(insert rs-message-coverity-header)
(insert "\n"))
(re-search-forward
"\
CID: \\([0-9]+\\)
Checker: [^\n]*
File: [^\n]*
Function: \\([^\n]*\\)
Description: \\([^\n]*\\)" nil t)
(let ( ;;
(cid (match-string 1))
(fct (match-string 2))
(des (match-string 3)))
(message-replace-header "Subject" (format "PR #%s: %s; %s" cid fct des))
(message-replace-header "To" "address@hidden"))
(when rs-message-coverity-footer
(message-goto-signature)
(unless (eobp) (forward-line -1))
(insert rs-message-coverity-footer)
(insert "\n"))))
;; (define-key message-mode-map (kbd "<f8>") 'rs-message-coverity)
--8<---------------cut here---------------end--------------->8---
Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/