]> git.eshelyaron.com Git - emacs.git/commitdiff
(sh-shell-file): If $SHELL evaluates to
authorEli Zaretskii <eliz@gnu.org>
Sun, 3 May 1998 15:57:33 +0000 (15:57 +0000)
committerEli Zaretskii <eliz@gnu.org>
Sun, 3 May 1998 15:57:33 +0000 (15:57 +0000)
one of MS-DOS or MS-Windows shells, use "bin/sh" instead.

lisp/progmodes/sh-script.el

index 508a9abaf4ea15a8db02877158daa77fe1d63ca1..c30d22202698e7334cb056ac2f736a6087b37dda 100644 (file)
@@ -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."