emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* tangle the code blocks in the regions
@ 2014-03-07  0:47 zhenjiang zech xu
  2014-03-07  3:00 ` Eric Schulte
  0 siblings, 1 reply; 2+ messages in thread
From: zhenjiang zech xu @ 2014-03-07  0:47 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 520 bytes --]

Hi all,

is there function to extract all the code blocks in the selected region?

For example, can I select the region of the following two blocks and
extract them with just one command? Or I have to move cursor to each block
and extract them one by one?

   #+BEGIN_SRC sh :tangle foo.sh
     echo 'hello'
   #+END_SRC
   #+BEGIN_SRC python :tangle foo.py
     print 'hello'
   #+END_SRC

I doesn't find the extracting region command in manual. I would think this
can be a convenient feature to have?

Best,
Zhenjiang

[-- Attachment #2: Type: text/html, Size: 655 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: tangle the code blocks in the regions
  2014-03-07  0:47 tangle the code blocks in the regions zhenjiang zech xu
@ 2014-03-07  3:00 ` Eric Schulte
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Schulte @ 2014-03-07  3:00 UTC (permalink / raw)
  To: zhenjiang zech xu; +Cc: emacs-orgmode

zhenjiang zech xu <zhenjiang.xu@gmail.com> writes:

> Hi all,
>
> is there function to extract all the code blocks in the selected region?
>
> For example, can I select the region of the following two blocks and
> extract them with just one command? Or I have to move cursor to each block
> and extract them one by one?
>
>    #+BEGIN_SRC sh :tangle foo.sh
>      echo 'hello'
>    #+END_SRC
>    #+BEGIN_SRC python :tangle foo.py
>      print 'hello'
>    #+END_SRC
>
> I doesn't find the extracting region command in manual. I would think this
> can be a convenient feature to have?
>
> Best,
> Zhenjiang

Currently tangling does not support limiting to the active region.  It
shouldn't be too difficult to update org-babel-tangle to use
region-active-p to perform such limiting, unfortunately I personally
don't have the time to implement such an extension.

Best,

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-03-07  3:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-07  0:47 tangle the code blocks in the regions zhenjiang zech xu
2014-03-07  3:00 ` Eric Schulte

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).