unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Glenn Morris <rgm@gnu.org>
To: Will Parsons <wbparsons@cshore.com>
Cc: 3354@emacsbugs.donarmstrong.com
Subject: bug#3354: tcl-mode regression in Emacs 22
Date: Wed, 03 Jun 2009 20:28:39 -0400	[thread overview]
Message-ID: <r1skigvo3s.fsf@fencepost.gnu.org> (raw)
In-Reply-To: 20090523.135622.258140755.wbparsons@cshore.com

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.





  reply	other threads:[~2009-06-04  0:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-23 17:56 bug#3354: tcl-mode regression in Emacs 22 Will Parsons
2009-06-04  0:28 ` Glenn Morris [this message]
2009-06-04  0:35   ` Processed: " Emacs bug Tracking System
2009-06-04  0:56   ` Glenn Morris
2009-06-04  2:41   ` Jason Rumney
2009-06-04  4:04     ` Glenn Morris
2009-06-04  5:14       ` Jason Rumney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=r1skigvo3s.fsf@fencepost.gnu.org \
    --to=rgm@gnu.org \
    --cc=3354@emacsbugs.donarmstrong.com \
    --cc=wbparsons@cshore.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).