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: Thu, 15 Dec 2022 16:04:13 +0200 Message-ID: <32c2e183-eb11-ad1c-d656-b7531cb46e6c@yandex.ru> References: <8735budxiz.fsf@gmail.com> <864jvphx4r.fsf@mail.linkov.net> <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> <86o7s5i1ec.fsf@mail.linkov.net> <871qp0ncvm.fsf@gmail.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="8028"; 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 , 58447@debbugs.gnu.org To: Augusto Stoffel , Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 15 15:05:40 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 1p5orj-0001ti-Gr for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 15 Dec 2022 15:05:39 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p5orQ-0002Hi-RC; Thu, 15 Dec 2022 09:05:22 -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 1p5or8-00028l-RB for bug-gnu-emacs@gnu.org; Thu, 15 Dec 2022 09:05:07 -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 1p5or8-0001HF-HA for bug-gnu-emacs@gnu.org; Thu, 15 Dec 2022 09:05:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p5or7-0006XP-TU for bug-gnu-emacs@gnu.org; Thu, 15 Dec 2022 09:05:01 -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 14:05:01 +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.167111306525117 (code B ref 58447); Thu, 15 Dec 2022 14:05:01 +0000 Original-Received: (at 58447) by debbugs.gnu.org; 15 Dec 2022 14:04:25 +0000 Original-Received: from localhost ([127.0.0.1]:43038 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5oqW-0006X3-Ut for submit@debbugs.gnu.org; Thu, 15 Dec 2022 09:04:25 -0500 Original-Received: from mail-wm1-f44.google.com ([209.85.128.44]:54800) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5oqU-0006Wx-4x for 58447@debbugs.gnu.org; Thu, 15 Dec 2022 09:04:23 -0500 Original-Received: by mail-wm1-f44.google.com with SMTP id o15so13833628wmr.4 for <58447@debbugs.gnu.org>; Thu, 15 Dec 2022 06:04:22 -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=ZHiBcfY4P68rIB5CFly57rNUpwwKIjoO2F2MZdfvJe0=; b=BbmqGSI8JM2HU/0DC7IifB8JTvPHnURhzDFw4l6gM6O4XycErw/3XSn98BpkAwvTFB orR1COmEzCn5+nFa6GRLzmJogFf8GB+RHFzupxSe0wEkkm6XUujPd7Y+7+XfxKXYCQYF DrRnlTzwxCmFMSgKSEb8f4WnYGtKl6EHmaYakqE4/ob4qDSmezDcdEhZ+Xn0yxpyHED+ QkMe2KyDfL3OEP02n4pzfjJbSodbBxw/qv5S1fS/IhE/jkMGaxZxPHZcBCztz6v6EupS dktHm1R6NTvY3KrxQ/3kTr5M0o9X+j5nBQDqg9PZgot+tjAN9CbAeorkyUlKuWzQBA+x en0w== 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=ZHiBcfY4P68rIB5CFly57rNUpwwKIjoO2F2MZdfvJe0=; b=Ua9gVjBSoOiW/3sDPRBRVOO1j3iicrCWoTcWh+LoaarOd+hX6IbVl8/NyivtA+KOV6 Np18PxCNhiA1/2fAfa9MZfQLuLaykvmuTPwTObFTt7T48WK9zqI/fOalOoI5jMI6OQSz 5sO7PLr2jhaCCqLoG2+fMuFRCrwBR8mbAp5eNfWRZVdB42bu7Tfo4g6S2nab9xDrEWGf Pup/HqUeRh/2x/1ljzFhg55doLCiYQM1cePmdrPRAskt973HtTCSinKWsB8DOkYrSavc z3II4+V2x+pPS8Pr0D2IHfXvdHCBPeSdyTyAGG0VlQEZ2kAhln4YuL4f7dimIRQVx9tA XhrA== X-Gm-Message-State: ANoB5pnBx7os7jRYZIadNx2iZB+hXLXGiigsvbjCqY1V5tDBq6EltBcY nDgT4Z9Um1CuAyVOjVtlK/g= X-Google-Smtp-Source: AA0mqf6jz7Pp7kGHcxr25Imq9biWVHlDiMh2tgkHBxEprtHuD2u1OctbANRMvKo/TXDbzLNLt7k3Hw== X-Received: by 2002:a05:600c:5570:b0:3d1:ee6c:f897 with SMTP id ja16-20020a05600c557000b003d1ee6cf897mr22137210wmb.3.1671113056042; Thu, 15 Dec 2022 06:04:16 -0800 (PST) Original-Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id j9-20020a05600c190900b003b4cba4ef71sm7395272wmq.41.2022.12.15.06.04.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 15 Dec 2022 06:04:15 -0800 (PST) Content-Language: en-US In-Reply-To: <871qp0ncvm.fsf@gmail.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:251093 Archived-At: On 15/12/2022 13:07, Augusto Stoffel wrote: > On Thu, 15 Dec 2022 at 09:24, Juri Linkov wrote: > >>> The patches could be combined, but v1 seems to be too invasive for >>> emacs-29, yet v2 could be just small enough to be considered "bugfix-only". >>> >>> So, what does everyone think about the latter? >>> >>> If people agree that the v2 patch is an improvement, we can check it in and >>> leave project-local histories until later. >> >> Does the second patch allow such workflows as re-visiting >> the same relative filenames in another directory? > > I don't think this should be the default behavior at all. To me it > seems much more likely that a user _does not_ want to see files from > other projects when doing `C-x p f M-p'. Do you think they will mind too much? At least if the relative names are shown, the user will recognize them and won't be too surprised. > Your workflow seems more of a job the "find related file" feature that > has been discussed recently in the list. > >> IMHO, the safest fix for emacs-29 would be to add relative filenames >> to the separate history. If someone might want to use >> 'file-name-history', then a new variable could be added like >> 'query-replace-from-history-variable'. Then this variable >> could be customized to 'file-name-history', or nil. > > Then let's do the opposite. We define 'project-file-history-variable' > and let it be nil by default. In this case, we get the behavior of > Dmitry's patch v2. If it's not nil, then we assume it's to be used > as-is, with no filtering or removal of project root prefix. The user > can set it whatever way they please and take care it makes sense. The problem with that is storing relative history in such a variable will only work with one of the values of project-read-file-name-function. So we'll have two defcustoms which need to be changed in concert..?