From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matthias Meulien Newsgroups: gmane.emacs.devel Subject: Re: Name of buffers created by project-shell Date: Sun, 14 Mar 2021 14:46:38 +0100 Message-ID: <87zgz526gx.fsf@gmail.com> References: <87czwh9rv9.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1840"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Mar 14 14:48:18 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lLR6P-0000OY-R6 for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Mar 2021 14:48:17 +0100 Original-Received: from localhost ([::1]:40984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lLR6O-0000jI-U8 for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Mar 2021 09:48:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42596) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lLR4u-00007Q-8G for emacs-devel@gnu.org; Sun, 14 Mar 2021 09:46:44 -0400 Original-Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:36847) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lLR4s-0004yY-EY for emacs-devel@gnu.org; Sun, 14 Mar 2021 09:46:43 -0400 Original-Received: by mail-wm1-x334.google.com with SMTP id r15-20020a05600c35cfb029010e639ca09eso18675214wmq.1 for ; Sun, 14 Mar 2021 06:46:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=qdi7vE/YNGkSV1Aqlhqwl1wSKFUYDuu1i/52S+USH1k=; b=Atlnwu2nF7o59oaoRb0dOFcygdEsbqExz9o14X0LSgupPaHgGdN7aq+COkuFKSyGre xBNyNDemdBgATB/fZ7+5T8BItIFpWbmAQZ+TOQ0nLFH3904fxvLmN8M+EE/tOzJkg5sL xX+U9PODOQsy6jNTBjlugBoUKeCLjok/fYaPvl/6D7W3rvYDIk9mkFFzXq99f1R1e361 pK39O2gDF3MA2ww1WVjJ7aOSXsg+DCVE0E9JdXwbEl0hnOHOns6O+U4jSo72ncGg0b/1 WYtgQzdbsI6OqeTETIfuztLyA2rj7epLliMXli6jIhVXlY1kI4YtvZ87bpPNE1zGL/Jb gTFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=qdi7vE/YNGkSV1Aqlhqwl1wSKFUYDuu1i/52S+USH1k=; b=UP+WgUsvR7HF0nBTVw+165l/UB4vwCLXB/IbdYF4IlBWCXtCKsn00VyYdIPCE3qLWh NGlHLlZ+3Y5+oNonNHRVLNrK3jGQPihpfBfMrlEEX/jOvWrvXNZ+5gsDukL8C7TPTJre 5f6TCdDcrCZPl27ikxaJC03uBiaGr4a2U7sVR0PMZBlE8bYs1vVTfAkMKiq8dpwZj0XQ qScGanwohjgryRVWQIjSeX3WwwFNHkvEw5veckUGqwsttbHlEPIjMsfOf4b+VgNZviEu weLAANYTW7ysWkzHDj3n1ERiLP3+urmUUqLHDAJalQOMTHHSkCB1zGyBb4C38ayhewf0 Pb7Q== X-Gm-Message-State: AOAM531+aGTndkJtaK1ZEo91NQM0HJ/qYdhp9bfvJUcbCf8gOJ8hmsgA F/c5/79fiRLYmv0xFhriMLJ98w3xMIc= X-Google-Smtp-Source: ABdhPJxqV91NWG9MEqHOsqJB/cGgx3k1sYTFxsg9CRmrXHSjdw63UKH2DRECGp82IcyRBrQdZwrv4A== X-Received: by 2002:a7b:cb90:: with SMTP id m16mr21768520wmi.162.1615729599954; Sun, 14 Mar 2021 06:46:39 -0700 (PDT) Original-Received: from carbon.localdomain ([2a01:e0a:245:c850:98f5:429a:aa8e:95bb]) by smtp.gmail.com with ESMTPSA id o2sm9670213wme.16.2021.03.14.06.46.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Mar 2021 06:46:39 -0700 (PDT) In-Reply-To: (Dmitry Gutov's message of "Thu, 4 Mar 2021 05:21:59 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=orontee@gmail.com; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:266452 Archived-At: > What you're asking for makes sense, but there is a snag because of how > these commands are implemented. > > vc-dir doesn't choose the buffer name format itself. It ultimately > calls create-file-buffer (which has an advice made by uniquify) which > renames the buffer based on uniquify-buffer-name-style (if uniquify is > loaded in the current session), of course. The problem with that > function is that it always creates a new buffer. So, before calling > it, vc-dir-prepare-status-buffer does a search for existing buffer and > can find existing one if it matches by major mode and default > directory. Thanks Dmitry, I had forgotten that users have different settings for uniquify-buffer-name-style variable... > Both shell and eshell buffers can change their default-directory, but > we can track which project they belong to with a new variable. See the > attached patch. Thanks! I am testing it. I am not an eshell user but I guess the patch should use the variable `eshell-buffer-name' defined in eshell.el in place of the hardcoded "*eshell*" string. > There's one problem, though: when called with C-u, the piece of > behavior which reads as "create a new inferior shell buffer even if > one already exists" now creates buffers uniquely named according to > uniquify's rules, which seems to mean > > *shell* > emacs-master/*shell* > vc/emacs-master/*shell* > > instead of what one might expect, like > > emacs-master/*shell* > emacs-master/*shell*<2> > emacs-master/*shell*<3> > I think there's a problem even without using C-u: `project-shell' from a buffer whose associated project root path is /src/project1 creates a buffer named *shell*. Then `project-shell' from a buffer whose associated project root path is /src/project2 creates a buffer named *shell* (I am using the default `post-forward-angle-brackets' for `uniquify-buffer-name-style'). But the uniquify rationalize mecanism doesn't rename the first buffer to *shell* which happens to be the case for buffers visiting files... -- Matthias