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.devel Subject: Re: project-compilation-buffer-name-function and recompile Date: Thu, 18 Jan 2024 07:30:17 +0200 Message-ID: <83cytzb446.fsf@gnu.org> References: <3474d4d5-5270-4cd4-94a2-efb9d24caa85@jbornemann.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2125"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: =?utf-8?Q?J=C3=B6rg?= Bornemann Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jan 18 06:31:07 2024 Return-path: Envelope-to: ged-emacs-devel@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 1rQKzb-0000R0-EA for ged-emacs-devel@m.gmane-mx.org; Thu, 18 Jan 2024 06:31:07 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQKyz-00007t-6e; Thu, 18 Jan 2024 00:30:29 -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 1rQKyx-00007R-N3 for emacs-devel@gnu.org; Thu, 18 Jan 2024 00:30:27 -0500 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 1rQKyw-0007UF-Ef; Thu, 18 Jan 2024 00:30:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=Bbzomw7vRPdXkuBm+Ur24EnjYfdmcKNQWYHrXIXOuxY=; b=HAZorcX1HmNHug8NPEAg e8HnLonLZmCSDxkN5ykk1Vt6aGA8NXyVFkGbl9YcTyvDife5QXB1xSob4Bd2k3ONf7yQXyZl6X2lv OTnJ0nQA8oHNcCYQAUVv4sN5AXBF0dle9lAT9ztibtF2QxWReGJvp5hmFkyma/Z/1cxlLCM8OUCGt S09OWedZtmy4Lbf4Atv3LlPf0het1hK4cen5gCkWAwCfD03sQnsglgnroiI81RlEhDuk42rYekmiO ZvJRoXDznjApa8A3ydG9r0xZsHagS29zRrJgAK37CZilWxb6d10SQ0GJJwKqISZrTxbd3H6XSOfng QZo9IqjzdBZQsw==; In-Reply-To: <3474d4d5-5270-4cd4-94a2-efb9d24caa85@jbornemann.de> (message from =?utf-8?Q?J=C3=B6rg?= Bornemann on Wed, 17 Jan 2024 21:54:53 +0100) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:315071 Archived-At: > Date: Wed, 17 Jan 2024 21:54:53 +0100 > From: Jörg Bornemann > > One can use project-compile to build a project and then call recompile > to repeat the compilation. This reuses the buffer named > "*compilation*". > > If I set project-compilation-buffer-name-function to > #'project-prefixed-buffer-name, this creates a compilation buffer > "*myproject-compilation*" when executing project-compile. Now, > recompile won't re-use "*myproject-compilation*" but create a new > buffer "*compilation*". > > To reproduce this behavior, it is enough to start Emacs like this: > $ emacs -Q --eval "(setq project-compilation-buffer-name-function > #'project-prefixed-buffer-name)" > > It would be nice if recompile could re-use project-compile's buffer > name. I have fixed this locally by setting > compilation-buffer-name-function like this: > > ---snip--- > (defun my-compilation-buffer-name (name-of-mode) > (if (project-current) > (apply project-compilation-buffer-name-function (list > name-of-mode)) > (compilation--default-buffer-name name-of-mode))) > > (setq compilation-buffer-name-function #'my-compilation-buffer-name) > ---snap--- > > Although I'm thinking by now that it might be more consistent to have a > separate project-recompile command in addition to > recompile. What do you think? Thanks, I think what you say makes a lot of sense. I suggest to submit a feature-request bug report using "M-x report-emacs-bug" with these details, so we could track this request. If you can suggest a patch to implement these ideas, it would be even better.