From wbparsons@cshore.com Sat May 23 11:18:36 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 23 May 2009 18:18:36 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=FOURLA autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 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 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 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 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 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 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) Date: Sat, 23 May 2009 13:56:22 -0400 (EDT) Message-Id: <20090523.135622.258140755.wbparsons@cshore.com> To: bug-gnu-emacs@gnu.org Subject: tcl-mode regression in Emacs 22 From: Will Parsons X-Mailer: Mew version 6.1 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: FreeBSD 6.x (1) 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 From rgm@gnu.org Wed Jun 3 17:28:46 2009 Received: (at 3354) by emacsbugs.donarmstrong.com; 4 Jun 2009 00:28:47 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-8.3 required=4.0 tests=AWL,HAS_BUG_NUMBER, X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n540SgA6010180; Wed, 3 Jun 2009 17:28:43 -0700 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1MC0ox-0006Ny-IR; Wed, 03 Jun 2009 20:28:39 -0400 From: Glenn Morris To: Will Parsons Cc: 3354@debbugs.gnu.org Subject: Re: bug#3354: tcl-mode regression in Emacs 22 References: <20090523.135622.258140755.wbparsons@cshore.com> X-Spook: ARPA Baranyi KGB S Box Rubin pipeline e-cash eternity X-Ran: X\821HquZHLxHRp/ZZ~4oFU=ZW.O68KQ2wxBgK&MMfV28spiQ4n4?sG&GP#j,}%~K"iptN X-Hue: white X-Debbugs-No-Ack: yes X-Attribution: GM Date: Wed, 03 Jun 2009 20:28:39 -0400 Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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. From rgm@gnu.org Wed Jun 3 17:56:31 2009 Received: (at 3354) by emacsbugs.donarmstrong.com; 4 Jun 2009 00:56:31 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-8.3 required=4.0 tests=AWL,HAS_BUG_NUMBER, X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n540uROq013159 for <3354@emacsbugs.donarmstrong.com>; Wed, 3 Jun 2009 17:56:28 -0700 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1MC1Fq-0007Iv-Ba; Wed, 03 Jun 2009 20:56:26 -0400 From: Glenn Morris To: 3354@debbugs.gnu.org Cc: Will Parsons Subject: Re: bug#3354: tcl-mode regression in Emacs 22 References: <20090523.135622.258140755.wbparsons@cshore.com> X-Spook: Zachawi FBI clandestine Ft. Knox pipeline bank Manfurov X-Ran: 4Cq8TgW;- (Glenn Morris's message of "Wed, 03 Jun 2009 20:28:39 -0400") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Glenn Morris wrote: > #!/usr/bin/env tclsh > > (and give it whatever extension you like.) > > But this has problems for argument passing. Actually, no it doesn't. http://wiki.tcl.tk/812 From jasonrumney@gmail.com Wed Jun 3 19:41:52 2009 Received: (at 3354) by emacsbugs.donarmstrong.com; 4 Jun 2009 02:41:52 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-4.6 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.224]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n542fmhW027998 for <3354@emacsbugs.donarmstrong.com>; Wed, 3 Jun 2009 19:41:49 -0700 Received: by rv-out-0506.google.com with SMTP id f9so175161rvb.1 for <3354@emacsbugs.donarmstrong.com>; Wed, 03 Jun 2009 19:41:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=sAAuy91yIxdC5z6Zz71peu6eJU5YSSjArPv/4VpkZg4=; b=oQ/sRRTeszqhY4Zl3QLvbq07wjBLyY2GKFqjIuKhix3N01SkvsE5O73hZ2xfzjj+MG cdeS62J6De45U9132fnCA/3JwT3ndnKMPSidnC41VstsPNogMcM0u3lJ1xYB3ieMNFpy IzA5/odlt0UfvqOrV9FHFwrjzK4nGrw9CZBp0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=rPaznQTExxX52u1xijLVp0JMCfw0dyY4LoYXa+MDGWwhEsJZhYSXkTEKTXMQdQWpRl 9vUzX4KyTlEliHpDOppLkeIYHF6wTFOqzZZHFbzNJ9ZjoF9/UosDNXDd9TMSLuSkrj9J vV4vNnfSeFBdTD1uBkKMlArkOjP59QafLkOnY= Received: by 10.140.247.11 with SMTP id u11mr1418073rvh.247.1244083308016; Wed, 03 Jun 2009 19:41:48 -0700 (PDT) Received: from ?10.1.1.112? ([61.4.103.130]) by mx.google.com with ESMTPS id f21sm2019429rvb.55.2009.06.03.19.41.45 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 03 Jun 2009 19:41:47 -0700 (PDT) Sender: Jason Rumney Message-ID: <4A27344B.7090402@f2s.com> Date: Thu, 04 Jun 2009 10:41:15 +0800 From: Jason Rumney User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: Glenn Morris , 3354@debbugs.gnu.org CC: Will Parsons Subject: Re: bug#3354: tcl-mode regression in Emacs 22 References: <20090523.135622.258140755.wbparsons@cshore.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Glenn Morris wrote: > 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. > The examples were given further down in that same thread. The file extension .conf is commonly used for configuration files. On Debian at least, these files are often shell scripts or XML files rather than simple name:value pairs that can be parsed by conf-mode. So the reporter wanted shell script detection and XML file detection to take priority over auto-mode-alist. From rgm@gnu.org Wed Jun 3 21:04:58 2009 Received: (at 3354) by emacsbugs.donarmstrong.com; 4 Jun 2009 04:04:58 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-8.3 required=4.0 tests=AWL,HAS_BUG_NUMBER, X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n5444sbS006610 for <3354@emacsbugs.donarmstrong.com>; Wed, 3 Jun 2009 21:04:55 -0700 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1MC4CB-0004OA-Q3; Thu, 04 Jun 2009 00:04:51 -0400 From: Glenn Morris To: Jason Rumney Cc: 3354@debbugs.gnu.org, Will Parsons Subject: Re: bug#3354: tcl-mode regression in Emacs 22 References: <20090523.135622.258140755.wbparsons@cshore.com> <4A27344B.7090402@f2s.com> X-Spook: Nazi subversive 9705 Samford Road Bellcore Firefly morse X-Ran: l<>Vo}*<#WErQ=kj:"01!SQdCUKCA&9EL)-&,zF^MxexL$B8oKZ*+Dd: X-Hue: cyan X-Debbugs-No-Ack: yes X-Attribution: GM Date: Thu, 04 Jun 2009 00:04:51 -0400 In-Reply-To: <4A27344B.7090402@f2s.com> (Jason Rumney's message of "Thu, 04 Jun 2009 10:41:15 +0800") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Jason Rumney wrote: > The examples were given further down in that same thread. The file > extension .conf is commonly used for configuration files. On Debian at > least, these files are often shell scripts or XML files rather than > simple name:value pairs that can be parsed by conf-mode. Of the 80+ /etc/*.conf files on my Debian system, none start with a '#!', so what does this have to do with interpreter-mode-alist needing to take priority over auto-mode-alist? From jasonrumney@gmail.com Wed Jun 3 22:15:29 2009 Received: (at 3354) by emacsbugs.donarmstrong.com; 4 Jun 2009 05:15:29 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-4.5 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.232]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n545FQDl017407 for <3354@emacsbugs.donarmstrong.com>; Wed, 3 Jun 2009 22:15:27 -0700 Received: by rv-out-0506.google.com with SMTP id f9so208021rvb.1 for <3354@emacsbugs.donarmstrong.com>; Wed, 03 Jun 2009 22:15:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=X3duhdazuBwIMqpVQHHCCcmQLTha+FFb0gxcqwe7fKw=; b=CBSFy1CtroL9XY28rxBdnF8JQdeF16DotpLmvNevOK5zN/FXrNEWTOaOOuolQmj420 FhB7MBLbrWCPQBQ5GgCIAyYaoPP6bIfpNtOCTbg08jaWH7Y6SENQ3vCEbaf/74XO4F/U 57U8Bqc1JIQeZsB5EGC3sC5pd/5KAKH/PGDAg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=VP+wu0d4YJAQc3xdN+KlNnU+yzLmUx3y2q4G9iQTzTQjuY6MI8QvzufsR6SsCA0hRz 5Fr/Vyjd9WJy6gaUScFw7axR28Z1SCcVQI1XXp3R8vY63brvqb/vVfZX10nnkANkOFSQ Lk8j7cRjmVE/EP0Bh6hdZFMPbaoAp9Q3cLI0o= Received: by 10.141.86.4 with SMTP id o4mr1505787rvl.172.1244092525692; Wed, 03 Jun 2009 22:15:25 -0700 (PDT) Received: from ?10.1.1.112? ([61.4.103.130]) by mx.google.com with ESMTPS id f21sm2700393rvb.35.2009.06.03.22.15.23 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 03 Jun 2009 22:15:24 -0700 (PDT) Sender: Jason Rumney Message-ID: <4A27584E.9080805@f2s.com> Date: Thu, 04 Jun 2009 13:14:54 +0800 From: Jason Rumney User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: Glenn Morris CC: 3354@debbugs.gnu.org, Will Parsons Subject: Re: bug#3354: tcl-mode regression in Emacs 22 References: <20090523.135622.258140755.wbparsons@cshore.com> <4A27344B.7090402@f2s.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Glenn Morris wrote: > Of the 80+ /etc/*.conf files on my Debian system, none start with a > '#!', so what does this have to do with interpreter-mode-alist needing > to take priority over auto-mode-alist? > In Debian testing/unstable, they seem to be going through adding .conf to the end of all files in /etc subdirectories that have the behavior of loading all files in the directory, presumably to solve the problem of backup files being evaluated in those directories. Quite a few of these are shell scripts, but having looked properly now, I can only find one out of around 300 .conf files under /etc that starts with #!. From unknown Sat Aug 09 14:04:51 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: $requester Subject: Internal Control Message-Id: bug archived. Date: Thu, 02 Jul 2009 14:24:19 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A log time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator