From 87a00c4f91fa3a744b06d7733c78bcec8d6842b2 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 21 Jun 1998 14:29:07 +0000 Subject: [PATCH] (vc-binary-suffixes): New variable. (vc-find-binary): Append every suffix from vc-binary-suffixes when looking for executable files. --- lisp/vc.el | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/lisp/vc.el b/lisp/vc.el index 26cfb0c0c2a..cda0544dc4a 100644 --- a/lisp/vc.el +++ b/lisp/vc.el @@ -5,7 +5,7 @@ ;; Author: Eric S. Raymond ;; Maintainer: Andre Spiegel -;; $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 @@ If nil, VC itself computes this value when it is first needed." (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 @@ If nil, VC itself computes this value when it is first needed." (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))) -- 2.39.2