emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sh-script.el and magic numbers


From: Luc Teirlinck
Subject: Re: sh-script.el and magic numbers
Date: Tue, 21 Jan 2003 09:30:09 -0600 (CST)

Glenn Morris wrote:

   one could set the variable `sh-shell' as a file local variable to have a
   given script recognized as a given shell type. This works (mostly), but
   still leaves the mode-line saying "[bash]" in all cases. That can be fixed
   with mode-line-process: "[tcsh]" (or whatever).

Setting mode-line-process is purely cosmetic.  It solves the symptom,
not the problem.  I assume you mean:

# -*- mode: sh; sh-shell: /bin/csh; mode-line-process: "[tcsh]"-*-

You get [tcsh] in the mode line all right but do C-c C-c: bash's case,
not csh's switch.  As I pointed out, what you have to do is:

# <your comment> -*- mode: sh; eval: (sh-set-shell "/bin/csh"); -*-

   I agree it would be nice if there was some easy way to switch sh-mode
   between the various different shell flavours with no side effects.

You mean interactively (temporarily) or persistently?

Interactively:

M-: (sh-set-shell "/bin/csh")

Persistently, see above.

It seems to me that all of this is not too difficult once one knows
it, but the main problem is that you need some familiarity with the
sh-script.el source code to figure this out.  As I said, it should be
mentioned in the mode documentation you get with C-h m.  Would you
consider this to be a sufficient solution?  There also is the problem
that the persistent solution requires enable-local-eval to be non-nil
(t or maybe).

Sincerely,

Luc.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]