diff options
Diffstat (limited to 'lisp/progmodes/executable.el')
| -rw-r--r-- | lisp/progmodes/executable.el | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lisp/progmodes/executable.el b/lisp/progmodes/executable.el index bfe860fb223..b0b798c2970 100644 --- a/lisp/progmodes/executable.el +++ b/lisp/progmodes/executable.el | |||
| @@ -138,21 +138,18 @@ This can be included in `font-lock-keywords' by modes that call `executable'.") | |||
| 138 | See `compilation-error-regexp-alist'.") | 138 | See `compilation-error-regexp-alist'.") |
| 139 | 139 | ||
| 140 | ;; The C function openp slightly modified would do the trick fine | 140 | ;; The C function openp slightly modified would do the trick fine |
| 141 | (defvar executable-binary-suffixes | 141 | (defvaralias 'executable-binary-suffixes 'exec-suffixes) |
| 142 | (if (memq system-type '(ms-dos windows-nt)) | ||
| 143 | '(".exe" ".com" ".bat" ".cmd" ".btm" "") | ||
| 144 | '(""))) | ||
| 145 | 142 | ||
| 146 | ;;;###autoload | 143 | ;;;###autoload |
| 147 | (defun executable-find (command) | 144 | (defun executable-find (command) |
| 148 | "Search for COMMAND in exec-path and return the absolute file name. | 145 | "Search for COMMAND in `exec-path' and return the absolute file name. |
| 149 | Return nil if COMMAND is not found anywhere in `exec-path'." | 146 | Return nil if COMMAND is not found anywhere in `exec-path'." |
| 150 | (let ((list exec-path) | 147 | (let ((list exec-path) |
| 151 | file) | 148 | file) |
| 152 | (while list | 149 | (while list |
| 153 | (setq list | 150 | (setq list |
| 154 | (if (and (setq file (expand-file-name command (car list))) | 151 | (if (and (setq file (expand-file-name command (car list))) |
| 155 | (let ((suffixes executable-binary-suffixes) | 152 | (let ((suffixes exec-suffixes) |
| 156 | candidate) | 153 | candidate) |
| 157 | (while suffixes | 154 | (while suffixes |
| 158 | (setq candidate (concat file (car suffixes))) | 155 | (setq candidate (concat file (car suffixes))) |
| @@ -233,7 +230,6 @@ executable." | |||
| 233 | (let ((point (point-marker)) | 230 | (let ((point (point-marker)) |
| 234 | (buffer-modified-p (buffer-modified-p))) | 231 | (buffer-modified-p (buffer-modified-p))) |
| 235 | (goto-char (point-min)) | 232 | (goto-char (point-min)) |
| 236 | (make-local-hook 'after-save-hook) | ||
| 237 | (add-hook 'after-save-hook 'executable-chmod nil t) | 233 | (add-hook 'after-save-hook 'executable-chmod nil t) |
| 238 | (if (looking-at "#![ \t]*\\(.*\\)$") | 234 | (if (looking-at "#![ \t]*\\(.*\\)$") |
| 239 | (and (goto-char (match-beginning 1)) | 235 | (and (goto-char (match-beginning 1)) |