From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Will Parsons Newsgroups: gmane.emacs.bugs Subject: bug#3354: tcl-mode regression in Emacs 22 Date: Sat, 23 May 2009 13:56:22 -0400 (EDT) Message-ID: <20090523.135622.258140755.wbparsons@cshore.com> Reply-To: Will Parsons , 3354@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1243183976 3177 80.91.229.12 (24 May 2009 16:52:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 24 May 2009 16:52:56 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 24 18:52:50 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1M8Gub-0002vR-K6 for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 May 2009 18:51:02 +0200 Original-Received: from localhost ([127.0.0.1]:42553 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M8Gub-0000EC-4K for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 May 2009 12:51:01 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M7vyM-0003az-85 for bug-gnu-emacs@gnu.org; Sat, 23 May 2009 14:29:30 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M7vyH-0003aX-Oo for bug-gnu-emacs@gnu.org; Sat, 23 May 2009 14:29:29 -0400 Original-Received: from [199.232.76.173] (port=46834 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M7vyH-0003aU-GI for bug-gnu-emacs@gnu.org; Sat, 23 May 2009 14:29:25 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:50902) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M7vyF-0004GE-Po for bug-gnu-emacs@gnu.org; Sat, 23 May 2009 14:29:24 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M7vyF-00075w-2x for bug-gnu-emacs@gnu.org; Sat, 23 May 2009 14:29:23 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n4NITBKg012166; Sat, 23 May 2009 11:29:14 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n4NIP9YE009766; Sat, 23 May 2009 11:25:09 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Will Parsons Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sat, 23 May 2009 18:25:08 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 3354 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.12431027167595 (code B ref -1); Sat, 23 May 2009 18:25:08 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 23 May 2009 18:18:36 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n4NHuVxW029174 for ; Sat, 23 May 2009 10:56:33 -0700 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M7vSR-0003H9-IS for bug-gnu-emacs@gnu.org; Sat, 23 May 2009 13:56:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M7vSM-0003GE-8g for bug-gnu-emacs@gnu.org; Sat, 23 May 2009 13:56:30 -0400 Original-Received: from [199.232.76.173] (port=36505 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M7vSM-0003G8-5A for bug-gnu-emacs@gnu.org; Sat, 23 May 2009 13:56:26 -0400 Original-Received: from smtp.cshore.com ([206.123.82.219]:59928) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M7vSL-0005jn-BJ for bug-gnu-emacs@gnu.org; Sat, 23 May 2009 13:56:25 -0400 Original-Received: from localhost (adsl25-202.cshore.com [65.113.125.202]) by smtp.cshore.com (Postfix) with ESMTP id 9E8F3804C87 for ; Sat, 23 May 2009 14:04:28 -0400 (EDT) X-Mailer: Mew version 6.1 on Emacs 22.3 / Mule 5.0 (SAKAKI) X-detected-operating-system: by monty-python.gnu.org: FreeBSD 6.x (1) X-Detected-Operating-System: by mx20.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Resent-Date: Sat, 23 May 2009 14:29:29 -0400 X-Mailman-Approved-At: Sun, 24 May 2009 12:50:39 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:28108 Archived-At: 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