emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ista Zahn <istazahn@gmail.com>
To: Andreas Leha <andreas.leha@med.uni-goettingen.de>
Cc: emacs-orgmode Mailinglist <emacs-orgmode@gnu.org>
Subject: Re: Evaluating inline source blocks on export issue
Date: Thu, 24 Jul 2014 21:53:26 -0400	[thread overview]
Message-ID: <CA+vqiLEJuAwUeVcJdhjKQBf0H8msgv01v6mP8Tth4Ypi=-5qQA@mail.gmail.com> (raw)
In-Reply-To: <olua97zt660.fsf@med.uni-goettingen.de>

On Thu, Jul 24, 2014 at 6:14 AM, Andreas Leha
<andreas.leha@med.uni-goettingen.de> wrote:
> Nick Dokos <ndokos@gmail.com> writes:
>
>> Grant Rettke <gcr@wisdomandwonder.com> writes:
>>
>>> Thanks for looking Thomas and Nick.
>>>
>>> When I set this and export
>>>
>>> ,----
>>> | (setq org-export-babel-evaluate t)
>>> `----
>>>
>>> I get the expected result of
>>>
>>> ,----
>>> | Here is a `16', stuck in the middle of some prose.
>>> `----
>>>
>>> But when I do this and export
>>>
>>> ,----
>>> | (setq org-export-babel-evaluate 'inline-only)
>>> `----
>>>
>>> I get this output which is not what I expected
>>>
>>> ,----
>>> | Here is a , stuck in the middle of some prose.
>>> `----
>>>
>>> I thought that I was enabling inline code block execution correctly
>>> and making the inline call correctly.
>>>
>>> How does it look should it be doing what I had wanted?
>>>
>>
>> I don't think you can: the `type' (see below) of the inline code is not
>> `inline' as one might think at first, but `lob', presumably because
>> call_foo is defined in the library-of-babel.
>>
>> The relevant code is in ob-exp.el:org-babel-exp-results:
>>
>> ,----
>> |   ...
>> |   (when (and (or (eq org-export-babel-evaluate t)
>> |              (and (eq type 'inline)
>> |                   (eq org-export-babel-evaluate 'inline-only)))
>> |          (not (and hash (equal hash (org-babel-current-result-hash)))))
>> |   ...
>> `----
>
> Then I would like to turn this into a feature request:  Enable
> inline-block-specific settings.

I'm not sure if this solves your problem, but

--8<---------------cut here---------------start------------->8---
 #+name: squareFun
 #+begin_src emacs-lisp :exports none
   (defun square (it) (* it it))
 #+end_src

 #+RESULTS: squareFun
 : square

Here is a src_emacs-lisp{(square 10)}, from an inline source block.
--8<---------------cut here---------------end--------------->8---

does work with org-export-babel-evaluate set to 'inline-only. You do
have to evaluate the squareFun block before exporting.

Best,
Ista



>
> This does not only hold for the evaluation, but also for default header
> arguments.  Different settings for inline code are quite useful.  I do
> have to specify [:results raw] on the block-to-block basis quite a lot
> and would benefit a lot from global inline-specific settings.
>
> As always, point me to the way to do it, if (quite likely) this is
> possible already.
>
> Regards,
> Andreas
>
>

  reply	other threads:[~2014-07-25  1:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-23  1:50 Evaluating inline source blocks on export issue Grant Rettke
2014-07-23  2:39 ` Thomas S. Dye
2014-07-23 12:43 ` Nick Dokos
2014-07-23 13:20   ` Grant Rettke
2014-07-24  1:24     ` Nick Dokos
2014-07-24 10:14       ` Andreas Leha
2014-07-25  1:53         ` Ista Zahn [this message]
2014-07-25 18:01           ` Grant Rettke

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='CA+vqiLEJuAwUeVcJdhjKQBf0H8msgv01v6mP8Tth4Ypi=-5qQA@mail.gmail.com' \
    --to=istazahn@gmail.com \
    --cc=andreas.leha@med.uni-goettingen.de \
    --cc=emacs-orgmode@gnu.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).