Capturing text in buffer as in org-capture?

33 views
Skip to first unread message

Andrea

unread,
May 16, 2016, 7:05:15 PM5/16/16
to mu-di...@googlegroups.com
Hello,

thanks for mu4e: it is a fantastic tool and the interaction with emacs
is wow!

I discovered org-capture recently, and I am not sure if a similar
functionality exists for mu4e as well. An example use case would be:

given that I am on the Emacs browser reading an article and I am
selecting a region,
when I want to share it with a friend,
then I can use a shortcut and open a mail with the quoted text and the
link to the article.

I created a template to create tasks structured as such with org-capture:
can I create already mails like that through mu4e?
Thanks again,

Andrea

Dirk-Jan C. Binnema

unread,
May 22, 2016, 1:58:26 PM5/22/16
to mu-di...@googlegroups.com
Hi Andrea,
There's no built-in functionality for this, but you could try something
like:

--8<---------------cut here---------------start------------->8---
(defun djcb-mu4e-share(share-with)
(interactive "sShare with (e-mail): ")
(let ((mail-user-agent 'mu4e-user-agent))
(compose-mail share-with "Read this!")
(yank)))
--8<---------------cut here---------------end--------------->8---

which should get you a new message, with the last kill as the message
body. Address-autocompletion etc. is left as an exercise for the
reader.

Kind regards,
Dirk.



--
Dirk-Jan C. Binnema Helsinki, Finland
e:dj...@djcbsoftware.nl w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C

Andrea

unread,
May 23, 2016, 4:19:54 AM5/23/16
to mu-di...@googlegroups.com

Thanks, that is really cool!

For documentation:

I have found also a solution to send org headers as mail by John Kitchin:
http://kitchingroup.cheme.cmu.edu/blog/2014/06/08/Better-integration-of-org-mode-and-email/

All the best,

Andrea
Reply all
Reply to author
Forward
0 new messages