From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Stuart D. Herring" Newsgroups: gmane.emacs.devel Subject: Re: Mode loaded twice with Local Variables Date: Wed, 10 May 2006 12:59:43 -0700 (PDT) Message-ID: <56589.128.165.123.132.1147291183.squirrel@webmail.lanl.gov> References: <87vesfmsma.fsf@lrde.org><52339.128.165.123.132.1147190882.squirrel@webmail.lanl.gov> <87lkt9ent8.fsf@lrde.org> Reply-To: herring@lanl.gov NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1147291314 31240 80.91.229.2 (10 May 2006 20:01:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 10 May 2006 20:01:54 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 10 22:01:49 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Fdurr-0001P3-Sw for ged-emacs-devel@m.gmane.org; Wed, 10 May 2006 22:01:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fdurr-0003z9-Fr for ged-emacs-devel@m.gmane.org; Wed, 10 May 2006 16:01:07 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fduqf-0003US-Uq for emacs-devel@gnu.org; Wed, 10 May 2006 15:59:54 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fduqd-0003RP-39 for emacs-devel@gnu.org; Wed, 10 May 2006 15:59:53 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fduqc-0003R5-N7 for emacs-devel@gnu.org; Wed, 10 May 2006 15:59:50 -0400 Original-Received: from [192.65.95.54] (helo=mailwasher-b.lanl.gov) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1Fdurx-0000LL-C0 for emacs-devel@gnu.org; Wed, 10 May 2006 16:01:13 -0400 Original-Received: from mailrelay1.lanl.gov (mailrelay1.lanl.gov [128.165.4.101]) by mailwasher-b.lanl.gov (8.12.11.20060308/8.12.11/(ccn-5)) with ESMTP id k4AJxi1t010263 for ; Wed, 10 May 2006 13:59:45 -0600 Original-Received: from webmail1.lanl.gov (webmail1.lanl.gov [128.165.4.106]) by mailrelay1.lanl.gov (8.12.11.20060308/8.12.11/(ccn-5)) with ESMTP id k4AJxhZM008713; Wed, 10 May 2006 13:59:43 -0600 Original-Received: from webmail1.lanl.gov (localhost.localdomain [127.0.0.1]) by webmail1.lanl.gov (8.12.11.20060308/8.12.11) with ESMTP id k4AJxhwN014683; Wed, 10 May 2006 13:59:43 -0600 Original-Received: (from apache@localhost) by webmail1.lanl.gov (8.12.11.20060308/8.12.11/Submit) id k4AJxhBo014681; Wed, 10 May 2006 12:59:43 -0700 X-Authentication-Warning: webmail1.lanl.gov: apache set sender to herring@lanl.gov using -f Original-Received: from 128.165.123.132 (SquirrelMail authenticated user 196434); by webmail.lanl.gov with HTTP; Wed, 10 May 2006 12:59:43 -0700 (PDT) In-Reply-To: <87lkt9ent8.fsf@lrde.org> Original-To: =?iso-8859-1?Q?Micha=EBl_Cadilhac?= User-Agent: SquirrelMail/1.4.3a-11.EL3 X-Mailer: SquirrelMail/1.4.3a-11.EL3 X-Priority: 3 (Normal) Importance: Normal X-PMX-Version: 4.7.1.128075 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:54200 Archived-At: > I didn't think it was the right fix for one reason : some modes > /may/ behave differently on startup if /some/ variables have > /certain/ values. In other words, Local Variables would set > variables to some value before launching the mode, expecting > a specified behavior. > > My change provides this feature, AFAIK, but I do agree that it could > be too... dangerous to patch normal-mode, and not so needed. I'm not sure that's how major modes are supposed to behave. I don't expect them to _do_ too much on startup; they ought to define commands and bindings which may depend on variables, but which will execute later (well after the application of local variables). Additionally, major modes run `kill-all-local-variables', so it would currently be disastrous to exchange those two activities (I now realize). But the very existence of major mode hooks makes me doubt myself. WDOT? If it'd be better to set up the mode last, perhaps `normal-mode' ought to: 1. Somehow discover what major mode should be set (via variable or otherwise). 2. `kill-all-local-variables' if the major mode is going to change. 3. `hack-local-variables' without setting the mode. 4. Set the mode, if it changed. But this is very much more complicated than just preventing double-loading the mode, so should probably happen later if ever. Davis PS - For amusement, load a file with this: -*- mode: normal; -*- -- This product is sold by volume, not by mass. If it appears too dense or too sparse, it is because mass-energy conversion has occurred during shipping.