summaryrefslogtreecommitdiff
path: root/lisp/progmodes/sh-script.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2006-02-21 19:55:46 +0000
committerRichard M. Stallman <rms@gnu.org>2006-02-21 19:55:46 +0000
commitf623a9d2e6e89ea12dc80fabc636a6b1fb4af5e9 (patch)
tree97ceb94d1f532471f5fac7082ccfe42b8693c19d /lisp/progmodes/sh-script.el
parentfe541a2743944789a066e5bcdf461d88791a18f8 (diff)
downloademacs-f623a9d2e6e89ea12dc80fabc636a6b1fb4af5e9.tar.gz
(sh-mode): Set shell type based on file name if no other specific basis.
Diffstat (limited to 'lisp/progmodes/sh-script.el')
-rw-r--r--lisp/progmodes/sh-script.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index e331268391a..02ce4a21c97 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -1438,6 +1438,16 @@ with your script for an edit-interpret-debug cycle."
((and buffer-file-name
(string-match "\\.m?spec\\'" buffer-file-name))
"rpm")))))
+ (unless interpreter
+ (setq interpreter
+ (cond ((string-match "[.]sh\\>" buffer-file-name)
+ "sh")
+ ((string-match "[.]bash\\>" buffer-file-name)
+ "bash")
+ ((string-match "[.]ksh\\>" buffer-file-name)
+ "ksh")
+ ((string-match "[.]csh\\>" buffer-file-name)
+ "csh"))))
(sh-set-shell (or interpreter sh-shell-file) nil nil))
(run-mode-hooks 'sh-mode-hook))