emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Berry, Charles" <ccberry@ucsd.edu>
To: Vikas Rawal <vikaslists@agrarianresearch.org>
Cc: org-mode mailing list <emacs-orgmode@gnu.org>,
	Nicolas Goaziou <mail@nicolasgoaziou.fr>
Subject: Re: "header-args :eval inline-only" not working
Date: Sat, 19 Aug 2017 22:10:35 +0000	[thread overview]
Message-ID: <A7EF0C13-A13B-405B-A87D-24D572C5391D@ucsd.edu> (raw)
In-Reply-To: <672780F6-F156-4D48-8774-3E449FF4EA5B@agrarianresearch.org>


> On Aug 19, 2017, at 1:36 PM, Vikas Rawal <vikaslists@agrarianresearch.org> wrote:
> 
> 
>> On 20-Aug-2017, at 12:57 AM, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
>> 
>> Hello,
>> 
>> Vikas Rawal <vikaslists@agrarianresearch.org> writes:
>> 
>>> My org-version (latest on org ELPA) is: Org mode version 9.0.9 (9.0.9-82-gb862c2-elpa @ /Users/vikas/.emacs.d/elpa/org-20170814/)
>>> 
>>> The following is not working: 
>>> 
>>> #+PROPERTY: header-args :eval inline-only
>>> 
>>> ":eval never-export” works; but ":eval inline-only" does not.
>> 
>> What is "not working”?
> 
> ":eval inline-only" has no effect. It still tries to evaluate all code blocks.
> 
> 
>>> I can deal with this by globally changing the option using:
>>> 
>>> (org-export-babel-evaluate (quote inline-only))
>>> 
>>> But this creates another problem. After this, org does not respect “:exports results” and exports both the code and results.
>> 
>> Could you provide an ECM?
> 
> Please see the attached file.

Which contains:

#+PROPERTY: header-args :session nss70 :eval inline-only
#+macro: getcell src_emacs-lisp[:results value raw]{(org-table-get-remote-range "$1" "$2")}
#+macro: roundnum src_emacs-lisp[:results value raw]{(round (string-to-number (org-table-get-remote-range "$1" "$2")))}


> 
> When I export this, it still tries to evaluate the code block ind1_t2_hhd_code. If I use (org-export-babel-evaluate (quote inline-only)), it does not evaluate  ind1_t2_hhd_code code block but it exports both the code and the output.
> 



The first problem is that you have babel code *inside* a macro.  Since macros are run after babel executes, nothing will happen.

Next, there is no `:eval inline-only'.  That seem to work only because only the negative cases are checked. i.e. it is the same as `:eval yes' or even  `:eval yes-please-and-thank-you'.

Instead of a macro containing babel, you can use `call_whatnot(a,b)' statements for inline execution, where a src block named `whatnot' handles the desired computations.  You can execute these in advance of exporting and specify `:eval never-export'.

HTH,

Chuck

p.s. I did not see a bug.  


  reply	other threads:[~2017-08-19 22:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-19 16:36 "header-args :eval inline-only" not working Vikas Rawal
2017-08-19 19:27 ` Nicolas Goaziou
2017-08-19 20:36   ` Vikas Rawal
2017-08-19 22:10     ` Berry, Charles [this message]
2017-08-20  1:10       ` Vikas Rawal
2017-08-20  2:07         ` Berry, Charles
2017-08-20  2:24           ` Vikas Rawal
2017-08-20  2:43             ` Berry, Charles
2017-08-20  3:26               ` Vikas Rawal
2017-08-20 10:21                 ` Nicolas Goaziou
2017-08-20 12:41                   ` Vikas Rawal
2017-08-20 16:51                   ` Berry, Charles
2017-08-26  8:34                     ` Nicolas Goaziou

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=A7EF0C13-A13B-405B-A87D-24D572C5391D@ucsd.edu \
    --to=ccberry@ucsd.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    --cc=vikaslists@agrarianresearch.org \
    /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).