From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xebar Saram Subject: Re: create a "send plain text/pdf email with current header" function? Date: Thu, 6 Aug 2015 07:42:14 +0300 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113a6612b1919b051c9d248b Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36341) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZND0U-0005EP-QB for emacs-orgmode@gnu.org; Thu, 06 Aug 2015 00:42:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZND0R-0003x1-AN for emacs-orgmode@gnu.org; Thu, 06 Aug 2015 00:42:18 -0400 Received: from mail-yk0-x235.google.com ([2607:f8b0:4002:c07::235]:35166) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZND0R-0003wx-4r for emacs-orgmode@gnu.org; Thu, 06 Aug 2015 00:42:15 -0400 Received: by ykcq64 with SMTP id q64so48588318ykc.2 for ; Wed, 05 Aug 2015 21:42:14 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: John Kitchin Cc: "emacs-orgmode@gnu org" --001a113a6612b1919b051c9d248b Content-Type: text/plain; charset=UTF-8 Perfect! (as always i might add John ;)) thx so muxh Z On Wed, Aug 5, 2015 at 9:38 PM, John Kitchin wrote: > * Automatic send email to myself > > #+BEGIN_SRC emacs-lisp > (defun email-heading-to-me () > "Send the current org-mode heading as the body of an email, with > headline as the subject." > (interactive) > (save-excursion > (org-mark-subtree) > (let ((content (buffer-substring (point) (mark))) > (SUBJECT (nth 4 (org-heading-components)))) > > (compose-mail "your@email.here" SUBJECT) > (message-goto-body) > (insert content) > (message-send) > (message-kill-buffer)))) > #+END_SRC > > #+RESULTS: > : email-heading-to-me > > > Xebar Saram writes: > > > thx both John and Matt > > > > I went on and used johns function he recommended (since i needed a simple > > text only export) and it works flawlessly :) > > > > John: just a quick follow up though > > > > with that function you kindly shred "email-heading " it opens up a buffer > > and you insert the email address. is it possible to have a function that > > sends to a prefixed email address (ie myself :)). also can the function > > then just do it in the background without even opening the buffer? since > i > > want to send it to a prefixed email i dont really need to see it and > press > > C-c C-c. > > > > This isnt really important so if its complicated please feel free to > ignore > > ;-) > > > > best > > > > Z > > > > > > On Sat, Aug 1, 2015 at 6:24 PM, John Kitchin > wrote: > > > >> You probably could use the function here > >> https://github.com/jkitchin/jmax/blob/master/email.el#L51 for the email > >> part after you find the heading you want to send. I think there is some > >> code there to send a pdf too. > >> > >> > >> On August 1, 2015, at 10:49 AM, Xebar Saram wrote: > >> > >> > >> Hi all > >> i find that i keep copy pasting food recipes (which i collect with org > >> obviously) to my email client and then sending it over to the phone to > use > >> in the kitchen (which reminds Me really should get a emacs touch screen > for > >> the kitchen..though my wife would get a stroke if she sees that > >> ;-))..anyway, anyone knows how one (with almost none to zero elisp > skills) > >> create such a function? > >> > >> all i need is locate the recipe (header) and then send the header and > sub > >> headers as text or pdf to my email > >> > >> best! > >> > >> Z > >> > >> > > -- > Professor John Kitchin > Doherty Hall A207F > Department of Chemical Engineering > Carnegie Mellon University > Pittsburgh, PA 15213 > 412-268-7803 > @johnkitchin > http://kitchingroup.cheme.cmu.edu > --001a113a6612b1919b051c9d248b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Perfect! (as always i might add John ;))

thx so muxh

Z

On Wed, Aug 5, 2015 at 9:38 PM, John Kit= chin <jkitchin@andrew.cmu.edu> wrote:
* Automatic send email to myself

#+BEGIN_SRC emacs-lisp
(defun email-heading-to-me ()
=C2=A0 "Send the current org-mode heading as the body of an email, wit= h headline as the subject."
=C2=A0 (interactive)
=C2=A0 (save-excursion
=C2=A0 =C2=A0 (org-mark-subtree)
=C2=A0 =C2=A0 (let ((content (buffer-substring (point) (mark)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (SUBJECT (nth 4 (org-heading-components)= )))

=C2=A0 =C2=A0 =C2=A0 (compose-mail "your@email.here" SUBJECT)
=C2=A0 =C2=A0 =C2=A0 (message-goto-body)
=C2=A0 =C2=A0 =C2=A0 (insert content)
=C2=A0 =C2=A0 =C2=A0 (message-send)
=C2=A0 =C2=A0 =C2=A0 (message-kill-buffer))))
#+END_SRC

#+RESULTS:
: email-heading-to-me


Xebar Saram writes:

> thx both John and Matt
>
> I went on and used johns function he recommended (since i needed a sim= ple
> text only export) and it works flawlessly :)
>
> John: just a quick follow up though
>
> with that function you kindly shred "email-heading " it open= s up a buffer
> and you insert the email address. is it possible to have a function th= at
> sends to a prefixed email address (ie myself :)). also can the functio= n
> then just do it in the background without even opening the buffer? sin= ce i
> want to send it to a prefixed email i dont really need to see it and p= ress
> C-c C-c.
>
> This isnt really important so if its complicated please feel free to i= gnore
> ;-)
>
> best
>
> Z
>
>
> On Sat, Aug 1, 2015 at 6:24 PM, John Kitchin <johnrkitchin@gmail.com> wrote:
>
>> You probably could use the function here
>> https://github.com/jkitchin/jmax/b= lob/master/email.el#L51 for the email
>> part after you find the heading you want to send. I think there is= some
>> code there to send a pdf too.
>>
>>
>> On August 1, 2015, at 10:49 AM, Xebar Saram <zeltakc@gmail.com> wrote:
>>
>>
>> Hi all
>> i find that i keep copy pasting food recipes=C2=A0 (which i collec= t with org
>> obviously) to my email client and then sending it over to the phon= e to use
>> in the kitchen (which reminds Me really should get a emacs touch s= creen for
>> the kitchen..though my wife would get a stroke if she sees that >> ;-))..anyway, anyone knows how one (with almost none to zero elisp= skills)
>> create such a function?
>>
>> all i need is locate the recipe (header) and then send the header = and sub
>> headers as text or pdf to my email
>>
>> best!
>>
>> Z
>>
>>

--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu

--001a113a6612b1919b051c9d248b--