emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Irrelevant src blocks can break noweb expansion
@ 2017-12-11  3:13 Berry, Charles
  2017-12-12  7:42 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Berry, Charles @ 2017-12-11  3:13 UTC (permalink / raw)
  To: emacs-org list

I used to avoid this by `(setq org-babel-use-quick-and-dirty-noweb-expansion t)'.

This illustrates the issue:

#+begin_src org

  ,* abc

  ,#+begin_src R :comment (message "running on empty")

  ,#+end_src

  ,#+begin_src R :noweb yes
  1
  ,#+end_src


#+end_src

The irrelevant, unnamed, empty src block its consulted via org-babel-get-src-block-info.  This runs the (message ...) expression.  Not much of a problem here, but I sometimes have a src block in my buffer that is a work-in-progress and has a header arg that calls a function I would not ordinarily have loaded.  When noweb does its thing, it chokes on the lack of a function.

Chuck

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

* Re: Irrelevant src blocks can break noweb expansion
  2017-12-11  3:13 Irrelevant src blocks can break noweb expansion Berry, Charles
@ 2017-12-12  7:42 ` Nicolas Goaziou
  2017-12-12 16:13   ` Berry, Charles
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2017-12-12  7:42 UTC (permalink / raw)
  To: Berry, Charles; +Cc: emacs-org list

Hello,

"Berry, Charles" <ccberry@ucsd.edu> writes:

> I used to avoid this by `(setq org-babel-use-quick-and-dirty-noweb-expansion t)'.
>
> This illustrates the issue:
>
> #+begin_src org
>
>   ,* abc
>
>   ,#+begin_src R :comment (message "running on empty")
>
>   ,#+end_src
>
>   ,#+begin_src R :noweb yes
>   1
>   ,#+end_src
>
>
> #+end_src
>
> The irrelevant, unnamed, empty src block its consulted via
> org-babel-get-src-block-info.

When? AFAICT, the second block doesn't contain any Noweb reference, so
there is nothing to consult in the first place. IOW, something is
missing in your recipe.

Also, `org-babel-use-quick-and-dirty-noweb-expansion' was intended to
skip properties check when collecting Noweb references from the buffer.
I.e., Org would only trust "name" keyword and ":noweb-ref" header
argument. Since there is no property in your example, I fail to see why
`org-babel-use-quick-and-dirty-noweb-expansion' would apply here.

Regards,

-- 
Nicolas Goaziou

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

* Re: Irrelevant src blocks can break noweb expansion
  2017-12-12  7:42 ` Nicolas Goaziou
@ 2017-12-12 16:13   ` Berry, Charles
  0 siblings, 0 replies; 3+ messages in thread
From: Berry, Charles @ 2017-12-12 16:13 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-org list


> On Dec 11, 2017, at 11:42 PM, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
> 
>> 
>> The irrelevant, unnamed, empty src block its consulted via
>> org-babel-get-src-block-info.
> 
> When? AFAICT, the second block doesn't contain any Noweb reference, so
> there is nothing to consult in the first place. IOW, something is
> missing in your recipe.

You are right. 

I had a problem with a subtree export seeming to fail at an unused src block and thought I had tracked it down to a bad header arg. But my example was clearly not right. And in trying the failed export again it worked. So I am deeply baffled.  If this problem shows up again, I'll do a better job of tracking it down.

Thanks,

Chuck

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

end of thread, other threads:[~2017-12-12 16:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-11  3:13 Irrelevant src blocks can break noweb expansion Berry, Charles
2017-12-12  7:42 ` Nicolas Goaziou
2017-12-12 16:13   ` Berry, Charles

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