emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <schulte.eric@gmail.com>
To: zhenjiang zech xu <zhenjiang.xu@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: tangle the code blocks in the regions
Date: Thu, 06 Mar 2014 20:00:25 -0700	[thread overview]
Message-ID: <87d2hyu306.fsf@gmail.com> (raw)
In-Reply-To: <CAAp=d8qdTg_Csxs4B6G+F4An2bmyOpAGFOs619vf-wHvOpnwaA@mail.gmail.com> (zhenjiang zech xu's message of "Thu, 6 Mar 2014 17:47:16 -0700")

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

      reply	other threads:[~2014-03-07  3:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-07  0:47 tangle the code blocks in the regions zhenjiang zech xu
2014-03-07  3:00 ` Eric Schulte [this message]

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=87d2hyu306.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=zhenjiang.xu@gmail.com \
    /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).