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: Wed, 24 Jan 2024 19:11:35 +0200 Organization: LINKOV.NET Message-ID: <86o7da1ws8.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> <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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18373"; 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 Wed Jan 24 18:14:11 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 1rSgpG-0004eX-DL for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 24 Jan 2024 18:14:10 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSgp4-0000Ze-K3; Wed, 24 Jan 2024 12:13:58 -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 1rSgp3-0000ZW-9j for bug-gnu-emacs@gnu.org; Wed, 24 Jan 2024 12:13:57 -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 1rSgp3-0004ez-0d for bug-gnu-emacs@gnu.org; Wed, 24 Jan 2024 12:13:57 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rSgp7-00035y-W7 for bug-gnu-emacs@gnu.org; Wed, 24 Jan 2024 12:14: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: Wed, 24 Jan 2024 17:14: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.170611638811817 (code B ref 68570); Wed, 24 Jan 2024 17:14:01 +0000 Original-Received: (at 68570) by debbugs.gnu.org; 24 Jan 2024 17:13:08 +0000 Original-Received: from localhost ([127.0.0.1]:46492 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSgoB-00034S-Ly for submit@debbugs.gnu.org; Wed, 24 Jan 2024 12:13:08 -0500 Original-Received: from relay2-d.mail.gandi.net ([2001:4b98:dc4:8::222]:57693) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSgo6-00033r-6Y for 68570@debbugs.gnu.org; Wed, 24 Jan 2024 12:13:02 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 0FB6C40004; Wed, 24 Jan 2024 17:12:44 +0000 (UTC) In-Reply-To: (Dmitry Gutov's message of "Wed, 24 Jan 2024 14:06:57 +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:278802 Archived-At: >>>> Recompiling from a non-compilation buffer has security concerns. >>>> The patch that I proposed above is intended only for >>>> recompiling from a compilation buffer. It sets >>>> `compilation-buffer-name-function' in the compilation buffer. >>> I think it behaves correctly inside the compilation buffer already? At >>> least it did when I tested. >> Sorry, I didn't show my compilation function: >> (setopt project-compilation-buffer-name-function >> (lambda (name-of-mode) >> (generate-new-buffer-name >> (project-prefixed-buffer-name name-of-mode)))) >> Currently 'g' doesn't create a new compilation buffer, because >> 'compilation--default-buffer-name' just reuses the current buffer. > > Is that bad? It's very useful to always create a unique buffer for every compilation: this allows keeping error messages from previous compilations. 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"))) The previous patch would be needed as well since currently there is no way to allow unique project compilation buffers.