From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#44066: 27.1; Values ignored when using .dir-locals.el and .dir-locals-2.el together Date: Mon, 19 Oct 2020 11:44:52 +0200 Message-ID: <87y2k2eei3.fsf@gnus.org> References: <87sgacdtg3.fsf@pebbles.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2100"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 44066@debbugs.gnu.org To: Jacob First Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 19 11:49:42 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kURnR-0000QY-7B for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Oct 2020 11:49:41 +0200 Original-Received: from localhost ([::1]:46476 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kURnQ-0000qt-8V for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Oct 2020 05:49:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50668) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kURju-0005Qe-TV for bug-gnu-emacs@gnu.org; Mon, 19 Oct 2020 05:46:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56741) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kURju-00028K-IM for bug-gnu-emacs@gnu.org; Mon, 19 Oct 2020 05:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kURju-0003VU-GH for bug-gnu-emacs@gnu.org; Mon, 19 Oct 2020 05:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Oct 2020 09:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44066 X-GNU-PR-Package: emacs Original-Received: via spool by 44066-submit@debbugs.gnu.org id=B44066.160310071113407 (code B ref 44066); Mon, 19 Oct 2020 09:46:02 +0000 Original-Received: (at 44066) by debbugs.gnu.org; 19 Oct 2020 09:45:11 +0000 Original-Received: from localhost ([127.0.0.1]:40054 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kURj5-0003UB-4q for submit@debbugs.gnu.org; Mon, 19 Oct 2020 05:45:11 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:33008) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kURj2-0003Tj-0a for 44066@debbugs.gnu.org; Mon, 19 Oct 2020 05:45:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=GSJBde2S5LstRqj6if71bNttbfrS5KWh/mX1mKPPpUo=; b=hJUKrrXFkCx6w8RRqsGg0hok9A 6AEQQS6bJap2HyIqFPRxBuf/Fmjy4EUqD4VWOnJoWfRWL/P2h9WjYPhTMxoWtAQNQVSPUKbaX97qX dDPmRI/Eu+DFkP9uNN13Ak5my2HyrpIRgQSa7pKsT0crVfOctJzQAu53Bm9kyFOAOgiE=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kURip-00066a-0v; Mon, 19 Oct 2020 11:45:01 +0200 X-Now-Playing: Elecktroids's _Elektroworld_: "Thermo Science" In-Reply-To: <87sgacdtg3.fsf@pebbles.i-did-not-set--mail-host-address--so-tickle-me> (Jacob First's message of "Sun, 18 Oct 2020 00:55:08 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:190976 Archived-At: Jacob First writes: > To reproduce, first create a directory with 3 files with the filenames > and the contents listed below: > > = file.txt = > test file > > = .dir-locals.el = > ((nil . ((eval . (setq var1 'foo)) (eval . (setq var2 'bar))))) > > = .dir-locals-2.el = > ((nil . ((eval . (setq var3 'baz)) (eval . (setq var4 'qux))))) This was fun to debug, because there's so much caching going on that... well. Anyway, here's what's happening if you have two .dir-locals files: (setq variables '((nil (eval setq var1 'foo) (eval setq var2 'bar)))) (setq newvars '((nil (eval setq var3 'baz) (eval setq var4 'qux)))) Then this is run: (map-merge-with 'list (lambda (a b) (map-merge 'list a b)) variables newvars) => ((nil (eval setq var4 'qux) (eval setq var2 'bar))) If there's only a single .dir-locals file, nothing is merged and the form is returned as is. This certainly seems like a bug, and it's present in Emacs 26, too (which is the earliest one I have here). But... is this syntax even allowed? Does it work in the single-dir-locals-file case by accident? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no