aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuchen Pei <id@ypei.org>2025-01-24 09:46:29 +1100
committerYuchen Pei <id@ypei.org>2025-01-24 09:46:29 +1100
commitd517e2b4b6f036f1d38142c4adc80d229404fc4c (patch)
treeba218347827d09ddbfe8ed973fbb786c5d22ec19
parent589d5daea2910facb5cde4a23f139a9db76dbcfb (diff)
[emacs] Expand env vars in exec-path
-rw-r--r--emacs/.emacs.d/init/ycp-basic.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/emacs/.emacs.d/init/ycp-basic.el b/emacs/.emacs.d/init/ycp-basic.el
index 6baf1b8..cb097e7 100644
--- a/emacs/.emacs.d/init/ycp-basic.el
+++ b/emacs/.emacs.d/init/ycp-basic.el
@@ -27,6 +27,12 @@
;;; Code:
+;;; If started from systemd, emacs treats env variables inside env
+;;; variables as literal. e.g. if we have
+;;; Environment=PATH=$HOME/.local/bin:$HOME/bin
+;;; emacs will set exec-path to be literally
+;;; $HOME/.local/bin:$HOME/bin, without expanding $HOME.
+(setq exec-path (seq-map 'substitute-in-file-name exec-path))
(my-configure
(my-keybind global-map