GNU bug report logs - #59502
29.0.50; [PATCH] Dedicated buffers per project

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Gabriel <gabriel376@HIDDEN>; Keywords: patch; dated Wed, 23 Nov 2022 05:12:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 59502 <at> debbugs.gnu.org:


Received: (at 59502) by debbugs.gnu.org; 10 Dec 2022 17:47:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 10 12:47:25 2022
Received: from localhost ([127.0.0.1]:44186 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1p43wa-0001XY-Ro
	for submit <at> debbugs.gnu.org; Sat, 10 Dec 2022 12:47:25 -0500
Received: from relay1-d.mail.gandi.net ([217.70.183.193]:44723)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1p43wY-0001X7-7O
 for 59502 <at> debbugs.gnu.org; Sat, 10 Dec 2022 12:47:23 -0500
Received: (Authenticated sender: juri@HIDDEN)
 by mail.gandi.net (Postfix) with ESMTPSA id D9C29240005;
 Sat, 10 Dec 2022 17:47:12 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
Subject: Re: bug#59502: 29.0.50; [PATCH] Dedicated buffers per project
In-Reply-To: <86ea8d5d-1a47-08ff-3e06-ee32d7362211@HIDDEN> (Dmitry Gutov's
 message of "Sat, 10 Dec 2022 03:50:56 +0200")
Organization: LINKOV.NET
References: <SJ0PR06MB86090A147EE6E14492A051198B0C9@HIDDEN>
 <f72f59df-6b52-dd97-f738-2059c19c6078@HIDDEN>
 <87fse7lacm.fsf@HIDDEN>
 <SJ0PR06MB8609B59842427CE38E41324E8B0E9@HIDDEN>
 <864ju8a5ch.fsf@HIDDEN>
 <9b353f38-9e1d-9bb6-4512-9e4db594a2a6@HIDDEN>
 <86y1rjveix.fsf@HIDDEN>
 <86ea8d5d-1a47-08ff-3e06-ee32d7362211@HIDDEN>
Date: Sat, 10 Dec 2022 19:34:20 +0200
Message-ID: <86v8mji417.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 59502
Cc: Gabriel <gabriel376@HIDDEN>, 59502 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>>>> (setopt project-buffer-name-function
>>>>     (lambda (project _command-symbol buffer-name)
>>>>       (format "%s<%s>" buffer-name (project-name project))))
>>> I think*prjname/Shell Command Output*  sounds nice enough.
>>>
>>> If it doesn't, we probably wouldn't choose*Shell Command Output*  as the
>>> name for non-project buffers of this type, would we?
>> For designing a naming scheme, I suggest to keep in mind that
>> the users might already have customized the behavior for
>> displaying these buffers by using display-buffer-alist
>> that often takes into account a uniquified suffix, e.g.:
>>    "\\`\\*\\(?:Shell Command Output\\|xref\\|vc-dir\\|compilation\\)
>>        \\*\\(?:<[^>]+>\\)?\\'"
>> So for compatibility it would be better to add the project name
>> in the suffix without changing the standard base buffer names, e.g.:
>>    "*Shell Command Output*<project-a>", "*xref*<project-b>"
>> But if you want to add the project name after the first asterisk,
>> this is easy to do as well with just:
>>    (setf (substring buffer-name 1 1) (project-name project))
>
> The naming scheme is often affected by the uniquify package, and different
> people use different ordering. Should we really go there?

It was an example of my customization preference.  So anyone can
customize project-buffer-name-function to comply with own
uniquification scheme.  My point was to ensure that
project-buffer-name-function should support any format.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59502; Package emacs. Full text available.

Message received at 59502 <at> debbugs.gnu.org:


Received: (at 59502) by debbugs.gnu.org; 10 Dec 2022 01:51:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 09 20:51:05 2022
Received: from localhost ([127.0.0.1]:39781 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1p3p17-0001i6-FB
	for submit <at> debbugs.gnu.org; Fri, 09 Dec 2022 20:51:05 -0500
Received: from mail-wr1-f54.google.com ([209.85.221.54]:36503)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1p3p16-0001hV-4T
 for 59502 <at> debbugs.gnu.org; Fri, 09 Dec 2022 20:51:04 -0500
Received: by mail-wr1-f54.google.com with SMTP id h10so6913258wrx.3
 for <59502 <at> debbugs.gnu.org>; Fri, 09 Dec 2022 17:51:04 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=V8RwnR0uKsokxaYOUOMfWpnzxHqLTCWwCRXdkzVEXUg=;
 b=pdTdocTkh2S3v3o8WekOtfRjjFYJIhZkdH7l4yOf3envPC5myaxaq0xgWqwmDXI9z8
 6N3LxtcDaavZJUj375Dzhip10qnXPBiou2MV1fomW0vYZ3YOAkpP3U8bn11yZAiDCqmN
 1TdZU+A0pFm8H+STy+qw3N5rIPQfvZ+noSmPH59g+HP7TtRI6dBxZqMcZ6fIXYUi1du+
 fHpk135K7ggK6SahSyyIN4ghsd3rtdGJ6G4IIIIP35J7oWLnKrs0iEvkJxwhpak5faT8
 EHogvaYQlMbhEpZCpGIncqWZjLFRys5+qNra1G84q46xXCOlZpQGYlDoB194b5LwGYZP
 1W2w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=V8RwnR0uKsokxaYOUOMfWpnzxHqLTCWwCRXdkzVEXUg=;
 b=jOWuvdKPTchTNi4lgeAOs9Ch9JZ1kLV9KjSROte+vNZFatRi8+WFyresu2z6plcUFL
 yfZTnfliIjna7JxixPDB4N0xX9f/0unGqY9AO3TSPAQF1+jfpd9qaUKrTP7HGOcIZew9
 /XUkaCurC379fX3nSb3R40qGxyc2CS9QmoyDEPtklQjBnP4xfKnvrKHyXJi6cn2IewFo
 30ftds04kmVBKUWxPV3tbJadYD/+B4UixLnjJBN9BfQ+iaJHYXx0+pM8IRQ0ZXQZ76rl
 ed1hHmxrSMMKOg+kBFTLLGr+CZaifxAD7NSenSZC3xqqBjmDD+A90IKZAuLMRnWRXqde
 NSLw==
X-Gm-Message-State: ANoB5pkT6tqzPliTRIP8yoUAjwDAtUFmKNEXXOHele5D+JHHOuSY7lgf
 4deZ7s5ujTTed6m+y6WzPf8=
X-Google-Smtp-Source: AA0mqf5f7NOdZ7hUhgeLIKkaRQhYoFBicPNSTMHNsl9kaR29QhmA4NhVstk5EVy+TWriT0jD9005tg==
X-Received: by 2002:a5d:4d4b:0:b0:242:6b2f:4988 with SMTP id
 a11-20020a5d4d4b000000b002426b2f4988mr4471564wru.46.1670637058217; 
 Fri, 09 Dec 2022 17:50:58 -0800 (PST)
Received: from [192.168.0.2] ([46.251.119.176])
 by smtp.googlemail.com with ESMTPSA id
 n3-20020a056000170300b002368f6b56desm3231305wrc.18.2022.12.09.17.50.57
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 09 Dec 2022 17:50:57 -0800 (PST)
Message-ID: <86ea8d5d-1a47-08ff-3e06-ee32d7362211@HIDDEN>
Date: Sat, 10 Dec 2022 03:50:56 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.4.2
Subject: Re: bug#59502: 29.0.50; [PATCH] Dedicated buffers per project
Content-Language: en-US
To: Juri Linkov <juri@HIDDEN>
References: <SJ0PR06MB86090A147EE6E14492A051198B0C9@HIDDEN>
 <f72f59df-6b52-dd97-f738-2059c19c6078@HIDDEN> <87fse7lacm.fsf@HIDDEN>
 <SJ0PR06MB8609B59842427CE38E41324E8B0E9@HIDDEN>
 <864ju8a5ch.fsf@HIDDEN>
 <9b353f38-9e1d-9bb6-4512-9e4db594a2a6@HIDDEN>
 <86y1rjveix.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <86y1rjveix.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 59502
Cc: Gabriel <gabriel376@HIDDEN>, 59502 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

On 07/12/2022 09:50, Juri Linkov wrote:
>>> (setopt project-buffer-name-function
>>>     (lambda (project _command-symbol buffer-name)
>>>       (format "%s<%s>" buffer-name (project-name project))))
>> I think*prjname/Shell Command Output*  sounds nice enough.
>>
>> If it doesn't, we probably wouldn't choose*Shell Command Output*  as the
>> name for non-project buffers of this type, would we?
> For designing a naming scheme, I suggest to keep in mind that
> the users might already have customized the behavior for
> displaying these buffers by using display-buffer-alist
> that often takes into account a uniquified suffix, e.g.:
> 
>    "\\`\\*\\(?:Shell Command Output\\|xref\\|vc-dir\\|compilation\\)
>        \\*\\(?:<[^>]+>\\)?\\'"
> 
> So for compatibility it would be better to add the project name
> in the suffix without changing the standard base buffer names, e.g.:
> 
>    "*Shell Command Output*<project-a>", "*xref*<project-b>"
> 
> But if you want to add the project name after the first asterisk,
> this is easy to do as well with just:
> 
>    (setf (substring buffer-name 1 1) (project-name project))

The naming scheme is often affected by the uniquify package, and 
different people use different ordering. Should we really go there?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59502; Package emacs. Full text available.

Message received at 59502 <at> debbugs.gnu.org:


Received: (at 59502) by debbugs.gnu.org; 7 Dec 2022 07:54:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Dec 07 02:54:44 2022
Received: from localhost ([127.0.0.1]:48267 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1p2pGO-0000U9-KI
	for submit <at> debbugs.gnu.org; Wed, 07 Dec 2022 02:54:44 -0500
Received: from relay7-d.mail.gandi.net ([217.70.183.200]:38097)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1p2pGM-0000U2-Ka
 for 59502 <at> debbugs.gnu.org; Wed, 07 Dec 2022 02:54:43 -0500
Received: (Authenticated sender: juri@HIDDEN)
 by mail.gandi.net (Postfix) with ESMTPSA id 717B320014;
 Wed,  7 Dec 2022 07:54:32 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
Subject: Re: bug#59502: 29.0.50; [PATCH] Dedicated buffers per project
In-Reply-To: <9b353f38-9e1d-9bb6-4512-9e4db594a2a6@HIDDEN> (Dmitry Gutov's
 message of "Wed, 7 Dec 2022 04:31:26 +0200")
Organization: LINKOV.NET
References: <SJ0PR06MB86090A147EE6E14492A051198B0C9@HIDDEN>
 <f72f59df-6b52-dd97-f738-2059c19c6078@HIDDEN>
 <87fse7lacm.fsf@HIDDEN>
 <SJ0PR06MB8609B59842427CE38E41324E8B0E9@HIDDEN>
 <864ju8a5ch.fsf@HIDDEN>
 <9b353f38-9e1d-9bb6-4512-9e4db594a2a6@HIDDEN>
Date: Wed, 07 Dec 2022 09:50:14 +0200
Message-ID: <86y1rjveix.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 59502
Cc: Gabriel <gabriel376@HIDDEN>, 59502 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> (setopt project-buffer-name-function
>>    (lambda (project _command-symbol buffer-name)
>>      (format "%s<%s>" buffer-name (project-name project))))
>
> I think *prjname/Shell Command Output* sounds nice enough.
>
> If it doesn't, we probably wouldn't choose *Shell Command Output* as the
> name for non-project buffers of this type, would we?

For designing a naming scheme, I suggest to keep in mind that
the users might already have customized the behavior for
displaying these buffers by using display-buffer-alist
that often takes into account a uniquified suffix, e.g.:

  "\\`\\*\\(?:Shell Command Output\\|xref\\|vc-dir\\|compilation\\)
      \\*\\(?:<[^>]+>\\)?\\'"

So for compatibility it would be better to add the project name
in the suffix without changing the standard base buffer names, e.g.:

  "*Shell Command Output*<project-a>", "*xref*<project-b>"

But if you want to add the project name after the first asterisk,
this is easy to do as well with just:

  (setf (substring buffer-name 1 1) (project-name project))




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59502; Package emacs. Full text available.

Message received at 59502 <at> debbugs.gnu.org:


Received: (at 59502) by debbugs.gnu.org; 7 Dec 2022 02:35:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 06 21:35:47 2022
Received: from localhost ([127.0.0.1]:46659 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1p2kHj-0003Kh-4q
	for submit <at> debbugs.gnu.org; Tue, 06 Dec 2022 21:35:47 -0500
Received: from mail-ej1-f43.google.com ([209.85.218.43]:34687)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1p2kHf-0003Kb-69
 for 59502 <at> debbugs.gnu.org; Tue, 06 Dec 2022 21:35:45 -0500
Received: by mail-ej1-f43.google.com with SMTP id t17so10838279eju.1
 for <59502 <at> debbugs.gnu.org>; Tue, 06 Dec 2022 18:35:43 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=hdrUulsohNsNwiSYpMK42d6/r8TFCgZJKRSD/xfK0xo=;
 b=jfufzsMENyUWRAS/BIFLs5LbePNK+iXf/XhdAYlCabo6yFp8Jqtr6EZ8e9uw+bViuB
 tMrKgX4zXP/htmRVzZOoGXjvBGE3isPtvKS3wr9r2RBPLFhvbI5O0dCww5wKGG5/P1Xp
 1BTI01SPfGB8Gf6jY7wUKvaSWJRrMUjfltLu4D3fIrm98HpdyIVl/0D0TcVV41ed3iG1
 ILZWqHkQLNWEMG8FbxkaKdxQyFaFG+bQskiDmwOa5HzjhtkFCl6iOX4EIOYSabZRURK/
 IAuLdpKxj8XDxph3T5SWH/yPck4M6u1ILarhdJRgwD1l/VjQmtVJKq+WK22Xh4CY8RwI
 v6EQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=hdrUulsohNsNwiSYpMK42d6/r8TFCgZJKRSD/xfK0xo=;
 b=xCqj4SvzGgPa6EyST4AdShLrjNPfn7k4cB2DuJAx0Eaa+KNcsKRGescdC3j0+N/Mu+
 S/qzoLiluZ4BRAypeymnb9Pqdp3Gxa87poGE6kOTB95yOTVyyHsq4nbZOpRsw3TltDcK
 0RflZIJc1kgRNkiCbEbucNlfr2FwUOdHAlthF+W8OaO8xHX5R0T3VdBHZ7rDRLMe/F9R
 MPFipPTx8Lko+u8HmrQHg7oa0a4vWIJpscb/uRxEcbfdD1I1HVTvZg1lG2ehfw1uH4uZ
 5ovRpleh2M/yENnkc9/fHEMBCjZ6XMTGxmM8a2dPCFZJE8WRAy8pnGO74uXkCdANypKH
 aChw==
X-Gm-Message-State: ANoB5pmyykU1HRx+5zPVexqcIRMn1/BzX8AqUiwqzA/CefA0PdaVlEw2
 5wV0w3WCOElPpLs9C59W+tA=
X-Google-Smtp-Source: AA0mqf49jN5qiI1KtAzmiWx017uHp1GHgsoYgog6aL44ioxZ8zflXHjvjTgJF26NTLQTsD4Gd0bC4g==
X-Received: by 2002:a17:906:2311:b0:7c0:e4b4:8cf7 with SMTP id
 l17-20020a170906231100b007c0e4b48cf7mr12038899eja.116.1670380537445; 
 Tue, 06 Dec 2022 18:35:37 -0800 (PST)
Received: from [192.168.0.2] ([46.251.119.176])
 by smtp.googlemail.com with ESMTPSA id
 d17-20020aa7d691000000b0046bb7503d9asm1633316edr.24.2022.12.06.18.35.36
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 06 Dec 2022 18:35:37 -0800 (PST)
Message-ID: <03249dbc-af36-503f-baa6-c0af8fd01274@HIDDEN>
Date: Wed, 7 Dec 2022 04:35:35 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.4.2
Subject: Re: bug#59502: 29.0.50; [PATCH] Dedicated buffers per project
Content-Language: en-US
To: Juri Linkov <juri@HIDDEN>
References: <SJ0PR06MB86090A147EE6E14492A051198B0C9@HIDDEN>
 <93661c9e-c754-0fcf-1eb9-7a5479aedbd5@HIDDEN>
 <86tu288qpd.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <86tu288qpd.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 59502
Cc: Gabriel <gabriel376@HIDDEN>, 59502 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

On 06/12/2022 19:23, Juri Linkov wrote:
>>> (setopt project-buffer-name-function
>>>           (lambda (name)
>>>               (format "*%s-%s*"
>>>                       (project-name (project-current))
>>>                       name)))
>> A couple more thoughts: the buffer name function will generally be used
>> before the buffer is created. The value of default-directory might even be
>> wrong.
> I haven't tried the proposed patch yet.  But it would be interesting to
> guess how it will behave with 'C-x p p ...'.

More testing is welcome.

 > Do you think it will get
 > the project name from the original project, or from another project
 > where it switches to?

It all depends on what's in project-find-functions. With project-vc it 
will probably work as expected (module the problem that was brought up 
in bug#59722, but we'll need to fix that separately anyway), but it can 
behave unexpectedly with more complex project-finding logic, like the 
one favored by Stephen L. or Eli Z., where belonging to a project is not 
defined by the directory only. But possibly by the major mode as well.

And I'm guessing project-buffer-name-function will usually be called 
before the major mode is set.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59502; Package emacs. Full text available.

Message received at 59502 <at> debbugs.gnu.org:


Received: (at 59502) by debbugs.gnu.org; 7 Dec 2022 02:31:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 06 21:31:40 2022
Received: from localhost ([127.0.0.1]:46638 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1p2kDk-0003Iw-D4
	for submit <at> debbugs.gnu.org; Tue, 06 Dec 2022 21:31:40 -0500
Received: from mail-ej1-f47.google.com ([209.85.218.47]:37821)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1p2kDg-0003Ip-78
 for 59502 <at> debbugs.gnu.org; Tue, 06 Dec 2022 21:31:38 -0500
Received: by mail-ej1-f47.google.com with SMTP id ud5so10788311ejc.4
 for <59502 <at> debbugs.gnu.org>; Tue, 06 Dec 2022 18:31:36 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=LUi+FpVwFWsgSoVJSjfjgXDpJPVgJ4hJMn6tcarKnu0=;
 b=gPzw5Q5tVuGMuvrdTxjolvHq8kCuXh9mnPce8+3VS2uCffNOP6t1WwUjxebl6n04CW
 aLpxDNhRGiY+fvmRs/9QuheN+tSnzQs5nMF4MKx310NacTxIn7NVY3+drR9EGwkewdYn
 3UHeCXz/JzHYJGsq5VZh/MVvjcksoJPOFJs+YCJO92tFZm+zCyN7cOkoVEHvkFHrPcFm
 rqmayY+R5QzmCrx7TrTTEucM2fn4y+0ACYVghiKYsOsdKFTyt6DuqEsxERWgBbJ7JL0p
 QjCOkvyVrPhzE19260get57Z0FWJGf/VBtKKMm/7ZmF6bjZHYZxuI6tbtPst7y/oHO2P
 MMHg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=LUi+FpVwFWsgSoVJSjfjgXDpJPVgJ4hJMn6tcarKnu0=;
 b=mZahM71y0sJ01QfY6uznPY86vtrF0K4afo16u3SYkAUcqYPsBxlrV/ADP4GoAPdfWF
 ZLTZ4DDjnPjgugbAfYqZZDWwESB+ptSwZA22UNoahu9IQGDTM9Ae3/0s+ogJ43LADbkr
 UkQQqh4exT29Y2b6Bv89aL4Vv4SFAPQGPu9+tdUJ+YtZE/1VrUhDEP/DoJ9vgKNkYYPD
 f23N43A1rBiEh9THW9b/NgGHfC5cTROumIydGsTyUhYahneJu/HE+fKkzChtyt2HMpOV
 WDdmYvFkonAmz2YVVVFKofTrCtiyeEFSfo1C1gWhEnYDj+jpqpLDrK1AoE7mBxuhHoe/
 AYpg==
X-Gm-Message-State: ANoB5pnaVdD8VZqMngKJsrt30AzMeXGoBxfO1w3jxx2g8lLpgpkIJE81
 2EjU2OjzuUTo3DTWL3YPXr8=
X-Google-Smtp-Source: AA0mqf6ygIrcIlDTn5tvhuWvKFcC1j1SxeiGbOoXoEzh/ctcad4vv4EPZIuHnFazQXsxc1LjHBAcHg==
X-Received: by 2002:a17:906:944c:b0:7b2:71fa:c367 with SMTP id
 z12-20020a170906944c00b007b271fac367mr71768072ejx.377.1670380289093; 
 Tue, 06 Dec 2022 18:31:29 -0800 (PST)
Received: from [192.168.0.2] ([46.251.119.176])
 by smtp.googlemail.com with ESMTPSA id
 14-20020a170906300e00b00780982d77d1sm7969677ejz.154.2022.12.06.18.31.27
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 06 Dec 2022 18:31:28 -0800 (PST)
Message-ID: <9b353f38-9e1d-9bb6-4512-9e4db594a2a6@HIDDEN>
Date: Wed, 7 Dec 2022 04:31:26 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.4.2
Subject: Re: bug#59502: 29.0.50; [PATCH] Dedicated buffers per project
Content-Language: en-US
To: Juri Linkov <juri@HIDDEN>, Gabriel <gabriel376@HIDDEN>
References: <SJ0PR06MB86090A147EE6E14492A051198B0C9@HIDDEN>
 <f72f59df-6b52-dd97-f738-2059c19c6078@HIDDEN> <87fse7lacm.fsf@HIDDEN>
 <SJ0PR06MB8609B59842427CE38E41324E8B0E9@HIDDEN>
 <864ju8a5ch.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <864ju8a5ch.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 59502
Cc: 59502 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

On 06/12/2022 19:21, Juri Linkov wrote:
>>> Idly wondering if it'd make sense to also pass the major-mode to
>>> project-buffer-name-function, since string matching might be unreliable
>>> in some situations?  Can't think of any concrete problem off the top of
>>> my head, I just have a vague expectation that mode symbols might be more
>>> stable than buffer names.  It's unsubstantiated though, so feel free to
>>> dismiss.
>>
>> I agree, and actually my first implementation used the major-mode symbol
>> as the argument to function project-buffer-name-function.  I changed to
>> a string to be able to handle the following cases:
> 
> A string is too confusing.  After seeing
> 
> +        (shell-command-buffer-name (funcall project-buffer-name-function
> +                                            "Shell Command Output")))

I think that's not too bad.

> the first thought was: why the buffer name is without asterisks
> as in the standard name "*Shell Command Output*".

>> | Command                     | major-mode       |
>> |-----------------------------+------------------|
>> | project-shell-command       | fundamental-mode |
>> | project-async-shell-command | shell-mode       |
> 
> More consistent would be to accept a symbol as the argument of
> project-buffer-name-function.  Then every project-supported command
> could have the corresponding symbol that is part of the command name:
> 
> | Command                     | name        |
> |-----------------------------+-------------|
> | project-shell-command       | shell       |
> | project-async-shell-command | async-shell |
> 
> Also for calling the user customized function it would be useful to
> provide an argument with the standard buffer name.  So users won't need
> to copy the mapping from project-buffer-name-default.  Then the default
> implementation will be just:
> 
> (defun project-buffer-name-default (project command-symbol buffer-name)
>    (or buffer-name (format "*%s-%s*" (project-name project) command-symbol)))
> 
> And here is an example of how I'd like to customize it:
> 
> (setopt project-buffer-name-function
>    (lambda (project _command-symbol buffer-name)
>      (format "%s<%s>" buffer-name (project-name project))))

I think *prjname/Shell Command Output* sounds nice enough.

If it doesn't, we probably wouldn't choose *Shell Command Output* as the 
name for non-project buffers of this type, would we?





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59502; Package emacs. Full text available.

Message received at 59502 <at> debbugs.gnu.org:


Received: (at 59502) by debbugs.gnu.org; 6 Dec 2022 17:27:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 06 12:27:53 2022
Received: from localhost ([127.0.0.1]:44125 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1p2bjV-00062X-9a
	for submit <at> debbugs.gnu.org; Tue, 06 Dec 2022 12:27:53 -0500
Received: from relay4-d.mail.gandi.net ([217.70.183.196]:44919)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1p2bjQ-00062E-GG
 for 59502 <at> debbugs.gnu.org; Tue, 06 Dec 2022 12:27:51 -0500
Received: (Authenticated sender: juri@HIDDEN)
 by mail.gandi.net (Postfix) with ESMTPSA id 03F1AE0006;
 Tue,  6 Dec 2022 17:27:38 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
Subject: Re: bug#59502: 29.0.50; [PATCH] Dedicated buffers per project
In-Reply-To: <93661c9e-c754-0fcf-1eb9-7a5479aedbd5@HIDDEN> (Dmitry Gutov's
 message of "Mon, 5 Dec 2022 04:35:21 +0200")
Organization: LINKOV.NET
References: <SJ0PR06MB86090A147EE6E14492A051198B0C9@HIDDEN>
 <93661c9e-c754-0fcf-1eb9-7a5479aedbd5@HIDDEN>
Date: Tue, 06 Dec 2022 19:23:27 +0200
Message-ID: <86tu288qpd.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 59502
Cc: Gabriel <gabriel376@HIDDEN>, 59502 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> (setopt project-buffer-name-function
>>          (lambda (name)
>>              (format "*%s-%s*"
>>                      (project-name (project-current))
>>                      name)))
>
> A couple more thoughts: the buffer name function will generally be used
> before the buffer is created. The value of default-directory might even be
> wrong.

I haven't tried the proposed patch yet.  But it would be interesting to
guess how it will behave with 'C-x p p ...'.  Do you think it will get
the project name from the original project, or from another project
where it switches to?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59502; Package emacs. Full text available.

Message received at 59502 <at> debbugs.gnu.org:


Received: (at 59502) by debbugs.gnu.org; 6 Dec 2022 17:27:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 06 12:27:46 2022
Received: from localhost ([127.0.0.1]:44121 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1p2bjN-00062K-SF
	for submit <at> debbugs.gnu.org; Tue, 06 Dec 2022 12:27:46 -0500
Received: from relay9-d.mail.gandi.net ([217.70.183.199]:43667)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1p2bjK-000621-BU
 for 59502 <at> debbugs.gnu.org; Tue, 06 Dec 2022 12:27:44 -0500
Received: (Authenticated sender: juri@HIDDEN)
 by mail.gandi.net (Postfix) with ESMTPSA id 08E60FF80C;
 Tue,  6 Dec 2022 17:27:32 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Gabriel <gabriel376@HIDDEN>
Subject: Re: bug#59502: 29.0.50; [PATCH] Dedicated buffers per project
In-Reply-To: <SJ0PR06MB8609B59842427CE38E41324E8B0E9@HIDDEN>
 (Gabriel's message of "Fri, 25 Nov 2022 10:27:59 -0300")
Organization: LINKOV.NET
References: <SJ0PR06MB86090A147EE6E14492A051198B0C9@HIDDEN>
 <f72f59df-6b52-dd97-f738-2059c19c6078@HIDDEN>
 <87fse7lacm.fsf@HIDDEN>
 <SJ0PR06MB8609B59842427CE38E41324E8B0E9@HIDDEN>
Date: Tue, 06 Dec 2022 19:21:50 +0200
Message-ID: <864ju8a5ch.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 59502
Cc: 59502 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> Idly wondering if it'd make sense to also pass the major-mode to
>> project-buffer-name-function, since string matching might be unreliable
>> in some situations?  Can't think of any concrete problem off the top of
>> my head, I just have a vague expectation that mode symbols might be more
>> stable than buffer names.  It's unsubstantiated though, so feel free to
>> dismiss.
>
> I agree, and actually my first implementation used the major-mode symbol
> as the argument to function project-buffer-name-function.  I changed to
> a string to be able to handle the following cases:

A string is too confusing.  After seeing

+        (shell-command-buffer-name (funcall project-buffer-name-function
+                                            "Shell Command Output")))

the first thought was: why the buffer name is without asterisks
as in the standard name "*Shell Command Output*".

> | Command                     | major-mode       |
> |-----------------------------+------------------|
> | project-shell-command       | fundamental-mode |
> | project-async-shell-command | shell-mode       |

More consistent would be to accept a symbol as the argument of
project-buffer-name-function.  Then every project-supported command
could have the corresponding symbol that is part of the command name:

| Command                     | name        |
|-----------------------------+-------------|
| project-shell-command       | shell       |
| project-async-shell-command | async-shell |

Also for calling the user customized function it would be useful to
provide an argument with the standard buffer name.  So users won't need
to copy the mapping from project-buffer-name-default.  Then the default
implementation will be just:

(defun project-buffer-name-default (project command-symbol buffer-name)
  (or buffer-name (format "*%s-%s*" (project-name project) command-symbol)))

And here is an example of how I'd like to customize it:

(setopt project-buffer-name-function
  (lambda (project _command-symbol buffer-name)
    (format "%s<%s>" buffer-name (project-name project))))




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59502; Package emacs. Full text available.

Message received at 59502 <at> debbugs.gnu.org:


Received: (at 59502) by debbugs.gnu.org; 5 Dec 2022 02:35:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 04 21:35:32 2022
Received: from localhost ([127.0.0.1]:32972 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1p21KO-0006Eb-7t
	for submit <at> debbugs.gnu.org; Sun, 04 Dec 2022 21:35:32 -0500
Received: from mail-wr1-f52.google.com ([209.85.221.52]:43000)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1p21KM-0006EV-7G
 for 59502 <at> debbugs.gnu.org; Sun, 04 Dec 2022 21:35:31 -0500
Received: by mail-wr1-f52.google.com with SMTP id w15so16599452wrl.9
 for <59502 <at> debbugs.gnu.org>; Sun, 04 Dec 2022 18:35:30 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=content-transfer-encoding:in-reply-to:from:references:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=/XiCHthb/WSzocIbt1VMBo65HeTCMIC0Jz9ESAKmfh0=;
 b=eqyAs+PViOhwKIXF4q7qhOtXQQy89X0MGBfUhUCqGvBYvvrKAD4kM5bif1+bWYqons
 QHlpR93zcZkL6WTN8jeaQpDabV98P1N6xYvPi8ZmpT2GB9Xbfu0wxdUxwBLyv5VSiyrS
 DnzqGJJVN3163442gG2XIcum3zQmaETfGBRVb5G+R019lQ57cwgVZCuITNb97LShXcNE
 48tNK56VMUbFDEW2X5MHVlByHHlSTlabVjUiHDavRAnvyddZmujCt230tCRyqupZMbcc
 Gz8Vc95DVfA1y/lA/5K669V3vJ5tIXqNKJk5S/fwAKdzNdbYtNYua1mPmvyH7qtSxifz
 G2ag==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:in-reply-to:from:references:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=/XiCHthb/WSzocIbt1VMBo65HeTCMIC0Jz9ESAKmfh0=;
 b=KsY94P8d1XCIm17FXk2OI62oGKvkHjSkYJcl9NrG4lXUWgd/8ivppBfywNS+bgp8PD
 mByLnWpFj/+BPnRc2p5zKPABWHEjUXOiaujqpA2a8IRjjaNfleaxhLcMSdwa28r0WEkZ
 f7bW4NcD91Vtxuu+rRwPC68hEO95ypEeof9cdWG38prynFJ7Tn2SWxyUMZesw9Py6Id+
 WHUGwA6glbgs4kl3o6FgpBDANwm1sVzXyXmcNP3fQtQ5zKsSld/7mME1VRHA8VnGirBI
 5Yeo9430hauwcGMAkOE5haVGXdNQ4kVh/2jG7NAYYtIf0/Gj+N2paDpHx1qBpUbimZX+
 zSig==
X-Gm-Message-State: ANoB5pk5RDIZnV6Y8GgqovparyRLwsNk4E/oBEXUu0TssU+CfyUsEIqo
 xUhw2eOGKBCz+Nv5XYNikl4=
X-Google-Smtp-Source: AA0mqf4Md4UpjO4de7ep/6lhy7f6Ny2ufxLVEB4+IDawRH9FJoDPeBv8uYWayomyFDN5CDvJVqVzxA==
X-Received: by 2002:a05:6000:142:b0:242:49d9:9d8f with SMTP id
 r2-20020a056000014200b0024249d99d8fmr6243500wrx.446.1670207724188; 
 Sun, 04 Dec 2022 18:35:24 -0800 (PST)
Received: from [192.168.0.6] ([46.251.119.176])
 by smtp.googlemail.com with ESMTPSA id
 bg28-20020a05600c3c9c00b003cfa3a12660sm25114962wmb.1.2022.12.04.18.35.22
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sun, 04 Dec 2022 18:35:23 -0800 (PST)
Message-ID: <93661c9e-c754-0fcf-1eb9-7a5479aedbd5@HIDDEN>
Date: Mon, 5 Dec 2022 04:35:21 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.4.2
Subject: Re: bug#59502: 29.0.50; [PATCH] Dedicated buffers per project
Content-Language: en-US
To: Gabriel <gabriel376@HIDDEN>, 59502 <at> debbugs.gnu.org
References: <SJ0PR06MB86090A147EE6E14492A051198B0C9@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <SJ0PR06MB86090A147EE6E14492A051198B0C9@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 59502
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

Hi again!

On 23/11/2022 07:11, Gabriel wrote:
> 3) Create a single defcustom to compute the name of project-related
> buffers.  This is similar to how `project-compile' behaves today, but
> would be a more general-purpose customization option.  This is currently
> my preferred solution (see the attached patch).  I tried to make it
> simple, consistent and without introducing behavior changes related to
> how project-related buffers are currently named, but I am not really
> happy with the implementation.  An example of how users could customize
> this option is presented below:
> 
> (setopt project-buffer-name-function
>          (lambda (name)
>              (format "*%s-%s*"
>                      (project-name (project-current))
>                      name)))

A couple more thoughts: the buffer name function will generally be used 
before the buffer is created. The value of default-directory might even 
be wrong.

But even if it's not, some project backends might choose to enable or 
disable themselves based on the value of the major mode, which at the 
time that the function is called, might not be set yet.

Which is to say, it might be handy to have the project instance passed 
to this function as an argument, rather than have it looked up again.

Does it look feasible to you in most cases? If yes, we could rethink the 
story with project-compilation-buffer-name-function. Perhaps make it a 
function which returns a function.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59502; Package emacs. Full text available.

Message received at 59502 <at> debbugs.gnu.org:


Received: (at 59502) by debbugs.gnu.org; 4 Dec 2022 23:50:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 04 18:50:52 2022
Received: from localhost ([127.0.0.1]:60522 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1p1yl2-0004mM-1C
	for submit <at> debbugs.gnu.org; Sun, 04 Dec 2022 18:50:52 -0500
Received: from mr85p00im-zteg06021501.me.com ([17.58.23.183]:36852)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <salutis@HIDDEN>) id 1p1ykx-0004mG-Vc
 for 59502 <at> debbugs.gnu.org; Sun, 04 Dec 2022 18:50:50 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai;
 t=1670197841; bh=mu27ocgcyE+a9XunV2uuFBpqqGx20CPGamPGVIxDlf0=;
 h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type;
 b=rHd4r1v0zDLEjFL21WExTy6M3DDGzivr9y8TUAm8fyQjsMnBG8JDG0uduQcqBGOin
 /Ox0IJVuyhUOzxgCIhPyIy+lOdO3V0dbLuTjRF/ld8u0jsoWMDt2mbIMKZLRwYI92t
 UDHze6PQDS8Dwr5FrzI2WqJ6TcxWyGJPyg8SgW4DwARKr6tVyh35haHzMryiNpjsuJ
 dvuz8JqPE6s2T43hI3E1s1QnVYk4F/v84tcu/It33qB7IjqUhnQkJKkKscjQ+Zlj8r
 Jk+gXWzEmikKXivkExtl6bNL8d+DvZvDE/PIZkEr5mmlQc2a1C0/GYVcm9k3BPnZNT
 RPGOzJ0jBvd1A==
Received: from Rudolfs-MacBook-Air.local (mr38p00im-dlb-asmtp-mailmevip.me.com
 [17.57.152.18])
 by mr85p00im-zteg06021501.me.com (Postfix) with ESMTPSA id 5F7432793F6C;
 Sun,  4 Dec 2022 23:50:40 +0000 (UTC)
From: Rudolf =?utf-8?Q?Adamkovi=C4=8D?= <salutis@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>, Gabriel <gabriel376@HIDDEN>,
 59502 <at> debbugs.gnu.org
Subject: Re: bug#59502: 29.0.50; [PATCH] Dedicated buffers per project
In-Reply-To: <f72f59df-6b52-dd97-f738-2059c19c6078@HIDDEN>
References: <SJ0PR06MB86090A147EE6E14492A051198B0C9@HIDDEN>
 <f72f59df-6b52-dd97-f738-2059c19c6078@HIDDEN>
Date: Mon, 05 Dec 2022 00:50:37 +0100
Message-ID: <m21qpewwxe.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Proofpoint-ORIG-GUID: CwHPTy1LwQPnSugc9d3LLC99UEurEXCQ
X-Proofpoint-GUID: CwHPTy1LwQPnSugc9d3LLC99UEurEXCQ
X-Proofpoint-Virus-Version: =?UTF-8?Q?vendor=3Dfsecure_engine=3D1.1.170-22c6f66c430a71ce266a39bfe25bc?=
 =?UTF-8?Q?2903e8d5c8f:6.0.425,18.0.572,17.0.605.474.0000000_definitions?=
 =?UTF-8?Q?=3D2022-01-14=5F01:2022-01-14=5F01,2020-02-14=5F11,2020-01-23?=
 =?UTF-8?Q?=5F02_signatures=3D0?=
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0
 adultscore=0 bulkscore=0
 suspectscore=0 clxscore=1011 mlxscore=0 malwarescore=0 mlxlogscore=695
 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2209130000 definitions=main-2212040217
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 59502
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Dmitry Gutov <dgutov@HIDDEN> writes:

> [...] I do wish we had an "upvote" button on these threads, to see how
> many people are interested in this.
>
> Anyone would like to +1?

+1, and especially for the compilation buffer (which I keep renaming
multiple times every day, even though Emacs knows its project).

Rudy
--=20
"I love deadlines.  I love the whooshing noise they make as they go by."
-- Douglas Adams, The Salmon of Doubt, 2002

Rudolf Adamkovi=C4=8D <salutis@HIDDEN> [he/him]
Studenohorsk=C3=A1 25
84103 Bratislava
Slovakia




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59502; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 25 Nov 2022 13:28:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 25 08:28:13 2022
Received: from localhost ([127.0.0.1]:33856 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oyYkW-0001Uh-RZ
	for submit <at> debbugs.gnu.org; Fri, 25 Nov 2022 08:28:13 -0500
Received: from lists.gnu.org ([209.51.188.17]:57638)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gabriel376@HIDDEN>) id 1oyYkV-0001UZ-Cr
 for submit <at> debbugs.gnu.org; Fri, 25 Nov 2022 08:28:11 -0500
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 <gabriel376@HIDDEN>)
 id 1oyYkV-0003eq-4X
 for bug-gnu-emacs@HIDDEN; Fri, 25 Nov 2022 08:28:11 -0500
Received: from mail-dm3nam02olkn2087.outbound.protection.outlook.com
 ([40.92.43.87] helo=NAM02-DM3-obe.outbound.protection.outlook.com)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <gabriel376@HIDDEN>)
 id 1oyYkT-0002Tv-EI
 for bug-gnu-emacs@HIDDEN; Fri, 25 Nov 2022 08:28:10 -0500
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=KBE2GuK/cZmgtgfzMU8lsQdKLM1+PdAL2RiCVgKApe8qkgZ2IHzyL6kLqO0ietGm3SHsZO5tCxiqfSa5vqGQsAr/axV8G1U7B8HhGyVF4uSUHPIyhh3dU0d7lIAxYwXf1D4/HaYkqCmcdw2+GxktP26t2KvMIJhWegZHHmgDZLuZSJKTT1VTR8COCKVF/r7qQGdBS1nIV/AbiHBoXH+xYMPOIgOJwIi6MLwiyZE2Txh6F/omPXZbIp+n6Ky7Ep7OOyh0gcQ8cq4xg1I3zhQb+8mYeCJqsmH3VjSUyA0czaL3BIGgF82mEb8Q0dLHJ0iSjwA1ykRQqLmzd/11jpm79Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; 
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=67TEezPY40rycj/EHOMazq0LSkELZaey9SLXk6HEexc=;
 b=SkgvRbrzcPZdrz6p39/sP1jeV/nFQjWzdbw4ElEcGK/ZSjjaZ64ng+Zm5DqBB1VcvuXov8QGhoHw4w4b4Ykb0t3HXOGCQ4RvA1c/PyHL4UiJELPGoTWgkEiWC/kvSVAY6WZOIdIa2K7566KZuXCxK09yUe4R/3DrZTR8zknTOEQl/a9+8vynX99Hx/0sZi/pagsFa02uO7TN184Zo0SLMs8btVK78BO/Lj10IPTJd1uPSllvX5Kic4mgHX3Akn+dsvYoRRJPdw3h0iMLRk1Xhe7Rmc+Vmu4FPh5dnLymjPrrdh5lGnlyALitSoah2E+2dZyqO/ZZjE1ovTJiUpgbMQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none;
 dkim=none; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=67TEezPY40rycj/EHOMazq0LSkELZaey9SLXk6HEexc=;
 b=PyPx6NkLB9cqZl9nvpXZR2+J4aZfiFjKaTuLiM010FxJ4WB6vB8PeIPgYYFQlcb7W4o633BPLBukjB8P858q26wSBZVJIGOkn/Sl9jQyXcT01PJtntACxgBUlG4ASGZ7dCzmtEwu7qE6DglfeISPfulwHL6Fafuf064AQ4ggzTnGA5py3p5UUv1cNSWwg9Yva93BQoI9XuPNWi4KtDARKmFB4RLGqnyYtaKxnS0Xpa2JTV9h2wXiacW2vRp8Ol12THKC1DNuOM/uaJvsAYBGNidsfOT+tFMGhuD8FZh1oKdotzPHrYgjyByyY2kpkHOc362g4so35FQpwGzsOYrgJw==
Received: from SJ0PR06MB8609.namprd06.prod.outlook.com (2603:10b6:a03:40c::11)
 by MWHPR06MB2831.namprd06.prod.outlook.com (2603:10b6:300:11c::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.5; Fri, 25 Nov
 2022 13:28:06 +0000
Received: from SJ0PR06MB8609.namprd06.prod.outlook.com
 ([fe80::33ae:d3a7:24ae:5c6f]) by SJ0PR06MB8609.namprd06.prod.outlook.com
 ([fe80::33ae:d3a7:24ae:5c6f%5]) with mapi id 15.20.5880.005; Fri, 25 Nov 2022
 13:28:06 +0000
From: Gabriel <gabriel376@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: Re: bug#59502: 29.0.50; [PATCH] Dedicated buffers per project
In-Reply-To: <87fse7lacm.fsf@HIDDEN> (=?utf-8?Q?=22K=C3=A9vin?= Le
 Gouguec"'s message of "Fri, 25 Nov 2022 09:14:17 +0100")
References: <SJ0PR06MB86090A147EE6E14492A051198B0C9@HIDDEN>
 <f72f59df-6b52-dd97-f738-2059c19c6078@HIDDEN>
 <87fse7lacm.fsf@HIDDEN>
Date: Fri, 25 Nov 2022 10:27:59 -0300
Message-ID: <SJ0PR06MB8609B59842427CE38E41324E8B0E9@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-TMN: [3xnDpF6LtIMa3LmwBPFza00shdsLioGedoA0BpEDXuhK8ExYwdkT8XDCVU9j0oPP]
X-ClientProxiedBy: CP5P284CA0027.BRAP284.PROD.OUTLOOK.COM
 (2603:10d6:103:94::14) To SJ0PR06MB8609.namprd06.prod.outlook.com
 (2603:10b6:a03:40c::11)
X-Microsoft-Original-Message-ID: <8735a7upsw.fsf@HIDDEN>
MIME-Version: 1.0
X-MS-Exchange-MessageSentRepresentingType: 1
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR06MB8609:EE_|MWHPR06MB2831:EE_
X-MS-Office365-Filtering-Correlation-Id: 994adf92-c8e4-46eb-022a-08dacee8e22f
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: qdzBd1uGDMgndYRLi18OXnfAUBKr91es06bbM0q2pke1zVDuMSiKxqbuv8guxNh6SohMKl+a3lVJ72jrw3vL2sN2qRuxC/Cd5o/wJ6tNgqlgdNVF7jIzUM3dhYM/NpZqrFgLEPObpWse8ZLfMOWvtIibyKgfu2puJDLNXYtkPaFl/dP04L1RXTnM8EBlmRV/rVVZelGOe9weGqrC4zUyJvjJaG7TyWFcC5QJ25Nux4X/XKSLTCorAiR/tZIQWTZGEPpd23D55yO3nuENSPJ16p57i24c7FP3bz+C7p/1l4eQuQk9x/gD+rUD3R8z6X9Xh1hw19hvRATguwDGCeUf+3aGOjPP4nMO2/2XgKLCRrFyg9vyGuUnWEkesQ+45v5LeswmqJXS+MiOZn3QiSQM7jDy+BdggcS5tEKNEXSVP8gfdcEtAWZevxhMjqXeKr6AIVCPt2e7TI15n3gzDe9FoYx7f2k8DDP5OlyJC/uHYLpVw5HVdeFcAfSPf+X04yuI9JsapRspHZOSN1ZRWD0tlySSPVAunfBS6zordaCubPhcXX6rxUlyQ7DmFb29hJXN/AK9sSM+0wx88OfKahJCz6BX5y3uVzDX6qKocWKe++pNnFIm3ULxHT2ZVw6QIGS74fenF0whNFOrmF/2bQjXgtRWn1owmQ33Kio8D/4febg=
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Z25BTDJwLzVZRmdWZEpzZ3d4T0t5TUJBRVNhNHlBRGVUajdqVkxKM2c4QTdX?=
 =?utf-8?B?bll0bmEvNk5JSE1LVmFyRUpzWWpoeUZmRWNVZW5OMzk1dHZ2TVJRdVNnNEpZ?=
 =?utf-8?B?OHpnOG84OXd1TVlQcWc5bFY2d2ozMUo0b1JFN3FteFN1U1YzdCtMdENEUi8z?=
 =?utf-8?B?VkxHQ3dOSnBBRUZEWEd6c21rMHc1aUVsU2dvN3c3M2RpUzFkVTlXUVJSK1Iy?=
 =?utf-8?B?QmR2YUU0d3dtK0lJMmV5TzNnNWp1WjR0U2Zmd2dwZEZIVENHMm9xelRXQ0pX?=
 =?utf-8?B?Ykp3TUNGWXpxak9tbWtGZERMWE0yV05zc1NqNkFEeXVVTHgyQytrMkZJRU11?=
 =?utf-8?B?dFB0SFp4SXI0Wi9oSWd6cFpxVm5vNkR0NU9EUDBBQ3lEYnVoUHdxa05RYmR6?=
 =?utf-8?B?dFRoVDhzMGRSbCtHRTA2Nkt2TmpBNkp4Y3pTS2h2WUlmRlIyaGhKVmhWSW1n?=
 =?utf-8?B?cjVvR2hBWXVaTnZST1JlZFVocVJ4TWZ0VEllUnpJODhBQUFCcS83bnU3SFhV?=
 =?utf-8?B?TnVzS0Nja3p4NFBNa3J0VmZaQzJ4aEJQNGVPREY4b2U4TjlhWjYwRSsrWHFa?=
 =?utf-8?B?dHZiN2p1bzlDYXZDVXUwWFI1c3RERXlMWTcvUXczQTFCMnRqdFJSY1dpM2N6?=
 =?utf-8?B?aEFDTlI3SGRLQkF0NzZXUm4rWHhqTDUwTllFV29JbUdndzZhL2JtV0srRmlY?=
 =?utf-8?B?bHVSV09iTWxBbTF3azVqNnZLWERGWTgwOGdYcm9xUGhsb3V5ZFVQckNZWjhB?=
 =?utf-8?B?Ny9HTUh5a2lRSWVsYnM4WHVPUENWazVxZjc5YjAyRzBzcHk4ekQ5TTBvZ1Er?=
 =?utf-8?B?cllRSGJJV0hmSmZZbVJKT1l4M24xVENIbGh2V2ZGK0phd0x2MnYvbXlITW5m?=
 =?utf-8?B?S2N4UHVVZS9pSW8vOGRTaFZkTU10RDU2REdCYmpCNjVERml6MDhMdEdkcVJp?=
 =?utf-8?B?QjdBbTlVSTlUbnQ1U1N4dkFFNzZzbnBNRXVnOEZlQWxKbEhLbEdwZzg4bHph?=
 =?utf-8?B?ZE9xbFYzR0JFOHVhVTBrRUMrSDdIdFJWT0pyWWk5VU1VSHIzZmlhaTB5ajAr?=
 =?utf-8?B?MkFLNS9KWUMyTEdQVFhlSG02TVRKOU9wVWQ0T0NYQlNGV0dXV0RIalN5OXVn?=
 =?utf-8?B?OVFmeW5hQzFMQ2doWWUwMTBTK1VocGNTRFNueWZBYkpoTSt3QXB6ZlVKMjd3?=
 =?utf-8?B?Q01PNEZLanoxRVBRNCtVQndxUGdDZEhJVnFEMzdpcG9MWExyVGorelBtN29D?=
 =?utf-8?B?d2dGUVJuSXA1QU5GRDRsNGZ3b1RZNVlpcmZmS2pnNDY3WEJ6N3doUzBBSUgw?=
 =?utf-8?B?bHFXSC9pdUtoWFBORXFuS0ExM0dPL2ZBc3dPSExCN09taDhyekswdkJiRGxT?=
 =?utf-8?B?WEM5b2pMZ3V6RW8rdk1GeUNiUXMwSG1SZ2JpbURRWjJtV1FtU3NTeXM3QS9L?=
 =?utf-8?B?VlhlbktDNzdhbVZZQlowMnBZd2JtZnBSZXNHL3Y2M2ppL3RUYXZUS2xYWG1a?=
 =?utf-8?B?ckdiUEUyK2kvOTBCYlF4a0VDSFJKWU5PTCs0Y1FxajV1c1RHbnV0WUxmclFm?=
 =?utf-8?B?ejE3bnQvTzBIdlBGaVhpeWxtUk4ybjliaDRSMXIyTEZBM2ZjU2FlNmtROFY4?=
 =?utf-8?B?c3pDM0Yxd2NFWm44Q05EOFQ5aXNxWnRmQjg1VlV3SHFONDh4MkY5NUpySDN6?=
 =?utf-8?B?SkpReXJmMlliZzZ3S1ZlTzNHOUFNOWs5UTBDVTBPWlNJWVcwMm5EVVlydWlh?=
 =?utf-8?B?TlZMWm1jQkE0U1llNVhhc3dnQ1R1NE9FeEhZTlRlWnkrY2FKaFphVmtEUSsz?=
 =?utf-8?B?akRjTzBINUZjckIvZDJxQT09?=
X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-89723.templateTenant
X-MS-Exchange-CrossTenant-Network-Message-Id: 994adf92-c8e4-46eb-022a-08dacee8e22f
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR06MB8609.namprd06.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Nov 2022 13:28:06.3822 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa
X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR06MB2831
Received-SPF: pass client-ip=40.92.43.87; envelope-from=gabriel376@HIDDEN;
 helo=NAM02-DM3-obe.outbound.protection.outlook.com
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, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.1 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.1 (--)

K=C3=A9vin Le Gouguec <kevin.legouguec@HIDDEN> writes:

> Idly wondering if it'd make sense to also pass the major-mode to
> project-buffer-name-function, since string matching might be unreliable
> in some situations?  Can't think of any concrete problem off the top of
> my head, I just have a vague expectation that mode symbols might be more
> stable than buffer names.  It's unsubstantiated though, so feel free to
> dismiss.
>

I agree, and actually my first implementation used the major-mode symbol
as the argument to function project-buffer-name-function.  I changed to
a string to be able to handle the following cases:

| Command                     | major-mode       |
|-----------------------------+------------------|
| project-shell-command       | fundamental-mode |
| project-async-shell-command | shell-mode       |

---
Gabriel




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59502; Package emacs. Full text available.

Message received at 59502 <at> debbugs.gnu.org:


Received: (at 59502) by debbugs.gnu.org; 25 Nov 2022 08:14:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 25 03:14:26 2022
Received: from localhost ([127.0.0.1]:33397 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oyTqs-0005Do-DP
	for submit <at> debbugs.gnu.org; Fri, 25 Nov 2022 03:14:26 -0500
Received: from mail-wr1-f43.google.com ([209.85.221.43]:36449)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <kevin.legouguec@HIDDEN>) id 1oyTqq-0005Da-Kf
 for 59502 <at> debbugs.gnu.org; Fri, 25 Nov 2022 03:14:25 -0500
Received: by mail-wr1-f43.google.com with SMTP id z4so5619292wrr.3
 for <59502 <at> debbugs.gnu.org>; Fri, 25 Nov 2022 00:14:24 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=T8M+2VZQiruqtPfUQIoU7zO4MWu8Op8zF5jnLjtiC+U=;
 b=fbu0xEdmY4c2/DIZjnHvwpSI8SviRVX9E2kRmoHyiwiWTU4Ut/wpGm5DyRE6jbPB40
 bqkNnOS1EX8E7BWdYdSlzEvvR08feQzu2KlN+ahHYS/p4zpilj3j3A6tu4Rh57T099aC
 J8n16iFMSpwQJ7UsvwOMenJIgZDAkW9jt5AWtQlPqK8v/Z1M742Sw+MGmdn0K7LsuhJs
 CF6DdNl0ftcLVDz/RuihIU9WrDnv5cTD/aAEPEapPaJdyzn161WowVtajwS3YyLtAeuN
 zyKMY283H8Vj2xS4YFCpTZMa9UVGHUdiSpSjoH8xHEx16thdiNpU4YQfWjGD5wWLH0ka
 8+dg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
 :to:cc:subject:date:message-id:reply-to;
 bh=T8M+2VZQiruqtPfUQIoU7zO4MWu8Op8zF5jnLjtiC+U=;
 b=5v9TInQ0MinJgXhyflYHGXTCst/O5HpyaYHAjrFB+7dLbAYJk8dmPh22ZCqBaj0gGN
 ohARLtlVucc+PZ1v/60G7lg7RyQaK0ln8Ecer83NFAl1OUTb5cCTEXeWHjKy6DP8m/1D
 q7lzPj99329XfzoXiGI3eSSkeYkPUOzbbRc+hhA6LVvvtUH1Y5VRW8LgMJ15lm+az6X9
 X2LC0JeeXNpYP3ulhbXLVz/Glsvm69chMXeMR8wv8cxlqVJw2LMGZKHGRMIufdIc4nj3
 dd2hs2EzyFP6lpBf9ePM7xzRnlpPC0n4tjMgDZIeEhPHCZERGicv0cugs6qswnPk9uZO
 4tDg==
X-Gm-Message-State: ANoB5pnCgmuqQVdiCY28V5oYRSn69nTg03zQk7pb1PzSU7ZD5fXPJemJ
 2O+BGm2LLE2lNYY0xjcA+VG/+Pzo1bs=
X-Google-Smtp-Source: AA0mqf5Df10Oio/ZzK/HXq+AHthrTK2OnPP458rM7/R226KSGcjJoXyrmFITHCjei8OnmSc09WUHKg==
X-Received: by 2002:adf:e2c9:0:b0:241:db86:176d with SMTP id
 d9-20020adfe2c9000000b00241db86176dmr12675248wrj.40.1669364058368; 
 Fri, 25 Nov 2022 00:14:18 -0800 (PST)
Received: from amdahl30 ([2a01:e0a:253:fe0:2ef0:5dff:fed2:7b49])
 by smtp.gmail.com with ESMTPSA id
 bo24-20020a056000069800b00241d544c9b1sm3658740wrb.90.2022.11.25.00.14.17
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 25 Nov 2022 00:14:17 -0800 (PST)
From: =?utf-8?Q?K=C3=A9vin_Le_Gouguec?= <kevin.legouguec@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
Subject: Re: bug#59502: 29.0.50; [PATCH] Dedicated buffers per project
In-Reply-To: <f72f59df-6b52-dd97-f738-2059c19c6078@HIDDEN> (Dmitry Gutov's
 message of "Fri, 25 Nov 2022 03:37:09 +0200")
References: <SJ0PR06MB86090A147EE6E14492A051198B0C9@HIDDEN>
 <f72f59df-6b52-dd97-f738-2059c19c6078@HIDDEN>
Date: Fri, 25 Nov 2022 09:14:17 +0100
Message-ID: <87fse7lacm.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 59502
Cc: Gabriel <gabriel376@HIDDEN>, 59502 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Dmitry Gutov <dgutov@HIDDEN> writes:

> For the rest, this probably makes sense. I do wish we had an "upvote"
> button on these threads, to see how many people are interested in
> this.
>
> Anyone would like to +1?

=F0=9F=91=8D

I'd say solution 3) is the one I'm most attracted to.

Idly wondering if it'd make sense to also pass the major-mode to
project-buffer-name-function, since string matching might be unreliable
in some situations?  Can't think of any concrete problem off the top of
my head, I just have a vague expectation that mode symbols might be more
stable than buffer names.  It's unsubstantiated though, so feel free to
dismiss.

FWIW I think the "serving suggestion" from the OP=E2=80=A6

> (setopt project-buffer-name-function
>         (lambda (name)
>             (format "*%s-%s*"
>                     (project-name (project-current))
>                     name)))

=E2=80=A6 would make sense as a defcustom alternative (and could then be re=
-used
by project-buffer-name-default).

Thanks Gabriel!




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59502; Package emacs. Full text available.

Message received at 59502 <at> debbugs.gnu.org:


Received: (at 59502) by debbugs.gnu.org; 25 Nov 2022 07:10:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 25 02:09:59 2022
Received: from localhost ([127.0.0.1]:33261 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oySqV-0003UZ-Ku
	for submit <at> debbugs.gnu.org; Fri, 25 Nov 2022 02:09:59 -0500
Received: from mail-pg1-f180.google.com ([209.85.215.180]:34546)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <daanturo@HIDDEN>) id 1oySqT-0003UJ-SC
 for 59502 <at> debbugs.gnu.org; Fri, 25 Nov 2022 02:09:58 -0500
Received: by mail-pg1-f180.google.com with SMTP id 136so3261555pga.1
 for <59502 <at> debbugs.gnu.org>; Thu, 24 Nov 2022 23:09:57 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=content-transfer-encoding:from:cc:content-language:subject:to
 :user-agent:mime-version:date:message-id:from:to:cc:subject:date
 :message-id:reply-to;
 bh=GEPAQWRn9MU9+gTYyN43024tcbKWopVy0/bdiRAzyRk=;
 b=flcYSL3TPTTkeYT/Pu3vdCuuVmSKUj1HftZc8cRq1Gmu3UUeJPz8piAV8CFbyNPikT
 IE3iBeSrPY0M82ZoXXpG/R/FXDUn+X4UAKbANxJrhlIOqegz98pqKMOK4LT9B4titJtO
 jbMZCGLq4goOQhxZstviB2nLfbczGVi78lSUGdRTb/6d+WVo0HfXbFNw1Ui3m26kf/Hd
 EjdEgCprFkVy0239k/sveBessrkv+Fa8F4LZP2jfY5gcItI08OAmz4jzLNbXV+uWAaV4
 /Q02F+f+rsyknTVhbKAG72lWcH2kflK4Su8hLENCn1iRUFgf543olyuh0YbuzscCYOiB
 bkEw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:from:cc:content-language:subject:to
 :user-agent:mime-version:date:message-id:x-gm-message-state:from:to
 :cc:subject:date:message-id:reply-to;
 bh=GEPAQWRn9MU9+gTYyN43024tcbKWopVy0/bdiRAzyRk=;
 b=mieXyH0y1uFWK6J8CP9JrziroStSOkM4Lh3tC4kkWvGh1AVDUih6x+vZHTnoF509yn
 PM3FXrdXUYZQRabGgLxqukV+2AkeDhpy893lzY3oDshsdEifAL5GHchw49a6ccU/O9z5
 zsVrgWzk1PB56tT+pQimp1XfIGJZVgdFqh7efobdF1oR3RongaWDJ5ZXGaCkUlaMoObV
 A9UfehFoJQO4We8A5xCE/LjHQ86eF4UP0TzLuB4i78Mog85zE3MtA0lP5v1Hp8r5VmAy
 q+TOaF311Bvl4oCEn0SFmkIeAGPlylhCrGEAI3HAdOwhwWiAa6At1ycBQ39KuPHrzs2T
 ao3Q==
X-Gm-Message-State: ANoB5pmxjeWxs74VkDGNLuA6ZgLjzfti61gzi4biWVpoxOP06NLZMQ8O
 JVFHtQHlF5Qrx8k76RLzYeI=
X-Google-Smtp-Source: AA0mqf6HAs4Uh7MSJnmAbFPTga88gpBTtVaEeKkkdyreGHB4eSWAxu8Bdch6A72YsnZ5MpcrFdc2pg==
X-Received: by 2002:a63:5d5:0:b0:477:cdff:10f5 with SMTP id
 204-20020a6305d5000000b00477cdff10f5mr5800294pgf.539.1669360190682; 
 Thu, 24 Nov 2022 23:09:50 -0800 (PST)
Received: from ?IPV6:2001:ee0:50ce:c0f0:f9e1:f94e:db8d:e9ca?
 ([2001:ee0:50ce:c0f0:f9e1:f94e:db8d:e9ca])
 by smtp.gmail.com with ESMTPSA id
 c14-20020aa7952e000000b005745481a614sm2348114pfp.76.2022.11.24.23.09.48
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 24 Nov 2022 23:09:50 -0800 (PST)
Message-ID: <d6fe9139-bb20-d4d1-4512-574897874e29@HIDDEN>
Date: Fri, 25 Nov 2022 14:09:47 +0700
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.5.0
To: dgutov@HIDDEN
Subject: bug#59502: 29.0.50; [PATCH] Dedicated buffers per project
Content-Language: en-US
From: daanturo <daanturo@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 59502
Cc: 59502 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

> I do wish we had an "upvote" button on these threads

+1 from me.

IMO stuffs like this, along with REPL buffers should be project-dedicated by
default.

I think once this get merged, individual major mode's REPL buffer should start
adopting it (by taking the customized value), rather than creating a new
variable to set for each programming language like `python-shell-dedicated`,
`geiser-repl-per-project-p`, etc.

-- 
Daanturo.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59502; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 25 Nov 2022 03:00:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 24 22:00:44 2022
Received: from localhost ([127.0.0.1]:32829 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oyOxI-0005Qg-06
	for submit <at> debbugs.gnu.org; Thu, 24 Nov 2022 22:00:44 -0500
Received: from lists.gnu.org ([209.51.188.17]:46616)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gabriel376@HIDDEN>) id 1oyOxG-0005QX-0K
 for submit <at> debbugs.gnu.org; Thu, 24 Nov 2022 22:00:42 -0500
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 <gabriel376@HIDDEN>)
 id 1oyOxF-0004qM-Ln
 for bug-gnu-emacs@HIDDEN; Thu, 24 Nov 2022 22:00:41 -0500
Received: from mail-mw2nam12olkn20826.outbound.protection.outlook.com
 ([2a01:111:f400:fe5a::826]
 helo=NAM12-MW2-obe.outbound.protection.outlook.com)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <gabriel376@HIDDEN>)
 id 1oyOxB-0003Pt-BH
 for bug-gnu-emacs@HIDDEN; Thu, 24 Nov 2022 22:00:40 -0500
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=JyHFUfVA7hU+3jXBIui+O9VMzF0z7sMgLJGCTY7zRP/Es9+P9JlBuHOn18wRiUVp8Hl9O6rlEWsdYIdKLgpRewSBde66AssbAweX1MMtSVv0Itzenp5hiXADCEmkpamzdjo3InfjsactNNXw2E3krY5+KdM+rUHklqk1WgwOcIjlVzHhUFXRYlqJde9hi0TgThRwpnzVW0CUAi41Lx4fpPDtytmC8kDsLH2hHb999LZi/N8rtOsITsIzi7J4sR98n0CZoqp3GFDdy3HLC8wTHjWNfs5MzUL9DT9bioKmDynQBA2Y9Raq1kCmdn0pEpyuBU1Lj4aW6DRFNm/LWnYQTg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; 
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=QtNWFNHwBqJHaZ6cAc2pHoh1yTh3IyuLLmVc9KMJxko=;
 b=HJE2x8UuhESzVqLPpWWiKET/raM9nVBBV3MsZjN07e/xJqSIhfu1m/KuvEiHyEHvEzRRUnwhDQ110wZdnd5/PZ6PpHQ9NoEywI0GbC+/t+Q4q1L4E8pxNpzMlU5fMymfV428OwupWG1uYCyciZTEpdz7yUfpPdIxxeOvktukUNxQRMyyRzS80Vb0wVXURrUeV+1E+HOFq8TOWED5apJWUJN9cNALd4t/4XDoImLlD1Alko92WperKsSUPiHhVo0ETyFvUlToN4yK8/hUAjjCqfUIb/olB45J9JG6VfTMTGHApxyJd8exUiU5qcKEaQcRISTl5utxxHL+qEBfhlvbew==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none;
 dkim=none; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=QtNWFNHwBqJHaZ6cAc2pHoh1yTh3IyuLLmVc9KMJxko=;
 b=svQB5fQMAn8/M485WMghgTslhAmrpZplONJbjDUwBRKbBmMt9bEqo+lfF8Bv7meHgRuv0XlLyj923UvpUb6hKTYY3KMZMBD7as+c7m7tok+ius4zUzDvShFzQ+AzEjnWG7vqNAoeyRoZj04DSC52icTjmgmsb65zNp/3HKxeWFJSNVwpycAWswvL6TE/pvbJGb8infS63EajIHCrZ/wb/wYJQ8dfyjVePOtmfC1s4ZIVwNy5vlIDoGTohYQlCJBRXB3IQzrb1I2RLmrNo9S792Ab23Djv6X+ruJJgxRjcE5KGh2Rund18BJBOOw/rjK3sugrVFIU3mKa50H8gk0W6w==
Received: from SJ0PR06MB8609.namprd06.prod.outlook.com (2603:10b6:a03:40c::11)
 by MW4PR06MB8467.namprd06.prod.outlook.com (2603:10b6:303:12e::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.19; Fri, 25 Nov
 2022 02:55:26 +0000
Received: from SJ0PR06MB8609.namprd06.prod.outlook.com
 ([fe80::33ae:d3a7:24ae:5c6f]) by SJ0PR06MB8609.namprd06.prod.outlook.com
 ([fe80::33ae:d3a7:24ae:5c6f%4]) with mapi id 15.20.5857.017; Fri, 25 Nov 2022
 02:55:26 +0000
From: Gabriel <gabriel376@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: Re: bug#59502: 29.0.50; [PATCH] Dedicated buffers per project
In-Reply-To: <f72f59df-6b52-dd97-f738-2059c19c6078@HIDDEN> (Dmitry Gutov's
 message of "Fri, 25 Nov 2022 03:37:09 +0200")
References: <SJ0PR06MB86090A147EE6E14492A051198B0C9@HIDDEN>
 <f72f59df-6b52-dd97-f738-2059c19c6078@HIDDEN>
Date: Thu, 24 Nov 2022 23:55:19 -0300
Message-ID: <SJ0PR06MB86097019C56823FB3D468AA88B0E9@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
Content-Type: text/plain
X-TMN: [Wlq0ANwIHxvmQrUfNLcCNpzzj3sZrQDXsC+0rWIOyoWU+kVRfW5Rb794ujySlSWZ]
X-ClientProxiedBy: CP3P284CA0106.BRAP284.PROD.OUTLOOK.COM
 (2603:10d6:103:6f::21) To SJ0PR06MB8609.namprd06.prod.outlook.com
 (2603:10b6:a03:40c::11)
X-Microsoft-Original-Message-ID: <87cz9bkajs.fsf@HIDDEN>
MIME-Version: 1.0
X-MS-Exchange-MessageSentRepresentingType: 1
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR06MB8609:EE_|MW4PR06MB8467:EE_
X-MS-Office365-Filtering-Correlation-Id: ce3182a3-1a62-41ab-239e-08dace9080bd
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: AuPTaZ9FIyTNtSHaq4Z6ae7PslOExaTMP8Lr5GteWeHkFIoYvDRwArS4UXuGdKfZoW05quybD+m80Y86TIFYdsP7Ftm6dm5fSblSg2LF45uQ9Wr6phNHaxO6FOBws/i0Is9qay//fJahaeMCOACP6sboYc8WCCdkSJ4YX9C/FDE28mJ8EgalzlexLYWAorJuJaP59/iaOq4T4lZ+q4oVtw+RL9YgBzPUBxJN7ykz2W+kdODdLZOzilGXn1jqlnhEJhRjOFj+bBt22dgh1QUGjEo+3VZrDmRMViWRW782aYN5mF3qs6DaZ7vPbOAVNc8eddpbIqg3TzNm67Qsbc17s6GzuPMaNBpRH141RmJhSaa1J3e0zngpaD1B8g9QiGCJSV2Pp38OYmCvtxHXRAuYgVs5osoXNL4A6zTiOj/zt71mQ1f1Qg7k7dJRMYwGuIR1IVFpfw19de33eaPS76z+tS05lrj8E9AMb2lwqNidVtI+veZKePPJ5yWfzpsxYTQCQ3bI041aj+iuE83FwClyTLC2znH3/LgNgz6qfi0RObRs+cct7kpe5wcqe6AF/5tKxhrCtFRpxmGFz5eO/Xt3EjTFROABwD4WSJbucgkYvsMijXvMxajdVVLuv5KO3yGsBbh9v/Eepf/MjH+uYIuMf+YiPTjHnD43phon6UTAQ3s=
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?iX0BPlU3mNE3K49O9jO9U3r8v/EyBLQnxFPrJWUtc+iwGD3GK+ZvLP9nJF7a?=
 =?us-ascii?Q?voWaawzG7/HFrJh/Em3Z6rG3yGgc1dz16q9iexJ1VwB27mswehalBQsj0CqA?=
 =?us-ascii?Q?pCnU4RfmMNVQwDEL/vDRpObjRxdBkBb415qZTyqhPXeMmbapuiU+fknFiDPl?=
 =?us-ascii?Q?d7F2h8fsIaifNyRIaTO07WGEt/ptWZHWA8U9wJk1XuovLvF52QapxEj2CAzn?=
 =?us-ascii?Q?0AszHSA5hFhZmVEv4SJbwEdErKs/wq4I4R8nPiQXirjF0CVVr2Gf0gABLZD6?=
 =?us-ascii?Q?we5kUJ7Spjdbc7RbZ05I3jW7XTIbiz0og87QNiBIwVfSQKKaN29Ghv009Y+C?=
 =?us-ascii?Q?DDzhkJQ2ek8Yu2pjqg8Fy3M5nz6vc5qC6sO015qs1FrDXJjxe/a5vYMSlbAH?=
 =?us-ascii?Q?UlxGmxwfy9eI99Rikr83t09RD/HXLI/j5zDYxnetkucUDlxcGjEP//iYcSpr?=
 =?us-ascii?Q?Ys/EQDHCQSfJ+/KclzYrkEiJq04eBbser0EUiYly8QIeZguDE+wkZMztu/lk?=
 =?us-ascii?Q?s/sFzH2kpODhmx+IZYvh5PgiXfNyJcw9+uakVCLrDAflp/D5ta98SyRJ/mo0?=
 =?us-ascii?Q?77fJYPYzSo1cuRQXspLdYXlsCCokjRBhVtxRy30c35IEUxdyotKY8Zu1naHj?=
 =?us-ascii?Q?jvEJL3wGPtVCCbv39zNoi1IETC3hfsiq+uRfyJfFzVVwTyxgpeGdxL3RTq6C?=
 =?us-ascii?Q?yJXHU45Sdp6Ncb8d1jKhmB7MPKRvF7pol/s+CHN33aGlgCzrVEDI/U55pjwi?=
 =?us-ascii?Q?RyuMfmJASR73eFy+L6bypNYVrxBXVpEsrbhj1wJ6F7Vsd/o1qG7ZFO1Z0l8H?=
 =?us-ascii?Q?xkswIAd+oC0DOrz+4V7GvtOmjb2pmg9Wpff3pbUWFz74cwA2dJx/rDLqA7DS?=
 =?us-ascii?Q?qfNcRUy08ZSdFgpskhCopgq/rw11bwDg2cZGHVq6+Pnr9oUNjhAjXqf7PieR?=
 =?us-ascii?Q?m7zVoifw3uNLAU3K8Gn8MYrh5LpHiy0Mr+9ix61pq0MK9HowtL5+pwtrA9n2?=
 =?us-ascii?Q?94MtIqpDwaUm/9FB2th/QjRyEd9kYRl8eCpJdenqQ4dauhZNiLwO8PjAjxP6?=
 =?us-ascii?Q?egV3xaUpGDOfcwQTcGjtpYsQWJ62tFwBgFTXCrHhYqWBwoYXzNniEtIbUyg2?=
 =?us-ascii?Q?tUF9nMVpS5Ijr93CZMwJA0b1xUdyG7qoPfLoWZCrjvj1H3FC6ZemG9qHg7ME?=
 =?us-ascii?Q?vKSwR5DuRWktpOM/5JijjAcsY2W/DLigoS6P7cnS/IsVa+4cJqpLXNN5lrbL?=
 =?us-ascii?Q?XQhyGT9HVXvXgfVGXszQpuOidFIut1DEPDz8unxAMDv3OTKQE5/7gteJbjkK?=
 =?us-ascii?Q?ykP5Xd7Afk4atw7gghsSXn+RyRIv1Bp5a5uDjPdpPcwyCQ=3D=3D?=
X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-89723.templateTenant
X-MS-Exchange-CrossTenant-Network-Message-Id: ce3182a3-1a62-41ab-239e-08dace9080bd
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR06MB8609.namprd06.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Nov 2022 02:55:26.1225 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa
X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR06MB8467
Received-SPF: pass client-ip=2a01:111:f400:fe5a::826;
 envelope-from=gabriel376@HIDDEN;
 helo=NAM12-MW2-obe.outbound.protection.outlook.com
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, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.1 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.1 (--)

Dmitry Gutov <dgutov@HIDDEN> writes:

>
> This is a nice initiative, and the patch you sent seems to handle most of the
> technical issues.
>
> There's one thing, though: some of these buffers might only start to be
> project-related, but then "relate" to some different project a little
> after. Buffers such as Dired, Shell and Eshell.
>
> For the rest, this probably makes sense. I do wish we had an "upvote" button on
> these threads, to see how many people are interested in this.
>
> Anyone would like to +1?

Hi Dmitry,

I agree, some buffers (Shell, Eshell and Dired) allows the user to
navigate to a different location, which would move away from the
starting project.

For Shell and Eshell buffers, the tentative patch in this bug report do
not change the current behavior (which uses
project-prefixed-buffer-name).  For Dired buffers, the buffer name is
not explicitly handled by project.el (can be controlled via
uniquify.el).

I don't have a good answer on how to properly handle these cases.  A
possible approach would be to monitor for location changes on these
buffers (e.g.: via hooks or advices) and to update the buffer name
accordingly, but seems to be an overkill.  My suggestion is to leave
this small inconvenience (buffer name and location out-of-sync) as it is
today.

The good news is that project.el already properly handles the cases when
the buffer location is moved away from a project (e.g.: project-dired,
project-find-dir, project-switch-to-buffer, project-list-buffers,
project-kill-buffers etc), since buffer names do not really mater (only
its real location).

---
Gabriel




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59502; Package emacs. Full text available.

Message received at 59502 <at> debbugs.gnu.org:


Received: (at 59502) by debbugs.gnu.org; 25 Nov 2022 01:37:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 24 20:37:18 2022
Received: from localhost ([127.0.0.1]:60964 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oyNeY-00039j-9J
	for submit <at> debbugs.gnu.org; Thu, 24 Nov 2022 20:37:18 -0500
Received: from mail-wr1-f44.google.com ([209.85.221.44]:37676)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1oyNeX-00039V-0Z
 for 59502 <at> debbugs.gnu.org; Thu, 24 Nov 2022 20:37:17 -0500
Received: by mail-wr1-f44.google.com with SMTP id bs21so4755691wrb.4
 for <59502 <at> debbugs.gnu.org>; Thu, 24 Nov 2022 17:37:16 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=content-transfer-encoding:in-reply-to:from:references:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=GUrWMNbeICEvgYU1IPfPrAW/1JHfgcIEmeAXTeaW5Rg=;
 b=e9tzhmoiZH0SrC1xc51kvlyq/XuRol/gaaIasYK39LvGXcgGIfdsEpGgitkYWoxGXI
 ZHx0hd5VbJ0RH90uXmCUZ79vR69zMouofWuTwIwchyINjQowSQ41xVRNmt5txbazfnCG
 YlKRll7wDwpjSEZkLieOJMFbqVTAYjEaVXzCmxdOtEPfzPI0v6qoQn5zRjgasGDbWr0L
 +IBp6J7akwBXNg5pDhjfQKz071T2XCHcmJoIhfVGUy67oGqEShLMt/7PlJAknnq0do/N
 LnR+1qvYaG/DOkNDERnxZ4eBuzD/4AvmCyOaGeCjV9tgonMilUvX+FBmoFAwCLCK+OlZ
 TNoQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:in-reply-to:from:references:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=GUrWMNbeICEvgYU1IPfPrAW/1JHfgcIEmeAXTeaW5Rg=;
 b=T87Exoef51RoyMHNCHaYrv9icq/9ysF/9owoi0Jigkxm9CUc1skR8cAPSG9sLAH6jd
 APYYOyYkGr7rUIp2LQVDxKnJ5ugx1KhMRERuym484BpJZnnGF76ygLIdQt/2oLQFH9M0
 6B27GKS3bb2+ZT8p2w6uftohnGeYTiQ5xsJXVcf/oEvlTjZy14HSlYvcmSK+6cYfz10G
 NYo4uXZ02Si6CtsW1EFA0lqeRVYy1P6/hk2NkD0m+szh3nklm10lJfLD20rgclF/a+zQ
 TFnPYkdOJc9/H8aY8x4/xKYs3PP+6QekweZy4GotCQ9bcR8ZvAew9aFUoLa39jFQYnoY
 RgkQ==
X-Gm-Message-State: ANoB5plxpXm/5V2PlLRORVXdSvAeiVF7kSYsCxJSHnKJxHPRj81Kch7Y
 t+nU0NWOulc1oLdBMgSae2g=
X-Google-Smtp-Source: AA0mqf4qul1Ce081Nkg6POivqRwUemJhekjoUq9P0Trbl9j23GDD3DTWpbp1uBtUMV+fxIIoOdTN0A==
X-Received: by 2002:adf:ee4d:0:b0:236:8ead:3da5 with SMTP id
 w13-20020adfee4d000000b002368ead3da5mr21820591wro.391.1669340231007; 
 Thu, 24 Nov 2022 17:37:11 -0800 (PST)
Received: from [192.168.0.6] ([46.251.119.176])
 by smtp.googlemail.com with ESMTPSA id
 j8-20020adff548000000b002367ad808a9sm2568744wrp.30.2022.11.24.17.37.10
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 24 Nov 2022 17:37:10 -0800 (PST)
Message-ID: <f72f59df-6b52-dd97-f738-2059c19c6078@HIDDEN>
Date: Fri, 25 Nov 2022 03:37:09 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.4.2
Subject: Re: bug#59502: 29.0.50; [PATCH] Dedicated buffers per project
Content-Language: en-US
To: Gabriel <gabriel376@HIDDEN>, 59502 <at> debbugs.gnu.org
References: <SJ0PR06MB86090A147EE6E14492A051198B0C9@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <SJ0PR06MB86090A147EE6E14492A051198B0C9@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 59502
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

Hi!

On 23/11/22 07:11, Gabriel wrote:
> In summary, project.el currently has the following behavior and
> customization options:
> 
> | Project Command                   | Generated Buffer         | Current Behavior              | Customization Options                      |
> |-----------------------------------+--------------------------+-------------------------------+--------------------------------------------|
> | `project-find-regexp'             | "*xref*"                 | Use a default buffer          | Not available                              |
> | `project-or-external-find-regexp' | "*xref*"                 | Use a default buffer          | Not available                              |
> | `project-list-buffers'            | "*Buffer List*"          | Use a default buffer          | Not available                              |
> | `project-kill-buffers'            | "*Buffer List*"          | Use a default buffer          | Not available                              |
> | `project-shell-command'           | "*Shell Command Output*" | Use a default buffer          | Not available                              |
> | `project-async-shell-command'     | "*Async Shell Command*"  | Use a default buffer          | Not available                              |
> | `project-compile`                 | "*compilation*"          | Use a default buffer          | `project-compilation-buffer-name-function' |
> | `project-vc-dir'                  | "*vc-dir*"               | Use a default buffer          | Through uniquify.el defcustom's            |
> | `project-shell'                   | "*shell*"                | Use a project prefixed buffer | Not available                              |
> | `project-eshell'                  | "*eshell*"               | Use a project prefixed buffer | Not available                              |
> 
> My suggestion is to improve the consistency of how project-related
> buffers are created and named, providing sufficient customization
> options for users.

This is a nice initiative, and the patch you sent seems to handle most 
of the technical issues.

There's one thing, though: some of these buffers might only start to be 
project-related, but then "relate" to some different project a little 
after. Buffers such as Dired, Shell and Eshell.

For the rest, this probably makes sense. I do wish we had an "upvote" 
button on these threads, to see how many people are interested in this.

Anyone would like to +1?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59502; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 23 Nov 2022 05:11:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 23 00:11:56 2022
Received: from localhost ([127.0.0.1]:53218 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oxi39-0002SF-DK
	for submit <at> debbugs.gnu.org; Wed, 23 Nov 2022 00:11:56 -0500
Received: from lists.gnu.org ([209.51.188.17]:42722)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gabriel376@HIDDEN>) id 1oxi34-0002S4-5K
 for submit <at> debbugs.gnu.org; Wed, 23 Nov 2022 00:11:53 -0500
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 <gabriel376@HIDDEN>)
 id 1oxi33-0002Mx-WA
 for bug-gnu-emacs@HIDDEN; Wed, 23 Nov 2022 00:11:50 -0500
Received: from mail-mw2nam12olkn2083.outbound.protection.outlook.com
 ([40.92.23.83] helo=NAM12-MW2-obe.outbound.protection.outlook.com)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <gabriel376@HIDDEN>)
 id 1oxi31-0005dJ-8n
 for bug-gnu-emacs@HIDDEN; Wed, 23 Nov 2022 00:11:49 -0500
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=YpeBVvzNPCk3E/AKwpSra5PeU4gUafxTGLR/4HjXgWDj+Fg1VQhYit3bLH9WWpHXEQ/vyGaWXomyTR5NJylu4qvE7/uwZiKtSVGh/Xr7bMH2pnsjszHaDg/XipBWbGjX2rbPoGgEctiMRpjl5/v8Zg8wDaokzFesy0aQJLAWevm5SB0dAxkUxZe0cbBBVfDw/cxhFGRLta8vAkQAadcfMC8X39LazQ2vjllPODoQBkOCY+Y2qU01VZI5fjiHblim791GNgSCORNBbYMKBEdKU93+UW9vDcKJIESHz71IVZVFGvUbrSJXQ6ws8wMoUtE4TEsaVYZgVyG4R//ZNLa3OA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; 
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=5v6pkJqSNzBEbdeWN7Z/uH16O3Von6voqZbQtABJvXo=;
 b=Ehx0ONFDsNlvC361J1Zei4Uah1HpxnXlPCt/jrvv7DvrFWcYx50+grkVpjJFdlgOK1nScmaChzu2TvP8R7+BQ3WhrXfTV3JVWGLevFiBNIBLEVbSXqRhdZv0GL2tUs3l3aGtoeaBAqcrDyu/uX7nHYGVnQOZAQgMal6joo/1jt9/zg4nx/toPWbg69Izyvy8jTyjZMZbAlqkNYocmyNoKGQZ9aQwQdlmktNmjWGavIDdgJ0mVktEI2hR4nhvi4cT6Sv7uEkUJE9t6DD4qw2XQbOmVhVVbXvKfuLowVCFS28lyKdgkPX0TJ1y/dPtF3K5YamBZKhqcSxRmYHPQQ6K7g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none;
 dkim=none; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=5v6pkJqSNzBEbdeWN7Z/uH16O3Von6voqZbQtABJvXo=;
 b=j6oawAxH/6Q0hu7RoMChk9GB8vS+p+8Q0zvcp/XJ54xRsyo7jQhCaHM+m+I13ZqV8USpaULfP1KoXgLnYQ8zoUVSEHlcm01sBwF+y/zq8LNCitzjRD99SsaX/PNN/rAeWMCQuxKZQn8AyxDAVoHiFFKGs39ZtbLLFmgXftTi2dNFMFNfvV55JGXhl1vTB2TAfx1+NtszKx0Cn8kYtQjPialVS6ZC508hXT55QXoYHsztzq6jcG8NCFZaFO6teztED9NUqYCcT4OTyU88HZujQb6+UsrP91XDITH598CEb5j50uaZjXAarqTwwsX+oRXsINMUEBqOvCKpkxMLd+JSeA==
Received: from SJ0PR06MB8609.namprd06.prod.outlook.com (2603:10b6:a03:40c::11)
 by MWHPR06MB2909.namprd06.prod.outlook.com (2603:10b6:300:11d::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.17; Wed, 23 Nov
 2022 05:11:41 +0000
Received: from SJ0PR06MB8609.namprd06.prod.outlook.com
 ([fe80::33ae:d3a7:24ae:5c6f]) by SJ0PR06MB8609.namprd06.prod.outlook.com
 ([fe80::33ae:d3a7:24ae:5c6f%4]) with mapi id 15.20.5857.017; Wed, 23 Nov 2022
 05:11:41 +0000
From: Gabriel <gabriel376@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 29.0.50; [PATCH] Dedicated buffers per project
Date: Wed, 23 Nov 2022 02:11:36 -0300
Message-ID: <SJ0PR06MB86090A147EE6E14492A051198B0C9@HIDDEN>
Content-Type: multipart/mixed; boundary="=-=-="
X-TMN: [01O3SeMMhuknMLp+ymPZwGuBuEEGuZTXJhJ5lX0nVkxLNzgCD3TG1U/r8+vZZN3l]
X-ClientProxiedBy: CP6P284CA0003.BRAP284.PROD.OUTLOOK.COM
 (2603:10d6:103:1aa::12) To SJ0PR06MB8609.namprd06.prod.outlook.com
 (2603:10b6:a03:40c::11)
X-Microsoft-Original-Message-ID: <87wn7mcl13.fsf@HIDDEN>
MIME-Version: 1.0
X-MS-Exchange-MessageSentRepresentingType: 1
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR06MB8609:EE_|MWHPR06MB2909:EE_
X-MS-Office365-Filtering-Correlation-Id: c4825c33-471c-4ff8-23d3-08dacd1134d3
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: L1mOdbwoVmwLfOBVg5GC1KrUtLlmfVFDdXXUEOL6XNvNaGI+S8+80Ai1lt6Iy6gUsoZW/syeEVCYNGipHObMJaz58Jkwp/g6msDQ1t+VJpCW0fAQjHO6L35P9COiqFXX/lUqOMXJunexsqvXcQv+tE9BfST5Iv6QBUTcmiKzJochsRk5U2QFthePHbI7VqQ2RChJsMHf+vx8mSdyR9LaaGPelLurxig5ACzFGQzc6iCN5+qVJBT2JF/cXigP1LKX2pHF7xzo/Gg/60mlIXcDqsyrBQeKm9qE37uG1fbnioO7lDu3Kpz0vkg2FjGpL9idTAueYXLaLa90+YSV+tAR2j6vHZFmtbuPyxPKyJyyVbayEfMEbaAw6TiniQi5b5iRGzAqk/fiSS6LPOfZgWmhu8Zj7KKu36SE2xhOKZ4ImzCTmxG1oO/hohrK54Hid8cdAimDpbMuunu5/lOIehJfeWamcJNKphI8w9cJ2gKFlTbsNxwW6I+gXCz26s+Nwy8/Ms9Pg8OmdZL222oDLUWpYW0Vq/1XYB48bs4I+B9ULwMgVj4/Pzm4QGu988UK1XjeyXHPf6GWVeDGMxNX+ktngm13x/pthgwmuHjO07UbtFA=
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?XDs4zirakfyPZ2WIs3svliS28Ahm4eZmrXToidEahohb1zppc7sC52Iwp09q?=
 =?us-ascii?Q?gLkpaBW0n5VkMEUcOFTS3qsonL69uMtRXmmRI050Y6vucrw+pvJEewDQaw3M?=
 =?us-ascii?Q?HICiOKVU9UlnJnqUjD4nZTIz0IKQWWsmX3RhMg1ckXPWE8r3p+2CwXlcMODc?=
 =?us-ascii?Q?nPL15JX96Vu7lGOqLhUZVneQMHUV0OvZdCmkFcVj7ohW0Y2KLkDvF+gU7YpG?=
 =?us-ascii?Q?s0qbaIETQVAZ0qi3ey4cb09wFe+yx60F1mrMYBDdT9CDAAciXTHfCqqsHvMC?=
 =?us-ascii?Q?Tx8J6X7nxkh11tXV1OANdSoIlM1S33svGXaXOMQW3sv7rNRMM9mrw1wvIEzw?=
 =?us-ascii?Q?U0/gu5Kesxn8tRh3NLVW5S3So3faW9KFEaoNfhGqxqcWoefEg88jXjQsbfgO?=
 =?us-ascii?Q?b8fogo1/SD0yMLd74aLGkiYC+7rkxCj3hjsZMgPzHt8g9judU5lOH+KEykr+?=
 =?us-ascii?Q?X7J5KT2iigKpnY0b5ECkWUtQuAXmM+Wmmn1pYqmr9774JxfCiI7f++lmpTcn?=
 =?us-ascii?Q?ipfVuGm4J010EH/9TZ2Vw91jrNAJM8ITXydoV3AoetQ8c+ZzeV7yWZnqDb4T?=
 =?us-ascii?Q?Rs3+qjJ0g93APswPGNKy8xJoEjFiv9tVDlpwL4T+O5x0Y4n7cS6qg1jmJPJM?=
 =?us-ascii?Q?5/tLXNWMUVMeJHP4LmRxMDpq53vbSTVwQMCBha+tcWNqNRgrFwOX75xjwnmI?=
 =?us-ascii?Q?efHsPQnBTkG/prsy4vU/5hmkB1+im7GWlwlUCMQUyRphLTA38pGhTChsjQHW?=
 =?us-ascii?Q?PSfta0Vgd02x8asphOUXep4bLTmoO/1AfsK9MKBcmKpQepro4pBpFxvhaFlC?=
 =?us-ascii?Q?iJDkFU/1dT+fMwtrndv5O3fvywOlBuujecltZvQIj9xX0JVWuIzYeziaJOZz?=
 =?us-ascii?Q?ZaGAby0AjwwNWCGLlIwD0ydudEbPwahvo5Av6hgpVInrb49P7N10CyWL+iPe?=
 =?us-ascii?Q?RBmcFWGg8VJHKceHe8Ps6Zj9SQrHVe81FkJu50eFM/4mcF/wUGJlFiWbOp1i?=
 =?us-ascii?Q?zuuNUxB8NGsaWzrVDkJo34VdItTvQ2k3W0tYfPx4O+RVcUZGpPxazs1bC2s7?=
 =?us-ascii?Q?t9CD31hDpgqGYsDyUr7u0u7HXkN7aHpM+zmoy4xzu9NtWUkL9qQAb2iaW8/z?=
 =?us-ascii?Q?3oZAm/9VCJqSJhtSDj7m1CRiEU3TS3LgatwB3lMiJQZMfMIwf24EeZr5vQAV?=
 =?us-ascii?Q?op1LL63sLXArLUrW8l6vvHhVUdhQhwuztIPZf/6Y/EuPOdh1+LjRpwdYVFlm?=
 =?us-ascii?Q?KkMEvhZ5rQey2cgHPRFB7kvMhUKEYTRguvzx5S7W1nuRBAFzXq3MOvkcPRo3?=
 =?us-ascii?Q?yGUaT/qwn5iY3e4gvIeIt2TqX/bsunKUVxx1i5gJ0K5Kpw=3D=3D?=
X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-89723.templateTenant
X-MS-Exchange-CrossTenant-Network-Message-Id: c4825c33-471c-4ff8-23d3-08dacd1134d3
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR06MB8609.namprd06.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2022 05:11:41.7939 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa
X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR06MB2909
Received-SPF: pass client-ip=40.92.23.83; envelope-from=gabriel376@HIDDEN;
 helo=NAM12-MW2-obe.outbound.protection.outlook.com
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, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.1 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.1 (--)

--=-=-=
Content-Type: text/plain

Severity: wishlist

Description:

Currently, xref commands in project.el (`project-find-regexp' and
`project-or-external-find-regexp') use a "default" xref buffer (through
a call to `xref-show-xrefs').  It's a "default" buffer because it uses a
constant name ("*xref*") for the xref buffers created (see
`xref-buffer-name').

If a user is working with two or more projects, any xref command will
override a previous "*xref*" buffer.  Thus, it's required that the user
first manually rename any existing xref buffer prior to executing a new
xref command, in order to keep the xref buffers of other projects.  The
same is true for "*Buffer List*", "*Shell Command Output*" and "*Async
Shell Command*" buffers.

Currently, project.el already support prefix names for compilation,
shell and eshell commands (see `project-prefixed-buffer-name' and
`project-compilation-buffer-name-function').  The "*vc-dir*" buffer
created by `project-vc-dir' is handled by uniquify.el
(`vc-dir-prepare-status-buffer' uses `create-file-buffer').

In summary, project.el currently has the following behavior and
customization options:

| Project Command                   | Generated Buffer         | Current Behavior              | Customization Options                      |
|-----------------------------------+--------------------------+-------------------------------+--------------------------------------------|
| `project-find-regexp'             | "*xref*"                 | Use a default buffer          | Not available                              |
| `project-or-external-find-regexp' | "*xref*"                 | Use a default buffer          | Not available                              |
| `project-list-buffers'            | "*Buffer List*"          | Use a default buffer          | Not available                              |
| `project-kill-buffers'            | "*Buffer List*"          | Use a default buffer          | Not available                              |
| `project-shell-command'           | "*Shell Command Output*" | Use a default buffer          | Not available                              |
| `project-async-shell-command'     | "*Async Shell Command*"  | Use a default buffer          | Not available                              |
| `project-compile`                 | "*compilation*"          | Use a default buffer          | `project-compilation-buffer-name-function' |
| `project-vc-dir'                  | "*vc-dir*"               | Use a default buffer          | Through uniquify.el defcustom's            |
| `project-shell'                   | "*shell*"                | Use a project prefixed buffer | Not available                              |
| `project-eshell'                  | "*eshell*"               | Use a project prefixed buffer | Not available                              |

My suggestion is to improve the consistency of how project-related
buffers are created and named, providing sufficient customization
options for users.

Solutions:

1) Make all project-related buffers use by default
`project-prefixed-buffer-name'.  This is similar to how `project-shell'
and `project-eshell' behaves today.  The downsides are the lack of
customization options for users and the introduction of behavior changes
related to how some project-related buffers are currently named.

2) Create dedicated defcustom's for each project-related buffer.  This
is similar to how `project-compile' behaves today, by allowing users to
customize the option `project-compilation-buffer-name-function'.  The
downside is the excessive number of new defcustom's.

3) Create a single defcustom to compute the name of project-related
buffers.  This is similar to how `project-compile' behaves today, but
would be a more general-purpose customization option.  This is currently
my preferred solution (see the attached patch).  I tried to make it
simple, consistent and without introducing behavior changes related to
how project-related buffers are currently named, but I am not really
happy with the implementation.  An example of how users could customize
this option is presented below:

(setopt project-buffer-name-function
        (lambda (name)
            (format "*%s-%s*"
                    (project-name (project-current))
                    name)))


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=0001-Add-user-option-project-buffer-name-function.patch

From 1bd545fac60f955c1d8b6de2db3a0aca6b9d32c5 Mon Sep 17 00:00:00 2001
From: Gabriel do Nascimento Ribeiro <gabriel376@HIDDEN>
Date: Wed, 23 Nov 2022 01:50:21 -0300
Subject: [PATCH 1/1] Add user option `project-buffer-name-function'

* lisp/buff-menu.el (Buffer-menu-buffer-name): New constant to store
the default buffer name.
(list-buffers-noselect): Use the new constant.

* lisp/vc/vc-dir.el (vc-dir-buffer-name): New constant to store
the default buffer name.
(vc-dir): Use the new constant.

* lisp/progmodes/project.el (project-buffer-name-function): New user
option to allow customization of project-related buffer names.
(project-compilation-buffer-name-function): Make obsolete.
(project-buffer-name-default): New function to compute the name of
project-related buffers.
(project-find-regexp, project-or-external-find-regexp, project-vc-dir)
(project-shell, project-eshell, project-async-shell-command)
(project-shell-command, project-compile, project-list-buffers)
(project-kill-buffers): Use the new user option
`project-buffer-name-function' to compute the buffer name.

* etc/NEWS: Announce the changes.
---
 etc/NEWS                  |  8 +++++
 lisp/buff-menu.el         |  7 +++--
 lisp/progmodes/project.el | 65 ++++++++++++++++++++++++++++++---------
 lisp/vc/vc-dir.el         |  7 ++++-
 4 files changed, 69 insertions(+), 18 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 5a65896d69..b3e1b5e3c4 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2263,6 +2263,14 @@ matches.
 ---
 *** New function 'xref-show-xrefs'.
 
++++
+*** New user option 'project-buffer-name-function'.
+This control the name of project-related buffers.
+
+---
+*** 'project-compilation-buffer-name-function' is now obsolete.
+Use the new user option 'project-buffer-name-function' instead.
+
 ** File notifications
 
 +++
diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el
index aa5f70edf2..e6b91682dd 100644
--- a/lisp/buff-menu.el
+++ b/lisp/buff-menu.el
@@ -95,6 +95,9 @@ Buffer-menu-use-frame-buffer-list
   :group 'Buffer-menu
   :version "22.1")
 
+(defconst Buffer-menu-buffer-name "*Buffer List*"
+  "Name of the output buffer for `buffer-menu' and related commands.")
+
 (defvar-local Buffer-menu-files-only nil
   "Non-nil if the current Buffer Menu lists only file buffers.
 This is set by the prefix argument to `buffer-menu' and related
@@ -634,11 +637,11 @@ list-buffers-noselect
 that filters out buffers from the list of buffers.
 See more at `Buffer-menu-filter-predicate'."
   (let ((old-buffer (current-buffer))
-	(buffer (get-buffer-create "*Buffer List*")))
+        (buffer (get-buffer-create Buffer-menu-buffer-name)))
     (with-current-buffer buffer
       (Buffer-menu-mode)
       (setq Buffer-menu-files-only
-	    (and files-only (>= (prefix-numeric-value files-only) 0)))
+            (and files-only (>= (prefix-numeric-value files-only) 0)))
       (setq Buffer-menu-filter-predicate filter-predicate)
       (list-buffers--refresh buffer-list old-buffer)
       (tabulated-list-print))
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 751e240a56..d706bd128f 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -818,7 +818,8 @@ project-find-regexp
                                             caller-dir nil t)))
               (project--files-in-directory dir
                                            nil
-                                           (grep-read-files regexp))))))
+                                           (grep-read-files regexp)))))
+         (xref-buffer-name (funcall project-buffer-name-function "xref")))
     (xref-show-xrefs
      (apply-partially #'project--find-regexp-in-files regexp files)
      nil)))
@@ -846,7 +847,8 @@ project-or-external-find-regexp
          (files
           (project-files pr (cons
                              (project-root pr)
-                             (project-external-roots pr)))))
+                             (project-external-roots pr))))
+         (xref-buffer-name (funcall project-buffer-name-function "xref")))
     (xref-show-xrefs
      (apply-partially #'project--find-regexp-in-files regexp files)
      nil)))
@@ -1024,7 +1026,8 @@ project-dired
 (defun project-vc-dir ()
   "Run VC-Dir in the current project's root."
   (interactive)
-  (vc-dir (project-root (project-current t))))
+  (let ((vc-dir-buffer-name (funcall project-buffer-name-function "vc-dir")))
+    (vc-dir (project-root (project-current t)))))
 
 (declare-function comint-check-proc "comint")
 
@@ -1038,13 +1041,13 @@ project-shell
   (interactive)
   (require 'comint)
   (let* ((default-directory (project-root (project-current t)))
-         (default-project-shell-name (project-prefixed-buffer-name "shell"))
-         (shell-buffer (get-buffer default-project-shell-name)))
+         (buffer-name (funcall project-buffer-name-function "shell"))
+         (shell-buffer (get-buffer buffer-name)))
     (if (and shell-buffer (not current-prefix-arg))
         (if (comint-check-proc shell-buffer)
             (pop-to-buffer shell-buffer (bound-and-true-p display-comint-buffer-action))
           (shell shell-buffer))
-      (shell (generate-new-buffer-name default-project-shell-name)))))
+      (shell (generate-new-buffer-name buffer-name)))))
 
 ;;;###autoload
 (defun project-eshell ()
@@ -1056,7 +1059,7 @@ project-eshell
   (interactive)
   (defvar eshell-buffer-name)
   (let* ((default-directory (project-root (project-current t)))
-         (eshell-buffer-name (project-prefixed-buffer-name "eshell"))
+         (eshell-buffer-name (funcall project-buffer-name-function "eshell"))
          (eshell-buffer (get-buffer eshell-buffer-name)))
     (if (and eshell-buffer (not current-prefix-arg))
         (pop-to-buffer eshell-buffer (bound-and-true-p display-comint-buffer-action))
@@ -1067,7 +1070,9 @@ project-async-shell-command
   "Run `async-shell-command' in the current project's root directory."
   (declare (interactive-only async-shell-command))
   (interactive)
-  (let ((default-directory (project-root (project-current t))))
+  (let ((default-directory (project-root (project-current t)))
+        (shell-command-buffer-name-async (funcall project-buffer-name-function
+                                                  "Async Shell Command")))
     (call-interactively #'async-shell-command)))
 
 ;;;###autoload
@@ -1075,7 +1080,9 @@ project-shell-command
   "Run `shell-command' in the current project's root directory."
   (declare (interactive-only shell-command))
   (interactive)
-  (let ((default-directory (project-root (project-current t))))
+  (let ((default-directory (project-root (project-current t)))
+        (shell-command-buffer-name (funcall project-buffer-name-function
+                                            "Shell Command Output")))
     (call-interactively #'shell-command)))
 
 (declare-function fileloop-continue "fileloop" ())
@@ -1136,6 +1143,32 @@ project-compilation-buffer-name-function
                  (const :tag "Prefixed with root directory name"
                         project-prefixed-buffer-name)
                  (function :tag "Custom function")))
+(make-obsolete-variable 'project-compilation-buffer-name-function
+                        'project-buffer-name-function
+                        "29.1")
+
+(defcustom project-buffer-name-function 'project-buffer-name-default
+  "Function to compute the name of a project buffer.
+Function receives one argument, the base buffer name as string.
+It should return the buffer name as string."
+  :version "29.1"
+  :group 'project
+  :type 'function)
+
+(defun project-buffer-name-default (name)
+  "Function to compute buffer names for project commands."
+  (pcase name
+    ("compilation"          (compilation--default-buffer-name name))
+    ("shell"                (project-prefixed-buffer-name name))
+    ("eshell"               (project-prefixed-buffer-name name))
+    ("Shell Command Output" shell-command-buffer-name)
+    ("Async Shell Command"  shell-command-buffer-name-async)
+    ("Buffer List"          Buffer-menu-buffer-name)
+    ("xref"                 xref-buffer-name)
+    ("vc-dir"               vc-dir-buffer-name)
+    (t                      (format "*%s-%s*"
+                                    (project-name (project-current))
+                                    name))))
 
 ;;;###autoload
 (defun project-compile ()
@@ -1143,9 +1176,9 @@ project-compile
   (declare (interactive-only compile))
   (interactive)
   (let ((default-directory (project-root (project-current t)))
-        (compilation-buffer-name-function
-         (or project-compilation-buffer-name-function
-             compilation-buffer-name-function)))
+        (compilation-buffer-name-function (lambda (_)
+                                            (funcall project-buffer-name-function
+                                                     "compilation"))))
     (call-interactively #'compile)))
 
 (defcustom project-ignore-buffer-conditions nil
@@ -1231,13 +1264,13 @@ project-display-buffer-other-frame
 ;;;###autoload
 (defun project-list-buffers (&optional arg)
   "Display a list of project buffers.
-The list is displayed in a buffer named \"*Buffer List*\".
 
 By default, all project buffers are listed except those whose names
 start with a space (which are for internal use).  With prefix argument
 ARG, show only buffers that are visiting files."
   (interactive "P")
-  (let ((pr (project-current t)))
+  (let ((pr (project-current t))
+        (Buffer-menu-buffer-name (funcall project-buffer-name-function "Buffer List")))
     (display-buffer
      (if (version< emacs-version "29.0.50")
          (let ((buf (list-buffers-noselect arg (project-buffers pr))))
@@ -1365,6 +1398,8 @@ project-kill-buffers
   (interactive)
   (let* ((pr (project-current t))
          (bufs (project--buffers-to-kill pr))
+         (Buffer-menu-buffer-name (funcall project-buffer-name-function
+                                           "Buffer List"))
          (query-user (lambda ()
                        (yes-or-no-p
                         (format "Kill %d buffers in %s? "
@@ -1377,7 +1412,7 @@ project-kill-buffers
           (project-kill-buffers-display-buffer-list
            (when
                (with-current-buffer-window
-                   (get-buffer-create "*Buffer List*")
+                   (get-buffer-create Buffer-menu-buffer-name)
                    `(display-buffer--maybe-at-bottom
                      (dedicated . t)
                      (window-height . (fit-window-to-buffer))
diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index 037de415e6..ff7ac2e025 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -118,6 +118,10 @@ vc-dir-status-ignored
   ;; To distinguish files and directories.
   directory)
 
+;;;###autoload
+(defconst vc-dir-buffer-name "*vc-dir*"
+  "Name of the output buffer for `vc-dir' command.")
+
 (defvar vc-ewoc nil)
 
 (defvar vc-dir-process-buffer nil
@@ -1446,7 +1450,8 @@ vc-dir
   (unless backend
     (setq backend (vc-responsible-backend dir)))
   (let (pop-up-windows)		      ; based on cvs-examine; bug#6204
-    (pop-to-buffer (vc-dir-prepare-status-buffer "*vc-dir*" dir backend)))
+    (pop-to-buffer (vc-dir-prepare-status-buffer vc-dir-buffer-name
+                                                 dir backend)))
   (if (derived-mode-p 'vc-dir-mode)
       (vc-dir-refresh)
     ;; FIXME: find a better way to pass the backend to `vc-dir-mode'.
-- 
2.34.1


--=-=-=
Content-Type: text/plain


Please share your comments or suggestions.

---
Gabriel

--=-=-=--




Acknowledgement sent to Gabriel <gabriel376@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#59502; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 10 Dec 2022 18:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.