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

Reply via email to