Subject: Re: bug#78780: 31.0.50; Directory local variables not effective when loading Elisp file

From: Óscar Fuentes <[email-masked]>
Date: Fri, 13 Jun 2025 19:05:10 +0200

Andreas Schwab <[email-masked]> writes:

>> ((nil
>>   . ((warning-suppress-log-types
>>       . '((missing-lexbind-cookie))))))
>
> You need to remove the quote character.  This form is not evaluated.

Thanks for the suggestion, although my understanding is that if the form
is not evaluated the quote should not make a difference.

With this in .dir-locals.el:

((nil
  . ((warning-suppress-log-types
      . ((missing-lexbind-cookie))))))

or this

((nil
  . ((warning-suppress-log-types
      . (missing-lexbind-cookie)))))

emacs -Q

M-x load-library path/to/file.el

the *Warnings* buffer stills pops up with the lexical-binding cookie
warning.

There is no indication that .dir-locals.el is taken into account when
the file is loaded. I put some junk on .dir-locals.el and make no effect
while loading the file, but visiting it showed this message:

Invalid data in /home/oscar/elisp/singles/.dir-locals.el: oarnst