GNU bug report logs -
#76912
31.0.50; hack-local-variables docstring inaccurate about directory-local variables
Previous Next
Reported by: Sean Whitton <spwhitton <at> spwhitton.name>
Date: Mon, 10 Mar 2025 08:59:02 UTC
Severity: minor
Found in version 31.0.50
Done: Sean Whitton <spwhitton <at> spwhitton.name>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> From: Sean Whitton <spwhitton <at> spwhitton.name>
> Date: Mon, 10 Mar 2025 16:58:28 +0800
>
> We have:
>
> (defun hack-local-variables (&optional handle-mode inhibit-locals)
> "Parse and put into effect this buffer's local variables spec.
> For buffers visiting files, also puts into effect directory-local
> variables.
>
> but this second sentence is wrong -- buffers not visiting files get
> them, too. For example
>
> - emacs -Q
> - C-x v d ~/src/emacs/trunk/ RET
> - C-h v fill-column RET
> => local value of 72, from our .dir-locals.el, but VC-Dir is not a
> file-visiting buffer.
>
> I think this is not a bug in the implementation and the docstring just
> needs changing. Would someone kindly confirm?
The code clearly calls hack-dir-local-variables, and has been doing so
since 2008, AFAICT. As usual, we changed the code, but failed pt
update the doc string.
Note that the ELisp manual keeps silence about this aspect of
hack-local-variables.
It would be good to document which directory is used for non-file
buffers, btw.
This bug report was last modified 72 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.