GNU bug report logs -
#78780
31.0.50; Directory local variables not effective when loading Elisp file
Previous Next
To reply to this bug, email your comments to 78780 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78780
; Package
emacs
.
(Fri, 13 Jun 2025 11:54:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Óscar Fuentes <oscarfv <at> eclipso.eu>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Fri, 13 Jun 2025 11:54:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
In ~/elisp/singles I created this .dir-locals.el file:
((nil
. ((warning-suppress-log-types
. '(missing-lexbind-cookie)))))
Then emacs -Q and eval this:
(load "~/elisp/singles/buffer-flip.el")
That file does not contain the lexical-binding cookie. The *Warnings*
file pops out:
Warning (files): Missing ‘lexical-binding’ cookie in
"~/elisp/singles/buffer-flip.el".
If I visit the file Emacs asks about applying .dir-locals ("The local
variables list in /home/oscar/elisp/singles or .dir-locals.el contains
values..."), press "y" and then C-h v warning-suppress-log-types
warning-suppress-log-types is a variable defined in ‘warnings.el’.
Its value is '((missing-lexbind-cookie))
Original value was nil
Local in buffer buffer-flip.el; global value is nil
It seems that .dir-locals.el is ignored when Emacs load files on the
directory.
I'm not sure it should, as asking for the user's permission when the
file is loaded (usually at start time) is quite inconvenient, and on
some scenarios there is no user present (--daemon)
In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
version 1.18.4) of 2025-06-08 built on sky
Repository revision: f90cee6f761b0c2bffcfa64556284884c0f7348f
Repository branch: igc
Windowing system distributor 'The X.Org Foundation', version 11.0.12101016
System Description: Debian GNU/Linux 13 (trixie)
Configured using:
'configure 'CPPFLAGS=-O2 -fno-omit-frame-pointer -g3'
CPPFLAGS=-I/home/oscar/dev/include/mps
LDFLAGS=-L/home/oscar/dev/other/mps/code --with-native-compilation
--with-tree-sitter --without-toolkit-scroll-bars --with-x-toolkit=lucid
--with-modules --without-imagemagick --with-mps=yes'
Configured features:
CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG LIBOTF
LIBSELINUX LIBSYSTEMD LIBXML2 MODULES MPS NATIVE_COMP NOTIFY INOTIFY
PDUMPER PNG SECCOMP SOUND SQLITE3 THREADS TIFF TREE_SITTER WEBP X11
XAW3D XDBE XIM XINERAMA XINPUT2 XPM XRANDR LUCID ZLIB
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78780
; Package
emacs
.
(Fri, 13 Jun 2025 15:31:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 78780 <at> debbugs.gnu.org (full text, mbox):
Óscar Fuentes via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs <at> gnu.org> writes:
> In ~/elisp/singles I created this .dir-locals.el file:
>
> ((nil
> . ((warning-suppress-log-types
> . '(missing-lexbind-cookie)))))
For the record: following Eli's suggestion on emacs-devel, I also tried
with this in .dir-locals.el:
((nil
. ((warning-suppress-log-types
. '((missing-lexbind-cookie))))))
Still, no effect when the file is loaded.
Related: bug#78787 "Support for directories and globs in
warning-suppress-log-types et al"
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78780
; Package
emacs
.
(Fri, 13 Jun 2025 16:15:06 GMT)
Full text and
rfc822 format available.
Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):
On Jun 13 2025, Óscar Fuentes via "Bug reports for GNU Emacs, the Swiss army knife of text editors" wrote:
> For the record: following Eli's suggestion on emacs-devel, I also tried
> with this in .dir-locals.el:
>
> ((nil
> . ((warning-suppress-log-types
> . '((missing-lexbind-cookie))))))
You need to remove the quote character. This form is not evaluated.
--
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78780
; Package
emacs
.
(Fri, 13 Jun 2025 16:15:12 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78780
; Package
emacs
.
(Fri, 13 Jun 2025 17:06:04 GMT)
Full text and
rfc822 format available.
Message #17 received at 78780 <at> debbugs.gnu.org (full text, mbox):
Andreas Schwab <schwab <at> linux-m68k.org> 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
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78780
; Package
emacs
.
(Fri, 13 Jun 2025 17:18:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 78780 <at> debbugs.gnu.org (full text, mbox):
On Jun 13 2025, Óscar Fuentes wrote:
> Andreas Schwab <schwab <at> linux-m68k.org> 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.
There is a big difference between (quote ((missing-lexbind-coo))) and
((missing-lexbind-coo)).
--
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
This bug report was last modified 5 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.