[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Automatically executing a function at sending
From: |
Richard Riley |
Subject: |
Re: Automatically executing a function at sending |
Date: |
Tue, 19 Jan 2010 19:59:15 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Merciadri Luca <Luca.Merciadri@student.ulg.ac.be> writes:
> Hi,
>
> I have defined some function, say funcx, that is useful for me if it
> is executed once I have finished writing my message (for Usenet or in
> an e-mail). If this function is executed before writing the message,
> that does the same effect. The only thing it needs is to be executed in an
> e-mail/group
> posting buffer.
>
> I currently do M-x funcx (manually), but I do not like manually doing things
> that may be repeated.
>
> Is there an alternative to this?
>
> Thanks.
> --
> Merciadri Luca
> See http://www.student.montefiore.ulg.ac.be/~merciadri/
>
(your .sig separator should be "-- " btw)
Does this help?
,----
| (defun wicked/gnus-add-subject-to-bbdb-record ()
| "Add datestamped subject note for each person this message has been sent
to."
| (let* ((subject (concat (format-time-string "%Y.%m.%d")
| ": E-mail: " (message-fetch-field "Subject") "\n"))
| (bbdb-get-addresses-headers
| (list (assoc 'recipients bbdb-get-addresses-headers)))
| records)
| (setq records
| (bbdb-update-records
| (bbdb-get-addresses nil gnus-ignored-from-addresses
'gnus-fetch-field)
| nil nil))
| (mapc (lambda (rec)
| (bbdb-record-putprop rec
| 'contact
| (concat subject
| (or
| (bbdb-record-getprop rec 'contact)
| ""))))
| records)))
|
| (add-hook 'message-send-hook 'wicked/gnus-add-subject-to-bbdb-record)
`----
I borrowed it from Sacha Chua's website.
--
Google Talk : rileyrgdev@googlemail.com http://www.google.com/talk