emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* eval with :dir in included file
@ 2023-07-07 15:36 Dominique Dumont
  2023-07-07 15:44 ` Ihor Radchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Dominique Dumont @ 2023-07-07 15:36 UTC (permalink / raw)
  To: emacs-orgmode

Hi

I have a file with this code block:

~~~ file terraform-admin.org

** Retrieve public IPs
:PROPERTIES:
:CUSTOM_ID: retrieve-public-ips
:END:

#+begin_src shell :results verbatim :dir "stacks/public-ips" :exports both
terragrunt output ips
#+end_src

~~~

Exporting this file works fine.

I have another file which imports the file above:

~~~
#+include: "../../../infra-terraform/terraform-admin.org::#retrieve-public-ips" :only-contents 	t
~~~

Here the export fails with this (slightly edited) error:

process-file: Setting current directory: No such file or directory, /home/domi/Documentation/admin/stacks/public-ips/

Indeed this directory does not exist: org-mode is looking for "stacks/public-ips" directory in the wrong place, i.e. org-mode
is starting to search "stacks/public-ips" from the *including* file.

Is there a way to tell org-mode to search "stacks/public-ips" directory starting from the directory of the *included* file ? 

All the best

Dominique






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

* Re: eval with :dir in included file
  2023-07-07 15:36 eval with :dir in included file Dominique Dumont
@ 2023-07-07 15:44 ` Ihor Radchenko
  2023-07-19 10:10   ` Dominique Dumont
  0 siblings, 1 reply; 3+ messages in thread
From: Ihor Radchenko @ 2023-07-07 15:44 UTC (permalink / raw)
  To: Dominique Dumont; +Cc: emacs-orgmode

Dominique Dumont <dominique.dumont@netc.fr> writes:

> Is there a way to tell org-mode to search "stacks/public-ips" directory starting from the directory of the *included* file ? 

No, currently.
We do something similar in `org-export--update-included-link', but not
for :dir.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: eval with :dir in included file
  2023-07-07 15:44 ` Ihor Radchenko
@ 2023-07-19 10:10   ` Dominique Dumont
  0 siblings, 0 replies; 3+ messages in thread
From: Dominique Dumont @ 2023-07-19 10:10 UTC (permalink / raw)
  To: emacs-orgmode

On Friday, 7 July 2023 17:44:10 CEST Ihor Radchenko wrote:
> No, currently.
> We do something similar in `org-export--update-included-link', but not
> for :dir.

Thanks for the quick answer.

FTR, I'm now using ':eval never-export' [1] to workaround this issue.

All the best

[1] https://orgmode.org/manual/Evaluating-Code-Blocks.html







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

end of thread, other threads:[~2023-07-19 10:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-07 15:36 eval with :dir in included file Dominique Dumont
2023-07-07 15:44 ` Ihor Radchenko
2023-07-19 10:10   ` Dominique Dumont

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