emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-export-babel-evaluate and header arguments
@ 2016-03-10  0:44 Anthony Cowley
  2016-03-10  3:25 ` Charles C. Berry
  0 siblings, 1 reply; 4+ messages in thread
From: Anthony Cowley @ 2016-03-10  0:44 UTC (permalink / raw)
  To: emacs-orgmode


If I have org-export-babel-evaluate set to nil, source blocks are not evaluated on export. However, if a source block has a :var header argument that calls another source block, I am prompted if the callee should be evaluated.

Given that the caller is not to be evaluated, I'm not sure I see a reason for the :var to be evaluated. Is there a way I can disable this argument evaluation?

My goal is quick exports, but in this case it actually seems like a bug since all of my code blocks are :session. If I give permission to evaluate the :var argument, it will result in an error since the session hasn't been updated with the evaluations of other source blocks.

Thanks,
Anthony

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

* Re: org-export-babel-evaluate and header arguments
  2016-03-10  0:44 org-export-babel-evaluate and header arguments Anthony Cowley
@ 2016-03-10  3:25 ` Charles C. Berry
  2016-03-11  0:10   ` Anthony Cowley
  0 siblings, 1 reply; 4+ messages in thread
From: Charles C. Berry @ 2016-03-10  3:25 UTC (permalink / raw)
  To: Anthony Cowley; +Cc: emacs-orgmode

On Wed, 9 Mar 2016, Anthony Cowley wrote:

>
> If I have org-export-babel-evaluate set to nil, source blocks are not 
> evaluated on export. However, if a source block has a :var header 
> argument that calls another source block, I am prompted if the callee 
> should be evaluated.
>
> Given that the caller is not to be evaluated, I'm not sure I see a 
> reason for the :var to be evaluated.

What gives here is that `org-babel-get-src-block-info' needs to develop 
all the header arguments regardless of evaluation of the code block, so 
:var gets handled.

> Is there a way I can disable this argument evaluation?

Something like:

 	:var a=(and org-export-babel-evaluate (org-sbe "abc"))


See C-h f org-sbe RET

HTH,

Chuck

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

* Re: org-export-babel-evaluate and header arguments
  2016-03-10  3:25 ` Charles C. Berry
@ 2016-03-11  0:10   ` Anthony Cowley
  2016-03-11  3:30     ` Charles C. Berry
  0 siblings, 1 reply; 4+ messages in thread
From: Anthony Cowley @ 2016-03-11  0:10 UTC (permalink / raw)
  To: emacs-orgmode


Charles C. Berry writes:

> On Wed, 9 Mar 2016, Anthony Cowley wrote:
>
>>
>> If I have org-export-babel-evaluate set to nil, source blocks are not 
>> evaluated on export. However, if a source block has a :var header 
>> argument that calls another source block, I am prompted if the callee 
>> should be evaluated.
>>
>> Given that the caller is not to be evaluated, I'm not sure I see a 
>> reason for the :var to be evaluated.
>
> What gives here is that `org-babel-get-src-block-info' needs to develop 
> all the header arguments regardless of evaluation of the code block, so 
> :var gets handled.
>
>> Is there a way I can disable this argument evaluation?
>
> Something like:
>
>  	:var a=(and org-export-babel-evaluate (org-sbe "abc"))
>
>
> See C-h f org-sbe RET
>
> HTH,
>
> Chuck

Thanks for the tip, Chuck!

This works out very well with one minor caveat:

Setting org-export-babel-evaluate to nil means that C-c C-c no longer properly evaluates a block with such a header. This means that exporting must be enabled during development.

Other than that little quibble, I've gotten this to work in both tiny tests and with complicated, slow to evaluate documents, so I'm pleased.

A minor note about org-sbe documentation is that header arguments need not be in a table, but should simply be passed as a single string as the first argument to org-sbe. This is inferable from the documentation, but a bit oblique.

Anthony

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

* Re: org-export-babel-evaluate and header arguments
  2016-03-11  0:10   ` Anthony Cowley
@ 2016-03-11  3:30     ` Charles C. Berry
  0 siblings, 0 replies; 4+ messages in thread
From: Charles C. Berry @ 2016-03-11  3:30 UTC (permalink / raw)
  To: Anthony Cowley; +Cc: emacs-orgmode

On Thu, 10 Mar 2016, Anthony Cowley wrote:

>
> Charles C. Berry writes:
>
>> On Wed, 9 Mar 2016, Anthony Cowley wrote:
>>
>>>
>>> If I have org-export-babel-evaluate set to nil, source blocks are not
>>> evaluated on export. However, if a source block has a :var header
>>> argument that calls another source block, I am prompted if the callee
>>> should be evaluated.
[snip]
>>
>>> Is there a way I can disable this argument evaluation?
>>
>> Something like:
>>
>>  	:var a=(and org-export-babel-evaluate (org-sbe "abc"))

[snip]

>
> This works out very well with one minor caveat:
>
> Setting org-export-babel-evaluate to nil means that C-c C-c no longer 
> properly evaluates a block with such a header. This means that exporting 
> must be enabled during development.
>

Maybe you can get what you want by setting `:eval never-exports' for the 
buffer. See

 	(info "(org) exports")

 	(info "(org) Header arguments in Org mode properties")

HTH,

Chuck

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

end of thread, other threads:[~2016-03-11  3:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-10  0:44 org-export-babel-evaluate and header arguments Anthony Cowley
2016-03-10  3:25 ` Charles C. Berry
2016-03-11  0:10   ` Anthony Cowley
2016-03-11  3:30     ` Charles C. Berry

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