From: Lars Ingebrigtsen <larsi@gnus.org>
To: Jacob First <jacob.first@member.fsf.org>
Cc: 44066@debbugs.gnu.org
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 [thread overview]
Message-ID: <87lfg1i2a2.fsf@gnus.org> (raw)
In-Reply-To: <87pn5ehrl2.fsf@member.fsf.org> (Jacob First's message of "Mon, 19 Oct 2020 16:46:17 -0400")
Jacob First <jacob.first@member.fsf.org> 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
next prev parent reply other threads:[~2020-10-20 11:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-18 4:55 bug#44066: 27.1; Values ignored when using .dir-locals.el and .dir-locals-2.el together Jacob First
2020-10-19 9:44 ` Lars Ingebrigtsen
2020-10-19 20:46 ` Jacob First
2020-10-20 11:07 ` Lars Ingebrigtsen [this message]
2020-10-20 20:50 ` Jacob First
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lfg1i2a2.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=44066@debbugs.gnu.org \
--cc=jacob.first@member.fsf.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.