From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Will Parsons Newsgroups: gmane.emacs.help Subject: Re: Can priority of interpreter-mode-alist over auto-mode-alist be changed? Date: 28 Mar 2008 21:34:31 GMT Message-ID: References: <44iqz6ooyl.fsf@be-well.ilk.org> <654hlcF2emjjuU1@mid.individual.net> <44od8ymz5y.fsf@be-well.ilk.org> Reply-To: ellenophilos@yahoo.com NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1206755211 12380 80.91.229.12 (29 Mar 2008 01:46:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Mar 2008 01:46:51 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Mar 29 02:47:22 2008 Return-path: Envelope-to: geh-help-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 1JfQAE-0000Bh-9B for geh-help-gnu-emacs@m.gmane.org; Sat, 29 Mar 2008 02:47:22 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JfQ9c-0008G7-PU for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Mar 2008 21:46:44 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 59 Original-X-Trace: individual.net Xs1GXVSwS/aS/o/k1GHwqgqsu9KU3K41PivQMNHZxNwsZ3ccQZ Cancel-Lock: sha1:3t++KaB2AaPpFJaX6GAJMZ9DDWE= User-Agent: slrn/0.9.8.1 (FreeBSD) Original-Xref: shelby.stanford.edu gnu.emacs.help:157413 X-Mailman-Approved-At: Fri, 28 Mar 2008 21:46:26 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:52784 Archived-At: Lowell Gilbert wrote: > Will Parsons writes: > >> Lowell Gilbert wrote: >>> Peter Dyballa writes: >>> >>>> Am 27.03.2008 um 13:42 schrieb skuhagen: >>>>> #!/bin/sh >>>>> #\ >>>>> exec tclsh "$0" "$@" >>>> >>>> Why can't you use >>>> >>>> #!/bin/tclsh >>>> >>>> directly? >>> >>> In some cases, because the script has to be run on multiple machines >>> that have different paths to tclsh. >> >>> I've used "Local Variables" sections to solve that in the past. >>> I wouldn't be surprised if there is a better way these days. >> >> This seems to be a regression with Emacs 22. I, too, have tcl scripts >> which begin with the common Tcl idiom cited by the OP, and they are >> correctly recognized as tcl mode in Emacs 21 but shell mode in Emacs 22. >> >> So, I'd like to join the OP in asking how to get the original behaviour >> back? > > Three minutes of investigation led me to think that you're looking for > the variable "magic-mode-alist". Perhaps it is, but if so, after reading the description of the variable I am left with no idea of how to use it to get the desired effect. > I think that what's happening is that your scripts end in ".tcl" and > the way it used to work was that auto-mode-alist used tcl-mode because > of the filename. [If the scripts don't end in .tcl, I don't see how > it ever worked without a hint inside the file.] Now something is > overriding auto-mode-alist, and it might be the "magic" mode-guessing. Quite right. For scripts that don't end in ".tcl", it would unrealistic to expect that Emacs should know that a file with a "#!/bin/sh" shebang is really a Tcl script, and in fact I add a second line in this case containing "#-*-tcl-*" and that forces Tcl mode. (So the question for me, at least, is not how to force Tcl mode, but how to get the old behaviour where Tcl mode is automatically recognized when Emacs should be able to do so.) > There are other possibilities, but the ones I thought to check don't > seem to have changed lately. [e.g., interpeter-mode-alist] If this seems to be a bug, I'll file a bug report, unless someone can say that this is an intended change and give an easy way of reverting to the Emacs 21 behaviour. -- Will