tpapp / julia-repl

Run an inferior Julia REPL in a terminal inside Emacs
Other
169 stars 35 forks source link

Not using exec-path #117

Closed yashi closed 2 years ago

yashi commented 2 years ago

Julia-repl doesn't seem to use exec-path. I know Julia-repl has julia-repl-executable-records and pass "julia" (or any other name) to make-term or via veterm-shell to vterm, but would it be nice to convert the executable name to absolute path by using exec-path before passing down to the backends?

https://www.gnu.org/software/emacs/manual/html_node/elisp/Subprocess-Creation.html

User Option: exec-path

The value of this variable is a list of directories to search for programs to run in subprocesses. Each element is either the name of a directory (i.e., a string), or nil, which stands for the default directory (which is the value of default-directory). *Note executable-find: Locating Files, for the details of this search.

The value of exec-path is used by call-process and start-process when the PROGRAM argument is not an absolute file name. :

tpapp commented 2 years ago

I am not sure what the issue is --- you can give a full path in julia-repl-executable-records.

In any case, the manual page you linked says

Generally, you should not modify exec-path directly. Instead, ensure that your PATH environment variable is set appropriately before starting Emacs. Trying to modify exec-path independently of PATH can lead to confusing results.

Why not just set PATH?

yashi commented 2 years ago

The issue is inconsistency.

I know I can workaround with julia-repl-executable-records. I'm just saying that it's inconsistent with other Emacs packages using call-process and start-process. I also feel that "have an absolute path" isn't a good solution. If it was, we won't have expand-file-name in Emacs but force everybody to write an absolute path.

Regarding PATH. I know I can also workaround by setting PATH and then start Emacs from that process. In multi-init and virtual / container era, it's not simple as editing ~/.profile but could be ~/.pam_environment or any other file. Having one init.el for multiple environments is a good to have.

yashi commented 2 years ago

this is closed by #118