emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] sending emails from org


From: Thorsten Jolitz
Subject: Re: [O] sending emails from org
Date: Mon, 07 Apr 2014 22:29:37 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Sharon Kimble <address@hidden> writes:

> Rainer M Krug <address@hidden> writes:
>
>> Hi
>>
>> I have two questions concerning sending subtrees as emails.
>>
>> 1) Which properties are supported by org-mime - I could not find a list
>> or an example of an email from org.
>>
>> 2) I am using gnus and have the following hooks to add automatic signing
>> of emails:
>>
>> ,----
>> | #+begin_src emacs-lisp
>> | (add-hook 'gnus-message-setup-hook 'mml-secure-message-sign-pgpmime)
>> | (add-hook 'message-s'etup-hook 'mml-secure-message-sign-pgpmime)
>> | #+end_src
>> `----
>>
>> These hooks are not called when composing emails in org. Is this on
>> purpose, or to gnus specific?
>
> I've found that I have to have some commands both in '.emacs' and in
> .gnus',
> and I use the same code to sign my emails in gnus. I've never tried
> writing an
> email in org-mode, but if I was I'd tend to use a snippet from
> YASnippet', or
> write my own for it. I've always believed in writing emails in gnus,
> and using
> org-mode for TODOs, documents, etc. 

You probably could have the best of both worlds using outorg.el, which
works out of the box with message-mode (although I never tried these
signing functions).

1. get outshine.el and outorg.el (github or melpa)

2. before loading outline-mode: define outline-minor-mode prefix in
.emacs:

#+begin_src emacs-lisp
 ;; must be set before outline is loaded
 (defvar outline-minor-mode-prefix "\M-#")
#+end_src


or maybe "\C-c".


3. put this in your .emacs:

#+begin_src emacs-lisp
(require 'outshine) ; has soft dependency to 'outorg
 (add-hook 'outline-minor-mode-hook 'outshine-hook-function)
 (add-hook 'message-mode-hook 'outline-minor-mode)
#+end_src

4. write your emails/posts in message-mode, and switch to full Org-mode
with e.g. M-# M-# (M-x outorg-edit-as-org). When there are already
Org-mode headlines in the message mode buffer, use C-u M-# M-# to edit
the whole buffer in Org-mode, and M-# M-# to edit the subtree at point. 

Use M-# (outorg-copy-edits-and-exit) when you are done in the
\*outorg-edit-buffer\*. 

There are several prefix args that allow you to (temporarilly or
persistently) insert a template for export options:

#+begin_quote
outorg-edit-as-org is an interactive Lisp function in `outorg.el'.

(outorg-edit-as-org &optional ARG)
 
 Convert and copy to temporary Org buffer
 
 With ARG, act conditional on the raw value of ARG:
 
 | prefix | raw | action 1          | action 2                         |
 |--------+-----+-------------------+----------------------------------|
 | C-u    | (4) | edit-whole-buffer | ---                              |
 | C-1    |   1 | edit-whole-buffer | insert default export-template   |
 | C-2    |   2 | edit-whole-buffer | ask user for template-file       |
 | C-3    |   3 | edit-whole-buffer | insert and keep default template |
 | C-4    |   4 | edit-whole-buffer | insert and keep template-file    |
#+end_quote

As a little demonstration, I switch to outorg, and insert the following
code-block. Doing C-c C-c in the block suffices to attach the ASCII
version of the email.

#+begin_src emacs-lisp :results value
(org-export-as 'ascii)
#+end_src

#+results:
                          ___________________
                            Thorsten Jolitz
                           address@hidden
                          ___________________


1 --text follows this line--
============================

  Sharon Kimble <address@hidden> writes:

  > Rainer M Krug <address@hidden> writes: > Hi > > I have two
  >questions concerning sending subtrees as emails.  > > 1) Which
  >properties are supported by org-mime - I could not find a list > or
  >an example of an email from org.  > > 2) I am using gnus and have the
  >following hooks to add automatic signing > of emails: > > ,---- > |
  >#+begin_src emacs-lisp > | (add-hook 'gnus-message-setup-hook
  >'mml-secure-message-sign-pgpmime) > | (add-hook 'message-s'etup-hook
  >'mml-secure-message-sign-pgpmime) > | #+end_src > `---- > > These
  >hooks are not called when composing emails in org. Is this on >
  >purpose, or to gnus specific?  I've found that I have to have some
  >commands both in '.emacs' and in .gnus', and I use the same code to
  >sign my emails in gnus. I've never tried writing an email in
  >org-mode, but if I was I'd tend to use a snippet from YASnippet', or
  >write my own for it. I've always believed in writing emails in gnus,
  >and using org-mode for TODOs, documents, etc.

  You probably could have the best of both worlds using outorg.el, which
  works out of the box with message-mode (although I never tried these
  signing functions).

  1. get outshine.el and outorg.el (github or melpa)

  2. before loading outline-mode: define outline-minor-mode prefix in
  .emacs:

  ,----
  | ;; must be set before outline is loaded
  | (defvar outline-minor-mode-prefix "\M-#")
  `----


  or maybe "\C-c".


  1. put this in your .emacs:

  ,----
  | (require 'outshine) ; has soft dependency to 'outorg
  |  (add-hook 'outline-minor-mode-hook 'outshine-hook-function)
  |  (add-hook 'message-mode-hook 'outline-minor-mode)
  `----

  1. write your emails/posts in message-mode, and switch to full
     Org-mode
  with e.g. M-# M-# (M-x outorg-edit-as-org). When there are already
  Org-mode headlines in the message mode buffer, use C-u M-# M-# to edit
  the whole buffer in Org-mode, and M-# M-# to edit the subtree at
  point.

  Use M-# (outorg-copy-edits-and-exit) when you are done in the
  \*outorg-edit-buffer\*.

  There are several prefix args that allow you to (temporarilly or
  persistently) insert a template for export options:

        outorg-edit-as-org is an interactive Lisp function in
        `outorg.el'.

        (outorg-edit-as-org &optional ARG)

        Convert and copy to temporary Org buffer

        With ARG, act conditional on the raw value of ARG:

         prefix  raw  action 1           action 2                         
        ------------------------------------------------------------------
         C-u     (4)  edit-whole-buffer  ---                              
         C-1       1  edit-whole-buffer  insert default export-template   
         C-2       2  edit-whole-buffer  ask user for template-file       
         C-3       3  edit-whole-buffer  insert and keep default template 
         C-4       4  edit-whole-buffer  insert and keep template-file    


  ,----
  | (org-export-as 'ascii)
  `----


  -- cheers, Thorsten



                                          Emacs 24.3.1 (Org mode 8.2.5h)


-- 
cheers,
Thorsten




reply via email to

[Prev in Thread] Current Thread [Next in Thread]