Created
March 2, 2012 09:00
-
-
Save hara-y-u/1957008 to your computer and use it in GitHub Desktop.
Set path correctly even when Emacs has opened from desktop entry.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; When opened from Desktep entry, PATH won't be set to shell's value. | |
(let ((path-str | |
(replace-regexp-in-string | |
"\n+$" "" (shell-command-to-string "echo $PATH")))) | |
(setenv "PATH" path-str) | |
(setq exec-path (nconc (split-string path-str ":") exec-path))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
shell-command-to-string という関数を見つけたのでそれを使うように変更した