emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: #+include from same file when exporting


From: Nicolas Goaziou
Subject: Re: #+include from same file when exporting
Date: Tue, 13 Oct 2020 21:51:53 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Hello,

edgar@openmail.cc writes:

> My comment for today is that I have something like this:
>
> this-file.org
> ..............................
> * Fancy header 1
>
> #+NAME: blk1
> #+begin_src python
>
>    import numpy as np #+end_src
>
> ** Fancy subheader 2
>
> Res 1
>
> #+include: "this-file.org::blk1"
>
> Res 2
>
> #+include: "this-file.org::blk1" src python
>
> Res 3
>
> #+include: "./this-file.org::blk1" src python
> .............................. end

[...]

> I think that all of them should just export the python block, right?

I don't think so.

  #+include: file src python

means that file is really a python file, whose contents are going to be
enclosed in a Python source code block. So Res 2 and Res 3 are not
meaningful in that case; you cannot apply link search syntax to non-Org
files.

> Also, I think that it would be very useful to have something like this:
>
> another-file.org
> ..............................
> * Fancy header 1
>
> #+NAME: blk1
> #+begin_src python :exports none
>
>    print(2) #+end_src
>
> #+RESULTS: : 2
>
> ** Fancy subheader 2
>
> Res 1
>
> #+include: "this-file.org::blk1" src python :exports both
> .............................. end
>
>
> Which would allow to have the =#+include= override the =:exports= 
> directive from the original block and get the results from the block. 

"Include" is an export-only directive, which is not the case
of :exports. They live in two different worlds, and I think it is a good
thing to keep them orthogonal.

You may be looking after Babel calls.

Regards,
-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]