From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jacob First 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 16:46:17 -0400 Message-ID: <87pn5ehrl2.fsf@member.fsf.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="37600"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 44066@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 19 23:25:17 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 1kUceb-0009gu-7g for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Oct 2020 23:25:17 +0200 Original-Received: from localhost ([::1]:53692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUcea-0006pW-AN for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Oct 2020 17:25:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43594) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUcdO-0005wT-G7 for bug-gnu-emacs@gnu.org; Mon, 19 Oct 2020 17:24:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59339) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kUcdO-0001zN-4e for bug-gnu-emacs@gnu.org; Mon, 19 Oct 2020 17:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kUcdN-0003EF-WE for bug-gnu-emacs@gnu.org; Mon, 19 Oct 2020 17:24:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87sgacdtg3.fsf@pebbles.i-did-not-set--mail-host-address--so-tickle-me> Resent-From: Jacob First Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Oct 2020 21:24:01 +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.160314261312373 (code B ref 44066); Mon, 19 Oct 2020 21:24:01 +0000 Original-Received: (at 44066) by debbugs.gnu.org; 19 Oct 2020 21:23:33 +0000 Original-Received: from localhost ([127.0.0.1]:42652 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUcct-0003DT-DL for submit@debbugs.gnu.org; Mon, 19 Oct 2020 17:23:32 -0400 Original-Received: from mail-il1-f174.google.com ([209.85.166.174]:37242) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUc3J-0002IW-B5 for 44066@debbugs.gnu.org; Mon, 19 Oct 2020 16:46:45 -0400 Original-Received: by mail-il1-f174.google.com with SMTP id j13so1767083ilc.4 for <44066@debbugs.gnu.org>; Mon, 19 Oct 2020 13:46:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:cc:date:message-id:mime-version; bh=rNVTd2WMs6C6Sm7rguvY9iZ0EnYVBmLZQnpPEciGuKU=; b=E8IATAqqjrCv6aW29MFwVCp/fUUFksweylrVWFBwo7gynk2dzYG8ix9oG79PW1J4wc eGSmz4NyJMWmBajj04bqAma4LDwqmll13nSaW1QzVFe0rViM6KgbZpmYTfleVymEDj/w y1IEEWd7pH3JLPYaUrIQDW7eUlXPD/T3nr3p7W2ao/hhiBUf/vUDwWI0SJp1pHE9Zf+F y2kAxYxHSxqSoZKLu15sPRUQyMlrhjmCZCjza7K9RBUlzS7Ol3U0fVceE4EzvVxAMU6t y4lVv9ztbvQafgamJanHPwNk5EazyfFvWWRhm+Vufi84hyzvA5X7seqr09xoUd2Vn4vm wkmQ== X-Gm-Message-State: AOAM533WH+Xn7u8PyhnydDwsZCnwTChPQA5uD7f0YadCooVB42MNBe3p eB6YI6+Zkz/lyb7v+fU6jcRiyYrD48k= X-Google-Smtp-Source: ABdhPJyEOOc0VE55iBYijncL9Av9FW+M0bvZmmRjM6V0Y8WpMQbUok5+JU2oUs9znJsmx9iJGxcCjg== X-Received: by 2002:a92:cb0c:: with SMTP id s12mr1454865ilo.215.1603140399365; Mon, 19 Oct 2020 13:46:39 -0700 (PDT) Original-Received: from pebbles (205-201-19-136.starry-inc.net. [205.201.19.136]) by smtp.gmail.com with ESMTPSA id x13sm834943iox.31.2020.10.19.13.46.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Oct 2020 13:46:38 -0700 (PDT) X-Mailman-Approved-At: Mon, 19 Oct 2020 17:23:30 -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:191048 Archived-At: Hi, > 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))) Thanks! > But... is this syntax even allowed? Does it work in the > single-dir-locals-file case by accident? 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? Another thing that might imply support for multiple `eval' is intended: if in .dir-locals.el I have ((nil . ((eval . (setq var1 'foo)))) (scheme-mode . ((eval . (setq var2 'bar))))) then when I open a file in Scheme mode, both var1 and var2 are set rather than the Scheme setting overriding, even though for normal variables, the more specific setting is supposed to take precedence. This is getting a bit speculative though.