emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [babel] [bug] org-babel-use-quick-and-dirty-noweb-expansion
@ 2012-03-18 20:23 Nicolas Girard
  2012-03-19 14:39 ` Eric Schulte
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Girard @ 2012-03-18 20:23 UTC (permalink / raw)
  To: emacs-orgmode

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

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

[-- Attachment #2: Type: text/html, Size: 4517 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [babel] [bug] org-babel-use-quick-and-dirty-noweb-expansion
  2012-03-18 20:23 [babel] [bug] org-babel-use-quick-and-dirty-noweb-expansion Nicolas Girard
@ 2012-03-19 14:39 ` Eric Schulte
  2012-03-19 17:24   ` Nicolas Girard
  2012-03-20  1:41   ` Bastien
  0 siblings, 2 replies; 5+ messages in thread
From: Eric Schulte @ 2012-03-19 14:39 UTC (permalink / raw)
  To: Nicolas Girard; +Cc: emacs-orgmode

[-- 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/

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [babel] [bug] org-babel-use-quick-and-dirty-noweb-expansion
  2012-03-19 14:39 ` Eric Schulte
@ 2012-03-19 17:24   ` Nicolas Girard
  2012-03-19 19:56     ` Eric Schulte
  2012-03-20  1:41   ` Bastien
  1 sibling, 1 reply; 5+ messages in thread
From: Nicolas Girard @ 2012-03-19 17:24 UTC (permalink / raw)
  To: emacs-orgmode

2012/3/19 Eric Schulte <eric.schulte@gmx.com>
>
> 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.
>

Great ! It's such a relief to be able to tangle my stuff in 8 s vs 4
to 5 minutes !
Thanks so much !

Nicolas

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [babel] [bug] org-babel-use-quick-and-dirty-noweb-expansion
  2012-03-19 17:24   ` Nicolas Girard
@ 2012-03-19 19:56     ` Eric Schulte
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Schulte @ 2012-03-19 19:56 UTC (permalink / raw)
  To: Nicolas Girard; +Cc: emacs-orgmode

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

> 2012/3/19 Eric Schulte <eric.schulte@gmx.com>
>>
>> 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.
>>
>
> Great ! It's such a relief to be able to tangle my stuff in 8 s vs 4
> to 5 minutes !
> Thanks so much !
>
> Nicolas
>

Wow,

Out of curiosity how large is this file and with how many code blocks?
Is it possible to see how many times the `org-entry-get' function is
called during tangling?

The speed of non-quick-and-dirty style tangling is entirely dependent on
the heavy use of Org-mode properties so the former will only see speed
improvements if they are made in the later.

Happy the quick options is now working for you.

Cheers,

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [babel] [bug] org-babel-use-quick-and-dirty-noweb-expansion
  2012-03-19 14:39 ` Eric Schulte
  2012-03-19 17:24   ` Nicolas Girard
@ 2012-03-20  1:41   ` Bastien
  1 sibling, 0 replies; 5+ messages in thread
From: Bastien @ 2012-03-20  1:41 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-orgmode, Nicolas Girard

Hi Eric,

Eric Schulte <eric.schulte@gmx.com> writes:

> 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.

Applied in hotfix-7.8.06, thanks.

-- 
 Bastien

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-03-20  1:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-18 20:23 [babel] [bug] org-babel-use-quick-and-dirty-noweb-expansion Nicolas Girard
2012-03-19 14:39 ` Eric Schulte
2012-03-19 17:24   ` Nicolas Girard
2012-03-19 19:56     ` Eric Schulte
2012-03-20  1:41   ` Bastien

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).