Subject: bug#20959: Switching script mode to rpm puts nonsense on the first line

From: Glenn Morris <[email-masked]>
Date: Thu, 02 Jul 2015 11:53:11 -0400

Petr Hracek wrote:

> Reproducer is:
> 1) shell-script-mode
> 2) 'sh-set-shell' 'rpm'
>
> then on the first line is #!/usr/bin/rpm which doe not make sense.
> https://bugzilla.redhat.com/show_bug.cgi?id=1030391#c6
>
> Did you discover it?

That's what the command is documented to do.

I assume it's being called for the effect of "switching the buffer to
the rpm dialect of sh-mode". To do that, you can call it like

M-: (sh-set-shell "rpm" nil nil)

(which isn't much more typing).

Perhaps C-u M-x sh-set-shell could mean that.

The alternative would be a hard-coded list of interpreters that aren't
really shells (I think rpm is the only one sh-mode handles?).