changeset 39933:89f6eeae2af3

(executable-binary-suffixes): Make varalias. (executable-find): Use exec-suffixes. (executable-set-magic): Don't use make-local-hook.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sun, 14 Oct 2001 20:09:46 +0000
parents ade54d52bb06
children 674e73ec881a
files lisp/progmodes/executable.el
diffstat 1 files changed, 3 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/executable.el	Sun Oct 14 20:08:21 2001 +0000
+++ b/lisp/progmodes/executable.el	Sun Oct 14 20:09:46 2001 +0000
@@ -138,21 +138,18 @@
 See `compilation-error-regexp-alist'.")
 
 ;; The C function openp slightly modified would do the trick fine
-(defvar executable-binary-suffixes
-  (if (memq system-type '(ms-dos windows-nt))
-      '(".exe" ".com" ".bat" ".cmd" ".btm" "")
-    '("")))
+(defvaralias 'executable-binary-suffixes 'exec-suffixes)
 
 ;;;###autoload
 (defun executable-find (command)
-  "Search for COMMAND in exec-path and return the absolute file name.
+  "Search for COMMAND in `exec-path' and return the absolute file name.
 Return nil if COMMAND is not found anywhere in `exec-path'."
   (let ((list exec-path)
 	file)
     (while list
       (setq list
 	    (if (and (setq file (expand-file-name command (car list)))
-		     (let ((suffixes executable-binary-suffixes)
+		     (let ((suffixes exec-suffixes)
 			   candidate)
 		       (while suffixes
 			 (setq candidate (concat file (car suffixes)))
@@ -233,7 +230,6 @@
 	(let ((point (point-marker))
 	      (buffer-modified-p (buffer-modified-p)))
 	  (goto-char (point-min))
-	  (make-local-hook 'after-save-hook)
 	  (add-hook 'after-save-hook 'executable-chmod nil t)
 	  (if (looking-at "#![ \t]*\\(.*\\)$")
 	      (and (goto-char (match-beginning 1))