From f6025d255d134932d75b6dd4d777a4dcd67a1027 Mon Sep 17 00:00:00 2001 From: David Aspinall Date: Fri, 8 Sep 2000 13:31:43 +0000 Subject: ADded proof-locate-executable. --- generic/proof-utils.el | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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 @@ -600,6 +600,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. -- cgit v1.2.3