From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?J=C3=B6rg_Bornemann?= Newsgroups: gmane.emacs.devel Subject: project-compilation-buffer-name-function and recompile Date: Wed, 17 Jan 2024 21:54:53 +0100 Message-ID: <3474d4d5-5270-4cd4-94a2-efb9d24caa85@jbornemann.de> 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="26819"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jan 17 21:55:46 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 1rQCwr-0006lQ-7x for ged-emacs-devel@m.gmane-mx.org; Wed, 17 Jan 2024 21:55:45 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQCw9-0003P7-2H; Wed, 17 Jan 2024 15:55:01 -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 1rQCw7-0003Oz-5N for emacs-devel@gnu.org; Wed, 17 Jan 2024 15:54:59 -0500 Original-Received: from ms-10.1blu.de ([178.254.4.101]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rQCw5-0001uB-Co for emacs-devel@gnu.org; Wed, 17 Jan 2024 15:54:58 -0500 Original-Received: from [93.228.119.27] (helo=[192.168.188.81]) by ms-10.1blu.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rQCw0-00C8SG-BE for emacs-devel@gnu.org; Wed, 17 Jan 2024 21:54:52 +0100 Content-Language: en-US X-Con-Id: 36794 X-Con-U: 0-foss X-Originating-IP: 93.228.119.27 Received-SPF: pass client-ip=178.254.4.101; envelope-from=foss@jbornemann.de; helo=ms-10.1blu.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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:315052 Archived-At: Hi, 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? Cheers, Joerg