From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: dir-locals.el take precedence over user's mode-hook changes Date: Wed, 24 Dec 2008 22:52:55 +0200 Organization: JURTA Message-ID: <87wsdpp9q8.fsf@jurta.org> References: <200812241903.mBOJ3SjQ009445@mothra.ics.uci.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1230152870 27028 80.91.229.12 (24 Dec 2008 21:07:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Dec 2008 21:07:50 +0000 (UTC) Cc: Dan Nicolaescu , Stefan Monnier , emacs-devel@gnu.org To: Tom Tromey Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 24 22:08:55 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LFayN-0006Yp-6u for ged-emacs-devel@m.gmane.org; Wed, 24 Dec 2008 22:08:55 +0100 Original-Received: from localhost ([127.0.0.1]:33942 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LFaxA-0006HK-7p for ged-emacs-devel@m.gmane.org; Wed, 24 Dec 2008 16:07:40 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LFawN-0005qn-Ov for emacs-devel@gnu.org; Wed, 24 Dec 2008 16:06:51 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LFawJ-0005qR-0J for emacs-devel@gnu.org; Wed, 24 Dec 2008 16:06:51 -0500 Original-Received: from [199.232.76.173] (port=47420 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LFawI-0005qN-Q6 for emacs-devel@gnu.org; Wed, 24 Dec 2008 16:06:46 -0500 Original-Received: from relay03.kiev.sovam.com ([62.64.120.201]:63742) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LFawH-0006iX-VE for emacs-devel@gnu.org; Wed, 24 Dec 2008 16:06:46 -0500 Original-Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay03.kiev.sovam.com with esmtp (Exim 4.67) (envelope-from ) id 1LFawF-0001HP-L7; Wed, 24 Dec 2008 23:06:43 +0200 In-Reply-To: (Tom Tromey's message of "Wed, 24 Dec 2008 13:31:08 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu) X-Scanner-Signature: 7ffaa6bc246e67c9b1a22e0c753f4a43 X-DrWeb-checked: yes X-SpamTest-Envelope-From: juri@jurta.org X-SpamTest-Group-ID: 00000000 X-SpamTest-Header: Trusted X-SpamTest-Info: Profiles 6485 [Dec 24 2008] X-SpamTest-Info: {received from trusted relay: common white list} X-SpamTest-Info: {HEADERS: header Content-Type found without required header Content-Transfer-Encoding} X-SpamTest-Method: white ip list X-SpamTest-Rate: 10 X-SpamTest-Status: Trusted X-SpamTest-Status-Extended: trusted X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0278], KAS30/Release X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:107280 Archived-At: > Dan> If the user really really wants to override the settings doesn't > Dan> rm .dir-locals.el > Dan> or > Dan> changing the contents of .dir-locals.el > Dan> work well enough? > > My intent was for projects to check these into version control. > So, removing them is not always ok. > > As I recall you can set up your own local definition for a project to > override the project's file, though. This is somewhat inconvenient, > but it ought to work. I agree with Stefan that the current order of calling a hook and setting local variables (either dired-local or file-local) is wrong. Another problem with the current order is that it is impossible to use `bug-reference-mode' on ChangeLog files. We already have a local variable `bug-reference-url-format' set in Local Variables to the string "http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=%s" (BTW, this file-local variable should be moved to .dir-locals.el) And when I try to enable `bug-reference-mode' using the following hook: (add-hook 'change-log-mode-hook 'bug-reference-mode) it never gets enabled because `bug-reference-mode' tests whether a variable `bug-reference-url-format' is non-nil before enabling this mode, and this variable is not yet set because it gets initialized later in `hack-local-variables'. -- Juri Linkov http://www.jurta.org/emacs/