help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Can priority of interpreter-mode-alist over auto-mode-alist be chang


From: Will Parsons
Subject: Re: Can priority of interpreter-mode-alist over auto-mode-alist be changed?
Date: 28 Mar 2008 21:34:31 GMT
User-agent: slrn/0.9.8.1 (FreeBSD)

Lowell Gilbert wrote:
> Will Parsons <wbp@nodomain.invalid> writes:
>
>> Lowell Gilbert wrote:
>>> Peter Dyballa <Peter_Dyballa@Web.DE> writes:
>>>
>>>> Am 27.03.2008 um 13:42 schrieb skuhagen:
>>>>> #!/bin/sh
>>>>>  #\
>>>>>  exec tclsh "$0" "$@"
>>>>
>>>> Why can't you use
>>>>
>>>>    #!/bin/tclsh
>>>>
>>>> directly?
>>>
>>> In some cases, because the script has to be run on multiple machines
>>> that have different paths to tclsh.
>>
>>> I've used "Local Variables" sections to solve that in the past.
>>> I wouldn't be surprised if there is a better way these days.
>>
>> This seems to be a regression with Emacs 22.  I, too, have tcl scripts
>> which begin with the common Tcl idiom cited by the OP, and they are
>> correctly recognized as tcl mode in Emacs 21 but shell mode in Emacs 22.
>>
>> So, I'd like to join the OP in asking how to get the original behaviour
>> back?
>
> Three minutes of investigation led me to think that you're looking for
> the variable "magic-mode-alist".  

Perhaps it is, but if so, after reading the description of the variable I
am left with no idea of how to use it to get the desired effect.

> I think that what's happening is that your scripts end in ".tcl" and
> the way it used to work was that auto-mode-alist used tcl-mode because
> of the filename.  [If the scripts don't end in .tcl, I don't see how
> it ever worked without a hint inside the file.]  Now something is
> overriding auto-mode-alist, and it might be the "magic" mode-guessing.

Quite right.  For scripts that don't end in ".tcl", it would unrealistic to
expect that Emacs should know that a file with a "#!/bin/sh" shebang is
really a Tcl script, and in fact I add a second line in this case
containing "#-*-tcl-*" and that forces Tcl mode.  (So the question for me,
at least, is not how to force Tcl mode, but how to get the old behaviour
where Tcl mode is automatically recognized when Emacs should be able to do
so.)

> There are other possibilities, but the ones I thought to check don't
> seem to have changed lately.  [e.g., interpeter-mode-alist]

If this seems to be a bug, I'll file a bug report, unless someone can say
that this is an intended change and give an easy way of reverting to the
Emacs 21 behaviour.

-- 
Will


reply via email to

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