diff options
| -rw-r--r-- | lisp/progmodes/sh-script.el | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 508a9abaf4e..c30d2220269 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -128,7 +128,16 @@ shell it really is." | |||
| 128 | ;; the executable extension, so comparisons with the list of | 128 | ;; the executable extension, so comparisons with the list of |
| 129 | ;; known shells work. | 129 | ;; known shells work. |
| 130 | (and (memq system-type '(ms-dos windows-nt)) | 130 | (and (memq system-type '(ms-dos windows-nt)) |
| 131 | (file-name-sans-extension (downcase (getenv "SHELL")))) | 131 | (let* ((shell (getenv "SHELL")) |
| 132 | (shell-base | ||
| 133 | (and shell (file-name-nondirectory shell)))) | ||
| 134 | ;; shell-script mode doesn't support DOS/Windows shells, | ||
| 135 | ;; so use the default instead. | ||
| 136 | (if (or (null shell) | ||
| 137 | (member (downcase shell-base) | ||
| 138 | '("command.com" "cmd.exe" "4dos.com" "ndos.com"))) | ||
| 139 | "/bin/sh" | ||
| 140 | (file-name-sans-extension (downcase shell))))) | ||
| 132 | (getenv "SHELL") | 141 | (getenv "SHELL") |
| 133 | "/bin/sh") | 142 | "/bin/sh") |
| 134 | "*The executable file name for the shell being programmed." | 143 | "*The executable file name for the shell being programmed." |