Skip to content

Instantly share code, notes, and snippets.

@hara-y-u
Created March 2, 2012 09:00
Show Gist options
  • Save hara-y-u/1957008 to your computer and use it in GitHub Desktop.
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.
;; 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)))
@hara-y-u
Copy link
Author

hara-y-u commented Apr 6, 2012

shell-command-to-string という関数を見つけたのでそれを使うように変更した

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment