Subject: bug#17333: sh-mode: File local variables for setting shell variant

From: Glenn Morris <[email-masked]>
Date: Tue, 29 Apr 2014 10:21:23 -0400

Ben Finney wrote:

> The 'sh-mode' appears to have no means for allowing a non-executable
> file to declare, in its local variables, the shell variant to use for
> syntax.

I'd also like a way to do this.
In the past I've used

-*- mode: sh; eval: (sh-set-shell "tcsh" nil nil) -*-

but it is not great.

Ideas that come to mind are a bunch of aliases (sh-bash-mode etc) that
DTRT (yuck?); or sh-mode could add something to
hack-local-variables-hook that respects a file-local `sh-buffer-shell'
or somesuch.