From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/52902 Path: main.gmane.org!not-for-mail From: Benjamin Rutt Newsgroups: gmane.emacs.gnus.general Subject: Re: Getting message details from message-sent-hook Date: Wed, 28 May 2003 16:14:08 -0400 Sender: ding-owner@lists.math.uh.edu Message-ID: References: <874r3f7ydu.fsf@kruhft.vc.shawcable.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1054152767 29301 80.91.224.249 (28 May 2003 20:12:47 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 28 May 2003 20:12:47 +0000 (UTC) Cc: ding@gnus.org Original-X-From: ding-owner+M1446@lists.math.uh.edu Wed May 28 22:12:45 2003 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19L7Hx-0007cN-00 for ; Wed, 28 May 2003 22:12:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 19L7Jt-0004Tc-00; Wed, 28 May 2003 15:14:45 -0500 Original-Received: from sclp3.sclp.com ([64.157.176.121]) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 19L7Jo-0004TX-00 for ding@lists.math.uh.edu; Wed, 28 May 2003 15:14:41 -0500 Original-Received: (qmail 60193 invoked by alias); 28 May 2003 20:14:40 -0000 Original-Received: (qmail 60188 invoked from network); 28 May 2003 20:14:40 -0000 Original-Received: from mail.cis.ohio-state.edu (HELO cis.ohio-state.edu) (164.107.115.5) by sclp3.sclp.com with SMTP; 28 May 2003 20:14:40 -0000 Original-Received: from gamma.cis.ohio-state.edu (daemon@gamma.cis.ohio-state.edu [164.107.112.13]) by cis.ohio-state.edu (8.11.6/8.11.6) with ESMTP id h4SKE8706532; Wed, 28 May 2003 16:14:08 -0400 (EDT) Original-Received: (from rutt@localhost) by gamma.cis.ohio-state.edu (8.11.6/8.11.6) id h4SKE8L10145; Wed, 28 May 2003 16:14:08 -0400 (EDT) X-Authentication-Warning: gamma.cis.ohio-state.edu: rutt set sender to rutt@cis.ohio-state.edu using -f Original-To: Burton Samograd Mail-Followup-To: Burton Samograd , ding@gnus.org In-Reply-To: <874r3f7ydu.fsf@kruhft.vc.shawcable.net> (Burton Samograd's message of "28 May 2003 10:51:41 -0700") User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3.50 (usg-unix-v) Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:52902 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:52902 Burton Samograd 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