Fix #4478: backport exec-path function from 27.1

This commit is contained in:
Henrik Lissner 2021-01-03 17:40:33 -05:00
parent 6970903a43
commit c987794884
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -653,5 +653,18 @@ REMOTE is non-nil, search on the remote host indicated by
(file-name-quote default-directory))))
(locate-file command exec-path exec-suffixes 1)))))
(unless (fboundp 'exec-path)
;; DEPRECATED Backported from Emacs 27.1
(defun exec-path ()
"Return list of directories to search programs to run in remote subprocesses.
The remote host is identified by `default-directory'. For remote
hosts that do not support subprocesses, this returns `nil'.
If `default-directory' is a local directory, this function returns
the value of the variable `exec-path'."
(let ((handler (find-file-name-handler default-directory 'exec-path)))
(if handler
(funcall handler 'exec-path)
exec-path))))
(provide 'core-lib)
;;; core-lib.el ends here