Subject: 24.4.50; sh-mode does not use auto-mode-interpreter-regexp to find shell type

From: Christopher Monsanto <[email-masked]>
Date: Tue, 1 Apr 2014 07:36:29 -0400

See title; In sh-script.el, line ~1631

>    (cond ((save-excursion
>            (goto-char (point-min))
>           (looking-at "#![ \t]?\\([^ \t\n]*/bin/env[ \t]\\)?\\([^
\t\n]+\\)"))

This appears to duplicate auto-mode-interpreter-regexp in files.el, line
~2593:

> (defvar auto-mode-interpreter-regexp
>  (purecopy "#![ \t]?\\([^ \t\n]*\
/bin/env[ \t]\\)?\\([^ \t\n]+\\)")

This duplication makes it difficult to customize
auto-mode-interpreter-regexp. A discrepancy will cause the wrong shell type
(bash, ksh, csh, ...) to be selected.

Christopher Monsanto
[email-masked]  --  http://monsan.to/