From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#64088: [PATCH] Make project-root for vc projects return an absolute path Date: Wed, 23 Aug 2023 03:24:02 +0300 Message-ID: <3d4d2e2c-0ed1-6998-694d-dcc08b2ec837@gutov.dev> References: <3c6078aa-4089-46fd-18bb-d92be101ca4f@gutov.dev> <2690528f-bfc8-d164-c522-cd2fcf2ba1ba@gutov.dev> <16c053e0-cd4b-295d-2dae-e97bcf25f3b3@gutov.dev> <87ttsvgqnt.fsf@catern.com> <87lee7gpg1.fsf@catern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15779"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: Spencer Baugh , 64088-done@debbugs.gnu.org To: sbaugh@catern.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 23 02:25:32 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qYbgg-0003sY-VG for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 23 Aug 2023 02:25:32 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYbgD-0000BE-E1; Tue, 22 Aug 2023 20:25:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYbgB-0000Au-GT for bug-gnu-emacs@gnu.org; Tue, 22 Aug 2023 20:24:59 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYbgB-0007px-7n for bug-gnu-emacs@gnu.org; Tue, 22 Aug 2023 20:24:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qYbgE-00087C-22 for bug-gnu-emacs@gnu.org; Tue, 22 Aug 2023 20:25:02 -0400 Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 Aug 2023 00:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 64088 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Mail-Followup-To: 64088@debbugs.gnu.org, dmitry@gutov.dev, sbaugh@janestreet.com Original-Received: via spool by 64088-done@debbugs.gnu.org id=D64088.169275025831135 (code D ref 64088); Wed, 23 Aug 2023 00:25:01 +0000 Original-Received: (at 64088-done) by debbugs.gnu.org; 23 Aug 2023 00:24:18 +0000 Original-Received: from localhost ([127.0.0.1]:60640 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYbfW-000867-3W for submit@debbugs.gnu.org; Tue, 22 Aug 2023 20:24:18 -0400 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]:33583) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYbfT-00085t-Ev for 64088-done@debbugs.gnu.org; Tue, 22 Aug 2023 20:24:16 -0400 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id DAE125C023B; Tue, 22 Aug 2023 20:24:06 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 22 Aug 2023 20:24:06 -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:sender:subject:subject:to:to; s=fm3; t= 1692750246; x=1692836646; bh=jlsGtJJkA1vyOp+6ox/PKHYwVh/TMIHrLOW SiKpyut0=; b=D9e3WLTjdo6uaPFLjk3sRr7/NeOVUq1bhzK2AnDQsqtStDY2VYY sYD7SKwmte6uLDoaCkLjudHIjzp56I07d4PhV5Cp9ytfJggqid9jtGMSJeZZXxSp crWeBNC5Qp0c5Vrko3QVgkKJv3f+wRLt9q3hIu2c6/LDB97ElsgOGlIbCM4d4VFw 6uWkd2OV145blnJII58ywMG6liWcj7U/ntAYsS2xVS9INrpn6gKDIlEMZgXVAkQo 08Ls5u7WgbDaDJGFUwcCE/p7pOviaWNx4xv73UOq1IM6nvug+id73hfUn7rZ+USi 2icUDlSswZH7tNtjsE8knYUeAjQkod6/M6w== 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:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1692750246; x=1692836646; bh=jlsGtJJkA1vyOp+6ox/PKHYwVh/TMIHrLOW SiKpyut0=; b=r43RCfXzz3VxY+eSQIp+/Vz7KiLhe5vUNjW2Gfg/c8OD2ZH7bbw SAATctBiOP1mpu5GGYPPCPJRg2CE0Uu6jlE8sPOg3LOQsoj92vealdoE6mhPcMqg i01jbBI3M6dafpbxUGObp61L5YLkkktYgs8NOJxNPWAxUXs+qwQ4UTBIxzw6j/tN tlmhX4Bozj/BjBvQp0JE4XHiElpa6XOyO+qxNn7gR05lU+WTJ4EEHreyQqJXsTNN axfW6ECeWa5td6K5RPtfzpU3kIvU1LO2zHYM5CpCG4VlWwmd4xQxwnbm0dZ09Dib 5Ivw+MBPb8elL95PttmjHK4x5E9aVUSHP+Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedruddvvddgfeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 22 Aug 2023 20:24:05 -0400 (EDT) Content-Language: en-US In-Reply-To: <87lee7gpg1.fsf@catern.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:268192 Archived-At: On 19/08/2023 15:57, sbaugh@catern.com wrote: >>> Meaning it will be called N times (for the number of projects) every >>> time the list is displayed, instead of just once, when the project is >>> saved/visited. But maybe it's fine too? How slow could that be? >> I was sad about this but I think I've got the solution now: We just >> maintain project--list in abbreviated form and project-list-file in >> expanded form. Here's something else I thought of: project--write-project-list is called every time a different project is returned by (project-current t) -- i.e. when MAYBE-PROMPT=t, and when the found dir is not at the top of the project history already. So under certain conditions (slow CPU/spinning media/long project history) it might slow down (project-current t) calls. In my testing it's totally fine, though, and there are possible mitigations (limit the history and/or move saving to kill-hook). Just something to keep in mind. >> I think that solves all the problems: the persistent file is independent >> of user configuration, so if the user changes their abbreviations >> they'll get new ones the next time the file is read (presumably the next >> time they run Emacs). But project--list is abbreviated, so >> project-prompt-project-dir gets abbreviated dirs. >> >> It does mean that if they change their directory-abbrev-alist while >> Emacs is running they could get duplicate entries, but that already >> could happen before this patch, and it's not a big problem IMO. >> >> See patch below. > Oops, this patch needed a few tweaks. Especially, skipping the > expansion and abbreviation for remote files, to avoid making unnecesary > remote connections. Thanks! Pushed to master, and finally closing ;-)