emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Zelphir Kaltstahl <zelphirkaltstahl@posteo.de>
To: Org Mode List <emacs-orgmode@gnu.org>
Subject: Question regarding org-babel-eval and ob-erlang
Date: Sat, 24 Aug 2024 19:18:34 +0000	[thread overview]
Message-ID: <d9faf0a7-04d9-46c1-ad52-211b3fa6ec69@posteo.de> (raw)

Hello!

I have questions regarding `org-babel-eval'. Does `org-babel-eval' take into 
account the `PATH' or `exec-path' variables, when searching for 
executables/binaries to run source blocks?

More specifically in my experiments with `ob-erlang' it seems not to pick 
up/find binaries, which are in the first directory on the `PATH' and Emacs 
variable `exec-path'. `ob-erlang' calls `org-babel-eval' at 
https://github.com/xfwduke/ob-erlang/blob/a029c23902b4ad73b84f262a7fc5b98d87b63dfd/ob-erlang.el#L63-L68. 
That is how I came to `org-babel-eval'.

I am trying to get `ob-erlang' to work with an `emacs' and an `erlang' installed 
inside a guix profile. There is a repository, where I have a kind of example: 
https://codeberg.org/ZelphirKaltstahl/learn-you-some-erlang-workthrough/src/commit/daa84469286c05c9c4854c71e34f26b42da7b7c1. 
The readme has instructions of how I create a guix profile and in the following 
github issue of `ob-erlang' I describe my finding: 
https://github.com/xfwduke/ob-erlang/issues/1.

In short: Even though a directory `guix-profile/bin' is the first thing on the 
`PATH' and `exec-path' of Emacs, `org-babel-eval' does not seem to find `erlc' 
and `erl'.

What more do I need to do, in order to make org-babel find the Erlang executables?

Or is this a fault in `ob-erlang' and it shouldn't call `org-babel-eval' like that?

I see in the source code of org-mode, that `org-babel-eval' calls 
`org-babel--shell-command-on-region', but I failed to identify so far, where the 
portions of the code are, that are responsible for looking up binaries on the 
`PATH' directories.

I would like to create a merge request for `ob-erlang', fixing this behavior, 
possibly introducing a new defcustom, as someone mentioned in the above linked 
issue. I found the part where "erl" is in the code of `ob-erlang', but now I 
don't know how to proceed and whether it is really necessary, or there is a 
simple solution to make org-babel find the binaries on the `PATH' or `exec-path'.

My goal is to make the project self-contained. I do not want to install Erlang 
system-wide and hard-code `PATH' or similar things. I intentionally use guix 
profile to have things local in the project directory. I am using guix profile 
instead of guix shell, in order to have a predictable bin directory, that I can 
add to `PATH'.

Best regards,
Zelphir

-- 
repositories: https://notabug.org/ZelphirKaltstahl, https://codeberg.org/ZelphirKaltstahl



             reply	other threads:[~2024-08-24 19:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-24 19:18 Zelphir Kaltstahl [this message]
2024-08-31 18:38 ` Question regarding org-babel-eval and ob-erlang Ihor Radchenko

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=d9faf0a7-04d9-46c1-ad52-211b3fa6ec69@posteo.de \
    --to=zelphirkaltstahl@posteo.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).