From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: Re: Sending org buffer as mail? Date: Fri, 17 Dec 2010 09:57:33 +0100 Message-ID: <4D0B25FD.1030708@gmail.com> References: <4D09C7F2.8020806@gmail.com> <87sjxy168c.fsf@gmail.com> <4D09D3BB.3020508@gmail.com> <87bp4lxl60.fsf@fastmail.fm> <871v5hw5go.fsf@gmail.com> <87k4j8rj11.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=38402 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PTW8C-0008JG-3H for emacs-orgmode@gnu.org; Fri, 17 Dec 2010 03:57:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PTW8A-000841-Ft for emacs-orgmode@gnu.org; Fri, 17 Dec 2010 03:57:39 -0500 Received: from mail-ww0-f49.google.com ([74.125.82.49]:59371) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PTW8A-00083v-4r for emacs-orgmode@gnu.org; Fri, 17 Dec 2010 03:57:38 -0500 Received: by wwb17 with SMTP id 17so407749wwb.30 for ; Fri, 17 Dec 2010 00:57:36 -0800 (PST) In-Reply-To: <87k4j8rj11.fsf@gmail.com> 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: Eric Schulte Cc: Oscar Carlsson , Matt Lundin , emacs-orgmode@gnu.org, Jeff Horn -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 12/17/2010 07:48 AM, Eric Schulte wrote: Hi eric > I'm attaching a new version of org-mime.el which incorporates Matt's > function below. There are now two new functions, `org-mime-org-buffer' > and `org-mime-org-subtree' each of which takes a format argument > specifying the format of the final email, one of 'org, 'ascii, or 'html. This sounds perfect. So now a *subtree* or *org buffer* can be send as *org*, *ascii or *html*. Right? I just would like to suggest two more things: 1) to be able to mail the subtree or buffer as an attached pdf. Thinking of it, this could also be used for the other formats which result in one file, e.g. ascii, taskjuggle and I think all others except of the html? 2) the format of the inline text (and the attached one?) could be specified as a property, as a property - this would make sending the email consistent. And I must say, I really like the subtree option - now we just need a function to import an email into org, and one could use an org file to manage email conversations... Cheers and thanks a lot - this sounds really good, Rainer > > So, for example the following will export the current subtree as ascii > into an email body, using the MAIL_TO, MAIL_CC, and MAIL_BCC properties > to build the email headers, and the headline to set the subject (both > directly from Matt's function below). > > (defun org-mime-subtree-to-ascii () > (interactive) > (org-mime-org-subtree 'ascii)) > > Does this new version of org-mime look like it should be committed? Are > there any features or changes that should be considered first? > > Cheers -- Eric > > > > > > "Eric Schulte" 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. >> >> Thanks for sharing this function. >> >> Cheers -- Eric >> >> Matt Lundin writes: >> >>> Rainer M Krug writes: >>> >>>> On 12/16/2010 09:25 AM, Jeff Horn wrote: >>>>> On Thu, Dec 16, 2010 at 3:17 AM, Oscar Carlsson >>>>> wrote: >>>>>> And then, I can send a org-file by attaching it to a mail in Emacs. Try >>>>>> C-x m to start a new mail buffer, attach with C-c C-a and send with C-c >>>>>> C-c. >>>> >>>> Sounds very interesting - I'll try it out. >>>> >>>> C-x m looks great - I am sure I am going to use it a lot. And gmail is >>>> exactly what I want to use it for. >>>> >>>>> >>>>> Does this attach the buffer or read it into the message? I thought the >>>>> OP wanted to read-in a buffer. >>>> >>>> Yes - that was effectively what I am looking for: the possiblility to >>>> write my email in org mode and send the buffer content as the email text. >>>> >>>> Dream: Specify subject, to, cc, bcc (probably even attachments) as >>>> properties, press a key and the org file is send to the addresses. >>> >>> I too have been looking for this functionality for a while, so here's a >>> quick solution. When called on an Org-mode subtree, the following >>> function makes the headline the subject, exports the subtree to ascii, >>> and uses properties ("MAIL_TO", "MAIL_CC", "MAIL_BCC") to specify the >>> addressees: >>> >>> (defun my-org-subtree-to-message () >>> (interactive) >>> (unless (eq major-mode 'org-mode) >>> (error "Not in org buffer")) >>> (let ((subject (nth 4 (org-heading-components))) >>> (to (org-entry-get nil "MAIL_TO")) >>> (cc (org-entry-get nil "MAIL_CC")) >>> (bcc (org-entry-get nil "MAIL_BCC")) >>> text) >>> (save-excursion >>> (org-mark-subtree) >>> ;; don't include title in body >>> (forward-line) >>> (setq text (org-export-region-as-ascii (point) >>> (mark) t 'string))) >>> (message-mail to subject `((cc . ,cc) (bcc . ,bcc)) nil) >>> (when text >>> (save-excursion >>> (goto-char (point-max)) >>> (insert text))))) >>> >>> With this function, you can compose emails like this: >>> >>> * My obsequious missive >>> :PROPERTIES: >>> :MAIL_TO: highly_esteemed@gentlemen.net >>> :MAIL_BCC: peasants_united@plebeians.org >>> :END: >>> My most noble sirs, >>> >>> I thank you for gracing this world with your beauteous presence. >>> >>> Humbly yours, >>> An Org-mode user >>> >>> Best, >>> Matt >>> >>> _______________________________________________ >>> 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 - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Natural Sciences Building Office Suite 2039 Stellenbosch University Main Campus, Merriman Avenue Stellenbosch South Africa Tel: +33 - (0)9 53 10 27 44 Cell: +27 - (0)8 39 47 90 42 Fax (SA): +27 - (0)8 65 16 27 82 Fax (D) : +49 - (0)3 21 21 25 22 44 Fax (FR): +33 - (0)9 58 10 27 44 email: Rainer@krugs.de Skype: RMkrug -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk0LJf0ACgkQoYgNqgF2egqMhQCfRCdlivRA4Bm6FcW9zRR1tRT7 4IMAoIBfJI5QdVuOHz8RC0/mo5vupygJ =rw33 -----END PGP SIGNATURE-----