From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tomas Grigera Subject: Re: Problem with noweb-ref property Date: Thu, 29 Dec 2011 20:16:47 -0300 Message-ID: References: <87wr9frwa7.fsf@gmx.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:60215) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgPDQ-00087H-8h for emacs-orgmode@gnu.org; Thu, 29 Dec 2011 18:16:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RgPDO-0003QD-0M for emacs-orgmode@gnu.org; Thu, 29 Dec 2011 18:16:52 -0500 Received: from mail-pz0-f41.google.com ([209.85.210.41]:49974) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgPDN-0003Q9-P9 for emacs-orgmode@gnu.org; Thu, 29 Dec 2011 18:16:49 -0500 Received: by dakl33 with SMTP id l33so10827571dak.0 for ; Thu, 29 Dec 2011 15:16:49 -0800 (PST) In-Reply-To: <87wr9frwa7.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 Hi Eric, Thanks a lot for your quick reply and fix. Getting the git repo version scares me a bit, but I guess I'll just have to take the plunge! Here we go :) Thanks again, Tomas On Thu, Dec 29, 2011 at 16:51, Eric Schulte wrote: > Tomas Grigera writes: > >> Hi list, >> >> This is my first post, so just let me say first that I have been using >> org-mode for 10 months or so and I love it. It's an exceptional >> package, and before I ask my question I would just like to thank >> Carsten, Bastien, and the community for the great work and for >> sharing. >> >> Now my question: I am trying to extract code from a .org file by >> tangling with noweb-style references. As I understand from the manual, >> if I write <> in a code block, the line will be expanded with the >> code block named foo. This name I can set with #+NAME: =A0or with the >> :noweb-ref header argument. Both ways work for me, except that I >> cannont set the :noweb-ref argument through a property. >> >> The following example is almost verbatim from the manual: >> >> #+BEGIN_SRC sh :tangle yes :noweb yes :shebang #!/bin/sh >> <> >> #+END_SRC >> >> * the mount point of the fullest disk >> >> ** query all mounted disks >> >> #+HEADER: :noweb-ref fullest-disk >> #+BEGIN_SRC sh >> =A0 =A0 =A0 =A0 df \ >> #+END_SRC >> >> >> ** strip the header row >> =A0 :PROPERTIES: >> =A0 :noweb-ref: fullest-disk >> =A0 :END: >> #+BEGIN_SRC sh :noweb yes >> =A0 =A0 =A0 =A0 |sed '1d' \ >> #+END_SRC >> >> >> If I understand correctly, tangling should produce a file which is a >> concatenation of the two code blocks. However, when I do >> org-babel-tangle, only the first block =A0 is inserted. Am I doing >> something wrong? >> >> I'm with emacs 23.2.1 and org-mode 7.8.02 >> >> Thanks in advance, >> >> Tomas >> > > Hi Tomas, > > You are correct the behavior described above is a bug introduced by a > fairly recent commit of mine which switched to using regular expressions > when resolving noweb references in an attempt to decrease the time > required to tangle code blocks (which can be significant in large code > blocks). > > However correct performance is more important than fast performance. > I've just pushed up a patch which fixes the bug you've described, and > hopefully doesn't slow down the tangling process too significantly. > > Cheers, > > -- > Eric Schulte > http://cs.unm.edu/~eschulte/