emacs-devel
[Top][All Lists]
Advanced

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

Creating and accessing environmental variables


From: the_wurfkreuz
Subject: Creating and accessing environmental variables
Date: Sun, 08 Dec 2024 18:27:19 +0000

Is it possible to set environment variables and access them immediately without reloading the Emacs configuration (like using the load-file function)?

For instance, when I evaluate this code to set the PATH variable:

(let ((paths '("/some/path"
              "/some/path/2")))
  ;; (setq exec-path (append paths exec-path))
  (setenv "PATH" (concat (string-join paths ":")
                        ":"
                        (getenv "PATH"))))

And then try to launch eshell in the current Emacs session, I find that the new values aren't appended. The only way to set them is to put the code into a config file and reload it through (load-file "~/.emacs.d/init.el").

reply via email to

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