From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii 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: Sun, 14 Apr 2024 13:21:47 +0300 Message-ID: <86v84kmeh0.fsf@gnu.org> References: <87zfuc48d5.fsf@gmail.com> <86msqc9dsa.fsf@gnu.org> <874jcjeuac.fsf@gmail.com> <86edbnajfp.fsf@gnu.org> <87mspwcn0f.fsf_-_@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32011"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70136@debbugs.gnu.org, monnier@iro.umontreal.ca To: Augusto Stoffel Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 14 12:23:09 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 1rvx0u-00085Z-4Q for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Apr 2024 12:23:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rvx0n-00041d-66; Sun, 14 Apr 2024 06:23:01 -0400 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 1rvx0j-000412-3D for bug-gnu-emacs@gnu.org; Sun, 14 Apr 2024 06:22:57 -0400 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 1rvx0i-0000B7-M1 for bug-gnu-emacs@gnu.org; Sun, 14 Apr 2024 06:22:56 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rvx0t-0006XJ-2h for bug-gnu-emacs@gnu.org; Sun, 14 Apr 2024 06:23:07 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Apr 2024 10:23:06 +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.171309014024764 (code B ref 70136); Sun, 14 Apr 2024 10:23:06 +0000 Original-Received: (at 70136) by debbugs.gnu.org; 14 Apr 2024 10:22:20 +0000 Original-Received: from localhost ([127.0.0.1]:34397 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rvx03-0006Qc-6E for submit@debbugs.gnu.org; Sun, 14 Apr 2024 06:22:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46956) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rvwzv-0006Om-Hb for 70136@debbugs.gnu.org; Sun, 14 Apr 2024 06:22:11 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rvwzd-0008WV-JH; Sun, 14 Apr 2024 06:21:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=RohSRsRfHcUJ8p3Sjo5ddQby1nINj3EeOuOA8u3YF14=; b=Z7dsVNOX6y6M YeBXdRMkFRuj9Gj44MJffWQHDtOJKWKD1MolTk7Q704FPvSKO12j1VE0bDICzJSNXKCpbLusTSzBI GSmNAF+7FMbdUnHlCAXW6J0BzvBHBRezcpmroDRwRoxNB8WrKM64rLzNQj/VuxwE2GMXHv7d3MH16 /W7Or+9Dob1HTrHa86pAJtdXtbd/GZipFcFstJusBvuLwTGiUhSXW0aF8+Kf5vyoYLDJS+fYPlyr4 y47z0Bo8XK9QJUuk7VGhuzqq0UKdkxrbL1+mVbOpwz1Pvu1cylt2QlASEqa0Pp5vEOGayshvFoaiH X3Sz1/KEDt3XPNvQZYLOuQ==; In-Reply-To: <87mspwcn0f.fsf_-_@gmail.com> (message from Augusto Stoffel on Sun, 14 Apr 2024 11:27:28 +0200) 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:283270 Archived-At: > From: Augusto Stoffel > Cc: 70136@debbugs.gnu.org, Stefan Monnier > Date: Sun, 14 Apr 2024 11:27:28 +0200 > > Since compilation buffers go as far as to print the directory they're > running on at the top of the buffer, I think it's pretty clear they > should receive dir-local variables. > > So I'd suggest the attached patch, which does that and also removes a > more limited mechanism I added some time ago to allow compilation with > project-specific settings. I've CC'ed Stefan since at the time he kind > of supported the changes I'm now suggesting to remove. Thanks, but I think this should be optional behavior, by default off, because it could cause trouble in directory trees which already have .dir-locals.el that were not intended to affect compilation-mode (and its descendants, like Grep). Also, this needs a NEWS entry, I think. > + (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))) Why such a complicated way of using the symbol of a function that's defined in a preloaded Lisp file? Am I missing some subtlety here?