emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <eric.schulte@gmx.com>
To: Nicolas Girard <girard.nicolas@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [babel] [bug] org-babel-use-quick-and-dirty-noweb-expansion
Date: Mon, 19 Mar 2012 10:39:19 -0400	[thread overview]
Message-ID: <87ipi0ac4o.fsf@gmx.com> (raw)
In-Reply-To: <CANMKmec9OLCt76gOVNiA5-Fr-BTxhm73amA455Y2vROnXXP5_w@mail.gmail.com> (Nicolas Girard's message of "Sun, 18 Mar 2012 21:23:47 +0100")

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

Hi Nicolas,

Thanks for bringing up this bug.  I'm attaching a patch to this email,
once the current repositories issues are resolved I'll apply this patch
to the repository.  In the interim, you can apply this patch to your
local copy of the git repository with.

  $ cd your/path/to/org
  $ git am /tmp/0001-fix-bug-in-src-name-regexp-when-using-org-babel-use-.patch


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-fix-bug-in-src-name-regexp-when-using-org-babel-use-.patch --]
[-- Type: text/x-patch, Size: 992 bytes --]

From 13a43222a0ab8594647584844f1765e6f130d69e Mon Sep 17 00:00:00 2001
From: Eric Schulte <eric.schulte@gmx.com>
Date: Mon, 19 Mar 2012 10:37:04 -0400
Subject: [PATCH] fix bug in src name regexp when using
 *org-babel-use-quick-and-dirty-noweb-expansion*

* lisp/ob.el (org-babel-expand-noweb-references): Fix bug in src name
  regexp when using *org-babel-use-quick-and-dirty-noweb-expansion*.
---
 lisp/ob.el |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ob.el b/lisp/ob.el
index 9205a20..2e48524 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -2186,7 +2186,7 @@ block but are passed literally to the \"example-block\"."
 		    (when (org-babel-ref-goto-headline-id source-name)
 		      (org-babel-ref-headline-body)))
 		  ;; find the expansion of reference in this buffer
-		  (let ((rx (concat rx-prefix source-name))
+		  (let ((rx (concat rx-prefix source-name "[ \t\n]"))
 			expansion)
 		    (save-excursion
 		      (goto-char (point-min))
-- 
1.7.9.4


[-- Attachment #3: Type: text/plain, Size: 1039 bytes --]


Best,

Nicolas Girard <girard.nicolas@gmail.com> writes:

> Hi all,
> I've been succesfully using babel to make various literate programming work.
> Unfortunately, tangling performance has dramatically decreased, to the
> point of being barely usable.
> I wish I could get advantage of the "quick & dirty noweb expansion" Eric
> introduced in january, but it has an undesirable side effect. Consider the
> following minimal example:
>
> #####
> #+name: abc
> #+begin_src latex
>   Abc<<abc-d>>
> #+end_src
>
> #+name: abc-d
> #+begin_src latex
>   Def
> #+end_src
>
> #+begin_src latex :noweb yes :tangle test.tex
>   <<abc>>
> #+end_src
> #####
>
> Tangling with *org-babel-use-quick-and-dirty-noweb-expansion* set to nil
> gives
>
> #####
> AbcDef
> #####
>
> while tangling with *org-babel-use-quick-and-dirty-noweb-expansion* set to
> t gives
>
> #####
> AbcDef
> Def
> #####
>
> I'd be very happy if this bug could be tracked down.
> Thanks very much in advance !
> Cheers,
>
> Nicolas

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

  reply	other threads:[~2012-03-19 14:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-18 20:23 [babel] [bug] org-babel-use-quick-and-dirty-noweb-expansion Nicolas Girard
2012-03-19 14:39 ` Eric Schulte [this message]
2012-03-19 17:24   ` Nicolas Girard
2012-03-19 19:56     ` Eric Schulte
2012-03-20  1:41   ` Bastien

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=87ipi0ac4o.fsf@gmx.com \
    --to=eric.schulte@gmx.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=girard.nicolas@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).