comparison lisp/progmodes/sh-script.el @ 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 dc49655f57ae
children b5043066337b d1c5430c5bff
comparison
equal deleted inserted replaced
69082:31566461e709 69083:d148e515073b
1436 (cond ((looking-at "#![ \t]?\\([^ \t\n]*/bin/env[ \t]\\)?\\([^ \t\n]+\\)") 1436 (cond ((looking-at "#![ \t]?\\([^ \t\n]*/bin/env[ \t]\\)?\\([^ \t\n]+\\)")
1437 (match-string 2)) 1437 (match-string 2))
1438 ((and buffer-file-name 1438 ((and buffer-file-name
1439 (string-match "\\.m?spec\\'" buffer-file-name)) 1439 (string-match "\\.m?spec\\'" buffer-file-name))
1440 "rpm"))))) 1440 "rpm")))))
1441 (unless interpreter
1442 (setq interpreter
1443 (cond ((string-match "[.]sh\\>" buffer-file-name)
1444 "sh")
1445 ((string-match "[.]bash\\>" buffer-file-name)
1446 "bash")
1447 ((string-match "[.]ksh\\>" buffer-file-name)
1448 "ksh")
1449 ((string-match "[.]csh\\>" buffer-file-name)
1450 "csh"))))
1441 (sh-set-shell (or interpreter sh-shell-file) nil nil)) 1451 (sh-set-shell (or interpreter sh-shell-file) nil nil))
1442 (run-mode-hooks 'sh-mode-hook)) 1452 (run-mode-hooks 'sh-mode-hook))
1443 1453
1444 ;;;###autoload 1454 ;;;###autoload
1445 (defalias 'shell-script-mode 'sh-mode) 1455 (defalias 'shell-script-mode 'sh-mode)