emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Thorsten Jolitz <tjolitz@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: sending emails from org
Date: Mon, 07 Apr 2014 22:29:37 +0200	[thread overview]
Message-ID: <87eh18c28e.fsf@gmail.com> (raw)
In-Reply-To: 87k3b1cj4y.fsf@talktalk.net

Sharon Kimble <boudiccas@talktalk.net> writes:

> Rainer M Krug <Rainer@krugs.de> 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
			   tjolitz@gmail.com
			  ___________________


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

  Sharon Kimble <boudiccas@talktalk.net> writes:

  > Rainer M Krug <Rainer@krugs.de> 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	other threads:[~2014-04-07 20:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-07 13:18 sending emails from org Rainer M Krug
2014-04-07 14:24 ` Sharon Kimble
2014-04-07 20:29   ` Thorsten Jolitz [this message]
2014-04-08  7:53     ` Rainer M Krug
2014-04-08  7:54     ` Rainer M Krug

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eh18c28e.fsf@gmail.com \
    --to=tjolitz@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).