aboutsummaryrefslogtreecommitdiffhomepage
path: root/generic
diff options
context:
space:
mode:
authorGravatar David Aspinall <da@inf.ed.ac.uk>2000-09-08 13:31:43 +0000
committerGravatar David Aspinall <da@inf.ed.ac.uk>2000-09-08 13:31:43 +0000
commitf6025d255d134932d75b6dd4d777a4dcd67a1027 (patch)
tree4adef0941db475e31e292956c53da985522bc7ae /generic
parent10f195216526bd8fc993527d95b0534c5a4f62c7 (diff)
ADded proof-locate-executable.
Diffstat (limited to 'generic')
-rw-r--r--generic/proof-utils.el21
1 files changed, 21 insertions, 0 deletions
diff --git a/generic/proof-utils.el b/generic/proof-utils.el
index db1355d7..55842ab0 100644
--- a/generic/proof-utils.el
+++ b/generic/proof-utils.el
@@ -602,6 +602,27 @@ The name of the defined function is returned."
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
+;; Finding executables
+;;
+
+(defun proof-locate-executable (progname &optional returnnopath)
+ ;; XEmacs can search the paths for us. Probably FSF Emacs is too
+ ;; daft to provide a useful function to do that, and I don't have
+ ;; the time to waste writing one or trying to find one.
+ "Search for PROGNAME on PATH. Return the full path to PROGNAME, or nil.
+If RETURNNOPATH is non-nil, return PROGNAME even if we can't find a full path."
+ (or (and
+ (fboundp 'locate-file)
+ (locate-file progname
+ (split-path (getenv "PATH"))
+ (if proof-running-on-win32 '(".exe"))
+ 1))
+ (and
+ returnnopath
+ progname)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
;; Stuff for developing PG, not needed for ordinary users really.
;; [Could consider moving this to a new file `proof-devel.el']
;;