Elisp: exec-path, External Program Search Paths

By Xah Lee. Date: . Last updated: .

exec-path

exec-path

List of dir paths to search external programs. An element may be nil, it means default-directory.

By default the last element of this list is exec-directory (the emacs bin dir.) .

Emacs uses exec-path to find executable binary programs.

For example,

By default, emacs copies the value of (getenv "PATH") to exec-path. So, their values should be identical.

Here's a example of setting exec-path:

(when (eq system-type 'windows-nt) (push (expand-file-name "~/bin/oxipng/") exec-path))

Difference between exec-path and PATH

The value of (getenv "PATH") and exec-path do not need to be the same.

Emacs Lisp, Call Shell Command

Emacs Lisp, Get Version, OS Type, System Info, etc