On Tue, 31 Mar 2009 18:27:50 +0000 Johann 'Myrkraverk' Oskarsson 
<joh...@myrkraverk.com> wrote: 

JO> Hi all,
JO> Is it possible to add a function to some pre-send hook that makes sure
JO> the subject line contains a certain word?  News, not mail, if it
JO> matters.  Of course, the word in question depends on the group, so
JO> some mechanism that ties posting styles (or something similar) to the
JO> mixture would be nice.

JO> For arguments sake, you can assume I want the word GNUS to appear in
JO> the subject lines of all messages to this group, gnu.emacs.gnus.

Here's an example of a hook that aborts under certain conditions:

(defun jidanni-message-confirm ()
 "Confirm that we really want to send the message."
 (interactive)
 (or (y-or-n-p "Send?")
     (keyboard-quit)))

(add-hook 'message-send-hook 'jidanni-message-confirm)
;; you may need message-send--news-hook as well

To get the Subject header, you can do

(save-restriction
  (message-narrow-to-headers)
  (message-fetch-field "Subject"))

I am sure integrating this with posting styles won't be too hard either.

Ted
_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
http://lists.gnu.org/mailman/listinfo/info-gnus-english

Reply via email to