Rainer M Krug <r.m.k...@gmail.com> writes: > On 12/16/2010 11:41 AM, Rainer M Krug wrote: >> On 12/16/2010 11:38 AM, Oscar Carlsson wrote: >>> Rainer M Krug <r.m.k...@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.carls...@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. >>>> >>>> Rainer >>>> >>>>> There should be a built-in function for >>>>> that, but I've never used it. >>>>> >> >>> In my answer above, you'd have to include the file as an attachment, or >>> insert the text into the mail (either with M-x insert-file or >>> copy/paste), it would have been better if compose-mail would have >>> inserted any marked text or such, but I don't know how to code such >>> functionality :-( >> >> Thanks Oscar - I think I can live with it at the moment. >> >> But to insert the marked text in the email body sounds a lot like emacs... > > OK - I asked on the emacs help list, and got a response. I added the > followig to my emacs.org: > > * Add message hook to include selected text as body > Thanks to Deniz Dogan > #+begin_src emacs-lisp > (add-hook 'message-mode-hook > (lambda () > (let (text) > (with-current-buffer (other-buffer) > (when (region-active-p) > (setq text > (buffer-substring (region-beginning) > (region-end))))) > (when text > (end-of-buffer) > (insert text))))) > #+end_src > > This is doing exactly as expected.
Oh, I think that can be very handy in the long run. Thanks for sharing the snippet! Oscar _______________________________________________ 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