From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#68570: 29.1; recompile might not re-use project-compile's buffer Date: Mon, 22 Jan 2024 09:31:22 +0200 Organization: LINKOV.NET Message-ID: <86fryp7ubp.fsf@mail.linkov.net> References: <920b0c20-c6ee-4b41-84ec-5adfa06c64a2@jbornemann.de> <320b09d1-2af4-4110-bdf3-94da122f3dd6@gutov.dev> <86il3m1zi7.fsf@mail.linkov.net> <60842df3-8a64-4bde-b6d6-f94b9a964a17@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9363"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: =?UTF-8?Q?J=C3=B6rg?= Bornemann , 68570@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 22 08:56:37 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 1rRpAa-0002Ij-RI for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 22 Jan 2024 08:56:36 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rRpA1-0004Wm-VK; Mon, 22 Jan 2024 02:56:02 -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 1rRp9y-0004WP-HK for bug-gnu-emacs@gnu.org; Mon, 22 Jan 2024 02:55:59 -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 1rRp9y-0005cL-8o for bug-gnu-emacs@gnu.org; Mon, 22 Jan 2024 02:55:58 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rRpA2-000511-3U for bug-gnu-emacs@gnu.org; Mon, 22 Jan 2024 02:56:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Jan 2024 07:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68570 X-GNU-PR-Package: emacs Original-Received: via spool by 68570-submit@debbugs.gnu.org id=B68570.170591014719235 (code B ref 68570); Mon, 22 Jan 2024 07:56:02 +0000 Original-Received: (at 68570) by debbugs.gnu.org; 22 Jan 2024 07:55:47 +0000 Original-Received: from localhost ([127.0.0.1]:39818 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRp9n-00050B-5M for submit@debbugs.gnu.org; Mon, 22 Jan 2024 02:55:47 -0500 Original-Received: from relay7-d.mail.gandi.net ([217.70.183.200]:37741) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRp9k-0004zr-Ov for 68570@debbugs.gnu.org; Mon, 22 Jan 2024 02:55:45 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id CD3F12000F; Mon, 22 Jan 2024 07:55:33 +0000 (UTC) In-Reply-To: <60842df3-8a64-4bde-b6d6-f94b9a964a17@gutov.dev> (Dmitry Gutov's message of "Sun, 21 Jan 2024 20:33:00 +0200") X-GND-Sasl: juri@linkov.net 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:278690 Archived-At: >>>> Although I'm thinking by now that it might be more consistent to have >>>> a separate project-recompile command in addition to >>>> recompile. >>> I've pushed to master a new command called that (commit 0a07603ae8d), like >>> discussed on the mailing list. >> Shouldn't now 'g' in project buffers use 'project-recompile'? > > I don't know if it should - AFAICS 'M-x recompile' doesn't rename the > current buffer, so it seems like the current behavior is already correct. This patch would allow 'recompile' to use the renamed project compilation buffer: diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index ab4504fa027..58bf2401dac 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1395,7 +1395,10 @@ project-compile (compilation-buffer-name-function (or project-compilation-buffer-name-function compilation-buffer-name-function))) - (call-interactively #'compile))) + (with-current-buffer (call-interactively #'compile) + (when project-compilation-buffer-name-function + (setq-local compilation-buffer-name-function + project-compilation-buffer-name-function))))) (defun project-recompile (&optional edit-command) "Run `recompile' with appropriate buffer." Then 'project-recompile' won't be needed anymore.