Set path/exec-path to shell path

For .dir-locals.el to find the custom programs
This commit is contained in:
Laurens Miers 2024-09-14 08:37:47 +02:00
parent 12b33b1f49
commit 832bc40d81

View file

@ -622,3 +622,16 @@ https://github.com/remyferre/comment-dwim-2
)
)
#+END_SRC
** Set path to shell path
#+BEGIN_SRC emacs-lisp
(defun set-exec-path-from-shell-PATH ()
(let ((path-from-shell
(replace-regexp-in-string "[[:space:]\n]*$" ""
(shell-command-to-string "$SHELL -l -c 'echo $PATH'"))))
(setenv "PATH" path-from-shell)
(setq exec-path (split-string path-from-shell path-separator))))
(set-exec-path-from-shell-PATH)
#+END_SRC