From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: Re: Sending org buffer as mail? Date: Sun, 19 Dec 2010 18:46:44 -0700 Message-ID: <871v5dusfv.fsf@gmail.com> References: <4D09C7F2.8020806@gmail.com> <87sjxy168c.fsf@gmail.com> <4D09D3BB.3020508@gmail.com> <87bp4lxl60.fsf@fastmail.fm> <871v5hw5go.fsf@gmail.com> <87sjxw9jii.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=50477 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PUUpw-0000Tm-ER for emacs-orgmode@gnu.org; Sun, 19 Dec 2010 20:46:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PUUpu-0003T1-Hv for emacs-orgmode@gnu.org; Sun, 19 Dec 2010 20:46:52 -0500 Received: from mail-iy0-f169.google.com ([209.85.210.169]:60480) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PUUpu-0003Sw-CS for emacs-orgmode@gnu.org; Sun, 19 Dec 2010 20:46:50 -0500 Received: by iyj17 with SMTP id 17so2119105iyj.0 for ; Sun, 19 Dec 2010 17:46:49 -0800 (PST) In-Reply-To: (Ethan Ligon's message of "Sat, 18 Dec 2010 23:26:48 +0000 (UTC)") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Ethan Ligon Cc: emacs-orgmode@gnu.org Ethan Ligon writes: > Eric Schulte gmail.com> writes: >> >> Jean-Marie Gaillourdet gaillourdet.net> writes: >> >> > Hi Eric, >> > >> > "Eric Schulte" gmail.com> writes: >> > >> >> Hi Matt, >> >> >> >> This looks great, how would you feel about trying to fold this into >> >> org-mime, or would you mind if I did so. I've already mimicked your >> >> function to set subjects of outgoing emails to match the title of the >> >> org-mode buffer. I think that generalizing the org-mime functions to >> >> operate over either subtrees or whole files, and to output either html >> >> or plain text should cover all use cases with maximal code re-use. >> > >> > does it also support using ascii exports as text part and the html >> > export as html part in a multi part message? >> > >> >> It does now. In the version I just pushed up an html and ascii export >> can be accomplished by setting the :MAIL_FMT: property to html-ascii, or >> by calling either `org-mime-send-buffer' or `org-mime-send-subtree' with >> 'html-ascii as an argument. >> > > Eric- > > This is just great; thanks! > > Two additional suggestions: > > 1. The subject line should be exported as ascii also, to avoid > funky orgmode markup messing things up (I often have links in my > headlines, for example). > Unfortunately I don't know if any good/easy way to strip out these emphasis markers. > > 2. Could we get some indication that the subtree's been mailed? I'm > thinking of having org-mime-subtree set a property MAIL_SENT to a > time stamp or perhaps to the message id. > > This way, if we inspect the subtree later we'll know if and when > it was actually sent. A possible bonus if we use the message id: > when we get to the point of getting replies *back* into the org > file it'll be possible to thread things properly. > I've added two hooks, `org-mime-send-subtree-hook' and `org-mime-send-buffer-hook' which can be used to do this, for example the following #+begin_src emacs-lisp (add-hook 'org-mime-send-subtree-hook (lambda () (org-entry-put (point) "mail_sent" (current-time-string)))) #+end_src will add a mail_sent property with the current time when org-mime-subtree is called. The only downside here is that the property is added before the email is sent, so choosing not to send the email after reviewing it in the message buffer could result in a misleading mail_sent property, in fact maybe mail_sent should be changed to mail_composed. Cheers -- Eric > > -Ethan > > > > > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode