How to make Emacs use my .bashrc file?
问题 I need to use my $PATH in Emacs to run some commands. How can I make Emacs use it? I installed Emacs from Ubuntu repositories. 回答1: Here's a trick I use to ensure my GUI Emacs always sees the same $PATH that I get inside a shell: (defun set-exec-path-from-shell-PATH () (let ((path-from-shell (replace-regexp-in-string "[ \t\n]*$" "" (shell-command-to-string "$SHELL --login -i -c 'echo $PATH'")))) (setenv "PATH" path-from-shell) (setq eshell-path-env path-from-shell) ; for eshell users (setq