From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bill White Subject: Re: Tangle only current code block? Date: Mon, 08 Oct 2012 17:32:48 -0500 Message-ID: <87mwzwtx0v.fsf@wolfram.com> References: <87haq5zwbi.fsf@gmx.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:34626) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLLzV-000317-F7 for emacs-orgmode@gnu.org; Mon, 08 Oct 2012 18:40:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TLLzU-0006D1-Dj for emacs-orgmode@gnu.org; Mon, 08 Oct 2012 18:40:01 -0400 Received: from plane.gmane.org ([80.91.229.3]:56305) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLLzU-0006Ch-6n for emacs-orgmode@gnu.org; Mon, 08 Oct 2012 18:40:00 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TLLzX-0001fh-PL for emacs-orgmode@gnu.org; Tue, 09 Oct 2012 00:40:03 +0200 Received: from 173-19-205-93.client.mchsi.com ([173.19.205.93]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 09 Oct 2012 00:40:03 +0200 Received: from billw by 173-19-205-93.client.mchsi.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 09 Oct 2012 00:40:03 +0200 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: emacs-orgmode@gnu.org On Sun Oct 07 2012 at 18:39, 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. And you can tangle a consecutive subset of code blocks by narrowing your org buffer to only those blocks before tangling. It happens to me so often I wrote a bit of code to avoid it. From my emacs.org: #+begin_src emacs-lisp :tangle yes (defadvice org-babel-tangle (before widen-before-tangling) "Widen a buffer before calling org-babel-tangle." (widen)) (ad-activate 'org-babel-tangle) #+end_src Cheers - bw -- Bill White . billw@wolfram.com "No ma'am, we're musicians."