From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: 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 Message-ID: References: <87zfuc48d5.fsf@gmail.com> <86msqc9dsa.fsf@gnu.org> <874jcjeuac.fsf@gmail.com> <86edbnajfp.fsf@gnu.org> <87mspwcn0f.fsf_-_@gmail.com> <86le4s7n65.fsf@mail.linkov.net> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14642"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , Augusto Stoffel , 70136@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 20 16:56:23 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tOfMT-0003Zt-3f for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 20 Dec 2024 16:56:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOfMC-0001Sj-TI; Fri, 20 Dec 2024 10:56:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tOfMA-0001SR-Rq for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2024 10:56:02 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOfMA-0007TN-A6 for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2024 10:56:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=oiuzJMRKy4eRNAWnkm2mu0lKdMKsuz0rZoFof4xd9hk=; b=RJTzayre7n74fXBWjqJqcg6y+A/wT2AO0kxwzihTEVzEGqZencJUoUg8x2C4LFxuf16zGHbZN5KR7OP4brsKjBRtVG0Oh6r1QnEKCnGT4z2zeFY+SWnqxlMTPw6oEoolziHHNhyACELfrx+z6KM70FMxaBBIfnb2ukZFsjOMpHw4nz5OKa1o4z16dZc8eO2hBiTfYMdasaBjU7blkZ/uT679bDO8dYozCrVISULueSSxPagGpe+61sI6i+KZ3z1zyKj66TBOle9ktp5hFivOHQNqtexQbLvLRRsd27Ns9lccvu+4LM3qvbUtUh+MKtefRx2oW7tF3C+EGNgAHtMqOg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tOfMA-0008E4-43 for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2024 10:56:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Dec 2024 15:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70136 X-GNU-PR-Package: emacs Original-Received: via spool by 70136-submit@debbugs.gnu.org id=B70136.173471011331355 (code B ref 70136); Fri, 20 Dec 2024 15:56:02 +0000 Original-Received: (at 70136) by debbugs.gnu.org; 20 Dec 2024 15:55:13 +0000 Original-Received: from localhost ([127.0.0.1]:43719 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tOfLN-00089E-2I for submit@debbugs.gnu.org; Fri, 20 Dec 2024 10:55:13 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:58182) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tOfLK-000877-8A for 70136@debbugs.gnu.org; Fri, 20 Dec 2024 10:55:11 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 1F231808F9; Fri, 20 Dec 2024 10:55:04 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1734710103; bh=+oQNHijvQCr20BjjkROT5svHutVno9MO2vdowTKW/lQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=kB6F52uuAyJnmTrwLaUoAD+S1SZkXzRp3DSsVeGp1PL/0ZoriBEsnfypjJeY8lGc2 fYLruUZlLufN9PJrBZCl0rURRixcnbszVEw3szVg+iSNwOT2M8Zw19ErvArDJ+3uwW B/OWpz+SC2BW7a+bxfj+/bGI24VrfblPsUPV3On9pBMsRYr3CeWkrf5vsfLopQiG47 BtfEv1mtovtXWq1k/xwm56A/iD3YXIOGl4tM7DdcG21EqXEYpclqS5XeECSpP54wi4 I+vds26falciY7vMVbc+j4Z6E2r7/Pa+5pp42ZkrzV9a/2SFEBjmkx1XxfHs/ikG+8 l1y9W77fBTycQ== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 4E03080758; Fri, 20 Dec 2024 10:55:03 -0500 (EST) Original-Received: from asado (unknown [199.119.74.1]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 0AA11120611; Fri, 20 Dec 2024 10:55:02 -0500 (EST) In-Reply-To: <86le4s7n65.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 02 May 2024 09:17:22 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:297454 Archived-At: >> @@ -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