Re: [Orgmode] Re: Sending org buffer as mail?

2010-12-27 Thread Eric Schulte
Niels Giesen niels.gie...@gmail.com writes:

 Eric Schulte schulte.e...@gmail.com writes:

 Niels Giesen niels.gie...@gmail.com writes:

 Eric Schulte schulte.e...@gmail.com writes:

 Thanks, I've just pushed up a new version of org-mime which makes use of
 this function.


 Hi Eric, thanks for implementing this.

 However, I see a problem in the solution for when html-ascii is
 specified as the MAIL_FMT, being that the same hook will be run for both
 parts of the message. I think it better not to have a html-ascii hook
 and run the html hook for the html part and the ascii hook for the ascii
 part. Otherwise the ascii hook may for instance delete a =BEGIN_SRC=
 line and insert cut lines not needed by html.

 Same goes for html (which is in fact html-org). Although I cannot really
 think of any hooks I might want to run there.


Thanks for pointing this out.  I've just pushed up a fix which
implements a single hook for each format, and (as you suggested) runs
each hook over only the related mime part of the message.


 I'll take a look at the link you gave for Org-mode block fontification
 in gnus, although that seems like a solution for the receiving side, and
 most of my peers do not run gnus and org, or emacs for that matter, but
 many do want to receive mail in plain text.


I like the 'html option for situations like this, as a fontified html
version of the email is sent for normal users, however an org format
exports is supplied as a mime alternative, so users who have instructed
their email clients to prefer plain text will be presented with the
plain text org syntax.  In my wildest of dreams the org-mode begin_src
syntax could be adopted as a plain-text standard for setting off source
code, so that email clients other than gnus could begin providing for
their own fontification of such blocks.


 On the subject of encouraging so-called code blocks brought to our
 attention by Samuel, encouraging this was not my intention, I should
 have thought better before posting and I will never in my life post such
 immoral examples anymore.


Your consideration is much appreciated. :)


 Regards,

 Niels

 [...]

 Hi Eric,

 I love the org-mime-subtree function! It makes writing good-looking
 mails very easy.

 Now for a proposal:

 For ascii export used for mail, it would be cool if SRC and EXAMPLE
 blocks be surrounded by cut here scissor lines. They look well in gnus
 for example:


 For even better looking code in gnus, I personally prefer to use org as
 my export target (rather than ascii), and with Org-mode code block
 fontification configuration from
 http://eschulte.github.com/emacs-starter-kit/starter-kit-gnus.html
 code blocks inside org-mode markup will be correctly fontified in gnus
 messages.


 code or example here

 Maybe the best way to achieve this is to define a hook before the string
 is sent to `org-export-string' with the FMT arg set to 'ascii, so that
 people can define their own functions. For instance, there are also
 people who prefer a block like


 good idea, I've just added a series of hooks to org-mime which will be
 called in a temporary buffer holding the text to be exported, so you
 could add a function here to add scissor lines around code blocks.  Like
 Sam I would discourage the use of boxquotes for anything that users may
 want to cut and paste.  For ascii use the `org-mime-pre-ascii-hook'.

 If you come up with useful hooks it may be nice to share them on worg at
 http://orgmode.org/worg/org-contrib/org-mime.php


 ,[ emacs-lisp ]
 | source here
 `

 What do you think?

 Regards,

 Niels.

 Thanks for the suggestion -- Eric



___
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


Re: [Orgmode] Re: Sending org buffer as mail?

2010-12-27 Thread Samuel Wales
On 2010-12-21, Niels Giesen niels.gie...@gmail.com wrote:
 On the subject of encouraging so-called code blocks brought to our
 attention by Samuel, encouraging this was not my intention, I should
 have thought better before posting and I will never in my life post such
 immoral examples anymore.

I got a good laugh out of this!

Samuel

-- 
Q: How many CDC scientists does it take to change a lightbulb?
A: You only think it's dark. [CDC has denied a deadly serious
disease for 25 years]
==
HIV-like virus: http://www.wpinstitute.org/xmrv/index.html -- PLEASE DONATE
===
I want to see the original (pre-hold) Lo et al. 2010 NIH/FDA/Harvard MLV paper.

___
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


Re: [Orgmode] Re: Sending org buffer as mail?

2010-12-27 Thread Niels Giesen
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Sorry list for the last two mails (the ones with attachments), I messed
things up there. Below the mail I sent to Eric, but forgot to copy
carbonically to the list.

Eric Schulte schulte.e...@gmail.com writes:

 Niels Giesen niels.gie...@gmail.com writes:

 Eric Schulte schulte.e...@gmail.com writes:

 Niels Giesen niels.gie...@gmail.com writes:

 Eric Schulte schulte.e...@gmail.com writes:

 Thanks, I've just pushed up a new version of org-mime which makes use of
 this function.


 Hi Eric, thanks for implementing this.

 However, I see a problem in the solution for when html-ascii is
 specified as the MAIL_FMT, being that the same hook will be run for both
 parts of the message. I think it better not to have a html-ascii hook
 and run the html hook for the html part and the ascii hook for the ascii
 part. Otherwise the ascii hook may for instance delete a =BEGIN_SRC=
 line and insert cut lines not needed by html.

 Same goes for html (which is in fact html-org). Although I cannot really
 think of any hooks I might want to run there.


 Thanks for pointing this out.  I've just pushed up a fix which
 implements a single hook for each format, and (as you suggested) runs
 each hook over only the related mime part of the message.


Thanks. I think I noticed a bug though, being that
`org-mime-pre-html-hook' is run for the ascii and org parts of
html-ascii and org. The code below should fix this:

#+begin_src diff
  Changes in HEAD
  Modified contrib/lisp/org-mime.el
  diff --git a/contrib/lisp/org-mime.el b/contrib/lisp/org-mime.el
  index 48c898e..68a3498 100644
  --- a/contrib/lisp/org-mime.el
  +++ b/contrib/lisp/org-mime.el
  @@ -293,7 +293,8 @@ export that region, otherwise export the entire body.
 (html (org-mime-apply-html-hook (car html-and-images
(insert (org-mime-multipart
 (org-export-string
  -   (org-babel-trim (bhook body 'html))
  +   (org-babel-trim
  +(bhook body (if (eq fmt 'html) 'org 'ascii)))
  (if (eq fmt 'html) 'org 'ascii))
 html)
(mapconcat 'identity images \n
#+end_src


 I'll take a look at the link you gave for Org-mode block fontification
 in gnus, although that seems like a solution for the receiving side, and
 most of my peers do not run gnus and org, or emacs for that matter, but
 many do want to receive mail in plain text.


 I like the 'html option for situations like this, as a fontified html
 version of the email is sent for normal users, however an org format
 exports is supplied as a mime alternative, so users who have instructed
 their email clients to prefer plain text will be presented with the
 plain text org syntax.  In my wildest of dreams the org-mode begin_src
 syntax could be adopted as a plain-text standard for setting off source
 code, so that email clients other than gnus could begin providing for
 their own fontification of such blocks.


Now that would be something wild indeed. Of course the upside of org
syntax is that even if nothing is done with it automatically, the human
reader at least has a hint as to what language is used in the code
block, and in that regard it is better than ascii with nondescript
scissor lines. I just might have to revisit my earlier stance on this...


 On the subject of encouraging so-called code blocks brought to our
 attention by Samuel, encouraging this was not my intention, I should
 have thought better before posting and I will never in my life post such
 immoral examples anymore.


 Your consideration is much appreciated. :)


 Regards,

 Niels

 [...]

 Hi Eric,

 I love the org-mime-subtree function! It makes writing good-looking
 mails very easy.

 Now for a proposal:

 For ascii export used for mail, it would be cool if SRC and EXAMPLE
 blocks be surrounded by cut here scissor lines. They look well in gnus
 for example:


 For even better looking code in gnus, I personally prefer to use org as
 my export target (rather than ascii), and with Org-mode code block
 fontification configuration from
 http://eschulte.github.com/emacs-starter-kit/starter-kit-gnus.html
 code blocks inside org-mode markup will be correctly fontified in gnus
 messages.


 code or example here

 Maybe the best way to achieve this is to define a hook before the string
 is sent to `org-export-string' with the FMT arg set to 'ascii, so that
 people can define their own functions. For instance, there are also
 people who prefer a block like


 good idea, I've just added a series of hooks to org-mime which will be
 called in a temporary buffer holding the text to be exported, so you
 could add a function here to add scissor lines around code blocks.  Like
 Sam I would discourage the use of boxquotes for anything that users may
 want to cut and paste.  For ascii use the `org-mime-pre-ascii-hook'.

 If you come up with useful hooks it may be nice to share them on worg at
 

Re: [Orgmode] Re: Sending org buffer as mail?

2010-12-21 Thread Niels Giesen
Eric Schulte schulte.e...@gmail.com writes:

 Niels Giesen niels.gie...@gmail.com writes:

 Eric Schulte schulte.e...@gmail.com writes:

 Thanks, I've just pushed up a new version of org-mime which makes use of
 this function.


Hi Eric, thanks for implementing this.

However, I see a problem in the solution for when html-ascii is
specified as the MAIL_FMT, being that the same hook will be run for both
parts of the message. I think it better not to have a html-ascii hook
and run the html hook for the html part and the ascii hook for the ascii
part. Otherwise the ascii hook may for instance delete a =BEGIN_SRC=
line and insert cut lines not needed by html.

Same goes for html (which is in fact html-org). Although I cannot really
think of any hooks I might want to run there.

I'll take a look at the link you gave for Org-mode block fontification
in gnus, although that seems like a solution for the receiving side, and
most of my peers do not run gnus and org, or emacs for that matter, but
many do want to receive mail in plain text.

On the subject of encouraging so-called code blocks brought to our
attention by Samuel, encouraging this was not my intention, I should
have thought better before posting and I will never in my life post such
immoral examples anymore.

Regards,

Niels

 [...]

 Hi Eric,

 I love the org-mime-subtree function! It makes writing good-looking
 mails very easy.

 Now for a proposal:

 For ascii export used for mail, it would be cool if SRC and EXAMPLE
 blocks be surrounded by cut here scissor lines. They look well in gnus
 for example:


 For even better looking code in gnus, I personally prefer to use org as
 my export target (rather than ascii), and with Org-mode code block
 fontification configuration from
 http://eschulte.github.com/emacs-starter-kit/starter-kit-gnus.html
 code blocks inside org-mode markup will be correctly fontified in gnus
 messages.


 code or example here

 Maybe the best way to achieve this is to define a hook before the string
 is sent to `org-export-string' with the FMT arg set to 'ascii, so that
 people can define their own functions. For instance, there are also
 people who prefer a block like


 good idea, I've just added a series of hooks to org-mime which will be
 called in a temporary buffer holding the text to be exported, so you
 could add a function here to add scissor lines around code blocks.  Like
 Sam I would discourage the use of boxquotes for anything that users may
 want to cut and paste.  For ascii use the `org-mime-pre-ascii-hook'.

 If you come up with useful hooks it may be nice to share them on worg at
 http://orgmode.org/worg/org-contrib/org-mime.php


 ,[ emacs-lisp ]
 | source here
 `

 What do you think?

 Regards,

 Niels.

 Thanks for the suggestion -- Eric



-- 
http://pft.github.com/

___
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


[Orgmode] Re: Sending org buffer as mail?

2010-12-20 Thread Sébastien Vauban
Hi Eric,

Eric Schulte wrote:
 I've added two hooks, `org-mime-send-subtree-hook' and
 `org-mime-send-buffer-hook' which can be used to do this, for example
 the following

 #+begin_src emacs-lisp
   (add-hook 'org-mime-send-subtree-hook
 (lambda ()
   (org-entry-put (point) mail_sent (current-time-string
 #+end_src

Maybe we could format the time string as an inactive Org timestamp?

I've searched in org-capture for such an example (use of %u) but couldn't spot
one, at least easily.

 will add a mail_sent property with the current time when org-mime-subtree is
 called. The only downside here is that the property is added before the
 email is sent, so choosing not to send the email after reviewing it in the
 message buffer could result in a misleading mail_sent property, in fact
 maybe mail_sent should be changed to mail_composed.

I guess too that that name is better.

FYI, when I'm M-x'ing org-mime-subtree:

- it opens a message mode buffer, but slightly different from the one I have
  if I do `m' in Gnus:

  + no Organization field,
  + no signature
  + etc.

  (I'm using `gnus-alias' for handling on-the-fly personality change)

- after `C-c C-c', it writes it's sent, but then opens Thunderbird!?

I'll have a look at these features.

Best regards,
  Seb

-- 
Sébastien Vauban


___
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


Re: [Orgmode] Re: Sending org buffer as mail?

2010-12-19 Thread Samuel Wales
Hi Niels,

On 2010-12-19, Niels Giesen niels.gie...@gmail.com wrote:
 ,[ emacs-lisp ]
 | source here
 `

This is much harder to extract.  Even if most people are willing to
use and know rectangle commands, newcomers don't.

I once pointed this out on emacs-help, and one person responded by
writing a command that extracts the source.  So a newcomer would have
to know to look for that command, get it, extract it, evaluate it,
then extract the source he originally wanted to extract.  I think that
person didn't quite get the point.  :)

Samuel

-- 
Q: How many CDC scientists does it take to change a lightbulb?
A: You only think it's dark. [CDC has denied a deadly serious
disease for 25 years]
==
HIV-like virus: http://www.wpinstitute.org/xmrv/index.html -- PLEASE DONATE
===
I want to see the original (pre-hold) Lo et al. 2010 NIH/FDA/Harvard MLV paper.

___
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


Re: [Orgmode] Re: Sending org buffer as mail?

2010-12-19 Thread Eric Schulte
Niels Giesen niels.gie...@gmail.com writes:

 Eric Schulte schulte.e...@gmail.com writes:

 Thanks, I've just pushed up a new version of org-mime which makes use of
 this function.

 [...]

 Hi Eric,

 I love the org-mime-subtree function! It makes writing good-looking
 mails very easy.

 Now for a proposal:

 For ascii export used for mail, it would be cool if SRC and EXAMPLE
 blocks be surrounded by cut here scissor lines. They look well in gnus
 for example:


For even better looking code in gnus, I personally prefer to use org as
my export target (rather than ascii), and with Org-mode code block
fontification configuration from
http://eschulte.github.com/emacs-starter-kit/starter-kit-gnus.html
code blocks inside org-mode markup will be correctly fontified in gnus
messages.


 code or example here

 Maybe the best way to achieve this is to define a hook before the string
 is sent to `org-export-string' with the FMT arg set to 'ascii, so that
 people can define their own functions. For instance, there are also
 people who prefer a block like


good idea, I've just added a series of hooks to org-mime which will be
called in a temporary buffer holding the text to be exported, so you
could add a function here to add scissor lines around code blocks.  Like
Sam I would discourage the use of boxquotes for anything that users may
want to cut and paste.  For ascii use the `org-mime-pre-ascii-hook'.

If you come up with useful hooks it may be nice to share them on worg at
http://orgmode.org/worg/org-contrib/org-mime.php


 ,[ emacs-lisp ]
 | source here
 `

 What do you think?

 Regards,

 Niels.

Thanks for the suggestion -- Eric

___
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


Re: [Orgmode] Re: Sending org buffer as mail?

2010-12-19 Thread Eric Schulte
Ethan Ligon li...@are.berkeley.edu writes:

 Eric Schulte schulte.eric at gmail.com writes:
 
 Jean-Marie Gaillourdet jmg at gaillourdet.net writes:
 
  Hi Eric,
 
  Eric Schulte schulte.eric at 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.
 
  does it also support using ascii exports as text part and the html
  export as html part in a multi part message?
 
 
 It does now.  In the version I just pushed up an html and ascii export
 can be accomplished by setting the :MAIL_FMT: property to html-ascii, or
 by calling either `org-mime-send-buffer' or `org-mime-send-subtree' with
 'html-ascii as an argument.
 

 Eric-

 This is just great; thanks!  

 Two additional suggestions:

 1. The subject line should be exported as ascii also, to avoid 
funky orgmode markup messing things up (I often have links in my
headlines, for example).


Unfortunately I don't know if any good/easy way to strip out these
emphasis markers.


 2. Could we get some indication that the subtree's been mailed?  I'm
thinking of having org-mime-subtree set a property MAIL_SENT to a
time stamp or perhaps to the message id.  

This way, if we inspect the subtree later we'll know if and when
it was actually sent.  A possible bonus if we use the message id:
when we get to the point of getting replies *back* into the org
file it'll be possible to thread things properly.


I've added two hooks, `org-mime-send-subtree-hook' and
`org-mime-send-buffer-hook' which can be used to do this, for example
the following

#+begin_src emacs-lisp
  (add-hook 'org-mime-send-subtree-hook
(lambda ()
  (org-entry-put (point) mail_sent (current-time-string
#+end_src

will add a mail_sent property with the current time when
org-mime-subtree is called.  The only downside here is that the property
is added before the email is sent, so choosing not to send the email
after reviewing it in the message buffer could result in a misleading
mail_sent property, in fact maybe mail_sent should be changed to
mail_composed.

Cheers -- Eric


 -Ethan





 ___
 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

___
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


[Orgmode] Re: Sending org buffer as mail?

2010-12-18 Thread Ethan Ligon
Eric Schulte schulte.eric at gmail.com writes:
 
 Jean-Marie Gaillourdet jmg at gaillourdet.net writes:
 
  Hi Eric,
 
  Eric Schulte schulte.eric at 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.
 
  does it also support using ascii exports as text part and the html
  export as html part in a multi part message?
 
 
 It does now.  In the version I just pushed up an html and ascii export
 can be accomplished by setting the :MAIL_FMT: property to html-ascii, or
 by calling either `org-mime-send-buffer' or `org-mime-send-subtree' with
 'html-ascii as an argument.
 

Eric-

This is just great; thanks!  

Two additional suggestions:

1. The subject line should be exported as ascii also, to avoid 
   funky orgmode markup messing things up (I often have links in my
   headlines, for example).

2. Could we get some indication that the subtree's been mailed?  I'm
   thinking of having org-mime-subtree set a property MAIL_SENT to a
   time stamp or perhaps to the message id.  

   This way, if we inspect the subtree later we'll know if and when
   it was actually sent.  A possible bonus if we use the message id:
   when we get to the point of getting replies *back* into the org
   file it'll be possible to thread things properly.

-Ethan





___
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


Re: [Orgmode] Re: Sending org buffer as mail?

2010-12-17 Thread Rainer M Krug
-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.e...@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 m...@imapmail.org writes:

 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.

 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_estee...@gentlemen.net
   :MAIL_BCC:  peasants_uni...@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) 

Re: [Orgmode] Re: Sending org buffer as mail?

2010-12-17 Thread Eric Schulte
Rainer M Krug r.m.k...@gmail.com writes:

 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?


Correct, all one need do is to write an interactive wrapping function
similar to the example in my previous email.  Note: In the version
attached to this email the functions are renamed to
`org-mime-send-buffer' and `org-mime-send-subtree'.


 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?


Sounds like a good idea, this shouldn't be overly hard to implement
using the existing attachment features of org-mime.


 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.


I'm attaching another version of org-mime which provides the
org-mime-subtree interactive command which uses the MAIL_FMT property to
determine the format of the mail message to populate.

Thanks -- Eric



org-mime.el
Description: application/emacs-lisp
___
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


Re: [Orgmode] Re: Sending org buffer as mail?

2010-12-17 Thread Jean-Marie Gaillourdet
Hi Eric,

Eric Schulte schulte.e...@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.

does it also support using ascii exports as text part and the html
export as html part in a multi part message?

Thanks for org-mime, I'll try it tomorrow.

Cheers,
Jean-Marie

___
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


Re: [Orgmode] Re: Sending org buffer as mail?

2010-12-17 Thread Eric Schulte
Jean-Marie Gaillourdet j...@gaillourdet.net writes:

 Hi Eric,

 Eric Schulte schulte.e...@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.

 does it also support using ascii exports as text part and the html
 export as html part in a multi part message?


It does now.  In the version I just pushed up an html and ascii export
can be accomplished by setting the :MAIL_FMT: property to html-ascii, or
by calling either `org-mime-send-buffer' or `org-mime-send-subtree' with
'html-ascii as an argument.

Best -- Eric


 Thanks for org-mime, I'll try it tomorrow.

 Cheers,
 Jean-Marie

___
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


[Orgmode] Re: Sending org buffer as mail?

2010-12-16 Thread Oscar Carlsson
Rainer M Krug r.m.k...@gmail.com writes:

 Hi

 From time to time, I would like to mail an .org buffer. At the moment, I
 copy it into thunderbird and mail it - this is quite awkward.

 I assume, there must be a better way of doing this from within emacs?.

 I do not intend to switch to gnus or similar for reading my email, I
 just want to be able to send, from time to time, an .org buffer as an email

 Cheers,

 Rainer

You don't have to switch to GNUS in order to do it, but you might have
to configure Emacs's built in smtp-support. This is how I do it:

#+BEGIN_SRC lisp
(setq message-send-mail-function 'smtpmail-send-it
  smtpmail-starttls-credentials '((smtp.gmail.com 587 nil nil))
  smtpmail-auth-credentials ~/.authinfo
  smtpmail-default-smtp-server smtp.gmail.com
  smtpmail-smtp-server smtp.gmail.com
  smtpmail-smtp-service 587)
#+END_SRC

This is obviously for GMail. In my ~/.authinfo, I input the following:

#+BEGIN_SRC
machine smtp.gmail.com login user.n...@gmail.com password p4ssw0rd
#+END_SRC

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. 


___
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


Re: [Orgmode] Re: Sending org buffer as mail?

2010-12-16 Thread Jeff Horn
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.

Does this attach the buffer or read it into the message? I thought the
OP wanted to read-in a buffer. There should be a built-in function for
that, but I've never used it.

-- 
Jeffrey Horn
Graduate Lecturer and PhD Student in Economics
George Mason University

(704) 271-4797
jh...@gmu.edu
jrhorn...@gmail.com

http://www.failuretorefrain.com/jeff/

___
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


Re: [Orgmode] Re: Sending org buffer as mail?

2010-12-16 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

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.
 


- -- 
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:  rai...@krugs.de

Skype:  RMkrug
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk0J07sACgkQoYgNqgF2egrdpACfQkvt6rkmqyESt2r+wOvdq1hn
fCsAn0ReY6hNGtxnKP1lZUTXdAY/ev7L
=Z0gh
-END PGP SIGNATURE-

___
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


Re: [Orgmode] Re: Sending org buffer as mail?

2010-12-16 Thread Oscar Carlsson
Jeff Horn jrhorn...@gmail.com writes:

 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.

 Does this attach the buffer or read it into the message? I thought the
 OP wanted to read-in a buffer. There should be a built-in function for
 that, but I've never used it.

It would attach the file. But inserting the file would be trivial: =M-x
insert-file=

But I have to admit that's not optimal - it would be better have a macro
(or such) that did it for you. Or properties in the org-file in
question. Or tell compose-mail that it should include marked text.


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


Re: [Orgmode] Re: Sending org buffer as mail?

2010-12-16 Thread Oscar Carlsson
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 :-(


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


Re: [Orgmode] Re: Sending org buffer as mail?

2010-12-16 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

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...

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:  rai...@krugs.de

Skype:  RMkrug
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEUEARECAAYFAk0J7MoACgkQoYgNqgF2egoVSQCeM6Hlm6FBRKzsVARZlovJsS2l
Z8YAljq2RvUkqS+AVf4hMYbEsKfkBbM=
=L9Cf
-END PGP SIGNATURE-

___
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


Re: [Orgmode] Re: Sending org buffer as mail?

2010-12-16 Thread Eric Schulte
Please look at org-mime in the contrib directory.  It is designed for
this exact need.  Calling `org-mime-org-buffer-htmlize' from within an
Org-mode document will export the document to html, and then place the
html into a mail buffer with appropriate mime configuration, ensuring
things like linked images are handled appropriately.  See the worg page
for more information (follow gnus instructions for simple mail use)
http://orgmode.org/worg/org-contrib/org-mime.php

Hope this helps -- Eric

Oscar Carlsson oscar.carls...@gmail.com writes:

 Jeff Horn jrhorn...@gmail.com writes:

 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.

 Does this attach the buffer or read it into the message? I thought the
 OP wanted to read-in a buffer. There should be a built-in function for
 that, but I've never used it.

 It would attach the file. But inserting the file would be trivial: =M-x
 insert-file=

 But I have to admit that's not optimal - it would be better have a macro
 (or such) that did it for you. Or properties in the org-file in
 question. Or tell compose-mail that it should include marked text.


 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

___
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


Re: [Orgmode] Re: Sending org buffer as mail?

2010-12-16 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 12/16/2010 02:22 PM, Eric Schulte wrote:

Hi Eric

 Please look at org-mime in the contrib directory.  It is designed for
 this exact need.  Calling `org-mime-org-buffer-htmlize' from within an
 Org-mode document will export the document to html, and then place the
 html into a mail buffer with appropriate mime configuration, ensuring
 things like linked images are handled appropriately.  See the worg page
 for more information (follow gnus instructions for simple mail use)
 http://orgmode.org/worg/org-contrib/org-mime.php

Interesting - there is always something new in org-land.

But I was actually looking at not exporting the org file, but sending it
as text - so I am happy with what I have now.

Thanks a lot,

Rainer


 
 Hope this helps -- Eric
 
 Oscar Carlsson oscar.carls...@gmail.com writes:
 
 Jeff Horn jrhorn...@gmail.com writes:

 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.

 Does this attach the buffer or read it into the message? I thought the
 OP wanted to read-in a buffer. There should be a built-in function for
 that, but I've never used it.

 It would attach the file. But inserting the file would be trivial: =M-x
 insert-file=

 But I have to admit that's not optimal - it would be better have a macro
 (or such) that did it for you. Or properties in the org-file in
 question. Or tell compose-mail that it should include marked text.


 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
 
 ___
 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:  rai...@krugs.de

Skype:  RMkrug
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk0KFpwACgkQoYgNqgF2ego/EgCdEPFql4mVoc2Z6V8xNt9quUdY
nfcAn2+WFS7A++f0G1yM/MybZYM1Qit+
=BzER
-END PGP SIGNATURE-

___
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


Re: [Orgmode] Re: Sending org buffer as mail?

2010-12-16 Thread Oscar Carlsson
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


[Orgmode] Re: Sending org buffer as mail?

2010-12-16 Thread Sébastien Vauban
Hi Eric,

Eric Schulte wrote:
 Please look at org-mime in the contrib directory.  It is designed for
 this exact need.  Calling `org-mime-org-buffer-htmlize' from within an
 Org-mode document will export the document to html, and then place the
 html into a mail buffer with appropriate mime configuration, ensuring
 things like linked images are handled appropriately.  See the worg page
 for more information (follow gnus instructions for simple mail use)
 http://orgmode.org/worg/org-contrib/org-mime.php

Would it be possible to send the headline as text in Gnus' message-mode,
keeping the same functionality (mailto, etc.)?

Best regards,
  Seb

-- 
Sébastien Vauban


___
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


Re: [Orgmode] Re: Sending org buffer as mail?

2010-12-16 Thread Eric Schulte
Sébastien Vauban wxhgmqzgw...@spammotel.com writes:

 Hi Eric,

 Eric Schulte wrote:
 Please look at org-mime in the contrib directory.  It is designed for
 this exact need.  Calling `org-mime-org-buffer-htmlize' from within an
 Org-mode document will export the document to html, and then place the
 html into a mail buffer with appropriate mime configuration, ensuring
 things like linked images are handled appropriately.  See the worg page
 for more information (follow gnus instructions for simple mail use)
 http://orgmode.org/worg/org-contrib/org-mime.php

 Would it be possible to send the headline as text in Gnus' message-mode,
 keeping the same functionality (mailto, etc.)?


I don't understand what you mean.  Do you mean to set the title of an
Org-mode file as the subject of an email?

Thanks -- Eric

___
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


[Orgmode] Re: Sending org buffer as mail?

2010-12-16 Thread Sébastien Vauban
Eric,

Eric Schulte wrote:
 Sébastien Vauban wxhgmqzgw...@spammotel.com writes:
 Eric Schulte wrote:
 Please look at org-mime in the contrib directory.  It is designed for
 this exact need.  Calling `org-mime-org-buffer-htmlize' from within an
 Org-mode document will export the document to html, and then place the
 html into a mail buffer with appropriate mime configuration, ensuring
 things like linked images are handled appropriately.  See the worg page
 for more information (follow gnus instructions for simple mail use)
 http://orgmode.org/worg/org-contrib/org-mime.php

 Would it be possible to send the headline as text in Gnus' message-mode,
 keeping the same functionality (mailto, etc.)?

 I don't understand what you mean.  Do you mean to set the title of an
 Org-mode file as the subject of an email?

Yes, exactly. Sending a subtree in text, with its headline used as =Subject=.

And maybe setting accordingly the =To=, =Cc=, =BCc=, if such are in the
PROPERTY drawer?

Not that important, but something that could be used quite often...

Best regards,
  Seb

-- 
Sébastien Vauban


___
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


Re: [Orgmode] Re: Sending org buffer as mail?

2010-12-16 Thread Eric Schulte
Hi,

This is not implemented yet, but shouldn't be hard to implement starting
with the current code base.  I encourage anyone who is interested to
take a look at org-mime and try their hand at improving it.  I'm
strapped for time at the moment and probably wont have time to take a
look at it, but I do plan to make improvements in the long term.

Best -- Eric

Sébastien Vauban wxhgmqzgw...@spammotel.com writes:

 Eric,

 Eric Schulte wrote:
 Sébastien Vauban wxhgmqzgw...@spammotel.com writes:
 Eric Schulte wrote:
 Please look at org-mime in the contrib directory.  It is designed for
 this exact need.  Calling `org-mime-org-buffer-htmlize' from within an
 Org-mode document will export the document to html, and then place the
 html into a mail buffer with appropriate mime configuration, ensuring
 things like linked images are handled appropriately.  See the worg page
 for more information (follow gnus instructions for simple mail use)
 http://orgmode.org/worg/org-contrib/org-mime.php

 Would it be possible to send the headline as text in Gnus' message-mode,
 keeping the same functionality (mailto, etc.)?

 I don't understand what you mean.  Do you mean to set the title of an
 Org-mode file as the subject of an email?

 Yes, exactly. Sending a subtree in text, with its headline used as =Subject=.

 And maybe setting accordingly the =To=, =Cc=, =BCc=, if such are in the
 PROPERTY drawer?

 Not that important, but something that could be used quite often...

 Best regards,
   Seb

___
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


Re: [Orgmode] Re: Sending org buffer as mail?

2010-12-16 Thread Jeff Horn
On Thu, Dec 16, 2010 at 5:37 AM, Oscar Carlsson
oscar.carls...@gmail.com wrote:
 Jeff Horn jrhorn...@gmail.com writes:

 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.

 Does this attach the buffer or read it into the message? I thought the
 OP wanted to read-in a buffer. There should be a built-in function for
 that, but I've never used it.

 It would attach the file. But inserting the file would be trivial: =M-x
 insert-file=

 But I have to admit that's not optimal - it would be better have a macro
 (or such) that did it for you. Or properties in the org-file in
 question. Or tell compose-mail that it should include marked text.

I could see myself using properties for this.

-- 
Jeffrey Horn
Graduate Lecturer and PhD Student in Economics
George Mason University

(704) 271-4797
jh...@gmu.edu
jrhorn...@gmail.com

http://www.failuretorefrain.com/jeff/

___
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


Re: [Orgmode] Re: Sending org buffer as mail?

2010-12-16 Thread Sebastian Rose
Rainer M Krug r.m.k...@gmail.com writes:
 * 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.


How about inserting as ascii (just change the `(setq text...' lines)?


  (add-hook 'message-mode-hook
(lambda ()
  (let (text)
(with-current-buffer (other-buffer)
  (when (region-active-p)
(setq text
  (org-export-region-as-ascii  (region-beginning)
   (region-end) t 
'string
(when text
  (end-of-buffer)
  (insert text)


This inserts the ascii export.  Thanks for sharing :)


Sebastian

___
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


Re: [Orgmode] Re: Sending org buffer as mail?

2010-12-16 Thread Sebastian Rose
Rainer M Krug r.m.k...@gmail.com writes:
 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


I finally added an  `(if (org-mode-p)' for my local usage:


(add-hook 'message-mode-hook
  (lambda ()
(let (text)
  (with-current-buffer (other-buffer)
(when (region-active-p)
  (setq text
(if (org-mode-p)
(org-export-region-as-ascii  (region-beginning)
 (region-end) t 'string)
  (buffer-substring (region-beginning)
(region-end))
  (when text
(end-of-buffer)
(insert text)


Best wishes

  Sebastian

___
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


[Orgmode] Re: Sending org buffer as mail?

2010-12-16 Thread Matt Lundin
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.

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:

--8---cut here---start-8---
(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)
--8---cut here---end---8---

With this function, you can compose emails like this:

--8---cut here---start-8---
* My obsequious missive
  :PROPERTIES:
  :MAIL_TO:  highly_estee...@gentlemen.net
  :MAIL_BCC:  peasants_uni...@plebeians.org
  :END:
My most noble sirs,

I thank you for gracing this world with your beauteous presence.

Humbly yours,
An Org-mode user
--8---cut here---end---8---

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


Re: [Orgmode] Re: Sending org buffer as mail?

2010-12-16 Thread Eric Schulte
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 m...@imapmail.org writes:

 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.

 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_estee...@gentlemen.net
   :MAIL_BCC:  peasants_uni...@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

___
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


Re: [Orgmode] Re: Sending org buffer as mail?

2010-12-16 Thread Eric Schulte
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.

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



org-mime.el
Description: application/emacs-lisp

Eric Schulte schulte.e...@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 m...@imapmail.org writes:

 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.

 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_estee...@gentlemen.net
   :MAIL_BCC:  peasants_uni...@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
___
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