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#63829: 29.0.90; project-find-file's future history breaks with common-parent-directory Date: Sat, 12 Aug 2023 04:23:14 +0300 Message-ID: References: <16b64d95-35e9-ef94-2c54-17b670111f0f@gutov.dev> <86h6rnw7gm.fsf@mail.linkov.net> <3e404df1-b3a9-f9e3-4270-f42df8b704c7@gutov.dev> 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="39411"; 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: 63829@debbugs.gnu.org, Juri Linkov To: Spencer Baugh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 12 03:24:26 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 1qUdMe-000A1p-Ao for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 12 Aug 2023 03:24:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qUdMK-0005ED-UP; Fri, 11 Aug 2023 21:24:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qUdMJ-0005Dq-05 for bug-gnu-emacs@gnu.org; Fri, 11 Aug 2023 21:24:03 -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 1qUdMI-0008BM-O2 for bug-gnu-emacs@gnu.org; Fri, 11 Aug 2023 21:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qUdMI-0007oQ-Br for bug-gnu-emacs@gnu.org; Fri, 11 Aug 2023 21:24: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: Sat, 12 Aug 2023 01:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63829 X-GNU-PR-Package: emacs Original-Received: via spool by 63829-submit@debbugs.gnu.org id=B63829.169180341029988 (code B ref 63829); Sat, 12 Aug 2023 01:24:02 +0000 Original-Received: (at 63829) by debbugs.gnu.org; 12 Aug 2023 01:23:30 +0000 Original-Received: from localhost ([127.0.0.1]:48304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qUdLl-0007nb-A5 for submit@debbugs.gnu.org; Fri, 11 Aug 2023 21:23:29 -0400 Original-Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:56089) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qUdLh-0007nJ-Hq for 63829@debbugs.gnu.org; Fri, 11 Aug 2023 21:23:28 -0400 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 9D2A932003F4; Fri, 11 Aug 2023 21:23:18 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Fri, 11 Aug 2023 21:23:18 -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=fm2; t= 1691803398; x=1691889798; bh=ctXOz0Crg7LjzdSVfxe/CIrN9BMW0Bj0Jgu MQ9Z4Pts=; b=JlIzDObkn+wZrGSz6ZnxRWHsVJ483dSoRhEDoxFRhO/m3WRSOjg x7gWmL9M+uG8S2cFGSq6P9tMjcdMkU6qdgtmyBW7gJ+EH7H8ryRuvSuyNYEmmk9R Mi1nhQLE8UTVBf5O9Yq48NwEhAgN+u9E87ARKeLlAivO5nzYu55iFNjNl6RSQSFm ED9pp/rqL6STTDi3x8XZaH5aKvH9rpklcp9irRIpAQiLNXdEfmZLvHribJakmGSp dUwVyNlDoeUQmenFYSkepPU9paQ1ftHfRds9EtCLSjcZpod8qPCqeA8giQomiOkz 3cj7hoDutiSOOTHzvb4Hn0iAQwdyMbvCa0g== 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=fm3; t= 1691803398; x=1691889798; bh=ctXOz0Crg7LjzdSVfxe/CIrN9BMW0Bj0Jgu MQ9Z4Pts=; b=Z3iU2XLjvpW4YCr2cNkv2pdWtBc3g7ADPfDmLy8Tz9VS9Zaf0Ak xT9NJeFbBm67awRwU1VwAsxp8HjXlbBX2285AQYh65WtTaZQA6FXFk26pNgnX0k4 fvpLTXyNIdP3xDWdMv4nB9u476uzor+dkz/cnmS4rg4YHSO3Jv1bo39NHNe/1HvO HcuOvOcEkxqBGZkNjfd1R4mY72QS9dosGV0uSJWQLR+orx53SkH/+rrI+4vMwsXl y1DTXCrxz8xF+k8GzV5PaKM011mFPQ971mrdVoAKNs7SS8p4LNwTHDB7ORy2TCaR yl2K7sfl5sD3ttsYDgd55TzzP50PSrr6ZHw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrleelgdeghecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpefhuedtkeevgeegteetkeefjeffgeduudduhfeuveelfedtffffgeegiedvvdej leenucffohhmrghinhepghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 11 Aug 2023 21:23:16 -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:267239 Archived-At: Hi Spencer, Thanks for the ping. On 06/06/2023 18:55, Spencer Baugh wrote: >> But so far the patch over there is not complete yet, is it? I wouldn't >> say it's a settled matter so far. > > Yes, I expect there are any number of alternative implementation > strategies, I'm not at all tied to using > project-current-directory-override. Happy to port to whatever approach > we end up with. Notes: - We're still using project-current-directory-override, not migrated to anything else yet. - I've pushed my earlier patch which should fix the immediate bug as reported. Let's talk about yours a little bit more. I'm a little wary of adding a specialized feature this way (being able to visit the file corresponding to the current one only), but that patch might be the most optimal still. >>> BTW, I asked about this before inhttps://debbugs.gnu.org/58447#127 >>> and then it was deemed to be not too general to handle, so I backed it out >>> inhttps://debbugs.gnu.org/58447#160 with such conclusion: >>> OTOH, `C-x p f M-p' in another project is not my primary >>> workflow. >>> But if someone wants to keep a plain history, this could be added >>> later in master, e.g. by a new value of project-read-file-name-function >>> and a function that is mostly a copy of project--read-file-cpd-relative. >>> So maybe this could be implemented in master now? >> >> I think the design there was to use relative file names in history? Or >> a different variable for project file name history (which would use >> relative names only). I'm not ruling that out, but the patch proposed >> here is a little more focused. >> >> OTOH, it only allows finding the "current" file in the other project, >> but not other files that were previously visited too. Spencer, what do >> you think about that capability? Do you also feel it is missing and >> would like to look into it next? Then the current patch might be the >> wrong direction. > > Hm, the main thing I want is to make it very easy to visit the current > file in another project - I am frequently getting user requests for that > feature. (Mainly because our workflow heavily uses a "git worktree" > equivalent, where users have one project for each bug/branch they're > working on, all with basically the same layout, so "visit the same file > in a different project" is also "visit the same file in a different > branch", which is often useful. (I actually might work on some code to > help implement the same kind of workflow for Emacs development, one > worktree per bug/branch)) I suppose one other way to do that would be to create a dedicated command just for that. But that's a little clunkier -- would require a separate binding. > I'm not sure I understand the alternative - the idea would be to share > project file name history between all projects? I guess that could be > nice, although I don't personally use file name history that much, and > AFAIK it wouldn't solve any concrete user problems, so I'm not really > motivated to implement it. The alternative is a little more general, e.g. propertize every such history entry with the value of the root, so that they can be post-processed to adapt to any other root directory. This shouldn't take too much work, actually. But I don't know if that is indeed a necessary feature. From the discussion (https://debbugs.gnu.org/58447), I had been under impression that it would be wanted, but it might be just "nice to have". Juri, are *you* okay with the functionality in Spencer's patch? No need for further generality? > However, if we did share project file name history in that way, I'd want > to still automatically prepend the "current file" as history. Even if > we didn't navigate to the current file via project-find-file, I still > want to make it very easy to visit the current file in another project. > Just sharing project file name history doesn't provide that. Fair point.