From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#68570: 29.1; recompile might not re-use project-compile's buffer Date: Sun, 28 Jan 2024 15:42:10 +0200 Message-ID: <7062f157-0e9c-4c72-8edd-5a86d0dfcc43@gutov.dev> 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> <86fryp7ubp.fsf@mail.linkov.net> <871a3ea4-46d9-419e-a375-1d32968ccc88@jbornemann.de> <867ck0leif.fsf@mail.linkov.net> <0598898e-8e25-43b1-92c0-4596ad242ec8@gutov.dev> <86bk9b6vu4.fsf@mail.linkov.net> <86o7da1ws8.fsf@mail.linkov.net> <2a3f08b8-5334-41c6-8003-707424a8a0fe@gutov.dev> <86a5oqmzmp.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24136"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: =?UTF-8?Q?J=C3=B6rg?= Bornemann , 68570@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 28 14:43:17 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 1rU5RM-00067v-32 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 Jan 2024 14:43:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rU5R6-0006NM-JX; Sun, 28 Jan 2024 08:43:00 -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 1rU5R0-0006Mi-Sb for bug-gnu-emacs@gnu.org; Sun, 28 Jan 2024 08:42:56 -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 1rU5R0-0005gL-J6 for bug-gnu-emacs@gnu.org; Sun, 28 Jan 2024 08:42:54 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rU5R7-0005AV-Vq for bug-gnu-emacs@gnu.org; Sun, 28 Jan 2024 08:43:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Jan 2024 13:43:01 +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.170644935119825 (code B ref 68570); Sun, 28 Jan 2024 13:43:01 +0000 Original-Received: (at 68570) by debbugs.gnu.org; 28 Jan 2024 13:42:31 +0000 Original-Received: from localhost ([127.0.0.1]:56864 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rU5Qd-00059g-1L for submit@debbugs.gnu.org; Sun, 28 Jan 2024 08:42:31 -0500 Original-Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:52803) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rU5QZ-00059Q-VZ for 68570@debbugs.gnu.org; Sun, 28 Jan 2024 08:42:29 -0500 Original-Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.west.internal (Postfix) with ESMTP id DFD7F3200A7F; Sun, 28 Jan 2024 08:42:13 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Sun, 28 Jan 2024 08:42:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1706449333; x=1706535733; bh=v7YWty5hUN3TzPQT/KLu3JK6jWYd2Taz+5Xq6FDZnUs=; b= Agk+4pZpPRNkzfzwpFiYHwbG2onBqJp5sp4qoYhrGIUMF8OreiUNKSTUAn3nJgC0 78P4al1gaQcXIjf88htB588yqItC3itcfaKLw+wOQMzueAE6Ek8OItMNSQUNnUc3 t8A/BhtNBCj2Gi/Oop7FdXhpnnMKDK3VlCuPTzn0u3L5r+omOwWkUobp2bHy8BCV wDIpt1vxHnUpYiL+p7DV4GW5gjtrfych5BxHDiUGP5l9LxVmMYpNbos1opjPRDnj WT3NQqup5E41VdfoGJlH7JPcRaQInnfPZD208MwG3NOQe9N5eq8dVo2etPwabCQD 08VnBo3Ptghl/BEPdBh6Vg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1706449333; x= 1706535733; bh=v7YWty5hUN3TzPQT/KLu3JK6jWYd2Taz+5Xq6FDZnUs=; b=O kgymXJR2J21JWHhW+7UcuBAIR59fHWYbuUxIDxG0jMSi5BejbTAEedwEkJli9prc d2NR5rOUTLV+qCi5LtuOXPA3t9pzmHu0iqBKb8jFHiepxtmj/D4C8fugu0rrSj/l PIvs5EBfo99cr/RBzkxV3+bNe4C+1dgSbqFH3jC2HEsEP+8QI1k1tBZDYRCU/XEi LiniDQBM4IOx5t34M/fLLRxrLWOLzzEpLXTlf80KY0VJo4+wLtTesoJh4u5iB+R+ 1StYAJgHY0UODuka9zVddwGcsn63V2TBK9pcR3VLJhqjfy1OmBlzwbOHLEQ2uBGQ hIJOuIVfXPZJvYhWJ/Y5A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrfedtvddgheegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepffeifedvleeukedtgfelieegudfgveekfeejveejffetffeuueeugefhveei uddvnecuffhomhgrihhnpehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 28 Jan 2024 08:42:11 -0500 (EST) Content-Language: en-US In-Reply-To: <86a5oqmzmp.fsf@mail.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:279086 Archived-At: On 27/01/2024 19:53, Juri Linkov wrote: >>> It's very useful to always create a unique buffer for every compilation: >>> this allows keeping error messages from previous compilations. >> >> Hmm, but I suppose it can be a personal preference whether a "recompile" >> should create a new buffer or not. >> >> Because it's also reasonable to expect that 'M-x compile' creates a new >> buffer (e.g. project-prefixed and unique), but 'recompile', or >> 'revert-buffer' - keep that buffer around and reuse it. When one wants to >> keep the old contents, they could 'M-x compile' (or 'M-x project-compile') >> instead. >> >> This might be my preference anyway, because OT1H old compilations are often >> (but not always) handy to have around, OT2H I don't like to have too many >> buffers, and the above distinction between 'compile' and 'recompile' would >> be a tool to make that choice. > > A new option could be added indeed. But currently 'g' after 'compile' > uses 'compilation-buffer-name-function' that can be configured > to generate a new buffer. So it's expected that 'g' after > 'project-compile' should do the same and use > 'project-compilation-buffer-name-function', especially > when it's configured to generate a new buffer. Again, I'm not sure if it's expected: even if I do like the idea of unique per-project compilation buffers, seeing 'g' reuse the existing buffer feels pretty natural. > IOW, I think these two 'compile' and 'project-compile' > should be in sync in regard to what 'recompile' does. When I'm saying is that when 'recompile' reuses the current buffer it already follows the result of project-compilation-buffer-name-function (when it was invoked from project-compile, of course). >>> I propose even to add such an option to the choice list in >>> project-compilation-buffer-name-function, e.g.: >>> (defcustom project-compilation-buffer-name-function nil >>> :type '(choice (const :tag "Default" nil) >>> (const :tag "Prefixed with project name" >>> project-prefixed-buffer-name) >>> (const :tag "Prefixed and unique with project name" >>> project-prefixed-unique-buffer-name) >>> (function :tag "Custom function"))) >> >> Sounds good. > > There is also a proposal to add the same option > to 'compilation-buffer-name-function' in bug#68697. Sounds good to me. We could also ask the reporter there what they think 'g' should do in such buffers (create a new one or reuse current). >>> The previous patch would be needed as well since currently >>> there is no way to allow unique project compilation buffers. >> >> The one in 0a07603ae8d? > > Actually I meant https://debbugs.gnu.org/68570#23 We could make a new option in compile.el which would determine whether to do this in general: when non-nil, 'compilation-start' would save the current dynamic value of 'compilation-buffer-name-function', and 'recompile' would call it again. Otherwise the distinction remains that when 'recompile' is invoked inside a compilation buffer, the same buffer is used; and when it's invoked from some other buffer, a new compilation buffer can be created.