GNU bug report logs - #70136
30.0.50; comint-mode doesn't call hack-dir-local-variables-non-file-buffer

Previous Next

Package: emacs;

Reported by: Augusto Stoffel <arstoffel <at> gmail.com>

Date: Tue, 2 Apr 2024 05:56:02 UTC

Severity: normal

Found in version 30.0.50

Full log


Message #89 received at 70136 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Juri Linkov <juri <at> linkov.net>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Augusto Stoffel <arstoffel <at> gmail.com>,
 70136 <at> debbugs.gnu.org
Subject: Re: bug#70136: 30.0.50; compilation-mode [was: comint-mode] doesn't
 call hack-dir-local-variables-non-file-buffer
Date: Fri, 20 Dec 2024 10:54:57 -0500
>> @@ -2372,6 +2363,11 @@ compilation-mode
>>    ;; some other input event happens.
>>    (setq-local jit-lock-defer-time nil)
>>    (setq buffer-read-only t)
>> +  (unless (buffer-file-name)
>> +    (let ((sym (make-symbol "hack-dir-local-variables-non-file-buffer")))
>> +      (set sym #'hack-dir-local-variables-non-file-buffer)
>> +      ;; Ensure hack-dir-locals is called only after a derived mode is set.
>> +      (push sym delayed-mode-hooks)))
>>    (run-mode-hooks 'compilation-mode-hook))
>
> Thanks for the patch.  I confirm it completely fixes the bug
> reported at the end of bug#68570.

Clearly, I'm in favor, tho I find the specific code above rather ugly.
Could we improve it?
Maybe setting a `enable-dir-local-variables-non-file-buffer` variable,
which is then obeyed in the hack-local-* functions?


        Stefan





This bug report was last modified 179 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.