jorge.a.alf...@gmail.com (Jorge A. Alfaro-Murillo) writes:

> Hi, I would like to use org-edit-src-code outside of org, I think it
> would be very handy in Message mode, to send messages that contain code
> and edit that code in the proper mode.

This can be done with outshine.el and outorg.el. 
Install them as described in the docs and then add

,------------------------------------------------------------
| (when (require 'outline nil t)
| (add-hook 'message-mode-hook 'outline-minor-mode))
| 
| (require 'outshine nil t)
| (add-hook 'outline-minor-mode-hook 'outshine-hook-function)
| 
| (setq outshine-use-speed-commands t)
`------------------------------------------------------------

M-# M-# will then convert your message-mode buffer to full Org-mode, M-#
will copy the changes back to message-mode. As a proof of concept, I
attach this mail exported to ASCII by evaluating the following
source-block directly in the outorg-edit-buffer:

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

#+results:
                           _________________

                                  745

                            Thorsten Jolitz
                           _________________


Table of Contents
_________________

1 --text follows this line--


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

  jorge.a.alf...@gmail.com (Jorge A. Alfaro-Murillo) writes:

  > Hi, I would like to use org-edit-src-code outside of org, I think it
  > would be very handy in Message mode, to send messages that contain
  > code and edit that code in the proper mode.

  This can be done with outshine.el and outorg.el.  Install them as
  described in the docs and then add

  ,------------------------------------------------------------
   (when (require 'outline nil t)                              
   (add-hook 'message-mode-hook 'outline-minor-mode))          

   (require 'outshine nil t)                                   
   (add-hook 'outline-minor-mode-hook 'outshine-hook-function) 

   (setq outshine-use-speed-commands t)                        
  `------------------------------------------------------------

  M-# M-# will then convert your message-mode buffer to full Org-mode,
  M-# will copy the changes back to message-mode. As a proof of concept,
  I attach this mail exported to ASCII.


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

  -- cheers, Thorsten

-- 
cheers,
Thorsten


Reply via email to