From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yann Le Du Subject: Re: Tangle only current code block? Date: Mon, 8 Oct 2012 08:21:40 +0200 Message-ID: References: <87haq5zwbi.fsf@gmx.com> Reply-To: yann.ledu.fr@gmail.com Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=e89a8f838e9ffba0fb04cb863c9a Return-path: Received: from eggs.gnu.org ([208.118.235.92]:41274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TL6j0-0001p3-Me for emacs-orgmode@gnu.org; Mon, 08 Oct 2012 02:21:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TL6iz-000265-9N for emacs-orgmode@gnu.org; Mon, 08 Oct 2012 02:21:58 -0400 Received: from mail-oa0-f41.google.com ([209.85.219.41]:37381) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TL6iz-00025x-31 for emacs-orgmode@gnu.org; Mon, 08 Oct 2012 02:21:57 -0400 Received: by mail-oa0-f41.google.com with SMTP id k14so3964847oag.0 for ; Sun, 07 Oct 2012 23:21:56 -0700 (PDT) In-Reply-To: <87haq5zwbi.fsf@gmx.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: emacs-orgmode@gnu.org --e89a8f838e9ffba0fb04cb863c9a Content-Type: text/plain; charset=ISO-8859-1 On Mon, Oct 8, 2012 at 1:39 AM, Eric Schulte wrote: > Yann Le Du writes: > > > Hi, > > > > I have a bunch of code chunks with stuff like <> and headers > like > > :tangle toto.c exporting to different files in noweb style > > > > If I use C-c C-v t, it extracts all of those code chunks nicely > > > > However, sometimes I would like to put my cursor inside one of those code > > chunks and then extract only that one, not the others. > > > > Is there a simple way ? > > > > Yes, run the tangle with a prefix argument to tangle only the block > under your cursor e.g., C-u C-c C-v t. > > Very nice! Is that documented? It's not in http://orgmode.org/manual/Extracting-source-code.html > Best, > > > > > I narly found a solution, but to make it work nicely I need to put > > org-babel-tangle inside a macro, but it fails: if I define a macro : > > > > C-x ( > > M-x org-babel-tangle > > C-x ) > > C-x e > > > > it fails, saying wrong type argument stringp, nul > > > > I'm lost. > > > > Yann > > -- > Eric Schulte > http://cs.unm.edu/~eschulte > --e89a8f838e9ffba0fb04cb863c9a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Mon, Oct 8, 2012 at 1:39 AM, Eric Schulte <eric.schulte= @gmx.com> wrote:
Yann Le Du <yann.ledu.fr@gmail.com> writes:

> Hi,
>
> I have a bunch of code chunks with stuff like <<fun name>>= and headers like
> :tangle toto.c exporting to different files in noweb style
>
> If I use C-c C-v t, it extracts all of those code chunks nicely
>
> However, sometimes I would like to put my cursor inside one of those c= ode
> chunks and then extract only that one, not the others.
>
> Is there a simple way ?
>

Yes, run the tangle with a prefix argument to tangle only the block under your cursor e.g., C-u C-c C-v t.


Very nice! Is that documented? It's not in http://orgm= ode.org/manual/Extracting-source-code.html
=A0
Best,

>
> I narly found a solution, but to make it work nicely I need to put
> org-babel-tangle inside a macro, but it fails: if I define a macro : >
> C-x (
> M-x org-babel-tangle
> C-x )
> C-x e
>
> it fails, saying wrong type argument stringp, nul
>
> I'm lost.
>
> Yann

--
Eric Schulte
http://cs.unm.edu= /~eschulte

--e89a8f838e9ffba0fb04cb863c9a--