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#72300: project.el: detect newly created project contained within another Date: Tue, 13 Aug 2024 04:43:06 +0300 Message-ID: <04986428-27b5-462d-8f89-139cd56ea117@gutov.dev> References: <87r0bh8cy7.fsf@gmx.de> <86mslssny9.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38053"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 72300@debbugs.gnu.org, Federico Tedin To: Ship Mints , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 13 03:43:57 2024 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 1sdgZj-0009gj-FB for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 13 Aug 2024 03:43:52 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sdgZP-0005BO-P6; Mon, 12 Aug 2024 21:43:31 -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 1sdgZN-0005Az-RS for bug-gnu-emacs@gnu.org; Mon, 12 Aug 2024 21:43:29 -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 1sdgZN-0008Cz-Ih for bug-gnu-emacs@gnu.org; Mon, 12 Aug 2024 21:43:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:From:References:MIME-Version:Date:To:Subject; bh=UbKDsQBq9zeIxf7l5afcZUnLUeTamLt5MlQLLV8qe6E=; b=R5WurCm4wE0HOtZHJ38gzbbENaE3O5uWWYIfUOUsakw94bAdsJIO8JQcOX5GILYDVYJ4RoBYs11d52DjNpJZRYruTe1rYYs0L705uFuGIqEC8Y6sTNo/1YmfBRFyIp1Qsxp1AabxIeiKcLlorxaDDGlw1aYx4Y/FXaPr0152mpNJEnp16FyVyCmBN7UeeTnbohPE/9aqsk1iu050E/1xfyu4l0tbeR21+Ge0jKfDBOavybunqqoi1Ro1rsx5179ywjNuDrTDJOaoOcoMJTFjkwqAW+JxyB7giD3F+t6MkJEeJB4ZVlgx/xVVp5kaJUDAQ0doi8m98jXLeaoCL0+cuQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sdgZu-0004Ej-1o for bug-gnu-emacs@gnu.org; Mon, 12 Aug 2024 21:44:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Aug 2024 01:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72300 X-GNU-PR-Package: emacs Original-Received: via spool by 72300-submit@debbugs.gnu.org id=B72300.172351343116256 (code B ref 72300); Tue, 13 Aug 2024 01:44:02 +0000 Original-Received: (at 72300) by debbugs.gnu.org; 13 Aug 2024 01:43:51 +0000 Original-Received: from localhost ([127.0.0.1]:43961 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sdgZj-0004E5-6R for submit@debbugs.gnu.org; Mon, 12 Aug 2024 21:43:51 -0400 Original-Received: from fhigh1-smtp.messagingengine.com ([103.168.172.152]:44041) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sdgZg-0004Do-WB for 72300@debbugs.gnu.org; Mon, 12 Aug 2024 21:43:50 -0400 Original-Received: from phl-compute-03.internal (phl-compute-03.nyi.internal [10.202.2.43]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 130AB1151A2B; Mon, 12 Aug 2024 21:43:11 -0400 (EDT) Original-Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Mon, 12 Aug 2024 21:43:11 -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=fm2; t=1723513391; x=1723599791; bh=UbKDsQBq9zeIxf7l5afcZUnLUeTamLt5MlQLLV8qe6E=; b= ubZh4dvQ9ofLzkKAEwgtu1A/XigN/dtuVCsEsChGqo7YzdrD8QrclxxxHk+pyidp SP6Lh6wWBfkuvqTk8MOVpSARtjptQw635tKt2lQ59k95zIJ5CA3OTx61oUYpw2HW +Tec1XsudJxhqi8/QMG2B97LoDU17KYc0bMBBMC2qkCb32twUbr+LYbdnotMMCIZ KooJmf6c8pfLMcGT6yRZxQkpIAMJ1IMyzPzzNyuXWAXXB+HriEMVV/5SkSItvxk1 NGE+5eo2xjmWUlKyEjOacUbb3YuX4uDFTzJVLSf0fpFwLAzpIltlfhI18XIg0IKV yJLmhPRumkPpd9L4aGOkBQ== 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-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1723513391; x= 1723599791; bh=UbKDsQBq9zeIxf7l5afcZUnLUeTamLt5MlQLLV8qe6E=; b=s lf9my4Arfo5FPcin7TMscwXbURrGrPgcAK7G5K68PKDPCRvh70tBiSYSQpq8k6lf e8BKiQr45BraW1v2kh+T+mnQygnfZiYc3cPTrmHQGu1Cb6MKJbFh2p9lnoq1Xzn0 r4rLhPso5njNGiyMAxlvVkUb6elicZ9+W60+H7Xh0QKQvMvBloef9Tji76dhKQfs z5sjBRNDRAi78WTejrdIn8ma8zgCdZTi8ozkre79nkzXT8DtFMOJ+AjQJ1rbKJuy lGLTRertnnIFTtAm5UpirKrHJfhiLU3MVM0LhxZ01VGOxJx7lbjAWEpT9sl1tBLS cRQgQPdo6zE2VlW07QFBw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddruddtuddgheduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdej necuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdrug gvvheqnecuggftrfgrthhtvghrnhepgeelfeetkefghfdvhfdtgeevveevteetgeetveeg tedthefhudekteehffeukeeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghvpdhnsggprhgtphhtthho peegpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehshhhiphhmihhnthhssehgmh grihhlrdgtohhmpdhrtghpthhtohepvghlihiisehgnhhurdhorhhgpdhrtghpthhtohep fhgvuggvrhhitghothgvughinhesghhmgidruggvpdhrtghpthhtohepjedvfedttdesug gvsggsuhhgshdrghhnuhdrohhrgh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 12 Aug 2024 21:43:09 -0400 (EDT) Content-Language: en-US In-Reply-To: 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:290064 Archived-At: Hi! On 05/08/2024 20:18, Ship Mints wrote: > (vc-file-setprop dir 'project-vc project) in project-try-vc. There is no > facility, public API or private, to clear the cache en-masse. One could > reset the cache via clearing the vector vc-file-prop-obarray > (setq vc-file-prop-obarray (make-vector 17 0)) in the absence of an API. > You can observe what's in your vc-file-prop-obarray for yourself before > taking this action. That's right. One step toward that goal would be moving the cache to some other data structure - possibly a tree-like one, to also be able to short-circuit the upward directory searches. Cache invalidation is a sore point, though: the directory tree can change behind the scenes outside Emacs, so unless the caching is disabled the other complete solutions would rely on something like filenotify. OT2H if we're okay with supporting only manual clears e.g. using 'M-x project-forget-project' or 'M-x project-forget-projects-under', that could be implemented easily enough. The current vc-file-prop-obarray structure could be refreshed with a full scan.