Gnus development mailing list
 help / color / mirror / Atom feed
From: Benjamin Rutt <rutt+news@cis.ohio-state.edu>
Cc: ding@gnus.org
Subject: Re: Getting message details from message-sent-hook
Date: Wed, 28 May 2003 16:14:08 -0400	[thread overview]
Message-ID: <wc3y90qrfqn.fsf@gamma.cis.ohio-state.edu> (raw)
In-Reply-To: <874r3f7ydu.fsf@kruhft.vc.shawcable.net> (Burton Samograd's message of "28 May 2003 10:51:41 -0700")

Burton Samograd <kruhft@hotmail.com> writes:

> Hi,
>
> I'm trying to write a function that inserts some information about
> emails I send into my diary.  I'm hoping to be able to get it to write
> lines like:
>
> Mar 28, 2003 To: someone@pobox.com Subject: Hi There
>
> So far I've got the following:
>
> (defun message-to-diary ()
>   (make-diary-entry (concat 
> 		   (calendar-julian-date-string) 
> 		   " To: "  " From: ")))
> (add-hook 'message-sent-hook 'message-to-diary)
>
> What I need is functions that get the To and Subject from the mail or
> post that was sent.  Is any of that information available or am I
> going to have to write something that parses the current *mail*
> buffer?

Something like:

(defun message-to-diary ()
  (save-restriction
    (save-excursion
      (make-diary-entry
        (concat 
          (calendar-julian-date-string) 
          " To: " (message-fetch-field "To")
          " Subject: " (message-fetch-field "Subject"))))))

should work.
-- 
Benjamin



      parent reply	other threads:[~2003-05-28 20:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-28 17:51 Burton Samograd
2003-05-28 19:25 ` Burton Samograd
2003-05-29  3:22   ` Bill White
2003-05-29 15:08     ` Burton Samograd
2003-05-29 17:30       ` Ted Zlatanov
2003-05-28 19:57 ` Johan Bockgård
2003-05-28 20:14 ` Benjamin Rutt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=wc3y90qrfqn.fsf@gamma.cis.ohio-state.edu \
    --to=rutt+news@cis.ohio-state.edu \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).