GNU bug report logs -
#3354
tcl-mode regression in Emacs 22
Previous Next
Reported by: Will Parsons <wbparsons <at> cshore.com>
Date: Sat, 23 May 2009 18:25:08 UTC
Severity: normal
Merged with 97
Done: Chong Yidong <cyd <at> stupidchicken.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
unarchive 97
forcemerge 97 3354
stop
Will Parsons wrote:
> The following valid Tcl script is recognized automatically as Tcl mode
> under Emacs 21 but as shell mode under Emacs 22:
>
> ------
> isis% cat test.tcl
> #!/bin/sh
> #\
> exec tclsh "$0" ${1+"$@"}
> puts test
[...]
> Using a shebang of "#!/bin/tclsh" is not portable, since tclsh may be
> installed elsewhere (typically /usr/local/bin).
#!/usr/bin/env tclsh
(and give it whatever extension you like.)
But this has problems for argument passing.
> I am aware that "-*-" can be used to force recognition of Tcl mode,
> but this should not be necessary if the script has a ".tcl"
> extension, and in fact it is not necessary in versions of Emacs
> prior to version 22, so the current behaviour is a regression.
It's a change.
> If for some reason a decision was made to have the shebang override
> the extension to determine the mode, then there should be an easy
> way of getting back the previous behaviour, *without* having to add
> instructions to Emacs to the script files themselves.
(setq interpreter-mode-alist
(delete (assoc "sh" interpreter-mode-alist)
interpreter-mode-alist))
(but #!/bin/sh scripts without filename extensions, which are
numerous, will no longer be opened in sh-mode).
I don't know what the reason is for giving interpreter-mode-alist the
highest priority (above magic-mode-alist as well). The only reference
I can find is:
http://lists.gnu.org/archive/html/emacs-pretest-bug/2004-10/msg00215.html
which just says "I feel this [the old behaviour] to be wrong", with no
examples.
This bug report was last modified 16 years and 42 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.