Received: (at 77312) by debbugs.gnu.org; 23 Jun 2025 11:27:29 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 23 07:27:29 2025 Received: from localhost ([127.0.0.1]:54649 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1uTfKi-0008BS-NM for submit <at> debbugs.gnu.org; Mon, 23 Jun 2025 07:27:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40628) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1uTfKg-0008B4-34 for 77312 <at> debbugs.gnu.org; Mon, 23 Jun 2025 07:27:26 -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 1uTfKZ-0001fD-Bd; Mon, 23 Jun 2025 07:27:19 -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=emgwOs87NbMY/JElQzH/93ClC1oRGjB3GF/rv/KlmgQ=; b=T98GK6YOlghN irlrz30xNs+sag4Go994o2Md2G/Q7bZwYA+jBNO77XptIDj9qIBfdTpBmpTEeKnUPzG9HhbOn8swx kjn0Vb/v0c7kKl/e7nNe5mqmKfuysX+zDDlXgT4Vg6avkA9HACu0nWhOsVazhw5T4t0rH6IysdBbD WdT4gHDn/kPY/QOdHQgriNERdopvi2tgRjHPR9w7HQ2TnDhIIwA/d8je96Kd4xR8+6/beH0m+1WSx 7Yj6RlOXkupIn2X/4YV56IscQzwkTExuKTiWrybFBRbma3B6Dov5j7lr3xO1iJiPu8J83OmIJYhU7 ps842TQNXYDfZKu4dcbMjw==; Date: Mon, 23 Jun 2025 14:27:15 +0300 Message-Id: <86ldpig0ks.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: Dmitry Gutov <dmitry@HIDDEN> In-Reply-To: <fb91895d-e216-4205-baed-6cbfdb5d76ed@HIDDEN> (message from Dmitry Gutov on Mon, 23 Jun 2025 04:53:55 +0300) Subject: Re: bug#77312: [PATCH] Add uniquify-get-unique-names References: <ierecyiseh6.fsf@HIDDEN> <iery0wpdm5o.fsf@HIDDEN> <e6dcfcd9-83d5-4f1f-9f77-a186cd4e5a00@HIDDEN> <5919de07-9849-4257-b448-af45f46b3181@HIDDEN> <87jz5o9dj5.fsf@HIDDEN> <851a4f79-6789-4f60-9952-2f896b9ee187@HIDDEN> <87ikl6yem8.fsf@HIDDEN> <iersek7ab8d.fsf@HIDDEN> <a34abc3a-dacd-4230-8818-6c677e6d9d80@HIDDEN> <8634bulvwa.fsf@HIDDEN> <cf9a0dc4-fcb3-43db-a73a-d9e519b25fb8@HIDDEN> <86ldplk1bq.fsf@HIDDEN> <fb91895d-e216-4205-baed-6cbfdb5d76ed@HIDDEN> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77312 Cc: sbaugh@HIDDEN, 77312 <at> debbugs.gnu.org, mail@HIDDEN 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 (---) > Date: Mon, 23 Jun 2025 04:53:55 +0300 > Cc: sbaugh@HIDDEN, mail@HIDDEN, 77312 <at> debbugs.gnu.org > From: Dmitry Gutov <dmitry@HIDDEN> > > On 21/06/2025 10:20, Eli Zaretskii wrote: > >> Do you have a particular section in mind? > > We have a special sub-section for that: "Special Properties". > > > >> I mean, it's not like a text property affecting display, for example. > > Text properties in Emacs affect many things, not just the display. > > See that section for a good demonstration. > > Okay. Still, all properties in that section seem to have some effect > when used somewhere inside a buffer text, either to control its display, > or some other behaviors of that buffer. > > We're talking about a property which would never be set on a buffer's > text. Still should be in the same sub-section? Text properties are set on strings as well, not only on buffer text. A notable example is the strings used to construct the mode line. So I don't see a problem here.
bug-gnu-emacs@HIDDEN
:bug#77312
; Package emacs
.
Full text available.Received: (at 77312) by debbugs.gnu.org; 23 Jun 2025 01:54:07 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 22 21:54:07 2025 Received: from localhost ([127.0.0.1]:51244 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1uTWNr-0006c8-2h for submit <at> debbugs.gnu.org; Sun, 22 Jun 2025 21:54:07 -0400 Received: from fhigh-b7-smtp.messagingengine.com ([202.12.124.158]:33619) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <dmitry@HIDDEN>) id 1uTWNp-0006bH-Dw for 77312 <at> debbugs.gnu.org; Sun, 22 Jun 2025 21:54:05 -0400 Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfhigh.stl.internal (Postfix) with ESMTP id AE4DD25400B5; Sun, 22 Jun 2025 21:53:59 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Sun, 22 Jun 2025 21:53:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1750643639; x=1750730039; bh=rABkibYzfLe1TuqKLPL+ibmNgICV1SQlIHPNopG2S28=; b= rkndZL7HGD9jFV/ZfGDQ5ViqbocXXkjraBOCFxiZm8HoVIsEsMhR+U7QD9tqBvEu XZgzRcqiXDbhMwwAyweVA+H2p2QcAAWnMgtXvz74ge20HGJrzidvi8ZiKWxXq1Tq z22JvoaPqucr862jbfVh4lE2xTDaficnqKdrTj2HqmPjYpU0n8ivK7MHg6MQuaJh 3d1KwWZg5t30xvrm+//sP0xvaZZ1C1fDgFqUnGM++IXw9LRSmuD+7YcAw+ztcWwX IQZD4nv+06UjJbmJdrTEsgs17UilBSugDaUcNokIGlrvcgEHsBmfSS0Lk/XCdqcv KaEB/kvQNfc/QlhvVw3jqA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1750643639; x= 1750730039; bh=rABkibYzfLe1TuqKLPL+ibmNgICV1SQlIHPNopG2S28=; b=M uRjRTbxgBPmFkV+YHoT8FU/KVDmxzoxGgmohAxjY0Orzl6ERe5eGDAC0mc2jGdbA qMOywknWloZxKIwvmZXzdMkWL3qPTSPrHkZqPxnzRd4affjz2Z5yAyX5nn8b1xuw WnmHijfl50QTDK7DpoAR9nJ6nL3wdDZXdpjEhWckaweKmwPD0viRUiiA6AJly6X+ yoesJeD7mPO8QEezvuCLbrppsDfPvgEZPf2wiPwX7GyAFmj62LX8RNyf+OEl/Uuz DI2SujLe24H/fjUVtANOUDr+fgnHkwRx8Ekwty+053UDYPZmnYcAqoEsnw/hmeg3 wn4Ajzh3FHV03DQvpKn+A== X-ME-Sender: <xms:trNYaEq_oYNgd78Q6SwxaajBKEmhtzJF8LDtTTl7TEP3Wv_WZZMCdw> <xme:trNYaKoK6SlmiCcqzT8EYn3U_IWCCJDZAnANNIXw-FKsQVVEy9kjnZnVNDuO2psfw TTBJrQCZUizkTdyF30> X-ME-Received: <xmr:trNYaJOe5m-kpEX0ymHpcJ0tGIm5zPLhYZNGC8XiOOTxBbf306ntweozDQsG7IXR> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddvgdduheejhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeenucfhrhhomhepffhmihhtrhih ucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtthgvrh hnpeetudeljeegheetgfehgeejkeeuhedvveeikeeufedtvddtveefhfdvveegudejheen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumhhith hrhiesghhuthhovhdruggvvhdpnhgspghrtghpthhtohepgedpmhhouggvpehsmhhtphho uhhtpdhrtghpthhtohepvghlihiisehgnhhurdhorhhgpdhrtghpthhtohepshgsrghugh hhsehjrghnvghsthhrvggvthdrtghomhdprhgtphhtthhopehmrghilhesuggrnhhivghl qdhmvghnughlvghrrdguvgdprhgtphhtthhopeejjeefuddvseguvggssghughhsrdhgnh hurdhorhhg X-ME-Proxy: <xmx:trNYaL4CEcb7e9yz5rKWJzZNM_y2m_BobSlrHwVa8hsprP2ZGQYYHQ> <xmx:trNYaD6jICUfQJYYASqbBISP3wDLYJbG1Xu8c66hwJEeoeqGQB0k5Q> <xmx:trNYaLjRnePX-Tbt5K3DvwFl-bc2gReeeAjEf2umwZHvWb-ZdQJcPA> <xmx:trNYaN4s2wx0vCz01fygpko3qbhepV5vy632V-S5YBeziWbgFlJC-A> <xmx:t7NYaCZv5ajP_O_23lx_WJpcBSuH4OfD7TjBDZFFp2xIlZ-GUl_HPFTF> Feedback-ID: i07de48aa:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 22 Jun 2025 21:53:57 -0400 (EDT) Message-ID: <fb91895d-e216-4205-baed-6cbfdb5d76ed@HIDDEN> Date: Mon, 23 Jun 2025 04:53:55 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#77312: [PATCH] Add uniquify-get-unique-names To: Eli Zaretskii <eliz@HIDDEN> References: <ierecyiseh6.fsf@HIDDEN> <iery0wpdm5o.fsf@HIDDEN> <e6dcfcd9-83d5-4f1f-9f77-a186cd4e5a00@HIDDEN> <5919de07-9849-4257-b448-af45f46b3181@HIDDEN> <87jz5o9dj5.fsf@HIDDEN> <851a4f79-6789-4f60-9952-2f896b9ee187@HIDDEN> <87ikl6yem8.fsf@HIDDEN> <iersek7ab8d.fsf@HIDDEN> <a34abc3a-dacd-4230-8818-6c677e6d9d80@HIDDEN> <8634bulvwa.fsf@HIDDEN> <cf9a0dc4-fcb3-43db-a73a-d9e519b25fb8@HIDDEN> <86ldplk1bq.fsf@HIDDEN> Content-Language: en-US From: Dmitry Gutov <dmitry@HIDDEN> In-Reply-To: <86ldplk1bq.fsf@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 77312 Cc: sbaugh@HIDDEN, 77312 <at> debbugs.gnu.org, mail@HIDDEN 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 (-) On 21/06/2025 10:20, Eli Zaretskii wrote: >> Do you have a particular section in mind? > We have a special sub-section for that: "Special Properties". > >> I mean, it's not like a text property affecting display, for example. > Text properties in Emacs affect many things, not just the display. > See that section for a good demonstration. Okay. Still, all properties in that section seem to have some effect when used somewhere inside a buffer text, either to control its display, or some other behaviors of that buffer. We're talking about a property which would never be set on a buffer's text. Still should be in the same sub-section?
bug-gnu-emacs@HIDDEN
:bug#77312
; Package emacs
.
Full text available.Received: (at 77312) by debbugs.gnu.org; 21 Jun 2025 07:24:02 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 21 03:24:02 2025 Received: from localhost ([127.0.0.1]:60579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1uSsa2-0006sd-7m for submit <at> debbugs.gnu.org; Sat, 21 Jun 2025 03:24:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35546) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1uSsZz-0006rb-64 for 77312 <at> debbugs.gnu.org; Sat, 21 Jun 2025 03:23:59 -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 1uSsZ2-0007fV-KK; Sat, 21 Jun 2025 03:23:47 -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=jRWgfTuWloZaRSZ+vbe79GLiOH3SRwocWW1YkQLxrGY=; b=PJH0O9ixwB1V oK0ZbPT/wlBPKvaIdVuZrGNHg1Uyz/+giRnBoI/lkgmM4ydRlRSi/MN6fKEKWOHFMCrMDv5GRJ8gK PQWH/fHrRF2dInL7K+1Q/O0O9kCl5Ck0GyXxo7SN6VtqTiHoCCZsVBj+FymhfFOa9RNgFPMBKNIKE 2qBHG8Ih2l/NW4rAsjghIQu8P3c3aLl7deskzWhLjC3meRXodWUcDFwtkhdxgq5fGOBHTfxQRRdcz x4LEr3XbBz4/SvN0zne7Q6o7vI5Tij2MnnNPBXoWpW9b/HvjCX3R7lHxJrteI5e8ZU6epXalTzG4/ RRF80w6pPsuANjQfHzv+Gw==; Date: Sat, 21 Jun 2025 10:20:41 +0300 Message-Id: <86ldplk1bq.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: Dmitry Gutov <dmitry@HIDDEN> In-Reply-To: <cf9a0dc4-fcb3-43db-a73a-d9e519b25fb8@HIDDEN> (message from Dmitry Gutov on Sat, 21 Jun 2025 05:29:46 +0300) Subject: Re: bug#77312: [PATCH] Add uniquify-get-unique-names References: <ierecyiseh6.fsf@HIDDEN> <iery0wpdm5o.fsf@HIDDEN> <e6dcfcd9-83d5-4f1f-9f77-a186cd4e5a00@HIDDEN> <5919de07-9849-4257-b448-af45f46b3181@HIDDEN> <87jz5o9dj5.fsf@HIDDEN> <851a4f79-6789-4f60-9952-2f896b9ee187@HIDDEN> <87ikl6yem8.fsf@HIDDEN> <iersek7ab8d.fsf@HIDDEN> <a34abc3a-dacd-4230-8818-6c677e6d9d80@HIDDEN> <8634bulvwa.fsf@HIDDEN> <cf9a0dc4-fcb3-43db-a73a-d9e519b25fb8@HIDDEN> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77312 Cc: sbaugh@HIDDEN, 77312 <at> debbugs.gnu.org, mail@HIDDEN 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 (---) > Date: Sat, 21 Jun 2025 05:29:46 +0300 > Cc: sbaugh@HIDDEN, mail@HIDDEN, 77312 <at> debbugs.gnu.org > From: Dmitry Gutov <dmitry@HIDDEN> > > On 20/06/2025 10:22, Eli Zaretskii wrote: > > If you decide to install this, please be sure to document this special > > text property in the ELisp manual. > > Do you have a particular section in mind? We have a special sub-section for that: "Special Properties". > I mean, it's not like a text property affecting display, for example. Text properties in Emacs affect many things, not just the display. See that section for a good demonstration.
bug-gnu-emacs@HIDDEN
:bug#77312
; Package emacs
.
Full text available.Received: (at 77312) by debbugs.gnu.org; 21 Jun 2025 02:30:11 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 20 22:30:11 2025 Received: from localhost ([127.0.0.1]:59328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1uSnzc-0004bH-Pc for submit <at> debbugs.gnu.org; Fri, 20 Jun 2025 22:30:10 -0400 Received: from fhigh-a8-smtp.messagingengine.com ([103.168.172.159]:50731) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <dmitry@HIDDEN>) id 1uSnzQ-0004YZ-HA for 77312 <at> debbugs.gnu.org; Fri, 20 Jun 2025 22:30:02 -0400 Received: from phl-compute-07.internal (phl-compute-07.phl.internal [10.202.2.47]) by mailfhigh.phl.internal (Postfix) with ESMTP id 648D51140177; Fri, 20 Jun 2025 22:29:49 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-07.internal (MEProxy); Fri, 20 Jun 2025 22:29:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1750472989; x=1750559389; bh=IvL9dW9LK/d6wstUnqTNRHNufOKpJK7w6d8l1zYRBTE=; b= aC3iIowKwsV26VKm3BQgJrNh166To8Be2Tg07qf42c9vm5YQNV8MB0lrSYs7zL34 JxiqX/soYXYr8BB6Xxzs5pflcNKUbooDakpmIFKvUfJ9ufWj3GYEOZkXaPgju/7z Ev3HPVZBR+m8EUkFFRz2DRf3V3gD7QNddaowHhkk3Ip7vYyzBXmir3OutulgQqBk YJrTiq23Y3BNgFZfr4EHIeypDMioCJxB15/KUF4Za5lIQKg+D5aJYBGSyx1p+nLp u0Q9km70W1Pqbv14DdwSDWtyeTeAJMBPi6tlAPWOOkx/1AEsMWzEhG0fWXUcwS1a nEwkES22+ivTwnBf3xbZHg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1750472989; x= 1750559389; bh=IvL9dW9LK/d6wstUnqTNRHNufOKpJK7w6d8l1zYRBTE=; b=H xjCzUBkImuzGrttK89vqSdJp9fRF6LHBNUd2WT78qcCmOCVQlp8ObRg3PRLqjIQG quFYMo4HOuZRy48xX1aZ8bGz2XqSD83BZOB2CmFgAwXRg9xtowvtPj8apsfdLCfF Oozwlgi4jo//nrqAWFMqxPkUwYABJ2wnjOQqvntHstJik07e7QtumEPPTSQM3JPl xzzmspBHKQhGMkddUnrSC0QjPP6whICR57YzZKmaTzvk4sIDdpKG2YQKvSf9sEYe +JwmZ8yzrPnz2J1jsOWpA4f/P/hxDIh/YPhsiDmJt+PbzLFESB6b3vWxVuJ5hXTg /MvMHwTj2g7kEMpHGv4GQ== X-ME-Sender: <xms:HBlWaNUrh0brFyU1rS16PojVInmt74OggTZZQ7QsmdFwpywRrMS_Mg> <xme:HBlWaNkjQd94G8Mx_09zxeYE6HCbvzIYUYWe4NV3gvIPvXKKFjYXKXkFhG5DMZuYz jOae18HTN6IAkCPF0A> X-ME-Received: <xmr:HBlWaJaRXcYNQOF3NXzCa2DgUWT2azuskNAeS8zLTsVGFCZvFgGJIS83W_mVUs-qliTD> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddvgddutddtkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeenucfhrhhomhepffhmihhtrhih ucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtthgvrh hnpeetudeljeegheetgfehgeejkeeuhedvveeikeeufedtvddtveefhfdvveegudejheen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumhhith hrhiesghhuthhovhdruggvvhdpnhgspghrtghpthhtohepgedpmhhouggvpehsmhhtphho uhhtpdhrtghpthhtohepvghlihiisehgnhhurdhorhhgpdhrtghpthhtohepshgsrghugh hhsehjrghnvghsthhrvggvthdrtghomhdprhgtphhtthhopehmrghilhesuggrnhhivghl qdhmvghnughlvghrrdguvgdprhgtphhtthhopeejjeefuddvseguvggssghughhsrdhgnh hurdhorhhg X-ME-Proxy: <xmx:HBlWaAUtzxWDZpPtQwRK54DnJtwoj7htnk7shqySEhTDhwKwwAw1kA> <xmx:HBlWaHltiH6WnFM3adliuDUxdxQAjcTAZQBBltOZsV0TNE_Lv6XLwQ> <xmx:HBlWaNfu48yqswvYaiPrx5T-0mXczPDBqs0X5cah_1uyVs3m2vvPiA> <xmx:HBlWaBFtcxiCbbA0dVy2u5u8wUQ84HYHjTOWzDjJ4Yns6PVISXQskQ> <xmx:HRlWaLHeufXus5EHw1d_OxdrS2_2ik3-1lYTXy9J04E80pcfwcS-pzgp> Feedback-ID: i07de48aa:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 20 Jun 2025 22:29:47 -0400 (EDT) Message-ID: <cf9a0dc4-fcb3-43db-a73a-d9e519b25fb8@HIDDEN> Date: Sat, 21 Jun 2025 05:29:46 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#77312: [PATCH] Add uniquify-get-unique-names To: Eli Zaretskii <eliz@HIDDEN> References: <ierecyiseh6.fsf@HIDDEN> <iery0wpdm5o.fsf@HIDDEN> <e6dcfcd9-83d5-4f1f-9f77-a186cd4e5a00@HIDDEN> <5919de07-9849-4257-b448-af45f46b3181@HIDDEN> <87jz5o9dj5.fsf@HIDDEN> <851a4f79-6789-4f60-9952-2f896b9ee187@HIDDEN> <87ikl6yem8.fsf@HIDDEN> <iersek7ab8d.fsf@HIDDEN> <a34abc3a-dacd-4230-8818-6c677e6d9d80@HIDDEN> <8634bulvwa.fsf@HIDDEN> Content-Language: en-US From: Dmitry Gutov <dmitry@HIDDEN> In-Reply-To: <8634bulvwa.fsf@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 77312 Cc: sbaugh@HIDDEN, 77312 <at> debbugs.gnu.org, mail@HIDDEN 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 (-) On 20/06/2025 10:22, Eli Zaretskii wrote: > If you decide to install this, please be sure to document this special > text property in the ELisp manual. Do you have a particular section in mind? I mean, it's not like a text property affecting display, for example.
bug-gnu-emacs@HIDDEN
:bug#77312
; Package emacs
.
Full text available.Received: (at 77312) by debbugs.gnu.org; 21 Jun 2025 02:27:46 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 20 22:27:45 2025 Received: from localhost ([127.0.0.1]:59323 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1uSnxH-0004Jb-Gj for submit <at> debbugs.gnu.org; Fri, 20 Jun 2025 22:27:45 -0400 Received: from fhigh-a8-smtp.messagingengine.com ([103.168.172.159]:37649) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <dmitry@HIDDEN>) id 1uSnx5-0004HX-MI for 77312 <at> debbugs.gnu.org; Fri, 20 Jun 2025 22:27:37 -0400 Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfhigh.phl.internal (Postfix) with ESMTP id 2743A1140176; Fri, 20 Jun 2025 22:27:26 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-08.internal (MEProxy); Fri, 20 Jun 2025 22:27:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1750472846; x=1750559246; bh=RfxE+laxT+vkf2mnlmS83kiCNzL7nEq2vmsovoiHBxY=; b= jDuTTd0y/zGWUSppcamhVBJM+R1P8l5vbijwjlj0auOeYOlY1nP4/7RC3lJzE/bo rj7JFCKiPKDXPWs3k2gHocCna1bKBV1OTSzT9J3pPojiksmYUsuBXUcfDCCTXbSS s15YJ/vkSzN+O716CLn2uXP8Ay6Kh/c0Z9A9yXuqVkcqaqBptx+/YFkWzCjzZZQd fWI0/nN5IVzHFd6xbbYvlF9arNGjhqbWFZfJL+EuOl/mn3A6ve1NBfS/p4LnZ4vj S19Huwon1Y0gXiNtZTFIJTNfVfPLygrMEe5QBHhp5WHgrdunQD2BrJcc1Z/g4eRY GxdOucXxk3VKrWk38tn24Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1750472846; x= 1750559246; bh=RfxE+laxT+vkf2mnlmS83kiCNzL7nEq2vmsovoiHBxY=; b=E m6l/jTiDf33piX0a0KN0/K5aYZK+wsbNkw/R5DbYJ98MhRDfM7NhcqV3zMRDV9dX T0/fI+/VLcUkEWptt9EVDD0IEvyvI4YHkzv0BPICXg/QzdT6i0vYT+vNxnYPQp7q 0ZPtH189OMxXz3rFUJ77jFF66rrBSCWfGvXq/iPcYsEgOld+QITzrhOjtn7eU9bh WfVdcURhy7lyXBRNMvlWZbrSgZI6MxkNk6lIkwdma1zqxhs+20704TqwIshLhDlM i5bvF8d6438xte4wGWomn28XPCOWJDXyvQshrp7uyRXAyUUQjEf/Heysv5doe9er 7Hp8UIZm3f7KwouiROCbw== X-ME-Sender: <xms:jRhWaPs7AqqvHrvvSZBAOSOkzIajTVzeNi95l2sFre_x-OroIF6Rkw> <xme:jRhWaAcoMaIB_QioXboWoaLrOfhsoU7y-cLP1UEU2x03RyWRS8nSuWab6UPvG9JXY bVwUvpHnK7cAJkZ7B8> X-ME-Received: <xmr:jRhWaCytuChrK2AbYzTQmmt4EbBZ4xXfW3gKL88FgQr1yUkW6QjneOAlHX2zw6LgGUa3> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddvgddutddtkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeenucfhrhhomhepffhmihhtrhih ucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtthgvrh hnpeetudeljeegheetgfehgeejkeeuhedvveeikeeufedtvddtveefhfdvveegudejheen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumhhith hrhiesghhuthhovhdruggvvhdpnhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphho uhhtpdhrtghpthhtohepmhgrihhlsegurghnihgvlhdqmhgvnhgulhgvrhdruggvpdhrtg hpthhtohepshgsrghughhhsehjrghnvghsthhrvggvthdrtghomhdprhgtphhtthhopeej jeefuddvseguvggssghughhsrdhgnhhurdhorhhg X-ME-Proxy: <xmx:jRhWaOOvqlPKA8DNnrQcuON_oBv8gEdZGC43pwdYGVK6M3teMQHO6Q> <xmx:jRhWaP-ZOjWtjHjcD3ve9Pt2X8MMNLtrBMUb8iruKRO9hE6X1jF2ag> <xmx:jRhWaOVHSeoPWD58rzaTlZjBq_azCLN9g27bPsjNBuHho3EZEV2A3A> <xmx:jRhWaAfshOe904miEwHtwYfMK5N6JxcexkbAyMIy5rp54Ue4Nz1hZA> <xmx:jhhWaG2urjt2zuSZpBggZK7Q43Pjq3yTWw_fSne6zw47ao4Q7Ph8NnBZ> Feedback-ID: i07de48aa:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 20 Jun 2025 22:27:24 -0400 (EDT) Message-ID: <fb76f871-454b-4554-a662-1b4a55ba973f@HIDDEN> Date: Sat, 21 Jun 2025 05:27:23 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#77312: [PATCH] Add uniquify-get-unique-names To: Daniel Mendler <mail@HIDDEN> References: <ierecyiseh6.fsf@HIDDEN> <iery0wpdm5o.fsf@HIDDEN> <e6dcfcd9-83d5-4f1f-9f77-a186cd4e5a00@HIDDEN> <5919de07-9849-4257-b448-af45f46b3181@HIDDEN> <87jz5o9dj5.fsf@HIDDEN> <851a4f79-6789-4f60-9952-2f896b9ee187@HIDDEN> <87ikl6yem8.fsf@HIDDEN> <iersek7ab8d.fsf@HIDDEN> <a34abc3a-dacd-4230-8818-6c677e6d9d80@HIDDEN> <875xgqepyo.fsf@HIDDEN> Content-Language: en-US From: Dmitry Gutov <dmitry@HIDDEN> In-Reply-To: <875xgqepyo.fsf@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 77312 Cc: Spencer Baugh <sbaugh@HIDDEN>, 77312 <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 (-) On 20/06/2025 12:12, Daniel Mendler wrote: > Okay, maybe copying the string could be avoided by checking (equal Maybe you meant the 'eq' check. > (buffer-name buf) uniquify--stateless-curname)? Hmm, okay. Should we worry about different callers of this seeing modified strings cached in the uniquify-managed variable? Maybe not - hard to imagine actual problem scenarios. > I wonder why you called the property `uniquify-orig-buffer-name' instead > of `uniquify-orig-buffer', since it carries a buffer object? Oh yeah, makes sense. I just used the name you originally suggested, but shorter is better - and more correct too.
bug-gnu-emacs@HIDDEN
:bug#77312
; Package emacs
.
Full text available.Received: (at 77312) by debbugs.gnu.org; 20 Jun 2025 09:13:01 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 20 05:13:00 2025 Received: from localhost ([127.0.0.1]:47239 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1uSXnv-0002aI-UK for submit <at> debbugs.gnu.org; Fri, 20 Jun 2025 05:13:00 -0400 Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:48177 helo=mail.qxqx.de) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1uSXns-0002ZP-2l for 77312 <at> debbugs.gnu.org; Fri, 20 Jun 2025 05:12:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ErOLTS/WHGziYd8+RX9a4EAQSFZy6Jg4Xay5IR8g44Y=; b=Fedp8p5RmuAEQDe3PbsgwVK8BH oPm9AOHRquYFc1XVpKyaX6xyNcujkv9HJ6z9c0ib2Z1y204MlIOZgk/J0WU/vp4GAC6H5ZOoZtj7c KXrLi0MqJ23NQdAUCQfF4sr7bJldVmYQrrtTeHy8G9vL7qO/cxjiuD+1EWyeiGIO/MC4=; From: Daniel Mendler <mail@HIDDEN> To: Dmitry Gutov <dmitry@HIDDEN> Subject: Re: bug#77312: [PATCH] Add uniquify-get-unique-names In-Reply-To: <a34abc3a-dacd-4230-8818-6c677e6d9d80@HIDDEN> References: <ierecyiseh6.fsf@HIDDEN> <iery0wpdm5o.fsf@HIDDEN> <e6dcfcd9-83d5-4f1f-9f77-a186cd4e5a00@HIDDEN> <5919de07-9849-4257-b448-af45f46b3181@HIDDEN> <87jz5o9dj5.fsf@HIDDEN> <851a4f79-6789-4f60-9952-2f896b9ee187@HIDDEN> <87ikl6yem8.fsf@HIDDEN> <iersek7ab8d.fsf@HIDDEN> <a34abc3a-dacd-4230-8818-6c677e6d9d80@HIDDEN> Date: Fri, 20 Jun 2025 11:12:47 +0200 Message-ID: <875xgqepyo.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 77312 Cc: Spencer Baugh <sbaugh@HIDDEN>, 77312 <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 (-) Dmitry Gutov <dmitry@HIDDEN> writes: > On 10/06/2025 18:05, Spencer Baugh wrote: >>> In order to avoid them, we could only attach the property if the buffer >>> name has really changed, such that no strings have to be copied. The >>> property could be called `uniquify-orig-buffer-name`. If the property is >>> present, it holds the original buffer name, if it is not present the >>> string itself is the original buffer name. >> All else being equal, I think changing uniquify-get-unique-names to >> return a list of strings which have the original buffer names as a >> property is a reasonable and easy thing to do. uniquify.el is generally >> pretty allocation heavy, so I wouldn't worry about the excess >> allocations, just stick the property on all the returned strings. > > Here's how the change can look. > > It actually increases consing a bit further, though like mentioned it probably > doesn't matter: > > - Added copy-sequence because I'm not sure if 'uniquify--stateless-curname' > always returns a new string (and never the original buffer name string > object). Okay, maybe copying the string could be avoided by checking (equal (buffer-name buf) uniquify--stateless-curname)? I wonder why you called the property `uniquify-orig-buffer-name' instead of `uniquify-orig-buffer', since it carries a buffer object? Thanks! Daniel
bug-gnu-emacs@HIDDEN
:bug#77312
; Package emacs
.
Full text available.Received: (at 77312) by debbugs.gnu.org; 20 Jun 2025 07:23:02 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 20 03:23:01 2025 Received: from localhost ([127.0.0.1]:45586 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1uSW5T-0007wF-Ot for submit <at> debbugs.gnu.org; Fri, 20 Jun 2025 03:23:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48932) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1uSW5Q-0007vD-QF for 77312 <at> debbugs.gnu.org; Fri, 20 Jun 2025 03:22:58 -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 1uSW5I-0008JA-S8; Fri, 20 Jun 2025 03:22: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=QK1DWDn9osPfM90ykA9Mu4yTi/+wCxkz2i7afepjS+Q=; b=VHD+7yUebB84 gu8ERkGwbMQzo4EY5CmcudJaYVXHeSgNFuM9gaEkB0/jtLiMOZvfxXUsgTvYbztwz58TjYI3otYiz nNzxND14ujksFjiXdKGBM0pUH4cLg8P7Jr9WbWrhXbWKsxFpnVuaA6w7WFJNS539mo3q3u4upSsMm X4dLVyyyx7wWdM8MY+IAmUEkMvH+36EhmR3sMFhcrkn4AWmwPvW1ZRXHJU534sKuubq1agAj0t2t2 w+/Gd/ejacoDssvZEuSn55MMr68VHQQp00WZIoefXth7X+PsMGvPnTD6a4i6XMM/fzUBV+SVr+o+i 0ga6MT4m/R5u2YivgDjPsw==; Date: Fri, 20 Jun 2025 10:22:45 +0300 Message-Id: <8634bulvwa.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: Dmitry Gutov <dmitry@HIDDEN> In-Reply-To: <a34abc3a-dacd-4230-8818-6c677e6d9d80@HIDDEN> (message from Dmitry Gutov on Fri, 20 Jun 2025 06:08:12 +0300) Subject: Re: bug#77312: [PATCH] Add uniquify-get-unique-names References: <ierecyiseh6.fsf@HIDDEN> <iery0wpdm5o.fsf@HIDDEN> <e6dcfcd9-83d5-4f1f-9f77-a186cd4e5a00@HIDDEN> <5919de07-9849-4257-b448-af45f46b3181@HIDDEN> <87jz5o9dj5.fsf@HIDDEN> <851a4f79-6789-4f60-9952-2f896b9ee187@HIDDEN> <87ikl6yem8.fsf@HIDDEN> <iersek7ab8d.fsf@HIDDEN> <a34abc3a-dacd-4230-8818-6c677e6d9d80@HIDDEN> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77312 Cc: sbaugh@HIDDEN, 77312 <at> debbugs.gnu.org, mail@HIDDEN 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 (---) > Cc: 77312 <at> debbugs.gnu.org > Date: Fri, 20 Jun 2025 06:08:12 +0300 > From: Dmitry Gutov <dmitry@HIDDEN> > > diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el > index 5cf9a68a294..0471daa55b7 100644 > --- a/lisp/progmodes/project.el > +++ b/lisp/progmodes/project.el > @@ -1580,7 +1580,14 @@ project--read-project-buffer > uniquify-buffer-name-style) > ;; Forgo the use of `buffer-read-function' (often nil) in > ;; favor of uniquifying the buffers better. > - (let* ((unique-names (uniquify-get-unique-names buffers)) > + (let* ((unique-names > + (mapcar > + (lambda (name) > + (cons name > + (and name > + (get-text-property 0 'uniquify-orig-buffer-name > + name)))) > + (uniquify-get-unique-names buffers))) > (other-name (when (funcall predicate (cons other-name other-buffer)) > (car (rassoc other-buffer unique-names)))) > (result (completing-read > diff --git a/lisp/uniquify.el b/lisp/uniquify.el > index 6e25323bf5a..67cf346d204 100644 > --- a/lisp/uniquify.el > +++ b/lisp/uniquify.el > @@ -517,10 +517,11 @@ uniquify--stateless-curname > "The current unique name of this buffer in `uniquify-get-unique-names'.") > > (defun uniquify-get-unique-names (buffers) > - "Return an alist with a unique name for each buffer in BUFFERS. > + "Return a list with unique names for buffers in BUFFERS. > > The names are unique only among BUFFERS, and may conflict with other > -buffers not in that list. > +buffers not in that list. Each string has a text property > +`uniquify-orig-buffer-name' that stores the corresponding buffer. > > This does not rename the buffers or change any state; the unique name is > only present in the returned alist." > @@ -547,8 +548,11 @@ uniquify-get-unique-names > (gethash name buffer-names))))) > (mapcar (lambda (buf) > (with-current-buffer buf > - (prog1 (cons uniquify--stateless-curname buf) > - (kill-local-variable 'uniquify--stateless-curname)))) > + (let ((name (copy-sequence uniquify--stateless-curname))) > + (when name > + (put-text-property 0 1 'uniquify-orig-buffer-name buf name)) > + (kill-local-variable 'uniquify--stateless-curname) > + name))) > buffers)) > > ;;; Hooks from the rest of Emacs If you decide to install this, please be sure to document this special text property in the ELisp manual. Thanks.
bug-gnu-emacs@HIDDEN
:bug#77312
; Package emacs
.
Full text available.Received: (at 77312) by debbugs.gnu.org; 20 Jun 2025 03:08:26 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 19 23:08:26 2025 Received: from localhost ([127.0.0.1]:42699 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1uSS76-0001nb-Se for submit <at> debbugs.gnu.org; Thu, 19 Jun 2025 23:08:25 -0400 Received: from fhigh-a2-smtp.messagingengine.com ([103.168.172.153]:34967) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <dmitry@HIDDEN>) id 1uSS73-0001ms-Ph for 77312 <at> debbugs.gnu.org; Thu, 19 Jun 2025 23:08:22 -0400 Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfhigh.phl.internal (Postfix) with ESMTP id 23529114027B; Thu, 19 Jun 2025 23:08:16 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Thu, 19 Jun 2025 23:08:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1750388896; x=1750475296; bh=x3JOKS8ilq eQtis8+8TPWYhFSt22XWVnaSjw8kptnQw=; b=XQU+ZDfk0mTiVkaezmt66vG6UV phQh0vqI+LW44sFXW+fTQoaNy6gHHcWBNNJH6PzRZQak+2b4opWUcMKuqKRfSJ/H SE4ahJ1Bfk5gIqyhIbQi8Spej9Zn2wiXPywpCcnaDepKqbIYLIOZnP/836kOT7SR dfYeiMTf4wQMYyAIeKlDsAjKTB8rFR1XxoKR7Gh5xlvwImVIwCALtGHYrmzmUoHk tZbZN3iAIf8cxjNEAtwpdxqdvylbEC4TewSDf8XSe02Z18ihDGPWSIih1dd4D6xJ TlrxaE8ppNtBaADNyHdHrG1bLzkyaVeY/RGvYgeZq4RoK2GzFCQyBZ4bIOKg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1750388896; x=1750475296; bh=x3JOKS8ilqeQtis8+8TPWYhFSt22XWVnaSj w8kptnQw=; b=Kz1ZvNPHJphs3t5U2VT/cSxaY2NL37uvJ9Fxc/15dC0gtSat5fb GWvlh0MKhobHParM77Q0Z52d1IaKtIW9IXJ8B4vr+ZI+jS04ae6CmeRJZUpDOVRI YFPt6CYoCx/X/voilf6SyI/3jg0v2J4GHQxK/FoXuMw7RrtU/Hrssp9RRhKn3AnX 6/bBb3FlOPxnmw3dDBGAh1hGZthqpsjB/0rsqFRpLaS/dG9ZrScmMioJewPS3TdP KrhLnSFRf+zlZ0JmE49G72jx7fiLDol90u7Wx/nV1VTuGZgR91pTUTVPIMLqEbPQ Spqrt3XMIfiPIAubiPxSZFyz/YS+K9vuh9w== X-ME-Sender: <xms:n9BUaP5afLCGLBbb2-sfsQMpA-mvS3IGkH4NAeWfY9y5Yimxr8G2Pw> <xme:n9BUaE4O0Ux-LE6cz7UtyUFt9fHGXrZVvaJW06JF2P1VeNVZON-kYsQXtt4v4oMZI nbZmp9ZqxPhmTgdOO4> X-ME-Received: <xmr:n9BUaGeDJVM06sBwNL143EkJNuo9U_2xNjnG3h5kpRfwBAKpCVm1_A1jCpUvrGZ3ucJN> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddvgdejvdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurh eptgfkffggfgfuvfevfhfhjgesmhdtreertddvjeenucfhrhhomhepffhmihhtrhihucfi uhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtthgvrhhnpe ehleefudekudduveekieelgfeiffdvkefhkeeljeeujeegueekveffkeejjeevheenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumhhithhrhi esghhuthhovhdruggvvhdpnhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphhouhht pdhrtghpthhtohepshgsrghughhhsehjrghnvghsthhrvggvthdrtghomhdprhgtphhtth hopehmrghilhesuggrnhhivghlqdhmvghnughlvghrrdguvgdprhgtphhtthhopeejjeef uddvseguvggssghughhsrdhgnhhurdhorhhg X-ME-Proxy: <xmx:n9BUaALp3tTuuCyMCPyvFB0HBUbSZOCWnQdXwZlkKPAMfZlqYiDbKw> <xmx:n9BUaDLGXK6j5XeSnxL59oqbdJy8dq0yxoMjlDMaeSpPQan655qFdw> <xmx:n9BUaJzrjyqC8agibGcZIUGQupfOK7qyrUSoG1yu_LvpJL7VTi5uaA> <xmx:n9BUaPIKY1tOkgN0jYxxKajRS9vwVrZL-L3JChEk_w0TM0DFOIrtIw> <xmx:oNBUaNTNq62V3amdxPYcrct2k5mKQPQ9ZZUIwq5SMouemuOb67VZ2RDD> Feedback-ID: i07de48aa:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Jun 2025 23:08:14 -0400 (EDT) Content-Type: multipart/mixed; boundary="------------6KGe0vBb5aCxfX0a2HzLo6L0" Message-ID: <a34abc3a-dacd-4230-8818-6c677e6d9d80@HIDDEN> Date: Fri, 20 Jun 2025 06:08:12 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#77312: [PATCH] Add uniquify-get-unique-names To: Spencer Baugh <sbaugh@HIDDEN>, Daniel Mendler <mail@HIDDEN> References: <ierecyiseh6.fsf@HIDDEN> <iery0wpdm5o.fsf@HIDDEN> <e6dcfcd9-83d5-4f1f-9f77-a186cd4e5a00@HIDDEN> <5919de07-9849-4257-b448-af45f46b3181@HIDDEN> <87jz5o9dj5.fsf@HIDDEN> <851a4f79-6789-4f60-9952-2f896b9ee187@HIDDEN> <87ikl6yem8.fsf@HIDDEN> <iersek7ab8d.fsf@HIDDEN> Content-Language: en-US From: Dmitry Gutov <dmitry@HIDDEN> In-Reply-To: <iersek7ab8d.fsf@HIDDEN> X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 77312 Cc: 77312 <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 (-) This is a multi-part message in MIME format. --------------6KGe0vBb5aCxfX0a2HzLo6L0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 10/06/2025 18:05, Spencer Baugh wrote: >> In order to avoid them, we could only attach the property if the buffer >> name has really changed, such that no strings have to be copied. The >> property could be called `uniquify-orig-buffer-name`. If the property is >> present, it holds the original buffer name, if it is not present the >> string itself is the original buffer name. > All else being equal, I think changing uniquify-get-unique-names to > return a list of strings which have the original buffer names as a > property is a reasonable and easy thing to do. uniquify.el is generally > pretty allocation heavy, so I wouldn't worry about the excess > allocations, just stick the property on all the returned strings. Here's how the change can look. It actually increases consing a bit further, though like mentioned it probably doesn't matter: - Added copy-sequence because I'm not sure if 'uniquify--stateless-curname' always returns a new string (and never the original buffer name string object). - project--read-project-buffer converts the list to alist anyway, to avoid having two different bindings for PREDICATE. --------------6KGe0vBb5aCxfX0a2HzLo6L0 Content-Type: text/x-patch; charset=UTF-8; name="uniquify-get-unique-buffers-with-textprop.diff" Content-Disposition: attachment; filename="uniquify-get-unique-buffers-with-textprop.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvcHJvZ21vZGVzL3Byb2plY3QuZWwgYi9saXNwL3Byb2dtb2Rl cy9wcm9qZWN0LmVsCmluZGV4IDVjZjlhNjhhMjk0Li4wNDcxZGFhNTViNyAxMDA2NDQKLS0t IGEvbGlzcC9wcm9nbW9kZXMvcHJvamVjdC5lbAorKysgYi9saXNwL3Byb2dtb2Rlcy9wcm9q ZWN0LmVsCkBAIC0xNTgwLDcgKzE1ODAsMTQgQEAgcHJvamVjdC0tcmVhZC1wcm9qZWN0LWJ1 ZmZlcgogICAgICAgICAgICAgICAgICAgIHVuaXF1aWZ5LWJ1ZmZlci1uYW1lLXN0eWxlKQog ICAgICAgICAgICAgICA7OyBGb3JnbyB0aGUgdXNlIG9mIGBidWZmZXItcmVhZC1mdW5jdGlv bicgKG9mdGVuIG5pbCkgaW4KICAgICAgICAgICAgICAgOzsgZmF2b3Igb2YgdW5pcXVpZnlp bmcgdGhlIGJ1ZmZlcnMgYmV0dGVyLgotICAgICAgICAgICAgICAobGV0KiAoKHVuaXF1ZS1u YW1lcyAodW5pcXVpZnktZ2V0LXVuaXF1ZS1uYW1lcyBidWZmZXJzKSkKKyAgICAgICAgICAg ICAgKGxldCogKCh1bmlxdWUtbmFtZXMKKyAgICAgICAgICAgICAgICAgICAgICAobWFwY2Fy CisgICAgICAgICAgICAgICAgICAgICAgIChsYW1iZGEgKG5hbWUpCisgICAgICAgICAgICAg ICAgICAgICAgICAgKGNvbnMgbmFtZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IChhbmQgbmFtZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdldC10 ZXh0LXByb3BlcnR5IDAgJ3VuaXF1aWZ5LW9yaWctYnVmZmVyLW5hbWUKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lKSkpKQor ICAgICAgICAgICAgICAgICAgICAgICAodW5pcXVpZnktZ2V0LXVuaXF1ZS1uYW1lcyBidWZm ZXJzKSkpCiAgICAgICAgICAgICAgICAgICAgICAob3RoZXItbmFtZSAod2hlbiAoZnVuY2Fs bCBwcmVkaWNhdGUgKGNvbnMgb3RoZXItbmFtZSBvdGhlci1idWZmZXIpKQogICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAoY2FyIChyYXNzb2Mgb3RoZXItYnVmZmVyIHVu aXF1ZS1uYW1lcykpKSkKICAgICAgICAgICAgICAgICAgICAgIChyZXN1bHQgKGNvbXBsZXRp bmctcmVhZApkaWZmIC0tZ2l0IGEvbGlzcC91bmlxdWlmeS5lbCBiL2xpc3AvdW5pcXVpZnku ZWwKaW5kZXggNmUyNTMyM2JmNWEuLjY3Y2YzNDZkMjA0IDEwMDY0NAotLS0gYS9saXNwL3Vu aXF1aWZ5LmVsCisrKyBiL2xpc3AvdW5pcXVpZnkuZWwKQEAgLTUxNywxMCArNTE3LDExIEBA IHVuaXF1aWZ5LS1zdGF0ZWxlc3MtY3VybmFtZQogICAiVGhlIGN1cnJlbnQgdW5pcXVlIG5h bWUgb2YgdGhpcyBidWZmZXIgaW4gYHVuaXF1aWZ5LWdldC11bmlxdWUtbmFtZXMnLiIpCiAK IChkZWZ1biB1bmlxdWlmeS1nZXQtdW5pcXVlLW5hbWVzIChidWZmZXJzKQotICAiUmV0dXJu IGFuIGFsaXN0IHdpdGggYSB1bmlxdWUgbmFtZSBmb3IgZWFjaCBidWZmZXIgaW4gQlVGRkVS Uy4KKyAgIlJldHVybiBhIGxpc3Qgd2l0aCB1bmlxdWUgbmFtZXMgZm9yIGJ1ZmZlcnMgaW4g QlVGRkVSUy4KIAogVGhlIG5hbWVzIGFyZSB1bmlxdWUgb25seSBhbW9uZyBCVUZGRVJTLCBh bmQgbWF5IGNvbmZsaWN0IHdpdGggb3RoZXIKLWJ1ZmZlcnMgbm90IGluIHRoYXQgbGlzdC4K K2J1ZmZlcnMgbm90IGluIHRoYXQgbGlzdC4gIEVhY2ggc3RyaW5nIGhhcyBhIHRleHQgcHJv cGVydHkKK2B1bmlxdWlmeS1vcmlnLWJ1ZmZlci1uYW1lJyB0aGF0IHN0b3JlcyB0aGUgY29y cmVzcG9uZGluZyBidWZmZXIuCiAKIFRoaXMgZG9lcyBub3QgcmVuYW1lIHRoZSBidWZmZXJz IG9yIGNoYW5nZSBhbnkgc3RhdGU7IHRoZSB1bmlxdWUgbmFtZSBpcwogb25seSBwcmVzZW50 IGluIHRoZSByZXR1cm5lZCBhbGlzdC4iCkBAIC01NDcsOCArNTQ4LDExIEBAIHVuaXF1aWZ5 LWdldC11bmlxdWUtbmFtZXMKICAgICAgICAgIChnZXRoYXNoIG5hbWUgYnVmZmVyLW5hbWVz KSkpKSkKICAgKG1hcGNhciAobGFtYmRhIChidWYpCiAgICAgICAgICAgICAod2l0aC1jdXJy ZW50LWJ1ZmZlciBidWYKLSAgICAgICAgICAgICAgKHByb2cxIChjb25zIHVuaXF1aWZ5LS1z dGF0ZWxlc3MtY3VybmFtZSBidWYpCi0gICAgICAgICAgICAgICAgKGtpbGwtbG9jYWwtdmFy aWFibGUgJ3VuaXF1aWZ5LS1zdGF0ZWxlc3MtY3VybmFtZSkpKSkKKyAgICAgICAgICAgICAg KGxldCAoKG5hbWUgKGNvcHktc2VxdWVuY2UgdW5pcXVpZnktLXN0YXRlbGVzcy1jdXJuYW1l KSkpCisgICAgICAgICAgICAgICAgKHdoZW4gbmFtZQorICAgICAgICAgICAgICAgICAgKHB1 dC10ZXh0LXByb3BlcnR5IDAgMSAndW5pcXVpZnktb3JpZy1idWZmZXItbmFtZSBidWYgbmFt ZSkpCisgICAgICAgICAgICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJ3VuaXF1aWZ5LS1z dGF0ZWxlc3MtY3VybmFtZSkKKyAgICAgICAgICAgICAgICBuYW1lKSkpCiAgICAgICAgICAg YnVmZmVycykpCiAKIDs7OyBIb29rcyBmcm9tIHRoZSByZXN0IG9mIEVtYWNzCg== --------------6KGe0vBb5aCxfX0a2HzLo6L0--
bug-gnu-emacs@HIDDEN
:bug#77312
; Package emacs
.
Full text available.Received: (at 77312) by debbugs.gnu.org; 10 Jun 2025 17:04:10 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 10 13:04:10 2025 Received: from localhost ([127.0.0.1]:39384 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1uP2ON-0006JH-8V for submit <at> debbugs.gnu.org; Tue, 10 Jun 2025 13:04:10 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:36485) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <sbaugh@HIDDEN>) id 1uP2OF-0006Gf-Pm for 77312 <at> debbugs.gnu.org; Tue, 10 Jun 2025 13:04:03 -0400 From: Spencer Baugh <sbaugh@HIDDEN> To: Daniel Mendler <mail@HIDDEN> Subject: Re: bug#77312: [PATCH] Add uniquify-get-unique-names In-Reply-To: <87sek7tu4r.fsf@HIDDEN> (Daniel Mendler's message of "Tue, 10 Jun 2025 18:54:12 +0200") References: <ierecyiseh6.fsf@HIDDEN> <iery0wpdm5o.fsf@HIDDEN> <e6dcfcd9-83d5-4f1f-9f77-a186cd4e5a00@HIDDEN> <5919de07-9849-4257-b448-af45f46b3181@HIDDEN> <87jz5o9dj5.fsf@HIDDEN> <851a4f79-6789-4f60-9952-2f896b9ee187@HIDDEN> <87ikl6yem8.fsf@HIDDEN> <iersek7ab8d.fsf@HIDDEN> <87sek7tu4r.fsf@HIDDEN> Date: Tue, 10 Jun 2025 13:03:53 -0400 Message-ID: <ierplfba5qe.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1749575033; bh=sop1UEnJZ3497V0rZNXoJYaQvO5FZUCja5idVC1SaoM=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=J4pVLsGhblpn/bK0uSmyp20vRz24BC3uZ551M6GyoUvN9GHJfzRbYrQbM4Hz4L0so 8j3PxXGNhkOpM+/nKgp9HUqii509b10Ov103/0Qyl5j/iZoalaOXIxcGdtG/EReFX0 9VA64tLagLe+yf/P346gKtanwB8HYG0ibX1K8YR4hpf2J6HfZUWg621WHJpUeNJ9I4 j8uRUwjJNAdynPjyNKysx23/dkMCfu6F3XxeJZnPKBdzOKHBKeuhXTo/lqt2fFviFI T7yBRulQCyKEgmmopE3H9HTPCCNJCm3r2z/oGOuMu5khxIaLlzV40GXO6RANX23JV/ rNCi8vp835FLA== X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77312 Cc: dmitry@HIDDEN, 77312 <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 (---) Daniel Mendler <mail@HIDDEN> writes: > Spencer Baugh via "Bug reports for GNU Emacs, the Swiss army knife of > text editors" <bug-gnu-emacs@HIDDEN> writes: > >> Daniel Mendler <mail@HIDDEN> writes: >> >>> Dmitry Gutov <dmitry@HIDDEN> writes: >>> >>>> Hey Daniel! >>>> >>>> On 07/06/2025 11:11, Daniel Mendler wrote: >>>>> Would it be possible to attach the buffer object or the original buffer >>>>> name to the completion candidate string as text property? This would >>>>> make it possible to attach annotations via Marginalia or to execute >>>>> buffer actions via Embark. Otherwise I don't see a possibility to access >>>>> the original buffer, since they are only present in the `unique-names` >>>>> alist local variable. >>>> >>>> That makes sense. Just call the property 'buffer'? >>> >>> That would work. I prefer a more specific property name to ease >>> grepping/debugging. Also see below regarding the consing. >>> >>>> I wonder if it would make sense to alter the calling convention for >>>> uniquify-get-unique-names itself to return a list of propertized strings >>>> instead. project--read-project-buffer can do the conversion (copy each string >>>> and attach the property), but it's just extra consing. >>> >>> I haven't checked if the current function is already working hard to >>> avoid unnecessary allocations. If yes, it would be wasteful to add extra >>> string allocations. >>> >>> In order to avoid them, we could only attach the property if the buffer >>> name has really changed, such that no strings have to be copied. The >>> property could be called `uniquify-orig-buffer-name`. If the property is >>> present, it holds the original buffer name, if it is not present the >>> string itself is the original buffer name. >> >> All else being equal, I think changing uniquify-get-unique-names to >> return a list of strings which have the original buffer names as a >> property is a reasonable and easy thing to do. uniquify.el is generally >> pretty allocation heavy, so I wouldn't worry about the excess >> allocations, just stick the property on all the returned strings. > > Okay. Er, sorry, crucial typo/miscommunication here: I think uniquify-get-unique-names should return a list of strings, each of which has a text property containing the original *buffer*. Not the original buffer name - the buffer itself. That would just be slightly more efficient. > >> Some unnecessary speculation about alternatives to the text property >> approach follows: >> >> One alternative to the text property approach is to have the alist >> returned by uniquify-get-unique-names be let-bound in some special >> variable around the call to completing-read. Then Embark/Marginalia >> could look up strings in that alist to figure out the underlying buffer >> that a string is referring to. > > Yes, this would work too. Or more ideally set a local variable in the > minibuffer setup hook, since then buffer unification can be detected by > checking if the variable is non-nil. Ah right, because otherwise a recursive edit could cause problems... so a local variable set in the minibuffer setup hook would indeed be bettter. >>>> Unless some more new callers are going to prefer the current convention. >>> >>> Both would be fine for me. Generally I think it is nice to push >>> functionality to the lower level API, as long as the functionality is >>> generic enough. >>> >>> Btw, would you be interested in having `uniquify-get-unique-names' in >>> Compat, such that you avoid the fboundp check? project.el would have to >>> depend on Compat for that, but that's essentially free on Emacs 30 and >>> newer. >> >> I think adding uniquify-get-unique-names to compat might be difficult >> because it depends on non-trivial changes to the rest of the code in >> uniquify.el. > > That's unfortunate. I have not looked in detail at it, but if the effort > is disproportionate, and half of uniquify.el would need to be > replicated, then we cannot port it back as part of Compat. Yep. Maybe about 120 lines would need to be replicated.
bug-gnu-emacs@HIDDEN
:bug#77312
; Package emacs
.
Full text available.Received: (at 77312) by debbugs.gnu.org; 10 Jun 2025 16:54:27 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 10 12:54:27 2025 Received: from localhost ([127.0.0.1]:39346 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1uP2Ez-0004S3-T1 for submit <at> debbugs.gnu.org; Tue, 10 Jun 2025 12:54:27 -0400 Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:35599 helo=mail.qxqx.de) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1uP2Et-0004Pi-J6 for 77312 <at> debbugs.gnu.org; Tue, 10 Jun 2025 12:54:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Jzm8WmL1oV3yDpj23ahiLHFU7H42O/PVdqexMCV3sqo=; b=OBOGApwX7SUAWHhtUHkYIIfjMT Elek0xIAwOgmKOJJ7QC7vVx2keAFLBVTOkn9W77wJcwITb/5EUX1P8QsXMd9ntNvlasXBCXI0voxX Xm3GMrvbnx7UxPuieKTtd4idUOCIABuzetRHzOmoNP+AB1jkxjZEBQ5qE0JR1pxXtoH0=; From: Daniel Mendler <mail@HIDDEN> To: Spencer Baugh via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN> Subject: Re: bug#77312: [PATCH] Add uniquify-get-unique-names In-Reply-To: <iersek7ab8d.fsf@HIDDEN> References: <ierecyiseh6.fsf@HIDDEN> <iery0wpdm5o.fsf@HIDDEN> <e6dcfcd9-83d5-4f1f-9f77-a186cd4e5a00@HIDDEN> <5919de07-9849-4257-b448-af45f46b3181@HIDDEN> <87jz5o9dj5.fsf@HIDDEN> <851a4f79-6789-4f60-9952-2f896b9ee187@HIDDEN> <87ikl6yem8.fsf@HIDDEN> <iersek7ab8d.fsf@HIDDEN> Date: Tue, 10 Jun 2025 18:54:12 +0200 Message-ID: <87sek7tu4r.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 77312 Cc: Spencer Baugh <sbaugh@HIDDEN>, 77312 <at> debbugs.gnu.org, Dmitry Gutov <dmitry@HIDDEN> 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 (-) Spencer Baugh via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN> writes: > Daniel Mendler <mail@HIDDEN> writes: > >> Dmitry Gutov <dmitry@HIDDEN> writes: >> >>> Hey Daniel! >>> >>> On 07/06/2025 11:11, Daniel Mendler wrote: >>>> Would it be possible to attach the buffer object or the original buffer >>>> name to the completion candidate string as text property? This would >>>> make it possible to attach annotations via Marginalia or to execute >>>> buffer actions via Embark. Otherwise I don't see a possibility to access >>>> the original buffer, since they are only present in the `unique-names` >>>> alist local variable. >>> >>> That makes sense. Just call the property 'buffer'? >> >> That would work. I prefer a more specific property name to ease >> grepping/debugging. Also see below regarding the consing. >> >>> I wonder if it would make sense to alter the calling convention for >>> uniquify-get-unique-names itself to return a list of propertized strings >>> instead. project--read-project-buffer can do the conversion (copy each string >>> and attach the property), but it's just extra consing. >> >> I haven't checked if the current function is already working hard to >> avoid unnecessary allocations. If yes, it would be wasteful to add extra >> string allocations. >> >> In order to avoid them, we could only attach the property if the buffer >> name has really changed, such that no strings have to be copied. The >> property could be called `uniquify-orig-buffer-name`. If the property is >> present, it holds the original buffer name, if it is not present the >> string itself is the original buffer name. > > All else being equal, I think changing uniquify-get-unique-names to > return a list of strings which have the original buffer names as a > property is a reasonable and easy thing to do. uniquify.el is generally > pretty allocation heavy, so I wouldn't worry about the excess > allocations, just stick the property on all the returned strings. Okay. > Some unnecessary speculation about alternatives to the text property > approach follows: > > One alternative to the text property approach is to have the alist > returned by uniquify-get-unique-names be let-bound in some special > variable around the call to completing-read. Then Embark/Marginalia > could look up strings in that alist to figure out the underlying buffer > that a string is referring to. Yes, this would work too. Or more ideally set a local variable in the minibuffer setup hook, since then buffer unification can be detected by checking if the variable is non-nil. >>> Unless some more new callers are going to prefer the current convention. >> >> Both would be fine for me. Generally I think it is nice to push >> functionality to the lower level API, as long as the functionality is >> generic enough. >> >> Btw, would you be interested in having `uniquify-get-unique-names' in >> Compat, such that you avoid the fboundp check? project.el would have to >> depend on Compat for that, but that's essentially free on Emacs 30 and >> newer. > > I think adding uniquify-get-unique-names to compat might be difficult > because it depends on non-trivial changes to the rest of the code in > uniquify.el. That's unfortunate. I have not looked in detail at it, but if the effort is disproportionate, and half of uniquify.el would need to be replicated, then we cannot port it back as part of Compat. Daniel
bug-gnu-emacs@HIDDEN
:bug#77312
; Package emacs
.
Full text available.Received: (at submit) by debbugs.gnu.org; 10 Jun 2025 16:54:48 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 10 12:54:48 2025 Received: from localhost ([127.0.0.1]:39349 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1uP2FI-0004Vd-Fd for submit <at> debbugs.gnu.org; Tue, 10 Jun 2025 12:54:48 -0400 Received: from lists.gnu.org ([2001:470:142::17]:35174) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1uP2FE-0004Tf-TS for submit <at> debbugs.gnu.org; Tue, 10 Jun 2025 12:54:41 -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 <mail@HIDDEN>) id 1uP2Ev-0002Gn-F1 for bug-gnu-emacs@HIDDEN; Tue, 10 Jun 2025 12:54:27 -0400 Received: from server.qxqx.de ([2a01:4f8:c012:9177::1] helo=mail.qxqx.de) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <mail@HIDDEN>) id 1uP2Eq-0001Il-UY for bug-gnu-emacs@HIDDEN; Tue, 10 Jun 2025 12:54:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Jzm8WmL1oV3yDpj23ahiLHFU7H42O/PVdqexMCV3sqo=; b=OBOGApwX7SUAWHhtUHkYIIfjMT Elek0xIAwOgmKOJJ7QC7vVx2keAFLBVTOkn9W77wJcwITb/5EUX1P8QsXMd9ntNvlasXBCXI0voxX Xm3GMrvbnx7UxPuieKTtd4idUOCIABuzetRHzOmoNP+AB1jkxjZEBQ5qE0JR1pxXtoH0=; From: Daniel Mendler <mail@HIDDEN> To: Spencer Baugh via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN> Subject: Re: bug#77312: [PATCH] Add uniquify-get-unique-names In-Reply-To: <iersek7ab8d.fsf@HIDDEN> References: <ierecyiseh6.fsf@HIDDEN> <iery0wpdm5o.fsf@HIDDEN> <e6dcfcd9-83d5-4f1f-9f77-a186cd4e5a00@HIDDEN> <5919de07-9849-4257-b448-af45f46b3181@HIDDEN> <87jz5o9dj5.fsf@HIDDEN> <851a4f79-6789-4f60-9952-2f896b9ee187@HIDDEN> <87ikl6yem8.fsf@HIDDEN> <iersek7ab8d.fsf@HIDDEN> Date: Tue, 10 Jun 2025 18:54:12 +0200 Message-ID: <87sek7tu4r.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a01:4f8:c012:9177::1; envelope-from=mail@HIDDEN; helo=mail.qxqx.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit Cc: Spencer Baugh <sbaugh@HIDDEN>, 77312 <at> debbugs.gnu.org, Dmitry Gutov <dmitry@HIDDEN> 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.1 (/) Spencer Baugh via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN> writes: > Daniel Mendler <mail@HIDDEN> writes: > >> Dmitry Gutov <dmitry@HIDDEN> writes: >> >>> Hey Daniel! >>> >>> On 07/06/2025 11:11, Daniel Mendler wrote: >>>> Would it be possible to attach the buffer object or the original buffer >>>> name to the completion candidate string as text property? This would >>>> make it possible to attach annotations via Marginalia or to execute >>>> buffer actions via Embark. Otherwise I don't see a possibility to access >>>> the original buffer, since they are only present in the `unique-names` >>>> alist local variable. >>> >>> That makes sense. Just call the property 'buffer'? >> >> That would work. I prefer a more specific property name to ease >> grepping/debugging. Also see below regarding the consing. >> >>> I wonder if it would make sense to alter the calling convention for >>> uniquify-get-unique-names itself to return a list of propertized strings >>> instead. project--read-project-buffer can do the conversion (copy each string >>> and attach the property), but it's just extra consing. >> >> I haven't checked if the current function is already working hard to >> avoid unnecessary allocations. If yes, it would be wasteful to add extra >> string allocations. >> >> In order to avoid them, we could only attach the property if the buffer >> name has really changed, such that no strings have to be copied. The >> property could be called `uniquify-orig-buffer-name`. If the property is >> present, it holds the original buffer name, if it is not present the >> string itself is the original buffer name. > > All else being equal, I think changing uniquify-get-unique-names to > return a list of strings which have the original buffer names as a > property is a reasonable and easy thing to do. uniquify.el is generally > pretty allocation heavy, so I wouldn't worry about the excess > allocations, just stick the property on all the returned strings. Okay. > Some unnecessary speculation about alternatives to the text property > approach follows: > > One alternative to the text property approach is to have the alist > returned by uniquify-get-unique-names be let-bound in some special > variable around the call to completing-read. Then Embark/Marginalia > could look up strings in that alist to figure out the underlying buffer > that a string is referring to. Yes, this would work too. Or more ideally set a local variable in the minibuffer setup hook, since then buffer unification can be detected by checking if the variable is non-nil. >>> Unless some more new callers are going to prefer the current convention. >> >> Both would be fine for me. Generally I think it is nice to push >> functionality to the lower level API, as long as the functionality is >> generic enough. >> >> Btw, would you be interested in having `uniquify-get-unique-names' in >> Compat, such that you avoid the fboundp check? project.el would have to >> depend on Compat for that, but that's essentially free on Emacs 30 and >> newer. > > I think adding uniquify-get-unique-names to compat might be difficult > because it depends on non-trivial changes to the rest of the code in > uniquify.el. That's unfortunate. I have not looked in detail at it, but if the effort is disproportionate, and half of uniquify.el would need to be replicated, then we cannot port it back as part of Compat. Daniel
bug-gnu-emacs@HIDDEN
:bug#77312
; Package emacs
.
Full text available.Received: (at 77312) by debbugs.gnu.org; 10 Jun 2025 15:05:16 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 10 11:05:16 2025 Received: from localhost ([127.0.0.1]:39144 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1uP0XL-0001B9-Ut for submit <at> debbugs.gnu.org; Tue, 10 Jun 2025 11:05:16 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:50057) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <sbaugh@HIDDEN>) id 1uP0XI-00019X-Ce for 77312 <at> debbugs.gnu.org; Tue, 10 Jun 2025 11:05:13 -0400 From: Spencer Baugh <sbaugh@HIDDEN> To: Daniel Mendler <mail@HIDDEN> Subject: Re: bug#77312: [PATCH] Add uniquify-get-unique-names In-Reply-To: <87ikl6yem8.fsf@HIDDEN> (Daniel Mendler's message of "Sun, 08 Jun 2025 07:41:19 +0200") References: <ierecyiseh6.fsf@HIDDEN> <iery0wpdm5o.fsf@HIDDEN> <e6dcfcd9-83d5-4f1f-9f77-a186cd4e5a00@HIDDEN> <5919de07-9849-4257-b448-af45f46b3181@HIDDEN> <87jz5o9dj5.fsf@HIDDEN> <851a4f79-6789-4f60-9952-2f896b9ee187@HIDDEN> <87ikl6yem8.fsf@HIDDEN> Date: Tue, 10 Jun 2025 11:05:06 -0400 Message-ID: <iersek7ab8d.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1749567906; bh=NQ2NnqzZo7g0MfD4fRH/23FOPpdiLNiqg1IALI+bIMM=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=U0rMU2ZiPUyApu7lKZTC8yG/uGL4jAQSMQv8InS9tYuREJQeDWbZFnidZrua6xGTF Ee8dhkKyD9mYbNm44o81Ws0JQLJsidf9Ai2XLgdSmT88gzUWQ9p4TWhudoTTElz14Q YG4VC4o6851aY+rF7jp4HjF77zk7EAmWJOm7hDDzbZeamF6yzN4qjVbj/eslP/TWsh NvFubBHXeNfbABFISBWVRtZk1+St8/H0QCCOjtXRWvauiDPKN3LWAukEg61cjziIfw INoahx6A0oOzXo1suXaydQVeoPs654DrjfXbveQn7FTOeqwp6ZiYCjHw8t8D/Ra34y TusfxzGWIyA9w== X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77312 Cc: Dmitry Gutov <dmitry@HIDDEN>, 77312 <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 (---) Daniel Mendler <mail@HIDDEN> writes: > Dmitry Gutov <dmitry@HIDDEN> writes: > >> Hey Daniel! >> >> On 07/06/2025 11:11, Daniel Mendler wrote: >>> Would it be possible to attach the buffer object or the original buffer >>> name to the completion candidate string as text property? This would >>> make it possible to attach annotations via Marginalia or to execute >>> buffer actions via Embark. Otherwise I don't see a possibility to access >>> the original buffer, since they are only present in the `unique-names` >>> alist local variable. >> >> That makes sense. Just call the property 'buffer'? > > That would work. I prefer a more specific property name to ease > grepping/debugging. Also see below regarding the consing. > >> I wonder if it would make sense to alter the calling convention for >> uniquify-get-unique-names itself to return a list of propertized strings >> instead. project--read-project-buffer can do the conversion (copy each string >> and attach the property), but it's just extra consing. > > I haven't checked if the current function is already working hard to > avoid unnecessary allocations. If yes, it would be wasteful to add extra > string allocations. > > In order to avoid them, we could only attach the property if the buffer > name has really changed, such that no strings have to be copied. The > property could be called `uniquify-orig-buffer-name`. If the property is > present, it holds the original buffer name, if it is not present the > string itself is the original buffer name. All else being equal, I think changing uniquify-get-unique-names to return a list of strings which have the original buffer names as a property is a reasonable and easy thing to do. uniquify.el is generally pretty allocation heavy, so I wouldn't worry about the excess allocations, just stick the property on all the returned strings. Also, some future work I was considering, which I hope we can accomodate: making this be internal functionality of read-buffer. That is, when read-buffer is passed a predicate, it could: - use the predicate to filter the buffers - then use uniquify-get-unique-names to get less-verbose buffer names - then call completing-read with those buffer names I think the text property approach would indeed work with this, but just mentioning it. Some unnecessary speculation about alternatives to the text property approach follows: One alternative to the text property approach is to have the alist returned by uniquify-get-unique-names be let-bound in some special variable around the call to completing-read. Then Embark/Marginalia could look up strings in that alist to figure out the underlying buffer that a string is referring to. Or, we could have a completion table action (ACTION='get-buffer or something) which ignores PRED and returns the buffer corresponding to the passed in STRING. No new special variables at all. I am reminded of the perennial discussions about how completing-read is an API for "read string with completion", not "select a value by its string name from a set of possible values", maybe this would be useful for that...) >> Unless some more new callers are going to prefer the current convention. > > Both would be fine for me. Generally I think it is nice to push > functionality to the lower level API, as long as the functionality is > generic enough. > > Btw, would you be interested in having `uniquify-get-unique-names' in > Compat, such that you avoid the fboundp check? project.el would have to > depend on Compat for that, but that's essentially free on Emacs 30 and > newer. I think adding uniquify-get-unique-names to compat might be difficult because it depends on non-trivial changes to the rest of the code in uniquify.el.
bug-gnu-emacs@HIDDEN
:bug#77312
; Package emacs
.
Full text available.Received: (at 77312) by debbugs.gnu.org; 10 Jun 2025 03:14:44 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 09 23:14:43 2025 Received: from localhost ([127.0.0.1]:59702 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1uOpRg-0006ki-Uq for submit <at> debbugs.gnu.org; Mon, 09 Jun 2025 23:14:43 -0400 Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:39375 helo=mail.qxqx.de) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1uOpRc-0006j5-VM for 77312 <at> debbugs.gnu.org; Mon, 09 Jun 2025 23:14:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=qg8cZM6YKywqwYu0Y83f/muPz27T0j5dDfux86bbpvQ=; b=uPEGRmFisPFFyTNkW/tM4HFAwR l7+jaeIzlcU3eIhoxJcwUI6J14bkmM+lykcjcR1+Hnk6InJKf2sD4UHy644dyALgOtV2eygNQ56+U TgeZBIw0Ct1ag9ggB9sngW6ZOJcegrnVYk7pi8P6oSnw2eWcewqtZ5/+bOfaNZPXV750=; From: Daniel Mendler <mail@HIDDEN> To: Dmitry Gutov <dmitry@HIDDEN> Subject: Re: bug#77312: [PATCH] Add uniquify-get-unique-names In-Reply-To: <1ac34a13-b0be-4229-a0ac-a9b6507dcfd0@HIDDEN> References: <ierecyiseh6.fsf@HIDDEN> <iery0wpdm5o.fsf@HIDDEN> <e6dcfcd9-83d5-4f1f-9f77-a186cd4e5a00@HIDDEN> <5919de07-9849-4257-b448-af45f46b3181@HIDDEN> <87jz5o9dj5.fsf@HIDDEN> <851a4f79-6789-4f60-9952-2f896b9ee187@HIDDEN> <87ikl6yem8.fsf@HIDDEN> <1ac34a13-b0be-4229-a0ac-a9b6507dcfd0@HIDDEN> Date: Tue, 10 Jun 2025 05:14:28 +0200 Message-ID: <87plfc70ff.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 77312 Cc: sbaugh@HIDDEN, 77312 <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 (-) Dmitry Gutov <dmitry@HIDDEN> writes: >> Btw, would you be interested in having `uniquify-get-unique-names' in >> Compat, such that you avoid the fboundp check? project.el would have to >> depend on Compat for that, but that's essentially free on Emacs 30 and >> newer. > > I usually try to avoid extra deps, but this can make sense, at least for users > of Emacs>30. Especially if it leads to simplification in multiple places. I also find it good to avoid extra deps, in particular if they introduce their own idioms. Compat doesn't invent functionality, it just provides some APIs from the latest stable Emacs versions, so it will help keeping your code up to date. Compat is made such that the dependency cost is minimized, since it is not installed if Emacs is sufficiently new. > Can you see other compatibility checks we could forgo this way? Offhand, I see > another fboundp in 'project-ignores' (default definition) and a version< inside > 'project-list-buffers-buffer-menu'. I think these checks cannot be avoided. But you could start using some new functions or macros like `defvar-keymap'. See the Compat manual for a list of backported functionality. Daniel
bug-gnu-emacs@HIDDEN
:bug#77312
; Package emacs
.
Full text available.Received: (at 77312) by debbugs.gnu.org; 10 Jun 2025 02:51:48 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 09 22:51:48 2025 Received: from localhost ([127.0.0.1]:59624 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1uOp5V-0003AM-MT for submit <at> debbugs.gnu.org; Mon, 09 Jun 2025 22:51:48 -0400 Received: from fout-b3-smtp.messagingengine.com ([202.12.124.146]:34373) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <dmitry@HIDDEN>) id 1uOp5R-00038X-Ir for 77312 <at> debbugs.gnu.org; Mon, 09 Jun 2025 22:51:43 -0400 Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfout.stl.internal (Postfix) with ESMTP id 524661140173; Mon, 9 Jun 2025 22:51:35 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Mon, 09 Jun 2025 22:51:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1749523895; x=1749610295; bh=oG9IYhoEhO49Rqv+elbKRjEkJhIeKAyvR4sb7nM4A1I=; b= QbPUKUBpJKmhpG/Hw/tN7am0MoWerlRegsw9D418yORv9rXrX69xff0t6fh3eX0/ CowulyIKKm4YFm5WGP9hsMwr2eioPkFi7LRRchlErsGY/CnK760MMwu2g2glOCaQ aQRHRRUzy8IcNRY+5u5eXsUB6YKIKGp5sxx3cfL9cSFMyGX0XORQ7EdIVWxgMnoR VfuOa3ffkS9gv8I5mfpu6kzU6Uc8cDevHuLMN296Z1SBVBhZIGU5wnZ4w3sLLZMz 5XmLTyshjc/DO23GIkW46OWllk6Ri0hSxiQEaG2Ad2Y5ocH/3ERLynfcxK33aUWo +66q8MPKhB2hw4zbBH4gQQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1749523895; x= 1749610295; bh=oG9IYhoEhO49Rqv+elbKRjEkJhIeKAyvR4sb7nM4A1I=; b=e InY+FBRC/Ng73sF0WW27yxBzWzvO1xxySxlygzntDR28EpB3jGLj7ctXXvhnw7eJ t+CqMt/1f8nEcSDFDHgiATMuef0KUte92dsc02ov4sgP2elT4orrROKhw8ldiqWH R5lvMb5VO3UfFIx2o/2Ka9Lv5WwXbnb8l7nYWn1Cp74uH876skJd43YL/x5av612 XtZ92Htjmusvw1Uh8lPzCeVlkqMPJ7h94fbpBJlFE4FEGFCt3cSxG+4uLyl0yjR7 kTuDoUgh6bshQB72TK07zoGEpaycM3KK9lLZPDaBkNZwEa4JZuxyEUdQ1t72Qht+ V4q94oubiRVG3ifCJN5yg== X-ME-Sender: <xms:tp1HaBgRnGAr5mnV8sIv_oCiH6BMis1JBXS62FUSUi--AXFN1v8FFg> <xme:tp1HaGDz5DOnNWBwfm3esnc_4T-_dy5IZhj-AqX1DBRD1X88qGKaXgESMHQFrO0z4 _9A6XxvxlmbvI5MC0E> X-ME-Received: <xmr:tp1HaBE4BF9uWo1QWWutGfNf-HencgzrU_uVrZOtMF8-ZqzfTyIAYzXqoLgIiT-_> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddugddutdduhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgg gfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhithhrhicuifhuthho vhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrthhtvghrnheptedule ejgeehtefgheegjeekueehvdevieekueeftddvtdevfefhvdevgedujeehnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepughmihhtrhihsehguh htohhvrdguvghvpdhnsggprhgtphhtthhopeefpdhmohguvgepshhmthhpohhuthdprhgt phhtthhopehmrghilhesuggrnhhivghlqdhmvghnughlvghrrdguvgdprhgtphhtthhope ejjeefuddvseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepshgsrghughhh sehjrghnvghsthhrvggvthdrtghomh X-ME-Proxy: <xmx:tp1HaGSRuvHA_IwlDPjYyKDV8aAXK4HqcND63gE1OgBMPMd4RD4Q8Q> <xmx:tp1HaOyDg4f9FR2X_DmocyYMAaJnj46k_QeKqFZP9iyb1rlFvZtkiQ> <xmx:tp1HaM7P-6GH2tG4Icy6iIF4IjvWynQnLNjehKxEgAryJxp0IjJT2w> <xmx:tp1HaDwgcN2T2fNN7sZnR0dZ_G-jrFI17CZKeV-PLJ5fbrBRALC0Xw> <xmx:t51HaCX8pWW4rFxN2gdnSAi6JrL02nNpTZ-6nr7g6JyJbvrZFPlJbotV> Feedback-ID: i07de48aa:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 9 Jun 2025 22:51:33 -0400 (EDT) Message-ID: <1ac34a13-b0be-4229-a0ac-a9b6507dcfd0@HIDDEN> Date: Tue, 10 Jun 2025 05:51:29 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#77312: [PATCH] Add uniquify-get-unique-names To: Daniel Mendler <mail@HIDDEN> References: <ierecyiseh6.fsf@HIDDEN> <iery0wpdm5o.fsf@HIDDEN> <e6dcfcd9-83d5-4f1f-9f77-a186cd4e5a00@HIDDEN> <5919de07-9849-4257-b448-af45f46b3181@HIDDEN> <87jz5o9dj5.fsf@HIDDEN> <851a4f79-6789-4f60-9952-2f896b9ee187@HIDDEN> <87ikl6yem8.fsf@HIDDEN> Content-Language: en-US From: Dmitry Gutov <dmitry@HIDDEN> In-Reply-To: <87ikl6yem8.fsf@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 77312 Cc: sbaugh@HIDDEN, 77312 <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 (-) On 08/06/2025 08:41, Daniel Mendler wrote: >> On 07/06/2025 11:11, Daniel Mendler wrote: >>> Would it be possible to attach the buffer object or the original buffer >>> name to the completion candidate string as text property? This would >>> make it possible to attach annotations via Marginalia or to execute >>> buffer actions via Embark. Otherwise I don't see a possibility to access >>> the original buffer, since they are only present in the `unique-names` >>> alist local variable. >> >> That makes sense. Just call the property 'buffer'? > > That would work. I prefer a more specific property name to ease > grepping/debugging. Also see below regarding the consing. All right. >> I wonder if it would make sense to alter the calling convention for >> uniquify-get-unique-names itself to return a list of propertized strings >> instead. project--read-project-buffer can do the conversion (copy each string >> and attach the property), but it's just extra consing. > > I haven't checked if the current function is already working hard to > avoid unnecessary allocations. If yes, it would be wasteful to add extra > string allocations. Also when you provide the same information via different ways, over time they tend to get out of sync. The simpler the better. > In order to avoid them, we could only attach the property if the buffer > name has really changed, such that no strings have to be copied. The > property could be called `uniquify-orig-buffer-name`. If the property is > present, it holds the original buffer name, if it is not present the > string itself is the original buffer name. Yeah, that's a good idea. > Btw, would you be interested in having `uniquify-get-unique-names' in > Compat, such that you avoid the fboundp check? project.el would have to > depend on Compat for that, but that's essentially free on Emacs 30 and > newer. I usually try to avoid extra deps, but this can make sense, at least for users of Emacs>30. Especially if it leads to simplification in multiple places. Can you see other compatibility checks we could forgo this way? Offhand, I see another fboundp in 'project-ignores' (default definition) and a version< inside 'project-list-buffers-buffer-menu'.
bug-gnu-emacs@HIDDEN
:bug#77312
; Package emacs
.
Full text available.Received: (at 77312) by debbugs.gnu.org; 8 Jun 2025 05:41:31 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 08 01:41:31 2025 Received: from localhost ([127.0.0.1]:50440 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1uO8mh-0000fu-2H for submit <at> debbugs.gnu.org; Sun, 08 Jun 2025 01:41:31 -0400 Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:49797 helo=mail.qxqx.de) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1uO8me-0000fZ-Bp for 77312 <at> debbugs.gnu.org; Sun, 08 Jun 2025 01:41:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=IYp8Wlykf9ZCyOBZWmXRObtgCJi0oPQtPRPcu6FGG3c=; b=HPZyKSNU3S2fHJ8ZKwJRyz0yoV SjTfesxqGkJzrtwr6kVVIVPfhnCxb1fuk7bbpYC5WcFQfd3UEwBIoltWeEH7xFrNmWy/CIKUSuCMO bUPst0QA2J0azttOWgT9i9UuV3iWTcu0BIP9Z7saDBe07wSCpPo33lPNGxF51W0y6Ay8=; From: Daniel Mendler <mail@HIDDEN> To: Dmitry Gutov <dmitry@HIDDEN> Subject: Re: bug#77312: [PATCH] Add uniquify-get-unique-names In-Reply-To: <851a4f79-6789-4f60-9952-2f896b9ee187@HIDDEN> References: <ierecyiseh6.fsf@HIDDEN> <iery0wpdm5o.fsf@HIDDEN> <e6dcfcd9-83d5-4f1f-9f77-a186cd4e5a00@HIDDEN> <5919de07-9849-4257-b448-af45f46b3181@HIDDEN> <87jz5o9dj5.fsf@HIDDEN> <851a4f79-6789-4f60-9952-2f896b9ee187@HIDDEN> Date: Sun, 08 Jun 2025 07:41:19 +0200 Message-ID: <87ikl6yem8.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 77312 Cc: sbaugh@HIDDEN, 77312 <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 (-) Dmitry Gutov <dmitry@HIDDEN> writes: > Hey Daniel! > > On 07/06/2025 11:11, Daniel Mendler wrote: >> Would it be possible to attach the buffer object or the original buffer >> name to the completion candidate string as text property? This would >> make it possible to attach annotations via Marginalia or to execute >> buffer actions via Embark. Otherwise I don't see a possibility to access >> the original buffer, since they are only present in the `unique-names` >> alist local variable. > > That makes sense. Just call the property 'buffer'? That would work. I prefer a more specific property name to ease grepping/debugging. Also see below regarding the consing. > I wonder if it would make sense to alter the calling convention for > uniquify-get-unique-names itself to return a list of propertized strings > instead. project--read-project-buffer can do the conversion (copy each string > and attach the property), but it's just extra consing. I haven't checked if the current function is already working hard to avoid unnecessary allocations. If yes, it would be wasteful to add extra string allocations. In order to avoid them, we could only attach the property if the buffer name has really changed, such that no strings have to be copied. The property could be called `uniquify-orig-buffer-name`. If the property is present, it holds the original buffer name, if it is not present the string itself is the original buffer name. > Unless some more new callers are going to prefer the current convention. Both would be fine for me. Generally I think it is nice to push functionality to the lower level API, as long as the functionality is generic enough. Btw, would you be interested in having `uniquify-get-unique-names' in Compat, such that you avoid the fboundp check? project.el would have to depend on Compat for that, but that's essentially free on Emacs 30 and newer. Daniel
bug-gnu-emacs@HIDDEN
:bug#77312
; Package emacs
.
Full text available.Received: (at 77312) by debbugs.gnu.org; 8 Jun 2025 02:06:55 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 07 22:06:55 2025 Received: from localhost ([127.0.0.1]:50176 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1uO5R0-0007Br-Qh for submit <at> debbugs.gnu.org; Sat, 07 Jun 2025 22:06:55 -0400 Received: from fout-a8-smtp.messagingengine.com ([103.168.172.151]:35819) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <dmitry@HIDDEN>) id 1uO5Qs-0007BV-TI for 77312 <at> debbugs.gnu.org; Sat, 07 Jun 2025 22:06:51 -0400 Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 492D5138013A; Sat, 7 Jun 2025 22:06:41 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Sat, 07 Jun 2025 22:06:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1749348401; x=1749434801; bh=gOADxLSs7QCCurTNSruUGQOySfoVES/5kNuxZVC13zg=; b= cDZ8319gZ4VCq6wWuOwjmRpRulu+sVEVeN98v0EcAQ087hxaYyV/gfRF01qQtUrh Qb2//SV5cgTZ+rf9sw82wZCxOw/V2+9ST+W1rMt8a2YByeC3nC6aRzv9rLSALbDi YAT+TgOcF/9B1AefPADKvVkaPL7XGaxOeyBLrkN9DPbyOA0T+Zmmovt28pxssNMf 2fFy/B3SAi0mHx3L/RyNpjOyk+yCVyY4w0zk8R9jpv5sh25cZylI9GF4eMCKbMir 4qT9AL5BrIMKsyKW+kVWOYGmj/faQaT6vu6gYa4sVnwiTYWfgEOA8aIcZc3Ax19u cd1qsAvmRlQyzosaYcKfnA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1749348401; x= 1749434801; bh=gOADxLSs7QCCurTNSruUGQOySfoVES/5kNuxZVC13zg=; b=Y xfRlCpBELrHs2Sb93h+Fv1LN1/prdIthHLICfoCbONJRoSTmDbyEUIrEJhzHxYff R3RBF7VsiaUGmMAp5P/FglmoGBCzFAgRGlDq/ioGxuBwgYJ8BI4/Z+yOY33MAs53 5vXJExnCh4XyrTTyjcamz70A51PL2q8imDGedII7n7rvDeLcNtOL1PtepxeLLv0X OtdEK/rpDyYsglmxHiby8Q42fcC4TsEPOIQfvg4t+sveMGhGzbfwl2ycWC/LXSJS NVibj/cQXIk1PaQdrkE7reS7xCPeebHWvGcP+ghbRV5AGAIlXw5UOxh1dWW7Wz9P Wpy3QGIaXaz2BUoWUD01g== X-ME-Sender: <xms:MPBEaIwkO2vchUT186JOTmZCJY23LWS9spLLKDokH8tfDd4GBcpu7g> <xme:MPBEaMRzCiwuPkdRZ0EAwizGotXImP7a7V3ltDbOHpI9SM8znwuAZBheDyNRhQ8MN PanPe0P4K39L3Hk1Ng> X-ME-Received: <xmr:MPBEaKW6hcwAFKvkMWYbSQTFCWiVx8uilkS9l8jbC71-dYuXEIh7WwJIQFuckaGU> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddugdejfeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfg fuvfevfhfhjggtgfesthejredttddvjeenucfhrhhomhepffhmihhtrhihucfiuhhtohhv uceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtthgvrhhnpeetudelje egheetgfehgeejkeeuhedvveeikeeufedtvddtveefhfdvveegudejheenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumhhithhrhiesghhuth hovhdruggvvhdpnhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghp thhtohepmhgrihhlsegurghnihgvlhdqmhgvnhgulhgvrhdruggvpdhrtghpthhtohepje ejfeduvdesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopehssggruhhghhes jhgrnhgvshhtrhgvvghtrdgtohhm X-ME-Proxy: <xmx:MPBEaGgioKVnGFJtwIIxGXgIHSB0ZtwSXjHqjy-eKDdzkKw8DS9Rhg> <xmx:MPBEaKDaO4gGLnGo9w0yV2KVNqG_L9Dun7c_GM58R4qFv6g7XabAIw> <xmx:MPBEaHJyTpREkGncSe5SIwN4dmv9GbfTuKOTaY05LYtvU0_D6o80uw> <xmx:MPBEaBC47m-ZmqR2iWOze7NJ-2U3lU-w7I9R1b3PqgOdm6CqVpvuoQ> <xmx:MfBEaIo49BXCPgMIkpaN5lU7anz36Y3Jb94h-SWv-m_nXpg5LbgEMD43> Feedback-ID: i07de48aa:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 7 Jun 2025 22:06:39 -0400 (EDT) Message-ID: <851a4f79-6789-4f60-9952-2f896b9ee187@HIDDEN> Date: Sun, 8 Jun 2025 05:06:36 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#77312: [PATCH] Add uniquify-get-unique-names To: Daniel Mendler <mail@HIDDEN>, 77312 <at> debbugs.gnu.org References: <ierecyiseh6.fsf@HIDDEN> <iery0wpdm5o.fsf@HIDDEN> <e6dcfcd9-83d5-4f1f-9f77-a186cd4e5a00@HIDDEN> <5919de07-9849-4257-b448-af45f46b3181@HIDDEN> <87jz5o9dj5.fsf@HIDDEN> Content-Language: en-US From: Dmitry Gutov <dmitry@HIDDEN> In-Reply-To: <87jz5o9dj5.fsf@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 77312 Cc: sbaugh@HIDDEN 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 (-) Hey Daniel! On 07/06/2025 11:11, Daniel Mendler wrote: > Would it be possible to attach the buffer object or the original buffer > name to the completion candidate string as text property? This would > make it possible to attach annotations via Marginalia or to execute > buffer actions via Embark. Otherwise I don't see a possibility to access > the original buffer, since they are only present in the `unique-names` > alist local variable. That makes sense. Just call the property 'buffer'? I wonder if it would make sense to alter the calling convention for uniquify-get-unique-names itself to return a list of propertized strings instead. project--read-project-buffer can do the conversion (copy each string and attach the property), but it's just extra consing. Unless some more new callers are going to prefer the current convention.
bug-gnu-emacs@HIDDEN
:bug#77312
; Package emacs
.
Full text available.Received: (at 77312) by debbugs.gnu.org; 7 Jun 2025 08:11:53 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 07 04:11:53 2025 Received: from localhost ([127.0.0.1]:46666 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1uNoef-00047V-Dm for submit <at> debbugs.gnu.org; Sat, 07 Jun 2025 04:11:53 -0400 Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:43147 helo=mail.qxqx.de) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1uNoec-000478-D1 for 77312 <at> debbugs.gnu.org; Sat, 07 Jun 2025 04:11:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=vyFCT245TbkkokpRqPYjHzmTFCUuaDB551w9BR/qXXA=; b=LCcLDwgUEuz37tloTqagQOkKSZ zeO9ckp3/Ztg/PDfO8VSTPOgwpdj9yBKshWUpBDoqfA1kMkMAEHlpMSIKToGelw0ugpRzgPoQb9lL WSDmzdhPSAZGUeSYckRvsKTeTlmRq9aH2mtHJgBYZtUXkMGQ29nTGlbo16wEOciSMzY8=; From: Daniel Mendler <mail@HIDDEN> To: 77312 <at> debbugs.gnu.org Subject: Re: bug#77312: [PATCH] Add uniquify-get-unique-names In-Reply-To: <5919de07-9849-4257-b448-af45f46b3181@HIDDEN> References: <ierecyiseh6.fsf@HIDDEN> <iery0wpdm5o.fsf@HIDDEN> <e6dcfcd9-83d5-4f1f-9f77-a186cd4e5a00@HIDDEN> <5919de07-9849-4257-b448-af45f46b3181@HIDDEN> Date: Sat, 07 Jun 2025 10:11:42 +0200 Message-ID: <87jz5o9dj5.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 77312 Cc: dmitry@HIDDEN, sbaugh@HIDDEN 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 (-) Hello Dmitry! Dmitry Gutov <dmitry@HIDDEN> writes: > On 31/03/2025 22:58, Dmitry Gutov wrote: >> Here's the corresponding patch to project.el to use the new function. >> The use of new logic is predicated on the non-nil value of uniquify- >> buffer-name-style. The latter doesn't necessarily imply that the user wants >> the former, but seems a safe enough bet. > > No further comments from anybody, so I've pushed the two patches and am closing > the bug. > > If anybody dislikes the change in project-switch-to-buffer's behavior, let me > know. Would it be possible to attach the buffer object or the original buffer name to the completion candidate string as text property? This would make it possible to attach annotations via Marginalia or to execute buffer actions via Embark. Otherwise I don't see a possibility to access the original buffer, since they are only present in the `unique-names` alist local variable. Daniel
bug-gnu-emacs@HIDDEN
:bug#77312
; Package emacs
.
Full text available.Received: (at 77312-done) by debbugs.gnu.org; 6 Jun 2025 02:45:35 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 05 22:45:35 2025 Received: from localhost ([127.0.0.1]:40187 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1uNN5L-0006Ri-3O for submit <at> debbugs.gnu.org; Thu, 05 Jun 2025 22:45:35 -0400 Received: from fout-b8-smtp.messagingengine.com ([202.12.124.151]:51169) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <dmitry@HIDDEN>) id 1uNN5H-0006RE-SP for 77312-done <at> debbugs.gnu.org; Thu, 05 Jun 2025 22:45:32 -0400 Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfout.stl.internal (Postfix) with ESMTP id 76AB21140154; Thu, 5 Jun 2025 22:45:25 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Thu, 05 Jun 2025 22:45:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1749177925; x=1749264325; bh=GnThgPayWp1mXIQ2v9NhD3t9EUJdv7E2GIexgtg7yMY=; b= SBoBYQwcJIn8lAF1u4JfmpAeD/fTeQRd09I1kEfkbBfM73JDsAox+DZXfuw3SsKd awmLsENixqPSnw9NJKgNVIix8ezSoGef/P31RX7q50i3KE58sVeC4uoreJjwN3od 58La2FfMt1RrEIpjm/vkSq0IVawfwD7x7I6l8XUZMxZoBO1YXqUtr8Rrq6unViAv OwTl1PWRgfNwuphC2jRzb/h5Y7YCYEMzlHRImq+EQVDc3uzAUTOkUzsi/SpiQ8PJ qtJOcmllLAm8fMPJrGTNuYww5yyPSTXD++b6ZvklIdo7CWVZRm+JiHGjaqgvcSpP RDfIbS7YzMBZK56Dozh52A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1749177925; x=1749264325; bh=G nThgPayWp1mXIQ2v9NhD3t9EUJdv7E2GIexgtg7yMY=; b=jBoJPHuhy5oPi7Vbm KA/EXO2qzLD80mk1pZr4TDFa1heKMDpqvYul47bFigYKyGktoGbbQSI65YbNa61Z 8kCHN+8rRNjTt9M9YGO45PCpExaRL6r1kW52FiQ6UcJ0ywQJL6mbPckRBz79+zgy +2ncccosSelfPiMZu706q1wx3zv5t1v1puGyzBkKImdSM1pmdF0toPVakS5CYxt0 /1gD9FEb1n/FaM/3ZqBWpffDpkV239F0KR0VNRdVfPuPpscH6SKbsRCGepuVwNMW A6MpfP+Nnp+baBzVqDb4gBtz7X3LbvFVHqASd8qwLAWCBYukOYDL59JxbqdIGS3k E7Ekg== X-ME-Sender: <xms:RFZCaBeHeqjvdXX4dbXhw0mF92phOSlPZbu4Yi9ouaF8LT5SmqpaHw> <xme:RFZCaPNKtJR7WrbhtAtW_epAgFgwHb6P0gtHd0Ojb-outjya_yvAyuq6PEaKCzA9f NPds_WGdFPeqzK4rrI> X-ME-Received: <xmr:RFZCaKiTfhUSQvZzsIExHHZ1nh8UlqOAJrcyx4NgS_dhym_f02BOllB6F-1ZJnvE> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddugdeggeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffhvfhfjggtgfesthejredttddvjeen ucfhrhhomhepffhmihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvg hvqeenucggtffrrghtthgvrhhnpefgieetieduhfefgeegveekfeevfeevjedtleejgeei vdevudefvedtkeegiedvleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvhdpnhgspghrtghpthhtohep vddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepshgsrghughhhsehjrghnvghsth hrvggvthdrtghomhdprhgtphhtthhopeejjeefuddvqdguohhnvgesuggvsggsuhhgshdr ghhnuhdrohhrgh X-ME-Proxy: <xmx:RVZCaK86UfMQGC7GWpvrdde2yKbXaX745XLTeLsiMv-jIXEINRYftA> <xmx:RVZCaNv65qs80DE17N7N-IGL_s7wY1xVPjaHKd8HVhNJnTiHHtfJ7Q> <xmx:RVZCaJEthGM2c792EiQV2Bi2u56-eAA3KYgRz738mXprXEGVygJoWA> <xmx:RVZCaEM-gVJ4z7Q4DkDnCiIPBXOLsyOUcwUwQgyK7Rkyx2i4G1gOgQ> <xmx:RVZCaLhzryUe_X930kBg5vPtrVHGQrLjY_NO75z24ksjvoZCt4C7087e> Feedback-ID: i07de48aa:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 5 Jun 2025 22:45:24 -0400 (EDT) Message-ID: <5919de07-9849-4257-b448-af45f46b3181@HIDDEN> Date: Fri, 6 Jun 2025 05:45:22 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#77312: [PATCH] Add uniquify-get-unique-names From: Dmitry Gutov <dmitry@HIDDEN> To: Spencer Baugh <sbaugh@HIDDEN>, 77312-done <at> debbugs.gnu.org References: <ierecyiseh6.fsf@HIDDEN> <iery0wpdm5o.fsf@HIDDEN> <e6dcfcd9-83d5-4f1f-9f77-a186cd4e5a00@HIDDEN> Content-Language: en-US In-Reply-To: <e6dcfcd9-83d5-4f1f-9f77-a186cd4e5a00@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 77312-done 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 (-) On 31/03/2025 22:58, Dmitry Gutov wrote: > Here's the corresponding patch to project.el to use the new function. > > The use of new logic is predicated on the non-nil value of uniquify- > buffer-name-style. The latter doesn't necessarily imply that the user > wants the former, but seems a safe enough bet. No further comments from anybody, so I've pushed the two patches and am closing the bug. If anybody dislikes the change in project-switch-to-buffer's behavior, let me know.
Spencer Baugh <sbaugh@HIDDEN>
:Dmitry Gutov <dmitry@HIDDEN>
:Received: (at 77312) by debbugs.gnu.org; 31 Mar 2025 19:58:32 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 31 15:58:31 2025 Received: from localhost ([127.0.0.1]:42982 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tzLHD-0005d8-Bs for submit <at> debbugs.gnu.org; Mon, 31 Mar 2025 15:58:31 -0400 Received: from fhigh-b5-smtp.messagingengine.com ([202.12.124.156]:40079) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <dmitry@HIDDEN>) id 1tzLHA-0005cJ-3R for 77312 <at> debbugs.gnu.org; Mon, 31 Mar 2025 15:58:29 -0400 Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfhigh.stl.internal (Postfix) with ESMTP id A407825401DD; Mon, 31 Mar 2025 15:58:22 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Mon, 31 Mar 2025 15:58:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1743451102; x=1743537502; bh=gkHdxZF9eb hd29fiYtgl7tLIHFMyyTUjCVbGKtX1hzE=; b=HbxV/IOO0NVKMti70WoXvKyUUO WwmnE7AR/ei66xTD6N3PyGSwJoFLbJDJCpfNBlA7dDnipthEfN8ZrzjrGeQW3Ui+ 0vcESonjZLmd1TpsrA6oHdFAoI0uv8RbM2u1XO7+Zut8IlCc/2CMnDx457pLouO7 oJ/eHkVT7fT6Jqo1/D63ME/iOifBzPlKZ7IeGJEQ5mW2/jI8e0IIsFUwhhYJdFDb 16HeHm6C3R4pjNnwU/OHBeg7msYfIvv7fD4edN8nIGiN8o2SxtZ5gSx66BPv+8DL JQsjH0sI5F4tXaeNSQ21lmd3EPaR4d5/XT1DRBoVmi9N5s1KY228HsSrWmuA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1743451102; x=1743537502; bh=gkHdxZF9ebhd29fiYtgl7tLIHFMyyTUjCVb GKtX1hzE=; b=ZxvD9trTlFRy7jRRZndsDRDAXL+DSwjazbp0n+qFNY/hqkQ8Y6P Mz/PEoB0yIkntQTKUaiMyJj58cYM4U3YnUtDIPS/gVkKZi/XzLOP/V5MTzFboLI2 6ixBLQw74MjQjGc1tHqBF0OwiFQtfh5ZG6ACNbjEUOlKMykYh+jHNnZ/W119FgbW qtuWZeYZwufUi2DpfSkANBibTWeTnoBWXA0lHgBMttrKiX+UUiMvP/9/xT2PxE2/ uujRHJ9tQgXqFjtHS6M8qA1V4GOqr43bol2d6TEYXlve4YX9yxxgyYORMjv89Heo kFE9xCdkziSQ9uIDyc5IQbw6WkCqTKZ0FzQ== X-ME-Sender: <xms:3vPqZ3ltdABbFbQZ9zGDxGr4eV4CFZS2I6QuKS6QxQ_hCr2aGDCcBg> <xme:3vPqZ61ub-0ftd7aFf-k4OIcMz6fQsc9o3GVFbpeDrIEEyuKAgO2byAgqwtuBmAsh JrNv34iGznfSrRapg8> X-ME-Received: <xmr:3vPqZ9rlvTpzfd6xhQAkS6dW2oR8Kycwe75VJ1ofAfxUGDnxU-KCCp0gDW500hfck6bZ> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddukedtkedvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurheptgfkffggfgfuvfhfhfgjsehmtderredtvdej necuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdrug gvvheqnecuggftrfgrthhtvghrnhepkefhieejheehjefhhefhuddvteettedvgeelteei geelueegheffueffleduvdffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghvpdhnsggprhgtphhtthho pedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehssggruhhghhesjhgrnhgvsh htrhgvvghtrdgtohhmpdhrtghpthhtohepjeejfeduvdesuggvsggsuhhgshdrghhnuhdr ohhrgh X-ME-Proxy: <xmx:3vPqZ_klONUvMyFz_7CC3Lvde3XgRvBBzh573MRlL8Kx4N4xamlGGQ> <xmx:3vPqZ12l1WanhaLdBq6uWyjYSx0JRu1Ez9ggbwfhvoEXQ5DfyY5U7w> <xmx:3vPqZ-uSK1ScDSSsV4vWnsKJQ021UVU5k5rNK700a7pIIv8votm_DA> <xmx:3vPqZ5VBzqnjmAT6tMggCumVw1DwEDIJVOn7MNXisamkckS8YXPK-Q> <xmx:3vPqZzAhe1mY6oYQbSsVtnjsSbqDl3pkto7xyuApr5eTOYxXukKxmlM5> Feedback-ID: i07de48aa:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 31 Mar 2025 15:58:21 -0400 (EDT) Content-Type: multipart/mixed; boundary="------------ZzhO5q6RjgBdZ1GLZSf4Yxaf" Message-ID: <e6dcfcd9-83d5-4f1f-9f77-a186cd4e5a00@HIDDEN> Date: Mon, 31 Mar 2025 22:58:19 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#77312: [PATCH] Add uniquify-get-unique-names To: Spencer Baugh <sbaugh@HIDDEN>, 77312 <at> debbugs.gnu.org References: <ierecyiseh6.fsf@HIDDEN> <iery0wpdm5o.fsf@HIDDEN> Content-Language: en-US From: Dmitry Gutov <dmitry@HIDDEN> In-Reply-To: <iery0wpdm5o.fsf@HIDDEN> X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 77312 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 (-) This is a multi-part message in MIME format. --------------ZzhO5q6RjgBdZ1GLZSf4Yxaf Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi all, On 28/03/2025 20:50, Spencer Baugh wrote: > After some use, it seems better to return an alist rather than a hash > table from this function; that alist is in the same order as the buffer > list that was passed in, which is nice for completion. So here's a > version which does that. Here's the corresponding patch to project.el to use the new function. The use of new logic is predicated on the non-nil value of uniquify-buffer-name-style. The latter doesn't necessarily imply that the user wants the former, but seems a safe enough bet. --------------ZzhO5q6RjgBdZ1GLZSf4Yxaf Content-Type: text/x-patch; charset=UTF-8; name="project--read-project-buffer-reuniquify.diff" Content-Disposition: attachment; filename="project--read-project-buffer-reuniquify.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvcHJvZ21vZGVzL3Byb2plY3QuZWwgYi9saXNwL3Byb2dtb2Rl cy9wcm9qZWN0LmVsCmluZGV4IGQ5NTRiNzhhNzQ1Li4wMjBkZWI0MzVmOCAxMDA2NDQKLS0t IGEvbGlzcC9wcm9nbW9kZXMvcHJvamVjdC5lbAorKysgYi9saXNwL3Byb2dtb2Rlcy9wcm9q ZWN0LmVsCkBAIC0xNTYyLDEzICsxNTYyLDI3IEBAIHByb2plY3QtLXJlYWQtcHJvamVjdC1i dWZmZXIKICAgICAgICAgICAgIChhbmQgKG1lbXEgKGNkciBidWZmZXIpIGJ1ZmZlcnMpCiAg ICAgICAgICAgICAgICAgIChub3QKICAgICAgICAgICAgICAgICAgIChwcm9qZWN0LS1idWZm ZXItY2hlY2sKLSAgICAgICAgICAgICAgICAgICAoY2RyIGJ1ZmZlcikgcHJvamVjdC1pZ25v cmUtYnVmZmVyLWNvbmRpdGlvbnMpKSkpKQotICAgICAgICAgKGJ1ZmZlciAocmVhZC1idWZm ZXIKLSAgICAgICAgICAgICAgICAgICJTd2l0Y2ggdG8gYnVmZmVyOiAiCi0gICAgICAgICAg ICAgICAgICAod2hlbiAoZnVuY2FsbCBwcmVkaWNhdGUgKGNvbnMgb3RoZXItbmFtZSBvdGhl ci1idWZmZXIpKQotICAgICAgICAgICAgICAgICAgICBvdGhlci1uYW1lKQotICAgICAgICAg ICAgICAgICAgbmlsCi0gICAgICAgICAgICAgICAgICBwcmVkaWNhdGUpKSkKKyAgICAgICAg ICAgICAgICAgICBidWZmZXIgcHJvamVjdC1pZ25vcmUtYnVmZmVyLWNvbmRpdGlvbnMpKSkp KQorICAgICAgICAgKGJ1ZmZlcgorICAgICAgICAgIChpZiB1bmlxdWlmeS1idWZmZXItbmFt ZS1zdHlsZQorICAgICAgICAgICAgICA7OyBGb3JnbyB0aGUgdXNlIG9mIGBidWZmZXItcmVh ZC1mdW5jdGlvbicgKG9mdGVuIG5pbCkgaW4KKyAgICAgICAgICAgICAgOzsgZmF2b3Igb2Yg dW5pcXVpZnlpbmcgdGhlIGJ1ZmZlcnMgYmV0dGVyLgorICAgICAgICAgICAgICAobGV0KiAo KHVuaXF1ZS1uYW1lcyAodW5pcXVpZnktZ2V0LXVuaXF1ZS1uYW1lcyBidWZmZXJzKSkKKyAg ICAgICAgICAgICAgICAgICAgIChvdGhlci1uYW1lICh3aGVuIChmdW5jYWxsIHByZWRpY2F0 ZSAoY29ucyBvdGhlci1uYW1lIG90aGVyLWJ1ZmZlcikpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIChjYXIgKHJhc3NvYyBvdGhlci1idWZmZXIgdW5pcXVlLW5hbWVz KSkpKQorICAgICAgICAgICAgICAgICAgICAgKHJlc3VsdCAoY29tcGxldGluZy1yZWFkCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiU3dpdGNoIHRvIGJ1ZmZlcjogIgorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pcXVlLW5hbWVzCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBwcmVkaWNhdGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIG5pbCBuaWwgbmlsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdGhlci1u YW1lKSkpCisgICAgICAgICAgICAgICAgKGFzc29jLWRlZmF1bHQgcmVzdWx0IHVuaXF1ZS1u YW1lcyAjJ2VxdWFsIHJlc3VsdCkpCisgICAgICAgICAgICAocmVhZC1idWZmZXIKKyAgICAg ICAgICAgICAiU3dpdGNoIHRvIGJ1ZmZlcjogIgorICAgICAgICAgICAgICh3aGVuIChmdW5j YWxsIHByZWRpY2F0ZSAoY29ucyBvdGhlci1uYW1lIG90aGVyLWJ1ZmZlcikpCisgICAgICAg ICAgICAgICBvdGhlci1uYW1lKQorICAgICAgICAgICAgIG5pbAorICAgICAgICAgICAgIHBy ZWRpY2F0ZSkpKSkKICAgICA7OyBYWFg6IFRoaXMgY2hlY2sgaGFyZGNvZGVzIHRoZSBkZWZh dWx0IGJ1ZmZlci1iZWxvbmdpbmcgcmVsYXRpb24KICAgICA7OyB3aGljaCBgcHJvamVjdC1i dWZmZXJzJyBpcyBhbGxvd2VkIHRvIG92ZXJyaWRlLiAgU3RyYWlnaHRlbgogICAgIDs7IHRo aXMgdXAgc29tZXRpbWUgbGF0ZXIuICBPciBub3QuICBTaW5jZSB3ZSBjYW4gYWRkIGEgbWV0 aG9kCg== --------------ZzhO5q6RjgBdZ1GLZSf4Yxaf--
bug-gnu-emacs@HIDDEN
:bug#77312
; Package emacs
.
Full text available.Received: (at 77312) by debbugs.gnu.org; 28 Mar 2025 18:51:11 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 28 14:51:11 2025 Received: from localhost ([127.0.0.1]:55505 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tyEnP-0001Jc-0f for submit <at> debbugs.gnu.org; Fri, 28 Mar 2025 14:51:11 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:35769) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <sbaugh@HIDDEN>) id 1tyEnJ-0001J3-8T for 77312 <at> debbugs.gnu.org; Fri, 28 Mar 2025 14:51:08 -0400 From: Spencer Baugh <sbaugh@HIDDEN> To: 77312 <at> debbugs.gnu.org Subject: Re: bug#77312: [PATCH] Add uniquify-get-unique-names In-Reply-To: <ierecyiseh6.fsf@HIDDEN> (Spencer Baugh's message of "Thu, 27 Mar 2025 11:03:17 -0400") References: <ierecyiseh6.fsf@HIDDEN> Date: Fri, 28 Mar 2025 14:50:59 -0400 Message-ID: <iery0wpdm5o.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1743187859; bh=89VXD1ldEHKy5NiAMmdyYkKDxm9HH4/8obSAKbrsnGo=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=qGxNi/JXqFP08BSaK8HDd3o5xU1BABMGuHWpLWFhfXk7iZKKzzGyvtNFz3tY8Be61 3Ph5GaaJhcUIk3R5k7qL80qDuSbCTkNSQzjpfLCXQEj1ufrvV2LbESBYZAf9vt68kB rZoNfGSGwBv6kxT9EPb3iHD4FhmoTY1+GLtEOUJ/HRHfMOjYtSpcZNSMtnSlIIPxL4 1sesBF7pnIeZ4GsW0T81zQYPcmy2crn4yx6edlepGzIdB8UlAcDp8L2q9Ds9leQYBf tRzsyBvy+oDJ/crFMVLMnNAapUVXRz1sGegMszyAtwqa+wPSwtuHJtUrPb7DWV3Qvc wLdedvQg2mWNw== X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77312 Cc: dmitry@HIDDEN 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 (---) --=-=-= Content-Type: text/plain After some use, it seems better to return an alist rather than a hash table from this function; that alist is in the same order as the buffer list that was passed in, which is nice for completion. So here's a version which does that. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Add-uniquify-get-unique-names.patch From 62ff7104ff2cc0ab5a258c2cd83d1278bc804961 Mon Sep 17 00:00:00 2001 From: Spencer Baugh <sbaugh@HIDDEN> Date: Thu, 27 Mar 2025 09:32:47 -0400 Subject: [PATCH] Add uniquify-get-unique-names This new function provides an interface to uniquify.el which doesn't change the actual names of the buffers. This is useful for any commands which deal with a subset of all buffers; for example, project.el. * lisp/uniquify.el (uniquify-rationalize--generic): Add. (uniquify-rationalize, uniquify-rationalize-a-list) (uniquify-rationalize-conflicting-sublist): Explicitly pass RENAME-BUFFER-FN and GET-BUFFER-FN. (uniquify--stateless-curname, uniquify-get-unique-names): Add. --- lisp/uniquify.el | 66 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 55 insertions(+), 11 deletions(-) diff --git a/lisp/uniquify.el b/lisp/uniquify.el index 358ae6af651..ac60228d9d8 100644 --- a/lisp/uniquify.el +++ b/lisp/uniquify.el @@ -320,14 +320,19 @@ uniquify-rerationalize-w/o-cb (defun uniquify-rationalize (fix-list) ;; Set up uniquify to re-rationalize after killing/renaming ;; if there is a conflict. + (dolist (item fix-list) + (with-current-buffer (uniquify-item-buffer item) + (setq uniquify-managed fix-list))) + (uniquify-rationalize--generic fix-list #'uniquify-rename-buffer #'get-buffer)) + +(defun uniquify-rationalize--generic (fix-list rename-buffer-fn get-buffer-fn) (dolist (item fix-list) (with-current-buffer (uniquify-item-buffer item) ;; Refresh the dirnames and proposed names. (setf (uniquify-item-proposed item) (uniquify-get-proposed-name (uniquify-item-base item) (uniquify-item-dirname item) - nil)) - (setq uniquify-managed fix-list))) + nil)))) ;; Strip any shared last directory names of the dirname. (when (and (cdr fix-list) uniquify-strip-common-suffix) (let ((strip t)) @@ -353,13 +358,13 @@ uniquify-rationalize fix-list))))) ;; If uniquify-min-dir-content is 0, this will end up just ;; passing fix-list to uniquify-rationalize-conflicting-sublist. - (uniquify-rationalize-a-list fix-list)) + (uniquify-rationalize-a-list fix-list nil rename-buffer-fn get-buffer-fn)) (defun uniquify-item-greaterp (item1 item2) (string-lessp (uniquify-item-proposed item2) (uniquify-item-proposed item1))) -(defun uniquify-rationalize-a-list (fix-list &optional depth) +(defun uniquify-rationalize-a-list (fix-list depth rename-buffer-fn get-buffer-fn) (unless depth (setq depth uniquify-min-dir-content)) (let (conflicting-sublist ; all elements have the same proposed name (old-proposed "") @@ -370,12 +375,14 @@ uniquify-rationalize-a-list (setq proposed (uniquify-item-proposed item)) (unless (equal proposed old-proposed) (uniquify-rationalize-conflicting-sublist conflicting-sublist - old-proposed depth) + old-proposed depth + rename-buffer-fn get-buffer-fn) (setq conflicting-sublist nil)) (push item conflicting-sublist) (setq old-proposed proposed)) (uniquify-rationalize-conflicting-sublist conflicting-sublist - old-proposed depth))) + old-proposed depth + rename-buffer-fn get-buffer-fn))) (defun uniquify-get-proposed-name (base dirname &optional depth) (unless depth (setq depth uniquify-min-dir-content)) @@ -427,12 +434,12 @@ uniquify-get-proposed-name ;; Deal with conflicting-sublist, all of whose elements have identical ;; "base" components. -(defun uniquify-rationalize-conflicting-sublist (conf-list old-name depth) +(defun uniquify-rationalize-conflicting-sublist (conf-list old-name depth rename-buffer-fn get-buffer-fn) (when conf-list (if (or (cdr conf-list) ;; Check that the proposed name doesn't conflict with some ;; existing buffer. - (let ((buf (get-buffer old-name))) + (let ((buf (funcall get-buffer-fn old-name))) (and buf (not (eq buf (uniquify-item-buffer (car conf-list))))))) (when uniquify-possibly-resolvable (setq uniquify-possibly-resolvable nil @@ -443,10 +450,9 @@ uniquify-rationalize-conflicting-sublist (uniquify-item-base item) (uniquify-item-dirname item) depth))) - (uniquify-rationalize-a-list conf-list depth)) + (uniquify-rationalize-a-list conf-list depth rename-buffer-fn get-buffer-fn)) (unless (string= old-name "") - (uniquify-rename-buffer (car conf-list) old-name))))) - + (funcall rename-buffer-fn (car conf-list) old-name))))) (defun uniquify-rename-buffer (item newname) (let ((buffer (uniquify-item-buffer item))) @@ -456,6 +462,44 @@ uniquify-rename-buffer ;; Pass the `unique' arg, so the advice doesn't mark it as unmanaged. (rename-buffer newname t)))))) +(defvar-local uniquify--stateless-curname nil + "The current unique name of this buffer in `uniquify-get-unique-names'.") + +(defun uniquify-get-unique-names (buffers) + "Return an alist with a unique name for each buffer in BUFFERS. + +The names are unique only among BUFFERS, and may conflict with other +buffers not in that list. + +This does not rename the buffers or change any state; the unique name is +only present in the returned alist." + (let ((buffer-names (make-hash-table :size (length buffers) :test 'equal)) + fix-lists-by-base) + (dolist (buf buffers) + (with-current-buffer buf + (setq uniquify--stateless-curname (buffer-name buf)) + (puthash (buffer-name buf) buf buffer-names) + (when uniquify-managed + (let ((base (uniquify-item-base (car uniquify-managed)))) + (push + (uniquify-make-item base (uniquify-buffer-file-name buf) buf nil) + (alist-get base fix-lists-by-base nil nil #'equal)))))) + (dolist (pair fix-lists-by-base) + (uniquify-rationalize--generic + (cdr pair) + (lambda (item name) ; rename-buffer + (with-current-buffer (uniquify-item-buffer item) + (remhash uniquify--stateless-curname buffer-names) + (setq uniquify--stateless-curname name) + (puthash name (current-buffer) buffer-names))) + (lambda (name) ; get-buffer + (gethash name buffer-names))))) + (mapcar (lambda (buf) + (with-current-buffer buf + (prog1 (cons uniquify--stateless-curname buf) + (kill-local-variable 'uniquify--stateless-curname)))) + buffers)) + ;;; Hooks from the rest of Emacs (defun uniquify-maybe-rerationalize-w/o-cb () -- 2.39.3 --=-=-=--
bug-gnu-emacs@HIDDEN
:bug#77312
; Package emacs
.
Full text available.Received: (at submit) by debbugs.gnu.org; 27 Mar 2025 15:03:35 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 27 11:03:35 2025 Received: from localhost ([127.0.0.1]:50818 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1txolY-0005bN-6r for submit <at> debbugs.gnu.org; Thu, 27 Mar 2025 11:03:35 -0400 Received: from lists.gnu.org ([2001:470:142::17]:36430) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <sbaugh@HIDDEN>) id 1txolU-0005Zm-H1 for submit <at> debbugs.gnu.org; Thu, 27 Mar 2025 11:03:31 -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 1txolP-0001bx-03 for bug-gnu-emacs@HIDDEN; Thu, 27 Mar 2025 11:03:23 -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 1txolM-0001Te-4i for bug-gnu-emacs@HIDDEN; Thu, 27 Mar 2025 11:03:22 -0400 From: Spencer Baugh <sbaugh@HIDDEN> To: bug-gnu-emacs@HIDDEN Subject: [PATCH] Add uniquify-get-unique-names X-Debbugs-Cc: dmitry@HIDDEN Date: Thu, 27 Mar 2025 11:03:17 -0400 Message-ID: <ierecyiseh6.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1743087797; bh=C2bQrXJNDsdEnC7XcH/9zbP5u1wSdXxQYMo9Gr77Cfw=; h=From:To:Subject:Date; b=ZOpHNvybOU2MdPIQN4zVlP7RDfwFfvdU6BpY0oHXSIsK65GSDctTfCLuSVl6Q9OLe r6F1Vvt/LrEQD2ID+ezzSRV+KeogDtoMGYwd8pv5DKDTisaKx/cujMyC1t0qtsjy19 TX3OdJlJ6UcjTJG1LPck1YyXIoP4beVJ+JpNrQrl6vRRzju3Tt4zYqjTa82Bcfg98q ujbY5M4eusWn48+lpLWK97rj1EVx+vzDKSaQphkVSmk+Pg/cd+G8fG+XMXYf/lEiEH dOoDG/HFpKaZVMc+2vfeTPKXtACYWgumzYJ4cQM6uleMQ8WbFqLXBoMZXsGKi+UIKw /cFJTu6TE2wYg== Received-SPF: pass client-ip=64.215.233.18; envelope-from=sbaugh@HIDDEN; helo=mxout5.mail.janestreet.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) 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: -0.1 (/) --=-=-= Content-Type: text/plain Tags: patch This new function provides an interface to uniquify.el which doesn't change the actual names of the buffers. This is useful for any commands which deal with a subset of all buffers; for example, project.el. * lisp/uniquify.el (uniquify-rationalize--generic): Add. (uniquify-rationalize, uniquify-rationalize-a-list) (uniquify-rationalize-conflicting-sublist): Explicitly pass RENAME-BUFFER-FN and GET-BUFFER-FN. (uniquify--stateless-curname, uniquify-get-unique-names): Add. In GNU Emacs 30.1.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.15.12, Xaw scroll bars) of 2025-03-11 built on igm-qws-u22796a Repository revision: 516d1e6463a9659951f7567e038efc5ee2a19bbf Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: Rocky Linux 8.10 (Green Obsidian) Configured using: 'configure --config-cache --with-x-toolkit=lucid --without-gpm --without-gconf --without-selinux --without-imagemagick --with-modules --with-gif=no --with-cairo --with-rsvg --without-compress-install --with-tree-sitter --with-native-compilation=aot --prefix=/usr/local/home/garnish/raw-emacs/30-20250311_131404' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Add-uniquify-get-unique-names.patch From afd867ef7577bab1cf83a62c5acaa1bfc5da6305 Mon Sep 17 00:00:00 2001 From: Spencer Baugh <sbaugh@HIDDEN> Date: Thu, 27 Mar 2025 09:32:47 -0400 Subject: [PATCH] Add uniquify-get-unique-names This new function provides an interface to uniquify.el which doesn't change the actual names of the buffers. This is useful for any commands which deal with a subset of all buffers; for example, project.el. * lisp/uniquify.el (uniquify-rationalize--generic): Add. (uniquify-rationalize, uniquify-rationalize-a-list) (uniquify-rationalize-conflicting-sublist): Explicitly pass RENAME-BUFFER-FN and GET-BUFFER-FN. (uniquify--stateless-curname, uniquify-get-unique-names): Add. --- lisp/uniquify.el | 65 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 54 insertions(+), 11 deletions(-) diff --git a/lisp/uniquify.el b/lisp/uniquify.el index 358ae6af651..50971e115b0 100644 --- a/lisp/uniquify.el +++ b/lisp/uniquify.el @@ -320,14 +320,19 @@ uniquify-rerationalize-w/o-cb (defun uniquify-rationalize (fix-list) ;; Set up uniquify to re-rationalize after killing/renaming ;; if there is a conflict. + (dolist (item fix-list) + (with-current-buffer (uniquify-item-buffer item) + (setq uniquify-managed fix-list))) + (uniquify-rationalize--generic fix-list #'uniquify-rename-buffer #'get-buffer)) + +(defun uniquify-rationalize--generic (fix-list rename-buffer-fn get-buffer-fn) (dolist (item fix-list) (with-current-buffer (uniquify-item-buffer item) ;; Refresh the dirnames and proposed names. (setf (uniquify-item-proposed item) (uniquify-get-proposed-name (uniquify-item-base item) (uniquify-item-dirname item) - nil)) - (setq uniquify-managed fix-list))) + nil)))) ;; Strip any shared last directory names of the dirname. (when (and (cdr fix-list) uniquify-strip-common-suffix) (let ((strip t)) @@ -353,13 +358,13 @@ uniquify-rationalize fix-list))))) ;; If uniquify-min-dir-content is 0, this will end up just ;; passing fix-list to uniquify-rationalize-conflicting-sublist. - (uniquify-rationalize-a-list fix-list)) + (uniquify-rationalize-a-list fix-list nil rename-buffer-fn get-buffer-fn)) (defun uniquify-item-greaterp (item1 item2) (string-lessp (uniquify-item-proposed item2) (uniquify-item-proposed item1))) -(defun uniquify-rationalize-a-list (fix-list &optional depth) +(defun uniquify-rationalize-a-list (fix-list depth rename-buffer-fn get-buffer-fn) (unless depth (setq depth uniquify-min-dir-content)) (let (conflicting-sublist ; all elements have the same proposed name (old-proposed "") @@ -370,12 +375,14 @@ uniquify-rationalize-a-list (setq proposed (uniquify-item-proposed item)) (unless (equal proposed old-proposed) (uniquify-rationalize-conflicting-sublist conflicting-sublist - old-proposed depth) + old-proposed depth + rename-buffer-fn get-buffer-fn) (setq conflicting-sublist nil)) (push item conflicting-sublist) (setq old-proposed proposed)) (uniquify-rationalize-conflicting-sublist conflicting-sublist - old-proposed depth))) + old-proposed depth + rename-buffer-fn get-buffer-fn))) (defun uniquify-get-proposed-name (base dirname &optional depth) (unless depth (setq depth uniquify-min-dir-content)) @@ -427,12 +434,12 @@ uniquify-get-proposed-name ;; Deal with conflicting-sublist, all of whose elements have identical ;; "base" components. -(defun uniquify-rationalize-conflicting-sublist (conf-list old-name depth) +(defun uniquify-rationalize-conflicting-sublist (conf-list old-name depth rename-buffer-fn get-buffer-fn) (when conf-list (if (or (cdr conf-list) ;; Check that the proposed name doesn't conflict with some ;; existing buffer. - (let ((buf (get-buffer old-name))) + (let ((buf (funcall get-buffer-fn old-name))) (and buf (not (eq buf (uniquify-item-buffer (car conf-list))))))) (when uniquify-possibly-resolvable (setq uniquify-possibly-resolvable nil @@ -443,10 +450,9 @@ uniquify-rationalize-conflicting-sublist (uniquify-item-base item) (uniquify-item-dirname item) depth))) - (uniquify-rationalize-a-list conf-list depth)) + (uniquify-rationalize-a-list conf-list depth rename-buffer-fn get-buffer-fn)) (unless (string= old-name "") - (uniquify-rename-buffer (car conf-list) old-name))))) - + (funcall rename-buffer-fn (car conf-list) old-name))))) (defun uniquify-rename-buffer (item newname) (let ((buffer (uniquify-item-buffer item))) @@ -456,6 +462,43 @@ uniquify-rename-buffer ;; Pass the `unique' arg, so the advice doesn't mark it as unmanaged. (rename-buffer newname t)))))) +(defvar-local uniquify--stateless-curname nil + "The current unique name of this buffer in `uniquify-get-unique-names'.") + +(defun uniquify-get-unique-names (buffers) + "Return a hash table with a unique name for each buffer in BUFFERS. + +The names are unique only among BUFFERS, and may conflict with other +buffers not in that list. + +This does not rename the buffers or change any state; the unique name is +only present in the returned alist." + (let ((buffer-names (make-hash-table :size (length buffers) :test 'equal))) + (let (fix-lists-by-base) + (dolist (buf buffers) + (with-current-buffer buf + (setq uniquify--stateless-curname (buffer-name buf)) + (puthash (buffer-name buf) buf buffer-names) + (when uniquify-managed + (let ((base (uniquify-item-base (car uniquify-managed)))) + (push + (uniquify-make-item base (uniquify-buffer-file-name buf) buf nil) + (alist-get base fix-lists-by-base nil nil #'equal)))))) + (dolist (pair fix-lists-by-base) + (uniquify-rationalize--generic + (cdr pair) + (lambda (item name) ; rename-buffer + (with-current-buffer (uniquify-item-buffer item) + (remhash uniquify--stateless-curname buffer-names) + (setq uniquify--stateless-curname name) + (puthash name (current-buffer) buffer-names))) + (lambda (name) ; get-buffer + (gethash name buffer-names))))) + (dolist (buf buffers) + (with-current-buffer buf + (kill-local-variable 'uniquify--stateless-curname))) + buffer-names)) + ;;; Hooks from the rest of Emacs (defun uniquify-maybe-rerationalize-w/o-cb () -- 2.39.3 --=-=-=--
Spencer Baugh <sbaugh@HIDDEN>
:dmitry@HIDDEN, bug-gnu-emacs@HIDDEN
.
Full text available.dmitry@HIDDEN, bug-gnu-emacs@HIDDEN
:bug#77312
; Package emacs
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.