diff options
author | Eli Zaretskii <eliz@gnu.org> | 1998-05-03 15:57:33 +0000 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 1998-05-03 15:57:33 +0000 |
commit | eee86eff468db2c025132133ddfce39c30dd65d0 (patch) | |
tree | 9d5db891943f127aa32e2d73c9a1b40104b12be4 /lisp | |
parent | 7ab2c2894c895f290ac56c7f0aaf903e1e4ff9df (diff) | |
download | emacs-eee86eff468db2c025132133ddfce39c30dd65d0.tar.gz emacs-eee86eff468db2c025132133ddfce39c30dd65d0.tar.bz2 emacs-eee86eff468db2c025132133ddfce39c30dd65d0.zip |
(sh-shell-file): If $SHELL evaluates to
one of MS-DOS or MS-Windows shells, use "bin/sh" instead.
Diffstat (limited to 'lisp')
-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." ;; the executable extension, so comparisons with the list of ;; known shells work. (and (memq system-type '(ms-dos windows-nt)) - (file-name-sans-extension (downcase (getenv "SHELL")))) + (let* ((shell (getenv "SHELL")) + (shell-base + (and shell (file-name-nondirectory shell)))) + ;; shell-script mode doesn't support DOS/Windows shells, + ;; so use the default instead. + (if (or (null shell) + (member (downcase shell-base) + '("command.com" "cmd.exe" "4dos.com" "ndos.com"))) + "/bin/sh" + (file-name-sans-extension (downcase shell))))) (getenv "SHELL") "/bin/sh") "*The executable file name for the shell being programmed." |