From c9877948848c1560b89443989b4cdf2f620dacc3 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 3 Jan 2021 17:40:33 -0500 Subject: [PATCH] Fix #4478: backport exec-path function from 27.1 --- core/core-lib.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/core-lib.el b/core/core-lib.el index 2a43c2407..783fb5fa8 100644 --- a/core/core-lib.el +++ b/core/core-lib.el @@ -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