My problem is simple, I'm working in embedded systems with a RTOS named zephyr. To compile my projects I need some variables set in PATH and the problem is that when I run projectile-compile-project and the compilation mode windows are open, my compilation fail because the compilation mode doesn't see the PATH variable. How can I make my variables be seen in compilation mode?

I tried this in my init.el (I just see some solutions and this worked for some people, so I tried and it failed, I don't know exactly if this lines bring some problem):

(let ((path (shell-command-to-string ". ~/.bashrc; echo -n $PATH")))
   (setenv "PATH" path)
   (setq exec-path 
          (split-string-and-unquote path ":")

 (setenv "PATH"
    (getenv "PATH")))

I realized that if I open Emacs from terminal this problem doesn't occur. What can I do to this problem doesn't occur regardless of where I open Emacs?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.