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: Blunderbuss ".dir-locals.el" raises everything in its path!! Date: Fri, 17 Jul 2009 12:42:57 +0300 Organization: JURTA Message-ID: <87eisf358e.fsf@mail.jurta.org> References: <20090712144137.GB2524@muc.de> <87hbxhony6.fsf@stupidchicken.com> <20090712180623.GA1009@muc.de> <87k52dycha.fsf@stupidchicken.com> <20090712212103.GB1009@muc.de> <8763dx6wi9.fsf@stupidchicken.com> <20090713082501.GD1803@muc.de> <5629A21B-960E-4D20-8BCB-E5B3D736DE3B@mit.edu> <87hbxg74i2.fsf@mail.jurta.org> <87fxcxievu.fsf@mail.jurta.org> <87zlb4wexa.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1247831303 18487 80.91.229.12 (17 Jul 2009 11:48:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 17 Jul 2009 11:48:23 +0000 (UTC) Cc: Chad Brown , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 17 13:48:16 2009 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 1MRlvC-0000bZ-Eq for ged-emacs-devel@m.gmane.org; Fri, 17 Jul 2009 13:48:14 +0200 Original-Received: from localhost ([127.0.0.1]:60217 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MRlvB-0006AH-M4 for ged-emacs-devel@m.gmane.org; Fri, 17 Jul 2009 07:48:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MRlv3-00069q-L9 for emacs-devel@gnu.org; Fri, 17 Jul 2009 07:48:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MRluz-000691-25 for emacs-devel@gnu.org; Fri, 17 Jul 2009 07:48:04 -0400 Original-Received: from [199.232.76.173] (port=55350 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MRluy-00068x-Ro for emacs-devel@gnu.org; Fri, 17 Jul 2009 07:48:00 -0400 Original-Received: from smtp-out2.starman.ee ([85.253.0.4]:33019 helo=mx2.starman.ee) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MRluy-0000p4-8h for emacs-devel@gnu.org; Fri, 17 Jul 2009 07:48:00 -0400 X-Virus-Scanned: by Amavisd-New at mx2.starman.ee Original-Received: from mail.starman.ee (82.131.55.177.cable.starman.ee [82.131.55.177]) by mx2.starman.ee (Postfix) with ESMTP id 3FA0F3F4107; Fri, 17 Jul 2009 14:47:52 +0300 (EEST) In-Reply-To: (Stefan Monnier's message of "Thu, 16 Jul 2009 23:01:26 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:112609 Archived-At: >>> If the variable is set in both, we should be careful to say it's >>> "file-local" and not "dir-local". > >> Sorry, I don't understand. If the variable is set in both >> `file-local-variables-alist' and `(dir-local-variables-alist)', >> then it's "dir-local" and not "file-local". > > No, if it's set both in dir-locals.el and in file-local, then it's > file-local. IIUC, there are three possible cases: 1. if it's set in file-local but not in dir-locals.el then (variable . value) is stored in `file-local-variables-alist' but not in `dir-local-variables-alist' 2. if it's set in dir-locals.el but not in file-local then (variable . value) is stored both in `file-local-variables-alist' and in `dir-local-variables-alist' 3. if it's set both in file-local and in dir-locals.el then (variable . value) is stored both in `file-local-variables-alist' and in `dir-local-variables-alist' The problem is that the 3rd case doesn't seem correct. I think we should fix `hack-local-variables-filter' to remove (variable . value) from `dir-local-variables-alist' when it comes from file-locals and thus overrides dir-locals. So the 3rd case will be: 3. if it's set both in file-local and in dir-locals.el then (variable . value) is stored in `file-local-variables-alist' but not in `dir-local-variables-alist' I could implement this with adding a new variable `dir-local-variables-alist' after Yidong installs his patch in the same part of code that removes duplicates from `file-local-variables-alist'. -- Juri Linkov http://www.jurta.org/emacs/