unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Will Parsons <wbparsons@cshore.com>
To: bug-gnu-emacs@gnu.org
Subject: bug#3354: tcl-mode regression in Emacs 22
Date: Sat, 23 May 2009 13:56:22 -0400 (EDT)	[thread overview]
Message-ID: <20090523.135622.258140755.wbparsons@cshore.com> (raw)


Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list,
and to the gnu.emacs.bug news group.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

(This is a repeat of a bug report sent to gnu.emacs.bugs on 29 Mar 2008.)

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
------

i.e., the shebang overrides the .tcl extension in determining programming
mode.

The original bug report was closed out with the response:

> If the shebang specified /bin/tcl, it would be recognized as a Tcl file.
> In ambiguous situations like this, it's better to use a `-*-' line or
> local variables list (see the node "Choosing Modes" in the Emacs
> manual).

I responded:

  Using a shebang of "#!/bin/tclsh" is not portable, since tclsh may be
  installed elsewhere (typically /usr/local/bin).  The idiom cited in the
  original message is commonly used in Tcl scripts to allow for this.  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.  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.

This has continued to bite me.  Yes, I *know* that I can stick a -*-tcl-*-
string in the file to force recognition as a Tcl file, but if the order of
precedence was changed in going from Emacs 21 to Emacs 22, there should be
a way of getting back the former behaviour.  I tried adding to my .emacs
file the line:

  (add-to-list 'auto-mode-alist '("\\.tcl$" . tcl-mode))

but files ending in ".tcl" but have a shebang of "#!/bin/sh" are still
being treated as shell mode.  I would like to re-open this as being a
genuine bug.

---

In GNU Emacs 22.3.1 (i386-portbld-freebsd7.0, GTK+ Version 2.12.11)
 of 2008-12-06 on nephthys.thalatta.eme
Windowing system distributor `The X.Org Foundation', version 11.0.60900000
configured using `configure  '--with-gtk' '--x-libraries=/usr/local/lib' '--x-includes=/usr/local/include' '--prefix=/usr/local' '--mandir=/usr/local/man' '--infodir=/usr/local/info/' '--build=i386-portbld-freebsd7.0' 'build_alias=i386-portbld-freebsd7.0' 'CC=cc' 'CFLAGS=-O2 -fno-strict-aliasing -pipe''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  locale-coding-system: nil
  default-enable-multibyte-characters: t

Major mode: Shell-script

Minor modes in effect:
  display-time-mode: t
  delete-selection-mode: t
  recentf-mode: t
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t







             reply	other threads:[~2009-05-23 17:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-23 17:56 Will Parsons [this message]
2009-06-04  0:28 ` bug#3354: tcl-mode regression in Emacs 22 Glenn Morris
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=20090523.135622.258140755.wbparsons@cshore.com \
    --to=wbparsons@cshore.com \
    --cc=3354@emacsbugs.donarmstrong.com \
    --cc=bug-gnu-emacs@gnu.org \
    /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).