emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Move marked text into environment


From: Thorsten Jolitz
Subject: Re: [O] Move marked text into environment
Date: Tue, 28 May 2013 17:56:11 +0200
User-agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux)

AW <address@hidden> writes:

> Dear list,
>
> would someone help me, being not a programmer, to achieve this:
>
> I get Emails, copy them into an org-file and would like to write down 
> comments 
> on single sentences or paragraphs of the text.
>
> I'd like to mark some text in the copied text of the Email inside the 
> org-file 
> and get "#+BEGIN_QUOTE" and "END_QUOTE" around the marked region.
>
> I know that I can get the "environment" #+BEGIN / #+END_QUOTE with "<q", but 
> that leaves it to me to transfer the text into this environment. 
>
> Orgmode 8.0.1, Emacs 24.3

This

,-----------------------------------------------------------
| (defun org-wrap-region-in-quote-block ()
|   "Wrap region in quote block"
|   (interactive)
|   (save-excursion
|     (save-restriction
|       (and
|        (region-active-p)
|        (use-region-p)
|        (narrow-to-region (region-beginning) (region-end)))
|       (goto-char (point-min))
|       (insert "#+BEGIN_QUOTE\n")
|       (goto-char (point-max))
|       (insert "#+END_QUOTE\n"))
|     (deactivate-mark)))
`-----------------------------------------------------------

does the job - wrap text (marked as region) into a quote block.

Not sure if there is such a function in Org-mode already, it might well
be ...

-- 
cheers,
Thorsten




reply via email to

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