diff options
| author | Eli Zaretskii | 1998-06-21 14:29:07 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 1998-06-21 14:29:07 +0000 |
| commit | 87a00c4f91fa3a744b06d7733c78bcec8d6842b2 (patch) | |
| tree | f320a9d74743e048983c1e69e59c29152a345d72 | |
| parent | ac3b28b1940043dec8e2e77ecb0a0956783403a5 (diff) | |
| download | emacs-87a00c4f91fa3a744b06d7733c78bcec8d6842b2.tar.gz emacs-87a00c4f91fa3a744b06d7733c78bcec8d6842b2.zip | |
(vc-binary-suffixes): New variable.
(vc-find-binary): Append every suffix from vc-binary-suffixes when
looking for executable files.
| -rw-r--r-- | lisp/vc.el | 26 |
1 files 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 @@ | |||
| 5 | ;; Author: Eric S. Raymond <esr@snark.thyrsus.com> | 5 | ;; Author: Eric S. Raymond <esr@snark.thyrsus.com> |
| 6 | ;; Maintainer: Andre Spiegel <spiegel@inf.fu-berlin.de> | 6 | ;; Maintainer: Andre Spiegel <spiegel@inf.fu-berlin.de> |
| 7 | 7 | ||
| 8 | ;; $Id: vc.el,v 1.231 1998/06/12 11:13:37 spiegel Exp rms $ | 8 | ;; $Id: vc.el,v 1.232 1998/06/16 16:38:47 rms Exp eliz $ |
| 9 | 9 | ||
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | 11 | ||
| @@ -506,7 +506,10 @@ If nil, VC itself computes this value when it is first needed." | |||
| 506 | (error "File %s is not under version control" (buffer-file-name)))))) | 506 | (error "File %s is not under version control" (buffer-file-name)))))) |
| 507 | 507 | ||
| 508 | (defvar vc-binary-assoc nil) | 508 | (defvar vc-binary-assoc nil) |
| 509 | 509 | (defvar vc-binary-suffixes | |
| 510 | (if (memq system-type '(ms-dos windows-nt)) | ||
| 511 | '(".exe" ".com" ".bat" ".cmd" ".btm" "") | ||
| 512 | '(""))) | ||
| 510 | (defun vc-find-binary (name) | 513 | (defun vc-find-binary (name) |
| 511 | "Look for a command anywhere on the subprocess-command search path." | 514 | "Look for a command anywhere on the subprocess-command search path." |
| 512 | (or (cdr (assoc name vc-binary-assoc)) | 515 | (or (cdr (assoc name vc-binary-assoc)) |
| @@ -515,13 +518,18 @@ If nil, VC itself computes this value when it is first needed." | |||
| 515 | (function | 518 | (function |
| 516 | (lambda (s) | 519 | (lambda (s) |
| 517 | (if s | 520 | (if s |
| 518 | (let ((full (concat s "/" name))) | 521 | (let ((full (concat s "/" name)) |
| 519 | (if (and (file-executable-p full) | 522 | (suffixes vc-binary-suffixes) |
| 520 | (not (file-directory-p full))) | 523 | candidate) |
| 521 | (progn | 524 | (while suffixes |
| 522 | (setq vc-binary-assoc | 525 | (setq candidate (concat full (car suffixes))) |
| 523 | (cons (cons name full) vc-binary-assoc)) | 526 | (if (and (file-executable-p candidate) |
| 524 | (throw 'found full))))))) | 527 | (not (file-directory-p candidate))) |
| 528 | (progn | ||
| 529 | (setq vc-binary-assoc | ||
| 530 | (cons (cons name candidate) vc-binary-assoc)) | ||
| 531 | (throw 'found candidate)) | ||
| 532 | (setq suffixes (cdr suffixes)))))))) | ||
| 525 | exec-path) | 533 | exec-path) |
| 526 | nil))) | 534 | nil))) |
| 527 | 535 | ||