Hot answers tagged

38 votes
Accepted

exec-path and $PATH

1) PATH and exec-path Emacs does set exec-path from the value of PATH on startup, but will not look at it again later. But if you run a command, it will inherit PATH, not exec-path, so subprocesses ...
26 votes

Emacs and command line $PATH disagreements on OSX

You can also install exec-path-from-shell package and add this to your init file: (exec-path-from-shell-initialize)
  • 431
23 votes
Accepted

Using conda environments in emacs

I'd suggest using pyvenv library, it provides a neat interface to selecting a virtual env among several alternatives updating interpreter and library paths. You will need to alter WORKON_HOME variable ...
  • 524
10 votes
Accepted

Emacs and command line $PATH disagreements on OSX

This is an OSX annoying environment issue, the $PATH appearing in Emacs is coming from /etc/paths file, which then gets appended with whatever I've set in the shell. I added /Users/g/Library/Haskell/...
10 votes
Accepted

GUI Emacs sets the exec-path only from Windows environment variable but not from .emacs file

PATH vs exec-path The PATH environment variable lists directories for programs to find executable files (when executing a non-absolute filename). The exec-path Emacs variable lists directories for ...
  • 8,853
9 votes
Accepted

M-x shell doesn't know about installed apps

Well, as @dshepherd mentioned, you are missing /usr/local/bin in PATH. git is working probably only because there is symlink in /bin. Try export PATH=$PATH:/usr/local/bin in emacs terminal. You can ...
  • 278
9 votes

exec-path and $PATH

When emacs starts a new external process using primitive functions such as call-process or start-process, the executable is searched in exec-path (and not $PATH) However, a function such as shell-...
8 votes

How do I make tramp+eshell use my environment customized in the remote ~/.bash_profile

This question has been already answered by rekado (thanks!) (as a reply to another more general question about eshell): You can configure TRAMP to respect the PATH variable on the remote machine (...
6 votes

Emacs and command line $PATH disagreements on OSX

If you start emacs from your GUI environment (gnome, kde, ...) your shell startup scripts will not be sourced into your environment. So the $PATH that you carefully set in your .zsh will not be loaded....
6 votes
Accepted

Set variables based on path without using directory-local variables

Directory-local variables were actually designed for this use case as well. Read the docs, especially at the end, where it discusses dir-locals-set-directory-class. The idea here is that you can ...
6 votes
Accepted

Who is "juergen" and why can I see the value of his exec-path?

It does sound like this was caused by the user who originally built the binary for you. If they didn't do so in some sort of stripped down environment then this would happen. You might want to report ...
6 votes

Using conda environments in emacs

I have recently incorporated Anaconda into my python development and was having similar problems setting up Emacs + flycheck + linters. This answer got me up and running, but I've modified it, since ...
4 votes

Why is exec-path different in emacsclient / emacsserver than in emacs?

exec_path is initialized from the EMACSPATH and PATH environment variables. Emacs also adds the directory containing the emacs binary to the end. This is done at startup by init_callproc_1 in callproc....
  • 12.6k
4 votes

Package `exec-path-from-shell` isn't setting PATH variables from `.zshenv` on MacOS

You should remove :defer f, because you don't want exec-path-from-shell to be defer loaded and you are going to use function from it when Emacs starts. Try something like the following (use-package ...
  • 13.8k
4 votes

Emacs - Path to Python interpreter

python-shell-interpreter is the variable you are looking for. You can set it using (setq python-shell-interpreter "D:\Python36") Add this to your .emacs and reload python process.
3 votes

Emacs and command line $PATH disagreements on OSX

Another way to accomplish this is to simply tell the shell that it's a login shell so that it sources all of the right files. I do this for bash by setting explicit-bash-args to ("--noediting" "--...
3 votes
Accepted

Emacs - Path to Python interpreter

(setq exec-path (append exec-path '("d:/Python36/")))
3 votes
Accepted

Convert a MS Windows path to short filename / 8.3 filename / SFN

The Windows build of Emacs provides a function for this, w32-short-file-name. (w32-short-file-name "C:/path with space (and parens)/") ; => "c:/PATHWI~1/"` w32-short-file-name is a built-in ...
  • 8,853
3 votes

How can I find the path of files in an (m)elpa package?

One (imperfect) solution is to use find-function-library. Given a function, this returns a pair (ORIG-FUNCTION . LIBRARY). Quote from the documentation: ORIG-FUNCTION is the original name, after ...
  • 2,480
3 votes

Emacs and command line $PATH disagreements on OSX

If some part of the PATH gets lost then you can add it in your ~/.emacs ;;; We add /path/to/something/extra by appending it to the path (setenv "PATH" (concat (getenv "PATH") ":/path/to/something/...
  • 183
2 votes

How to set PATH variable to latex, so that I can use latex layer?

Try adding (setenv "PATH" "/usr/local/bin:/Library/TeX/texbin/:$PATH" t) to your .emacs :)
  • 21
2 votes
Accepted

How can I find the path of files in an (m)elpa package?

(defvar guess-language-data-dir (expand-file-name "trigrams" (file-name-directory (or load-file-name buffer-file-name)))) load-file-name is set when the ...
  • 13.8k
2 votes

Bookmarks across different computers

It looks like the relevant bookmark function is bookmark-get-filename. You could advise this to expand or otherwise transform the path. For example, add some 'filter return' advice to call expand-...
  • 19.5k
2 votes
Accepted

How to get Exec-path-from-shell working in Spacemacs

Ok, solved this one. It turns out that there was an export PATH in my .bashrc (as well as .bash-profile). exec-path-from-shell doesn't like this, and only wants that export to happen in .bash-profile. ...
2 votes

two versions of emacs on mac osx - where are they

It is one question per customer / thread ... As to the first question, the great thing about Emacs from https://emacsformacosx.com/ is that it is a self-contained installation. The executable is ...
  • 18k
2 votes

ModuleNotFound for absolute imports in Emac's Python Repl

So it appears that emacs' built in python mode, at least as of 24.3, is now python.el rather than python-mode.el. This new version of python-mode for emacs does not, by default, remove the current ...
  • 423
2 votes

set paths in init file taking OS into account

The setting (setq feeds-file (expand-file-name "notes.org" org-directory )) is perfect for emacs internal usage. It gives "D:/my_data/notes.org" with forward-slashes. The relevant section of the ...
  • 30.8k
2 votes
Accepted

Can lisp code executed via (load ...) access it's own file path?

Yes The variable load-file-name https://www.gnu.org/software/emacs/manual/html_node/elisp/How-Programs-Do-Loading.html contains the name of the file that is being loaded. or buffer-file-name https://...
  • 319
1 vote

How to change the face of org-display-outline-path in echo area?

An answer to the point : turn off displaying any outline path in the echo area. Encountered the same problem : that behaviour appeared after changing the distribution from org to org-plus-contrib (...
  • 26

Only top scored, non community-wiki answers of a minimum length are eligible