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: Tue, 20 Oct 2020 13:07:33 +0200 Message-ID: <87lfg1i2a2.fsf@gnus.org> References: <87pn5ehrl2.fsf@member.fsf.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11063"; 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 Tue Oct 20 13:12:13 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 1kUpYr-0002lw-LS for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 20 Oct 2020 13:12:13 +0200 Original-Received: from localhost ([::1]:53802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUpYq-0000TW-NC for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 20 Oct 2020 07:12:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUpUp-0002bb-8o for bug-gnu-emacs@gnu.org; Tue, 20 Oct 2020 07:08:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60436) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kUpUo-0007O9-Kt for bug-gnu-emacs@gnu.org; Tue, 20 Oct 2020 07:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kUpUo-0005pu-Ea for bug-gnu-emacs@gnu.org; Tue, 20 Oct 2020 07:08: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: Tue, 20 Oct 2020 11:08: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.160319207222405 (code B ref 44066); Tue, 20 Oct 2020 11:08:02 +0000 Original-Received: (at 44066) by debbugs.gnu.org; 20 Oct 2020 11:07:52 +0000 Original-Received: from localhost ([127.0.0.1]:43746 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUpUe-0005pJ-3v for submit@debbugs.gnu.org; Tue, 20 Oct 2020 07:07:52 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:45150) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUpUd-0005p3-0j for 44066@debbugs.gnu.org; Tue, 20 Oct 2020 07:07:51 -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=VDfAsyPWglU5VEIxv7BoslRMEsFGFlnmt0R/relVqp4=; b=uvWwsV4/Gr4rOjU8E57fb05CG9 EeOGe1uey/G3OvWOwXi8+MuNUX44COUk+6sD3MyxTBG7Oc427C6i06ewGSaltt2CPAevY2RLNKfp+ OY1ORhGcEXxT1Lzi/U7tQEAnPgTaIKitDiNyREScfPo2cH9FfTL4Oo1JWm3IIeIJY0bw=; 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 1kUpUM-0006zg-NX; Tue, 20 Oct 2020 13:07:44 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAG1BMVEX8/P3X0uNiJ024 QlTYfnifIWvaWWzioJ/////0RaLlAAAAAWJLR0QIht6VegAAAAd0SU1FB+QKFAoiKTxdcMcAAAGz SURBVDjLlZPBjqMwDIbTNyjdQ+9m2gfAkL0TT7iTzbxAgudcDZq8/jqhtB2JjtRfECF/8W9sglKq Uru92tJuv5drC1SizZxdtntFu+u9oUpt13hR8ES/gPoZaCBf21b9NnijHk5+1fiQgY0E0D+qgNPJ j95R9whGUKtJ/wD+We/V8th9NG24gZSmDMB7pxFAX+2HIaX3Amrf5C5v5ds1o85vAZNGdJI8+Y9r xgj1JMRqPQJ2o/GomUwBZ80BkRmgRiylXCxAM0fmoBtAqMURsRMrF2RvezjzpIMT0MoqUk62B/f3 8PbNIgSNky9AtvPkWhMtFsAhbwgLECtpA3h5BbZy+wwCk2xtgaOUizmMwStdMlg+4llAay+zFOsY 7wA1EUU6AOUcvgLbA+InJUoJ6mOa78CQaWWqsRp6HGYkVjksHjYYiad0qf4MhAYXIIpEBaSLoS/9 rQuQIJGsEiYTMQwm11jic6Icn6XFFgl4BYtLshyHL9RYS4sCrCRI9WyXm27yWMKtwTwGmWmTB2vL dH+e2JP0qcN6RH8cTpc/Xwb+iZ6D6q50vFTVMa/peHz9b/4PDxXyfYPT/14AAAAldEVYdGRhdGU6 Y3JlYXRlADIwMjAtMTAtMjBUMTA6MzQ6NDErMDA6MDCS/O8wAAAAJXRFWHRkYXRlOm1vZGlmeQAy MDIwLTEwLTIwVDEwOjM0OjQxKzAwOjAw46FXjAAAAABJRU5ErkJggg== X-Now-Playing: Talk Talk's _It's My Life_: "It's My Life" In-Reply-To: <87pn5ehrl2.fsf@member.fsf.org> (Jacob First's message of "Mon, 19 Oct 2020 16:46:17 -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:191076 Archived-At: Jacob First writes: > Are you asking if multiple `eval' are allowed per file? I'm pretty sure > they are; at least, I've seen them used regularly and can't find a > restriction in the manual. In any case, there's still a problem when > each list contains only a single `eval': > > (setq variables '((nil (eval setq var1 'foo)))) > (setq newvars '((nil (eval setq var3 'baz)))) > > (map-merge-with 'list (lambda (a b) > (map-merge 'list a b)) > variables > newvars) > > => ((nil (eval setq var3 'baz))) > > Presumably (setq var1 'foo) should also be evaluated, right? Yup. I was a bit unsure what the point of the merge was at all, but it's for pruning repeated variables, like so: (setq variables '((nil (foo . bar1) (zot . bar2)))) (setq newvars '((nil (qux . bar1) (zot . bar3)))) (map-merge-with 'list (lambda (a b) (map-merge 'list a b)) variables newvars) => ((nil (qux . bar1) (foo . bar1) (zot . bar3))) So I'm guessing the `eval' case just wasn't considered when the merge bit was written. I think, in general, all the `eval' bits have to be preserved, and nothing should be pruned? So the fix would be to handle `eval's separately. I've now done this on the trunk, and it makes the test case work for me. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no