# HG changeset patch # User Richard M. Stallman # Date 1140551733 0 # Node ID d148e515073ba619fc2010f409d120b22883b6c6 # Parent 31566461e70911b529e94818eb2c44d97f017cd9 (sh-mode): Set shell type based on file name if no other specific basis. diff -r 31566461e709 -r d148e515073b lisp/progmodes/sh-script.el --- 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))