From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: Re: Sending org buffer as mail? Date: Thu, 16 Dec 2010 13:38:49 +0100 Message-ID: <4D0A0859.2040809@gmail.com> References: <4D09C7F2.8020806@gmail.com> <87sjxy168c.fsf@gmail.com> <4D09D3BB.3020508@gmail.com> <87aak60zpd.fsf@gmail.com> <4D09ECCB.5000407@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=60408 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PTD6l-00034X-1a for emacs-orgmode@gnu.org; Thu, 16 Dec 2010 07:38:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PTD6j-00059j-Gq for emacs-orgmode@gnu.org; Thu, 16 Dec 2010 07:38:54 -0500 Received: from mail-wy0-f169.google.com ([74.125.82.169]:49001) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PTD6j-00059Y-Ax for emacs-orgmode@gnu.org; Thu, 16 Dec 2010 07:38:53 -0500 Received: by wyj26 with SMTP id 26so2545303wyj.0 for ; Thu, 16 Dec 2010 04:38:52 -0800 (PST) In-Reply-To: <4D09ECCB.5000407@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: Rainer M Krug Cc: Oscar Carlsson , Jeff Horn , emacs-orgmode@gnu.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 12/16/2010 11:41 AM, Rainer M Krug wrote: > On 12/16/2010 11:38 AM, Oscar Carlsson wrote: >> 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. >>> >>> 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. Cheers, Rainer > > Cheers, > > Rainer > > >> Oscar > > - -- 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/ iEYEARECAAYFAk0KCFkACgkQoYgNqgF2egqX/ACdHmduO8M0C/QU6y9v9L/pTITj BV4An1xAQJsRr+hd3Dx8UKWQ7d3+w7ps =RDpz -----END PGP SIGNATURE-----