changeset 69083:d148e515073b

(sh-mode): Set shell type based on file name if no other specific basis.
author Richard M. Stallman <rms@gnu.org>
date Tue, 21 Feb 2006 19:55:33 +0000
parents 31566461e709
children 0af217c8b8bb
files lisp/progmodes/sh-script.el
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/sh-script.el	Tue Feb 21 19:54:36 2006 +0000
+++ b/lisp/progmodes/sh-script.el	Tue Feb 21 19:55:33 2006 +0000
@@ -1438,6 +1438,16 @@
 		 ((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))