From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#59502: 29.0.50; [PATCH] Dedicated buffers per project Date: Mon, 5 Dec 2022 04:35:21 +0200 Message-ID: <93661c9e-c754-0fcf-1eb9-7a5479aedbd5@yandex.ru> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27511"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 To: Gabriel , 59502@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 05 03:36:13 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p21L2-00071Z-Og for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 05 Dec 2022 03:36:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p21Ku-0007oc-KW; Sun, 04 Dec 2022 21:36:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p21Kt-0007oT-4a for bug-gnu-emacs@gnu.org; Sun, 04 Dec 2022 21:36:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p21Ks-0000xf-QY for bug-gnu-emacs@gnu.org; Sun, 04 Dec 2022 21:36:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p21Ks-0006Eq-EY for bug-gnu-emacs@gnu.org; Sun, 04 Dec 2022 21:36:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 05 Dec 2022 02:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59502 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 59502-submit@debbugs.gnu.org id=B59502.167020773223973 (code B ref 59502); Mon, 05 Dec 2022 02:36:02 +0000 Original-Received: (at 59502) by debbugs.gnu.org; 5 Dec 2022 02:35:32 +0000 Original-Received: from localhost ([127.0.0.1]:32972 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p21KO-0006Eb-7t for submit@debbugs.gnu.org; Sun, 04 Dec 2022 21:35:32 -0500 Original-Received: from mail-wr1-f52.google.com ([209.85.221.52]:43000) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p21KM-0006EV-7G for 59502@debbugs.gnu.org; Sun, 04 Dec 2022 21:35:31 -0500 Original-Received: by mail-wr1-f52.google.com with SMTP id w15so16599452wrl.9 for <59502@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) Original-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) Content-Language: en-US In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:249985 Archived-At: 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.