From: Rainer M Krug <r.m.krug@gmail.com>
To: Eric Schulte <schulte.eric@gmail.com>
Cc: Oscar Carlsson <oscar.carlsson@gmail.com>,
Matt Lundin <mdl@imapmail.org>,
emacs-orgmode@gnu.org, Jeff Horn <jrhorn424@gmail.com>
Subject: Re: Re: Sending org buffer as mail?
Date: Fri, 17 Dec 2010 09:57:33 +0100 [thread overview]
Message-ID: <4D0B25FD.1030708@gmail.com> (raw)
In-Reply-To: <87k4j8rj11.fsf@gmail.com>
-----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" <schulte.eric@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.
>>
>> Thanks for sharing this function.
>>
>> Cheers -- Eric
>>
>> Matt Lundin <mdl@imapmail.org> writes:
>>
>>> Rainer M Krug <r.m.krug@gmail.com> writes:
>>>
>>>> On 12/16/2010 09:25 AM, Jeff Horn wrote:
>>>>> On Thu, Dec 16, 2010 at 3:17 AM, Oscar Carlsson
>>>>> <oscar.carlsson@gmail.com> 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-----
next prev parent reply other threads:[~2010-12-17 8:57 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-16 8:04 Sending org buffer as mail? Rainer M Krug
2010-12-16 8:17 ` Oscar Carlsson
2010-12-16 8:25 ` Jeff Horn
2010-12-16 8:54 ` Rainer M Krug
2010-12-16 10:38 ` Oscar Carlsson
2010-12-16 10:41 ` Rainer M Krug
2010-12-16 12:38 ` Rainer M Krug
2010-12-16 13:49 ` Oscar Carlsson
2010-12-16 21:27 ` Sebastian Rose
2010-12-16 21:34 ` Sebastian Rose
2010-12-17 1:06 ` Matt Lundin
2010-12-17 1:27 ` Eric Schulte
2010-12-17 6:48 ` Eric Schulte
2010-12-17 8:57 ` Rainer M Krug [this message]
2010-12-17 10:02 ` Eric Schulte
2010-12-17 11:54 ` Matt Lundin
2010-12-17 21:25 ` Eric Schulte
2010-12-19 12:21 ` Niels Giesen
2010-12-19 20:47 ` Samuel Wales
2010-12-19 23:39 ` Eric Schulte
2010-12-21 20:55 ` Niels Giesen
2010-12-27 14:53 ` Eric Schulte
2010-12-27 18:11 ` Niels Giesen
2010-12-28 3:58 ` Eric Schulte
2010-12-27 17:53 ` Samuel Wales
2010-12-17 14:47 ` Jean-Marie Gaillourdet
2010-12-17 21:26 ` Eric Schulte
2010-12-18 23:26 ` Ethan Ligon
2010-12-20 1:46 ` Eric Schulte
2010-12-20 10:20 ` Sébastien Vauban
2010-12-16 10:37 ` Oscar Carlsson
2010-12-16 13:22 ` Eric Schulte
2010-12-16 13:39 ` Rainer M Krug
2010-12-16 14:45 ` Sébastien Vauban
2010-12-16 14:56 ` Eric Schulte
2010-12-16 16:19 ` Sébastien Vauban
2010-12-16 18:20 ` Eric Schulte
2010-12-16 18:29 ` Jeff Horn
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
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D0B25FD.1030708@gmail.com \
--to=r.m.krug@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=jrhorn424@gmail.com \
--cc=mdl@imapmail.org \
--cc=oscar.carlsson@gmail.com \
--cc=schulte.eric@gmail.com \
/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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).