From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#62621: 29.0.60; uniquify can't make buffers unique based on things other than filename Date: Fri, 14 Jul 2023 15:29:02 +0300 Message-ID: <83edlafzht.fsf@gnu.org> References: <87bkgfjugn.fsf@catern.com> <83edlb3t0t.fsf@gnu.org> <878rbika0i.fsf@catern.com> <83h6q6g0qx.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40754"; mail-complaints-to="usenet@ciao.gmane.io" Cc: sbaugh@catern.com, 62621@debbugs.gnu.org To: Spencer Baugh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 14 14:29:42 2023 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 1qKHvZ-000AMu-P2 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 14 Jul 2023 14:29:41 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qKHuy-0006e8-Al; Fri, 14 Jul 2023 08:29:04 -0400 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 1qKHuw-0006dG-DU for bug-gnu-emacs@gnu.org; Fri, 14 Jul 2023 08:29:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qKHuw-0006RC-2G for bug-gnu-emacs@gnu.org; Fri, 14 Jul 2023 08:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qKHuv-0006or-Un for bug-gnu-emacs@gnu.org; Fri, 14 Jul 2023 08:29:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 Jul 2023 12:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62621 X-GNU-PR-Package: emacs Original-Received: via spool by 62621-submit@debbugs.gnu.org id=B62621.168933773226180 (code B ref 62621); Fri, 14 Jul 2023 12:29:01 +0000 Original-Received: (at 62621) by debbugs.gnu.org; 14 Jul 2023 12:28:52 +0000 Original-Received: from localhost ([127.0.0.1]:41640 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKHum-0006oB-4d for submit@debbugs.gnu.org; Fri, 14 Jul 2023 08:28:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37220) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKHuj-0006nu-J9 for 62621@debbugs.gnu.org; Fri, 14 Jul 2023 08:28:50 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qKHud-0006P0-M9; Fri, 14 Jul 2023 08:28:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=mNGyzjGbtwW2arPQpm30RipHjc4HmwG9xmPFNCXaGDU=; b=XvnZTsTpU9U5 +NF1jO/N4e2M5MIAaMOPbhKNafhcYyulPgmdmXlvH0S9fK/pQJE+EujI3agjZzmf8JcfdurHHgC25 phyq9JhsABcxhklfsofShnMC4UTNZt128bI8V4y/AI143KcMurxifQJRLT95uOzAA7y4lElcosToi SsElDT8Zh67pZOYNxzUG+unfe5hHRRxQ8vxEeWB485Ygk2EF/R6dItlj2GNyaTMwiMnBluQbGz633 EjBtXr8Od5zfqF2k++7CAvd6S4WijxpiHp1wwVDsFpZDIUK3GiFYHOpXWGaMS+QCqpLNdoDaWLVq1 VQre8qsN6wEpX5MWHTHmbA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qKHud-0007D1-2d; Fri, 14 Jul 2023 08:28:43 -0400 In-Reply-To: (message from Spencer Baugh on Fri, 14 Jul 2023 08:20:02 -0400) 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:265088 Archived-At: > From: Spencer Baugh > Cc: sbaugh@catern.com, 62621@debbugs.gnu.org > Date: Fri, 14 Jul 2023 08:20:02 -0400 > > Eli Zaretskii writes: > > >> I agree, and I'm happy to change it to use a simple symbolic value > >> 'project instead for the transform I wrote, but I'm not sure how best to > >> handle the dependencies: uniquify.el is in loadup.el, is it OK for it to > >> rely on project-uniquify-dirname-transform being autoloaded? > > > > I don't understand the difficulty. If the function value could be > > defined in uniquify.el, why cannot a symbolic value be defined there? > > I don't understand your question :) > > Here's concretely the diff I would apply. This makes uniquify.el mention a > function from project.el. Is that OK? No. > > If the symbolic values are specific to project, simply let-bind > > uniquify-dirname-transform to the value of the appropriate project.el > > defcustom when project.el calls uniquify. > > These customizations are in effect all the time, not just when the user > is calling a project.el command. e.g. rename-buffer triggers uniquify. Then you can set the buffer-local value of uniquify-dirname-transform in the project.el buffers. Would that solve the problem? > >> Unfortunately, this isn't quite right. uniquify never uses > >> default-directory, counterintuitively - by default, it uses the > >> directory of buffer-file-name, which can differ from default-directory. > > > > That's a minor issue, just use "buffer's directory" instead. > > > > But I wonder why uniquify does something counterintuitive like that. > > I assume it's something like "default-directory changes (such as by M-x > cd) shouldn't change the buffer name too". default-directory of a file-visiting buffer doesn't change. > The fact that uniquify doesn't use default-directory also means it's > unable to uniquify buffers which aren't visiting files Exactly.