Subject: bug#70136: 30.0.50; compilation-mode [was: comint-mode] doesn't call hack-dir-local-variables-non-file-buffer

From: Augusto Stoffel <[email-masked]>
Date: Wed, 17 Apr 2024 10:16:03 +0200

On Tue, 16 Apr 2024 at 09:33, Juri Linkov wrote:

> IMHO, the problem is more wide and it's that dir-local variables
> are not supported in non-file buffers by default.  Maybe a new
> option could enable them not only in compilation buffers,
> but in all non-file buffers?

One would have to exclude temporary and internal work buffers, for
efficiency reasons.

And then there's also the case of buffers that don't really "belong" to
a directory, such as *Help*.  Do you think there's a reliable way to
distinguish those from the rest?

(By the way, *Help* and friends get stuck forever in whatever
default-directory they were first created; so for instance if you do
C-x C-f in a *Help* buffer, you will see a random directory as
starting point...)

>  Or such a new option could be a list of non-file modes that should
> support dir-local variables.

I'm not a big fan of this idea.  The .dir-locals.el file is already a
list of modes, you can decide there which modes you want to be affected.