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#58447: [PATCH] In project-find-file, add absolute file name to history Date: Fri, 16 Dec 2022 00:50:58 +0200 Message-ID: <4734c1c2-4bc3-42eb-a919-0e3f1e62fb47@yandex.ru> References: <8735budxiz.fsf@gmail.com> <86tu3mftm0.fsf@mail.linkov.net> <875yg0to11.fsf@gmail.com> <86zgdalj0h.fsf@mail.linkov.net> <86fsdpjasd.fsf@mail.linkov.net> <86k02zjiwj.fsf@mail.linkov.net> <864ju1lt5k.fsf@mail.linkov.net> <403e8284-e32c-f547-748e-371d26eedace@yandex.ru> <86cz8or02n.fsf@mail.linkov.net> <87sfhko3tf.fsf@gmail.com> <868rjbusog.fsf@mail.linkov.net> <87h6xylyox.fsf@gmail.com> <1d03758e-369a-c522-a91a-696243f1074f@yandex.ru> <87cz8ln5lt.fsf@gmail.com> <87359hlycd.fsf@gmail.com> <86r0x0acnh.fsf@mail.linkov.net> 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="18029"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Cc: Eli Zaretskii , Augusto Stoffel , 58447@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 15 23:52:32 2022 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 1p5x5b-0004Vn-5C for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 15 Dec 2022 23:52:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p5x5A-0007KU-Pj; Thu, 15 Dec 2022 17:52:04 -0500 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 1p5x58-0007Js-Sx for bug-gnu-emacs@gnu.org; Thu, 15 Dec 2022 17:52:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p5x58-0002Mr-9D for bug-gnu-emacs@gnu.org; Thu, 15 Dec 2022 17:52:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p5x58-0004um-4t for bug-gnu-emacs@gnu.org; Thu, 15 Dec 2022 17:52:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Dec 2022 22:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58447 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 58447-submit@debbugs.gnu.org id=B58447.167114467018861 (code B ref 58447); Thu, 15 Dec 2022 22:52:02 +0000 Original-Received: (at 58447) by debbugs.gnu.org; 15 Dec 2022 22:51:10 +0000 Original-Received: from localhost ([127.0.0.1]:45392 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5x4I-0004u9-Ga for submit@debbugs.gnu.org; Thu, 15 Dec 2022 17:51:10 -0500 Original-Received: from mail-wr1-f53.google.com ([209.85.221.53]:36833) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5x4F-0004to-AF for 58447@debbugs.gnu.org; Thu, 15 Dec 2022 17:51:10 -0500 Original-Received: by mail-wr1-f53.google.com with SMTP id h10so850044wrx.3 for <58447@debbugs.gnu.org>; Thu, 15 Dec 2022 14:51:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=8XkgUX2MZ9EJ2qB9w46n/gRokv29v2OTgjKzi2Qg8x8=; b=Kq0cXlMPQwLBX+zaUhNwOUuDY2y9RWphW7mdP/ID61a8T3Q+gD776TUjBGNN27p55b 3IbPHUJw2n1UC2zEENqEsp9cbxU8F/yDbLHZPjdW9xmbM6McsCoEXAi5aZRMCwycyWKc Lta8YRx1p9y/D2lQQyjbR8VuOs3rlKp44ZC94lbM+i+MeTLgoPo0oMZ9LcQIwQUppMZM F3tQUPR44UcoOVOoGVmYzH4hYeFWiSP/+mnV6wGvJlXwQz0k9T+LUwXKFawBKRJpgFG5 KTHJ0NfeWGp4ZNSrz3Ih5ej52FlaKozg/tBqXGsJk11qNrEHEsTqSvZTOj3qHdQkdG84 zy/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8XkgUX2MZ9EJ2qB9w46n/gRokv29v2OTgjKzi2Qg8x8=; b=JQg2NMV49SO6FTMFg8eyYxeclFMllXOcjcS+NxhfpqzWarF15Ql4pAj6qc+pzcZdYu KAX8Taz06PElCw0kXGGMFAMUJfwTaPgdr6PjJPWsp2YeCXpRxB1xvYVlEPn/V3UzcJ0p iHdx3+MJombaHHE2LCnut85k7rIZC/EgXe5kYh1WGyWE/TmorWOxJ4vKKxfw3eAm/sgl kISybmpdjxWBMokU6/IP37MOjJv9yqgLGOPxGcAocnq+oTMaQ60U4tGRbZ1+299Ebjst aKoe9zEkBXOUl1KI18A8Fx2sl9DDC8wcP42VyOBvUUrBZm88mukEAB/DbVdeDcwQVEDE l5TA== X-Gm-Message-State: ANoB5pkCsAdCE27kQg+SEqCKP0qhjQOxVRBvi4UNV1EdIvw2OgNW8Ruo tmE9uDhm5QHxKY+AFPTySRg= X-Google-Smtp-Source: AA0mqf4lZAFoOOJOkDJuVfimsUjjNoshlVbQol2tHOlonkvv0Y4vAZHgw+eRN5rxDkSlpVqemdutrQ== X-Received: by 2002:adf:e503:0:b0:242:8bf:a690 with SMTP id j3-20020adfe503000000b0024208bfa690mr27697726wrm.38.1671144661192; Thu, 15 Dec 2022 14:51:01 -0800 (PST) Original-Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id d16-20020adfe2d0000000b00241fde8fe04sm620034wrj.7.2022.12.15.14.50.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 15 Dec 2022 14:51:00 -0800 (PST) Content-Language: en-US In-Reply-To: <86r0x0acnh.fsf@mail.linkov.net> 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:251158 Archived-At: On 15/12/2022 19:21, Juri Linkov wrote: >>> In fact I think v2 already is a completely satisfactory implementation >>> the project-local file history feature. >> >> It seems like there are two incompatible behaviors here and you and Juri >> want. One is to filter by current project, and another to be able to reuse >> previous inputs freely. >> >> If forced to choose, I would be slightly inclined toward the latter (which >> could be implemented using text properties, although the concept is >> a little awkward). But both are reasonable. >> >> I think we should install one of them and then later (on master) add a user >> option to switch to the other behavior. > > I agree with Augusto that filtering that implements project-local history > should be the default behavior for emacs-29. I tried your second patch > and it nicely handles even such sequences as `C-x p f' and `C-x p F'. > (and in the opposite direction from `C-x p F' to `C-x p f' it > filters out external files, that is expected and consistent.) That sounds like a consensus, then. I've pushed the v2 patch to emacs-29. > 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. > > BTW, in a fresh emacs -Q `C-x p f' raises: > Debugger entered--Lisp error: (void-function cl-find-if) > But not sure how important is this case since usually `C-x p f' > is invoked on a project's file when project.el with cl is loaded. ...and included a fix for this too. Thanks!