bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#44066: 27.1; Values ignored when using .dir-locals.el and .dir-local


From: Lars Ingebrigtsen
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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]