Skip to main content
Share Your Experience: Take the 2024 Developer Survey
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 ...
npostavs's user avatar
  • 9,203
8 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 ...
Jim Parker's user avatar
6 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 ...
xuchunyang's user avatar
  • 14.6k
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....
db48x's user avatar
  • 18.2k
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.
Chillar Anand's user avatar
3 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 ...
zaile's user avatar
  • 463
3 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 ...
Tobias's user avatar
  • 33.2k
3 votes
Accepted

Emacs - Path to Python interpreter

(setq exec-path (append exec-path '("d:/Python36/")))
eflanigan00's user avatar
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 ...
tmalsburg's user avatar
  • 2,570
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 ...
npostavs's user avatar
  • 9,203
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" "--...
Ted Lemon's user avatar
2 votes

exec-path and $PATH

I tested the following solution on Mac 12.4. It works. https://www.emacswiki.org/emacs/ExecPath (defun set-exec-path-from-shell-PATH () "Set up Emacs' `exec-path' and PATH environment variable ...
Frank Wu's user avatar
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. ...
Nutritioustim's user avatar
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 ...
xuchunyang's user avatar
  • 14.6k
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 :)
syohey's user avatar
  • 21
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-...
glucas's user avatar
  • 20.6k
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 ...
lawlist's user avatar
  • 19.2k
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://...
mmmmmm's user avatar
  • 525
2 votes
Accepted

Accept default in ivy filename prompt

Use ivy-immediate-done (defaults to C-M-j) without entering any text to use the default value.
xeruf's user avatar
  • 354
2 votes

Is there some Emacs command that behaves as readlink -f to print the full path of a especific file?

I think you're looking for file-truename which also does an expand in default-directory unless the input filename is absolute.
Andy's user avatar
  • 21
2 votes
Accepted

How to add miktex pdflatex to PATH

I don't see it added to the PATH It is because exec-path is a variable in the Emacs Lisp world. C-h v exec-path: a variable defined in ‘C source code’. Whereas PATH is not a concept from Lisp. ...
shynur's user avatar
  • 5,318
2 votes
Accepted

Pointing Emacs to LaTeX under zsh (for org-latex-export-to-pdf)

Try this: (setenv "PATH" (concat "/Library/TeX/texbin/latexmk/" path-separator (getenv "PATH"))) Perhaps PATH can be inherited from Emacs when ...
shynur's user avatar
  • 5,318
1 vote
Accepted

How to set env values for eshell in emacs on macOS?

The init file ~/.emacs.d/init.el seems to be at the wrong place. It's better be at the home folder which is ~/ Besides, the code to inject the PATH contents into emacs seems wrong. So, comment them ...
Terry's user avatar
  • 370
1 vote
Accepted

Why can't Emacs find gfortran on my Mac?

As mentioned by @JeanPierre , the problem was because the location of gfortran was not added to the PATH environment variable for the emacs shell. Thus the shell did not know where to look to find the ...
Tian's user avatar
  • 288
1 vote
Accepted

Emacs installed with the Ubuntu application manager runs but isn't in the $PATH. Where is it?

On Ubuntu 18.04, the emacs package is a meta-package. If we look at it's dependancies... ❯ apt-cache show emacs |grep Depends Depends: emacs-gtk (>= 1:26.1) | emacs-lucid (>= 1:26.1) | emacs-...
nega's user avatar
  • 3,276
1 vote

Windows 10 native (spac)emacs install can't call cygwin binary (ledger) with proper path passed

I don't use ledger-mode but I am pretty sure that the following advice-add will help you. The code is only partially tested (up to make-process in ledger-flymake). Please test whether it is working ...
Tobias's user avatar
  • 33.2k
1 vote

Windows 10 native (spac)emacs install can't call cygwin binary (ledger) with proper path passed

The path you passed (c:/Users/USERNAME/Dropbox/Priv/2018.ledger) is not a valid cygwin file-path, it is a MS-windows file-path: It will look like a relative file-path to cygwin, so will be appended ...
ctrl-alt-delor's user avatar
1 vote
Accepted

Where is emacs powershell getting this PATH variable from?

The cause of this problem was hinted to me by eli-zaretskii over on reddit (link to the post here). It turns out that when spacemacs loads for the first time it creates a file .spacemacs.env in your ...
Oliver Marshall's user avatar
1 vote

How do I use a Python library in emacs?

require(epc) in the stack trace indicates that epc.el is not found in your Emacs load-path variable. You'll probably want to do something like: (add-to-list 'load-path "/path/to/directory") for the ...
phils's user avatar
  • 51.5k

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