aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2005-05-11 16:24:55 +0000
committerStefan Monnier <[email protected]>2005-05-11 16:24:55 +0000
commitc3f6aa2088306361718a65f26f767f333393ea8c (patch)
tree433a2255c4607e141f7298c36e30e400921efe7c
parentb71813cb9a4a74f5b2e06e50b0782cb7223f2045 (diff)
(executable-find): Move from executable.el. Use locate-file.
-rw-r--r--lisp/files.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/files.el b/lisp/files.el
index fa6d91fa42..99847b2f3f 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -676,6 +676,13 @@ PATH-AND-SUFFIXES is a pair of lists (DIRECTORIES . SUFFIXES)."
((null action) (try-completion string names))
(t (test-completion string names))))))
+(defun executable-find (command)
+ "Search for COMMAND in `exec-path' and return the absolute file name.
+Return nil if COMMAND is not found anywhere in `exec-path'."
+ ;; Use 1 rather than file-executable-p to better match the behavior of
+ ;; call-process.
+ (locate-file command exec-path exec-suffixes 1))
+
(defun load-library (library)
"Load the library named LIBRARY.
This is an interface to the function `load'."
@@ -4855,5 +4862,5 @@ With prefix arg, silently save all file-visiting buffers, then kill."
(define-key ctl-x-5-map "\C-f" 'find-file-other-frame)
(define-key ctl-x-5-map "r" 'find-file-read-only-other-frame)
-;;; arch-tag: bc68d3ea-19ca-468b-aac6-3a4a7766101f
+;; arch-tag: bc68d3ea-19ca-468b-aac6-3a4a7766101f
;;; files.el ends here