GNU bug report logs - #62621
29.0.60; uniquify can't make buffers unique based on things other than filename

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; Reported by: Spencer Baugh <sbaugh@HIDDEN>; dated Sun, 2 Apr 2023 17:38:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

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


Received: (at 62621) by debbugs.gnu.org; 14 Apr 2023 16:08:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 14 12:08:44 2023
Received: from localhost ([127.0.0.1]:47400 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pnLye-0008OK-1e
	for submit <at> debbugs.gnu.org; Fri, 14 Apr 2023 12:08:44 -0400
Received: from mxout5.mail.janestreet.com ([64.215.233.18]:39787)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sbaugh@HIDDEN>) id 1pnLyc-0008O1-M3
 for 62621 <at> debbugs.gnu.org; Fri, 14 Apr 2023 12:08:43 -0400
From: Spencer Baugh <sbaugh@HIDDEN>
To: 62621 <at> debbugs.gnu.org
Subject: Re: bug#62621: 29.0.60; uniquify can't make buffers unique based on
 things other than filename
In-Reply-To: <ierfs9i2nj3.fsf@HIDDEN> (Spencer Baugh's message of
 "Sun, 02 Apr 2023 13:37:36 -0400")
References: <ierfs9i2nj3.fsf@HIDDEN>
Date: Fri, 14 Apr 2023 12:08:37 -0400
Message-ID: <ierttxicupm.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 62621
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 (-)


FWIW, here is the (unpolished) patch I'm currently using.

This is correct but it's not what I think the final form of this should
look like.

For better or for worse, I have now Deeply Understood uniquify, and I
have various ideas for things to do to fix bugs in it and simplify it
and add new features... see bug#62732 for my first step.  (Which adds
tests, even!)

After some of those, then I can do this bug.

One sneak peak of a feature which I think I can manage to add with some
improvements to uniquify.el: a user customization which causes a new
behavior in read-buffer, so that when it's running on a subset of
buffers (by passing PREDICATE), it reads buffer names which are only
uniquified among that subset.  (So the buffer names will be shorter when
that doesn't cause ambiguity).  This would be really cool for
project-switch-to-buffer, so that if you have two projects working on
the same source repo with the same files open, you don't have to see the
extra uniquify cruft at the start of the buffer name when you just want
to look at buffers in a single project.

diff --git a/lisp/uniquify.el b/lisp/uniquify.el
index dee9ecba2ea..53b39920820 100644
--- a/lisp/uniquify.el
+++ b/lisp/uniquify.el
@@ -210,8 +210,8 @@ uniquify-rationalize-file-buffer-names
   (with-current-buffer newbuf (setq uniquify-managed nil))
   (when dirname
     (setq dirname (expand-file-name (directory-file-name dirname)))
-    (let ((fix-list (list (uniquify-make-item base dirname newbuf
-                                              nil dirname)))
+    (let ((fix-list (list (let ((dirname (uniquify-buffer-file-name newbuf dirname)))
+                            (uniquify-make-item base dirname newbuf nil dirname))))
 	  items)
       (dolist (buffer (buffer-list))
 	(when (and (not (and uniquify-ignore-buffers-re
@@ -258,20 +258,26 @@ uniquify-rationalize-file-buffer-names
       (uniquify-rationalize fix-list))))
 
 ;; uniquify's version of buffer-file-name; result never contains trailing slash
-(defun uniquify-buffer-file-name (buffer)
+(require 'project)
+(defun uniquify-buffer-file-name (buffer &optional dirname)
   "Return name of directory, file BUFFER is visiting, or nil if none.
 Works on ordinary file-visiting buffers and buffers whose mode is mentioned
 in `uniquify-list-buffers-directory-modes', otherwise returns nil."
   (with-current-buffer buffer
-    (let ((filename
-	   (or buffer-file-name
-	       (if (memq major-mode uniquify-list-buffers-directory-modes)
-		   list-buffers-directory))))
-      (when filename
-	(directory-file-name
-	 (file-name-directory
-	  (expand-file-name
-	   (directory-file-name filename))))))))
+    (let* ((filename
+	    (or buffer-file-name
+	        (if (memq major-mode uniquify-list-buffers-directory-modes)
+		    list-buffers-directory)))
+           (dir (or dirname
+                    (directory-file-name
+	             (file-name-directory
+	              (expand-file-name
+	               (directory-file-name filename)))))))
+      (if-let (pr (project-current nil dir))
+          (let* ((pr-dir (project-root pr))
+                 (pr-rel (file-relative-name dir pr-dir)))
+            (file-name-concat pr-dir (project-name pr) pr-rel))
+        dir))))
 
 (defun uniquify-rerationalize-w/o-cb (fix-list)
   "Re-rationalize the buffers in FIX-LIST, but ignoring `current-buffer'."




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

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


Received: (at 62621) by debbugs.gnu.org; 2 Apr 2023 22:00:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 02 18:00:01 2023
Received: from localhost ([127.0.0.1]:42891 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pj5k1-0004JG-4p
	for submit <at> debbugs.gnu.org; Sun, 02 Apr 2023 18:00:01 -0400
Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:52866)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1pj5jy-0004J7-Lr
 for 62621 <at> debbugs.gnu.org; Sun, 02 Apr 2023 17:59:59 -0400
Received: from pps.filterd (m0246630.ppops.net [127.0.0.1])
 by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 332LvsHQ014721; Sun, 2 Apr 2023 21:59:57 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com;
 h=from : to : cc :
 subject : date : message-id : references : in-reply-to : content-type :
 content-transfer-encoding : mime-version; s=corp-2022-7-12;
 bh=iEufQneYdUexB5zhQnT92trRko8boRaSJXE2jmbecUE=;
 b=YK4lbAxthcJtq8dCWDS0UpEqxl3F3f/pGx/zFzparpl5rC92AAtZvziGWuBCNLzz/P2F
 yqeEVIiy+AyahRBTAnYKsUUR0bHxjexXcbH/baermsHBB0IgdgyraPPM8STPPIphrfRg
 aGjRAY7JcRg1OD2IAix2Ymc4YgxMyIZm02cXfVkj7GDa/Sd/b3gYQX3TCnsWy5GUXwjF
 lYp9gEFw4JY9HWtOUXFIAJ6z4eFXEv/e5yeBt7QU2H4KYhoUEYdT02Mkiq30KJmxbefR
 nJQkorxs5WhyHhLMrZBHWHFxzLRPeoeXUjAovwwREMUfHbLJw8nrbpBb0uWiIPdfCG7B 6A== 
Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com
 (iadpaimrmta03.appoci.oracle.com [130.35.103.27])
 by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ppb1dhuc7-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Sun, 02 Apr 2023 21:59:57 +0000
Received: from pps.filterd
 (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1])
 by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19)
 with ESMTP id 332GfLSq027857; Sun, 2 Apr 2023 21:59:56 GMT
Received: from nam10-mw2-obe.outbound.protection.outlook.com
 (mail-mw2nam10lp2103.outbound.protection.outlook.com [104.47.55.103])
 by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id
 3pptum666t-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Sun, 02 Apr 2023 21:59:56 +0000
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=lZXhz+N11tr7kVhxMa0oOIBiDR/ats6A7nRLC/tdsDtczB7rtyY5Q6cIYcYWEUxC5K+jApyissxUsCdjUSDrHdEyDxwpgePLtFjYjjXU0bsN6yW+9U4QAkpptyajmi8BdlOxWIlxyj9N7GRGcXthWl5XfOa4+cmqfeNdL0NF+uc909pvZbNdr5P2icLx4WRCuQXgWDich9iY+KyiztQs4+oVNvjQZB5TkMcvtvsjVE24VVbza5zuaI1mUfu/v7Dpo3K/o7NQcjuRRHu+VjmpuKHNo3ck8RFtfU/nHgMBMgRwyaUpsU+IzT2BEgPNQm+WaWRY1RzdH1/jD7x7sxmvzg==
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=iEufQneYdUexB5zhQnT92trRko8boRaSJXE2jmbecUE=;
 b=MKhpRBXcDuhP7t8koSLNgwMgkbDIXAAI6OLOxsj4xbL/3oxBpOV6qqa6NxYu3PzVIbry4nJsnUwEPfeE87e/PlG+3a6s7dNBbZYM1ib9ztkiE8veSJuAey4+Anvo6gmlwntPOhV9LoAUvHLQeh5q9xeQfCql7w9qkS+6aHoaTCMynfK10vaA/Wuzp5S28j/eOKA9Xa92AhquHlG92GNAn2VU22tY1NA/zJ0eVsPFnoWaYWb9WbNmlxNVo7I8Eugpr067Y+LJNIzIKGhVb523x5IVS9sYpSEmg5Sb2dsAUHeTt2fTEp+d1dhjlZi9xtT94aqy6TGHgv6duE+eEXfpEg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com;
 dkim=pass header.d=oracle.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=iEufQneYdUexB5zhQnT92trRko8boRaSJXE2jmbecUE=;
 b=g+SAqcbF6ug1xKMo689NXC/IWaU/8VAuL7htff0klTPK9ulbZsbRoHflWYlClrPrNEbFDDnAyBvOyabT5u1K0Dwqsk7EoP5q4TyPH0PbSOncnQr4DgW4B8WouQbe/ADtUsTLJMKUcFBVXIeQORhUCvMjTIrKrUGSzmgioyrTir4=
Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19)
 by PH7PR10MB7696.namprd10.prod.outlook.com (2603:10b6:510:2e5::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.30; Sun, 2 Apr
 2023 21:59:54 +0000
Received: from SJ0PR10MB5488.namprd10.prod.outlook.com
 ([fe80::a995:2ae5:2745:24ff]) by SJ0PR10MB5488.namprd10.prod.outlook.com
 ([fe80::a995:2ae5:2745:24ff%5]) with mapi id 15.20.6254.028; Sun, 2 Apr 2023
 21:59:53 +0000
From: Drew Adams <drew.adams@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>, Spencer Baugh <sbaugh@HIDDEN>
Subject: RE: [External] : bug#62621: 29.0.60; uniquify can't make buffers
 unique based on things other than filename
Thread-Topic: [External] : bug#62621: 29.0.60; uniquify can't make buffers
 unique based on things other than filename
Thread-Index: AQHZZY0JBd1kKJa9506ASK5mQc/5NK8YihJQ
Date: Sun, 2 Apr 2023 21:59:52 +0000
Message-ID: <SJ0PR10MB5488FCAE69E055AE91FF370CF38D9@HIDDEN>
References: <ierfs9i2nj3.fsf@HIDDEN> <83fs9iw4jv.fsf@HIDDEN>
In-Reply-To: <83fs9iw4jv.fsf@HIDDEN>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|PH7PR10MB7696:EE_
x-ms-office365-filtering-correlation-id: 1b7bcfdc-632d-4905-27a8-08db33c59680
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: lTryuRbqIX9EMgHrPhA8N0fgbGxX0F9obhgdkq2Hfpp8PWGwwmeMBzuMsTLvfuzsmGb8ZA6h0XWbpaGwgwhA56mkqesYaHp04yCn7wT2vy2YtN7SxMo5P4P2/x/tAMbfVThohqp2eK+pLINlB4/qDRlzhIjJ2iaWCweMLbXBu9YmoNqsaVmaoDpgrYZeJgSf/iEIOWPrtR1xrbzsmCrqBeTZeITXFnaDtj50YZrCWQyKmFWNQkPJifHANO81Tls4SwVqNvLWFa01ZsyTdl4KonfGaPo05It6QbjhMuVnMjHI5gxFCunvU8tpdMTrUVTbET/1nfBBQWJknh75Tn3zzvbq+2kobVqBBtRO7TfLXTvWKvasXvLTY89JHiC5CwQz3JZh4qKlmhAopTXGwtvcwSaIo4iXgJeuzsgNrYeOnWGNtgWBYcMWXZ0G2WLSsFJiOAWYwCkqsIB0Pq9Z3AvZ59p1d7rFzmr/bneXqiSvCEsPFWejYmo9DoMugRLVK7W3052/HBL3sNT2fFL0DPMu182ADRDO2p+ckK9uaKScfS/NHGGnbF2QhMN+rQryo9wQEGyEX6tVlQxlmglQ5eAZ8oIGP+HzPCjljSLBrSuzBWdMxWoQAc1ov6IICkX9WR30
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
 IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE;
 SFS:(13230028)(366004)(346002)(396003)(39860400002)(376002)(136003)(451199021)(55016003)(4326008)(8676002)(66556008)(66476007)(76116006)(66446008)(64756008)(66946007)(478600001)(110136005)(316002)(52536014)(8936002)(44832011)(5660300002)(122000001)(41300700001)(38100700002)(186003)(7696005)(71200400001)(9686003)(6506007)(26005)(86362001)(33656002)(2906002)(38070700005)(66899021);
 DIR:OUT; SFP:1101; 
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?t29KLxoLvDZZ8u31A42imfXtlvhVf+94LgnuQwT3WPK7CwKsDHCaOEkGgKQu?=
 =?us-ascii?Q?c1OGOhEP2Fl75N3wiuPcW/nP5kNvCcIsShYxKWmEqbFmiHVZfZ9ogNCffclN?=
 =?us-ascii?Q?oIZ88rAnzv552icHrQD9byfPgeAZKmGRFjnYu2wOjxSoSyyYfi61uCTgQyXf?=
 =?us-ascii?Q?KD+oa17jPuqFA/JDMIoQNouiZ+AyGWWI4X/gGofs2Hv9Ciw4KConKJ2CgCAK?=
 =?us-ascii?Q?eLzXr1kxxtrfqisIGacL+vamqMoCO5fIb+BMJwcYbBBUrd2FwPSTJQOnGLRi?=
 =?us-ascii?Q?lTjMUXAnFNDndJ457LE3Slq3CJ02cNo7CJowINSPhzmvZ6M9J5gSvAYgseeq?=
 =?us-ascii?Q?KtP2UKsd2h44DKNsaJwUCgg/Ltf6/LyBv+Y9tTYgzIrwEF0e+z0Pe4dtVYco?=
 =?us-ascii?Q?OWzLpUbVrkFcLO9dlIDyIv+yANxpRj3KZ0HIeRC3PfLK3gudbAIUaveRvsXJ?=
 =?us-ascii?Q?vpOTgdj4a7de/dcYJ5nMF0QULbw7ntUanC4HXIPi/oIYS/c/aegi2TyQsvg9?=
 =?us-ascii?Q?j2fZHRJE1C2xU0P2D6XeUra6ZdikeiUSVga3fMv5A3NR7RYIWHjOTTGxRaq9?=
 =?us-ascii?Q?ZsWdl2CcdxZb49z04JE9B2t3zSUQ3hRpfOaFYILZqkNCjhYGl+myeRAtLwXP?=
 =?us-ascii?Q?xciYI3Fd2NmEngLQzDXfx6R/vUGxQgWN9DVYRxHgssS4W/7QaFxvO26yLiLt?=
 =?us-ascii?Q?Sxy1FfKQTe290+U6PmIy4eqSfUS+LZUO0EYK2AW8anduW7kuN9Y0ouj56N3C?=
 =?us-ascii?Q?USXF6u71zw6xyohhMuxmaYaZT49kENT/Qi+gzM04SuHM+O5DXIzrylC5+Sr3?=
 =?us-ascii?Q?H26NotBoGLfbzzP0U9/aMnYGQPJLPNxfUsyR9ejEF9iiKwnfxMjMYajWqqmC?=
 =?us-ascii?Q?DxNFz/3b6VWCaCd269DdwrXiLbrHSXOxnLxt1o1wXMkl+sqvRPQAVelzCGaK?=
 =?us-ascii?Q?d2JUueoFHJZwEXcJxIVfSqB7gAxiXTCVsvf9+hYAZRop9BsxddXOfvJVIpwC?=
 =?us-ascii?Q?XentDC7LmUfivyHjtFmeCyn/jmNQuOXby2lTkdX1GI5bPb4QD+yH6pYRPjD9?=
 =?us-ascii?Q?bVZRbLwAonH2gfvAlMSDhALEBVsVc31UzR8hAl4nILwz+I/Mm1hl4cw8py2L?=
 =?us-ascii?Q?pdDcCvM8dPzLvyVD2aznpHJDW0EUZWJ7Lmw722eTl78h4aZFlTjEYGbsM6yM?=
 =?us-ascii?Q?XdNn0AVVyBCQI8L6WCi1w6Umn82aWJ7+aT9aDb6uJMDJ1VHnylw8EflPGA1F?=
 =?us-ascii?Q?bgxEvMmDA+vJS8LY9vl+RCMNd6nQH9GVlc/f7nVPgx7Le6HYz60b8eeLAix7?=
 =?us-ascii?Q?ivx0HVa7QZFGFmIjmUA056h8YcsmxoPKDsK+mXxAKO9ocHBtEpPg9B7rcUs4?=
 =?us-ascii?Q?gvvissa7/YozdJC2mrcCgwc3epsE79K7+Okry7KVAnWM1dnZYnLOxEhb5jQ1?=
 =?us-ascii?Q?UzsVWfcBeWD4Aaui4wmGWXgfEWosLU8ptuwdWZOMdMbOgMRVCe5BGBcwgKHK?=
 =?us-ascii?Q?JUqRb4qmW1m15lVYAjeH8+f/DL03Nf86AzbjFfjSI+nxcLr2w9W+QLSNlAos?=
 =?us-ascii?Q?1kqQ9+LOjDC9VRJEUX6Qk7UuG+/T6tQhemYrelH8?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: Q0lnxuCFvCEjBtO6cWg0k4bLzGWufmO6iaYZF0TupEFaG9EO3u6sqHt28ipJsmnfrPKkhooJ+J07hfrj1K8w0s3/vMl360BM6YahTEizUH+C1wIgH297aTsJ5IL/CrJipQ8WKUhfsJhMX/u4joJE8E+gWcHVjCRN7jRJ280l3W+YeTxCVj7XOBNxXy4NkSwamOTJSg2AWROOFr0Tx0aecRNvewPuJK9GMyoNvERXcglC3rM+V72Aa4oSzWul3tzJNR5butjDLH6WhPMVvkvReA3UA4Nte92aO9oLgmYtDQouh0Sy3MK9TsLYzcNBYqePfU3mpNJButXApxs7G8OMKs5HFO/tRR5tAT1k3Udn0siMAZhT9S3Z63G1ilZUoW+p/Y6TuNA+srCK7WuQ1x3UweRyS21j6af3RoispLyMEGa4B+apBJ9Q/jTMioB8bbJpk+60VD1/Ge5h5ueOvkyRSn+3IRhrUGcINaXvHzBXy+Vk4Aw71PqZXhlOodYbUev1ymB4B7CCllfuYNNVq/+jkBsD+vpzHdGLzKA3XkSn/3bwN11QmZU57jiyfqQK1pjWRxuPFIBK/IUaGDgsNngPBYVKYYo9Hkhg1E1JV+akz9vD9mRGSBBo+/25/2WmCau0YjHY+3LJtY2bW1e57f9oiap1D5JZbq4+PAuoiv09p+QJ7jH5lmpHSJoYscahbod60+3DEoAxW1KKMbMWMvk2eRKCwtXKJYKR06Rh71FmD3sp2kBzOi86mf75G+rJnsacycQRYgHd8tswpR2mHd9xYgedQwWfrYjlHchSAFOsDfdJ6XaMogcoOEIi1Y6SQZQ2
X-OriginatorOrg: oracle.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 1b7bcfdc-632d-4905-27a8-08db33c59680
X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Apr 2023 21:59:52.9509 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: iyv/M9Sz7yzQ3lbOP0LhqC8FZo5Fdjh88tCQKHLOqK/4/nuWRnK97hnx96xOW4sUpR6NcGs/GahhcaVoNeaDMg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB7696
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22
 definitions=2023-03-31_07,2023-03-31_01,2023-02-09_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0
 mlxscore=0 malwarescore=0
 mlxlogscore=999 adultscore=0 phishscore=0 suspectscore=0 bulkscore=0
 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000
 definitions=main-2304020185
X-Proofpoint-GUID: nY583QalvD92WTu08GeM6BNa3diAJIGS
X-Proofpoint-ORIG-GUID: nY583QalvD92WTu08GeM6BNa3diAJIGS
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 62621
Cc: "62621 <at> debbugs.gnu.org" <62621 <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 (-)

> > However, uniquify is currently not customizable in this way.  Could we
> > add support for including additional attributes into the things which
> > uniquify will use?  Then I could add project-name as one of those
> > attributes in my configuration, and I'd be happy.
> >
> > I would be happy to implement this feature in uniquify myself, if this
> > is an interesting feature for upstream.
>=20
> Sounds like a useful feature indeed, provided that the customization
> will allow more or less arbitrary uniquification, not just by project
> names.  Also, please keep in mind that a single project could have
> files named the same in different directories.

+1.
_____

Off the top of my head (not thought through)...

User-definable, e.g., based on some defcustom
choice combinations; i.e., different name pieces
that can contribute to the overall name.

The current behavior of using the dir-name pieces
could be one such choice, which could then be
combined with other choices.
=20
`file-attributes' values (at least some of them)
could also be candidates for such combinations.

Or useful abbreviations of file-attribute values;
e.g., use a relative last-<whatever> number
instead of a full last-<whatver> value, to reflect
just recency, not bothering about what the absolute
values are.

Ability to assign arbitrary labels (one or more
"tags") to a given buffer would be good as another
combining choice.

In addition, as an alternative maybe a user-defined
function value to compute the overall name.
____

Anyway, any enhancement at all that might be made
wrt the naming would be welcome.





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

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


Received: (at 62621) by debbugs.gnu.org; 2 Apr 2023 18:25:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 02 14:25:53 2023
Received: from localhost ([127.0.0.1]:42634 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pj2On-0004IG-Lm
	for submit <at> debbugs.gnu.org; Sun, 02 Apr 2023 14:25:53 -0400
Received: from relay4-d.mail.gandi.net ([217.70.183.196]:34695)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1pj2Oj-0004Hw-RB
 for 62621 <at> debbugs.gnu.org; Sun, 02 Apr 2023 14:25:52 -0400
Received: (Authenticated sender: juri@HIDDEN)
 by mail.gandi.net (Postfix) with ESMTPSA id CABD7E0004;
 Sun,  2 Apr 2023 18:25:42 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Spencer Baugh <sbaugh@HIDDEN>
Subject: Re: bug#62621: 29.0.60; uniquify can't make buffers unique based on
 things other than filename
In-Reply-To: <ierfs9i2nj3.fsf@HIDDEN> (Spencer Baugh's message of
 "Sun, 02 Apr 2023 13:37:36 -0400")
Organization: LINKOV.NET
References: <ierfs9i2nj3.fsf@HIDDEN>
Date: Sun, 02 Apr 2023 21:25:08 +0300
Message-ID: <86y1najg57.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: 62621
Cc: 62621 <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 (-)

> However, uniquify is currently not customizable in this way.  Could we
> add support for including additional attributes into the things which
> uniquify will use?  Then I could add project-name as one of those
> attributes in my configuration, and I'd be happy.

This was discussed recently in bug#59502, but I don't remember
why the patch was never applied.




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

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


Received: (at 62621) by debbugs.gnu.org; 2 Apr 2023 17:56:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 02 13:56:59 2023
Received: from localhost ([127.0.0.1]:42609 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pj1wp-0003UH-FJ
	for submit <at> debbugs.gnu.org; Sun, 02 Apr 2023 13:56:59 -0400
Received: from eggs.gnu.org ([209.51.188.92]:33438)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pj1wl-0003Tx-Qq
 for 62621 <at> debbugs.gnu.org; Sun, 02 Apr 2023 13:56:57 -0400
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 <eliz@HIDDEN>)
 id 1pj1wf-0004CQ-O5; Sun, 02 Apr 2023 13:56:49 -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=HME1xggYo2VzEnIhPPEzWIYWOx43Af+hYzFgh3mf3rI=; b=K9hVxGRPZ1tG
 MFNTDU7TQ5FFUAW93MdAVIhYrz8XGLx+tsGvzGE4bQi5kgulVi/DHAcJihQ/SBjCPt+w0LYk8cs2S
 JAvhqpKJTZHtlaB9Nh3ywAI6scYKosnXZ/Jbz1kEv8L5j9B4qNnXtugXzzNwYHntNQ9YcBJVR5pFH
 dd8Zctrqv6KWlOxwgy3Ko2aSwN09lxqg+LDV8XBmmpC/UGoktHVy1STskVQLbfrdYD2Chr0G+noiP
 ZnBRQMlmcmRXtmVuJK41zz0z4ghNjxUm+sSJH5dUrgOcaZDdq3U+oa3iDVsorIrH44oA+oOGWVnRg
 9p0iZD9emVCPvjupN6iXIw==;
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 <eliz@HIDDEN>)
 id 1pj1wf-0004PN-BN; Sun, 02 Apr 2023 13:56:49 -0400
Date: Sun, 02 Apr 2023 20:57:08 +0300
Message-Id: <83fs9iw4jv.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Spencer Baugh <sbaugh@HIDDEN>
In-Reply-To: <ierfs9i2nj3.fsf@HIDDEN> (message from Spencer Baugh on
 Sun, 02 Apr 2023 13:37:36 -0400)
Subject: Re: bug#62621: 29.0.60;
 uniquify can't make buffers unique based on things other than filename
References: <ierfs9i2nj3.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 62621
Cc: 62621 <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: -3.3 (---)

> From: Spencer Baugh <sbaugh@HIDDEN>
> Date: Sun, 02 Apr 2023 13:37:36 -0400
> 
> 
> I have a lot of buffers visiting files with the same basename, in
> directory paths which have long meaningless numeric identifiers.  This
> means that with uniquify, I get buffers named things like:
> 
> foo<ahlai5Ei>, foo<IHoano7o>, foo<yoeWo3ae>
> 
> This is not much better than foo<1>, foo<2>, foo<3> for me.
> 
> What would be great is if uniquify could use things other than the
> filename when making unique buffer names.
> 
> For example, project-name from project.el is something that *is*
> unique for these files, because of my custom project.el integration.
> Then I'd get something like:
> 
> foo<proj-emacs>, foo<proj-vi>, foo<proj-nano>
> 
> However, uniquify is currently not customizable in this way.  Could we
> add support for including additional attributes into the things which
> uniquify will use?  Then I could add project-name as one of those
> attributes in my configuration, and I'd be happy.
> 
> I would be happy to implement this feature in uniquify myself, if this
> is an interesting feature for upstream.

Sounds like a useful feature indeed, provided that the customization
will allow more or less arbitrary uniquification, not just by project
names.  Also, please keep in mind that a single project could have
files named the same in different directories.




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

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


Received: (at submit) by debbugs.gnu.org; 2 Apr 2023 17:37:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 02 13:37:43 2023
Received: from localhost ([127.0.0.1]:42558 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pj1eB-0002e5-9B
	for submit <at> debbugs.gnu.org; Sun, 02 Apr 2023 13:37:43 -0400
Received: from lists.gnu.org ([209.51.188.17]:52922)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sbaugh@HIDDEN>) id 1pj1e8-0002du-Vl
 for submit <at> debbugs.gnu.org; Sun, 02 Apr 2023 13:37:42 -0400
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 <sbaugh@HIDDEN>)
 id 1pj1e8-0000bb-PF
 for bug-gnu-emacs@HIDDEN; Sun, 02 Apr 2023 13:37:40 -0400
Received: from mxout5.mail.janestreet.com ([64.215.233.18])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <sbaugh@HIDDEN>)
 id 1pj1e5-0000vh-LN
 for bug-gnu-emacs@HIDDEN; Sun, 02 Apr 2023 13:37:40 -0400
From: Spencer Baugh <sbaugh@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 29.0.60; uniquify can't make buffers unique based on things other
 than filename
Date: Sun, 02 Apr 2023 13:37:36 -0400
Message-ID: <ierfs9i2nj3.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=64.215.233.18; envelope-from=sbaugh@HIDDEN;
 helo=mxout5.mail.janestreet.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, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
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.4 (--)


I have a lot of buffers visiting files with the same basename, in
directory paths which have long meaningless numeric identifiers.  This
means that with uniquify, I get buffers named things like:

foo<ahlai5Ei>, foo<IHoano7o>, foo<yoeWo3ae>

This is not much better than foo<1>, foo<2>, foo<3> for me.

What would be great is if uniquify could use things other than the
filename when making unique buffer names.

For example, project-name from project.el is something that *is*
unique for these files, because of my custom project.el integration.
Then I'd get something like:

foo<proj-emacs>, foo<proj-vi>, foo<proj-nano>

However, uniquify is currently not customizable in this way.  Could we
add support for including additional attributes into the things which
uniquify will use?  Then I could add project-name as one of those
attributes in my configuration, and I'd be happy.

I would be happy to implement this feature in uniquify myself, if this
is an interesting feature for upstream.  Or if you'd prefer some other
approach, I'd be happy to hear it and I can implement it.



In GNU Emacs 29.0.60 (build 3, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.15.12, Xaw scroll bars) of 2023-03-13 built on
 igm-qws-u22796a
Repository revision: e759905d2e0828eac4c8164b09113b40f6899656
Repository branch: emacs-29
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: CentOS Linux 7 (Core)

Configured using:
 'configure --with-x-toolkit=lucid --with-modules
 --with-gif=ifavailable'

Configured features:
CAIRO DBUS FREETYPE GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND
SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XINPUT2 XPM LUCID
ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix




Acknowledgement sent to Spencer Baugh <sbaugh@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#62621; 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: Fri, 14 Apr 2023 16:15:01 UTC

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