emacs-orgmode
[Top][All Lists]
Advanced

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

Question regarding org-babel-eval and ob-erlang


From: Zelphir Kaltstahl
Subject: Question regarding org-babel-eval and ob-erlang
Date: Sat, 24 Aug 2024 19:18:34 +0000

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 via email to

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