changeset 22534:442d61eaab83

(vc-binary-suffixes): New variable. (vc-find-binary): Append every suffix from vc-binary-suffixes when looking for executable files.
author Eli Zaretskii <eliz@gnu.org>
date Sun, 21 Jun 1998 14:29:07 +0000
parents 6eae236a4f01
children fd9324c5a498
files lisp/vc.el
diffstat 1 files changed, 17 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/vc.el	Sat Jun 20 22:28:28 1998 +0000
+++ b/lisp/vc.el	Sun Jun 21 14:29:07 1998 +0000
@@ -5,7 +5,7 @@
 ;; Author:     Eric S. Raymond <esr@snark.thyrsus.com>
 ;; Maintainer: Andre Spiegel <spiegel@inf.fu-berlin.de>
 
-;; $Id: vc.el,v 1.231 1998/06/12 11:13:37 spiegel Exp rms $
+;; $Id: vc.el,v 1.232 1998/06/16 16:38:47 rms Exp eliz $
 
 ;; This file is part of GNU Emacs.
 
@@ -506,7 +506,10 @@
 	  (error "File %s is not under version control" (buffer-file-name))))))
 
 (defvar vc-binary-assoc nil)
-
+(defvar vc-binary-suffixes
+  (if (memq system-type '(ms-dos windows-nt))
+      '(".exe" ".com" ".bat" ".cmd" ".btm" "")
+    '("")))
 (defun vc-find-binary (name)
   "Look for a command anywhere on the subprocess-command search path."
   (or (cdr (assoc name vc-binary-assoc))
@@ -515,13 +518,18 @@
 	 (function 
 	  (lambda (s)
 	    (if s
-		(let ((full (concat s "/" name)))
-		  (if (and (file-executable-p full)
-			   (not (file-directory-p full)))
-		      (progn
-			(setq vc-binary-assoc
-			      (cons (cons name full) vc-binary-assoc))
-			(throw 'found full)))))))
+		(let ((full (concat s "/" name))
+		      (suffixes vc-binary-suffixes)
+		      candidate)
+		  (while suffixes
+		    (setq candidate (concat full (car suffixes)))
+		    (if (and (file-executable-p candidate)
+			     (not (file-directory-p candidate)))
+			(progn
+			  (setq vc-binary-assoc
+				(cons (cons name candidate) vc-binary-assoc))
+			  (throw 'found candidate))
+		      (setq suffixes (cdr suffixes))))))))
 	 exec-path)
 	nil)))