From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Augusto Stoffel Newsgroups: gmane.emacs.bugs Subject: bug#58447: [PATCH] In project-find-file, add absolute file name to history Date: Wed, 14 Dec 2022 20:32:46 +0100 Message-ID: <87cz8ln5lt.fsf@gmail.com> References: <8735budxiz.fsf@gmail.com> <83v8o5l0wa.fsf@gnu.org> <5c1cc828-5fcd-667f-41d4-f19923b2958e@yandex.ru> <87k04li5nw.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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29419"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 58447@debbugs.gnu.org, Juri Linkov To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 14 20:33:30 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 1p5XVS-0007S3-Jm for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 14 Dec 2022 20:33:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p5XV9-0000cE-7J; Wed, 14 Dec 2022 14:33:11 -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 1p5XV2-0000bk-7G for bug-gnu-emacs@gnu.org; Wed, 14 Dec 2022 14:33:05 -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 1p5XV0-0003Ww-LS for bug-gnu-emacs@gnu.org; Wed, 14 Dec 2022 14:33:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p5XV0-0000oq-GQ for bug-gnu-emacs@gnu.org; Wed, 14 Dec 2022 14:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Augusto Stoffel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Dec 2022 19:33: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.16710463783142 (code B ref 58447); Wed, 14 Dec 2022 19:33:02 +0000 Original-Received: (at 58447) by debbugs.gnu.org; 14 Dec 2022 19:32:58 +0000 Original-Received: from localhost ([127.0.0.1]:41149 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5XUw-0000oc-4B for submit@debbugs.gnu.org; Wed, 14 Dec 2022 14:32:58 -0500 Original-Received: from mail-ej1-f47.google.com ([209.85.218.47]:41671) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5XUs-0000oW-MM for 58447@debbugs.gnu.org; Wed, 14 Dec 2022 14:32:57 -0500 Original-Received: by mail-ej1-f47.google.com with SMTP id u19so28543320ejm.8 for <58447@debbugs.gnu.org>; Wed, 14 Dec 2022 11:32:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=xjqBUD+QphiVN3HgYpfJjirubGJN5/0BSzwBZCa0vUA=; b=O3MEqNEXUXvTt/cRKVBrMBY8GBv3BDptBJ7vXlc/jwjRQufE4NmS2JAPdKdZilTqjU 27FTLyO+RkgHbmFftseIOLUCYQXTqbJa2PEl0QJV27blXHSfEIT6gkjIxG6hFk1R8eDL Vk7qi2oTI/DjaiZ2fGV26u5ErI1tYUONUDUYJQ6dg0d6XzTcjCPJZB/VAm5almrZYY1I c5Ky3KOghwFFlv7/0T6THLY2+CysRRPYwF8hkPGEGWD2hUC7k9KPR+sHa4FpKWFyoJ3a Zq/12iY+psBb7YcwkvGUpQOo1MkWDQvy4migTMin271ui2+2XulkLF6UgDUUJZ8794rU 4/wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=xjqBUD+QphiVN3HgYpfJjirubGJN5/0BSzwBZCa0vUA=; b=BE3epfNzOTnYIgvyinPxeFe7lWimter1fPahDCVq2CiXLPCmTCrEiYCFpu71nM/GnP q4qYzmPK+aZB3rufOHm2YjqADPu134HxZ5Ag7ZsVzWU7ebmppVg8KnmeTTRk+PdJDOO5 JrFQoMJB4iku/q+sApAa/NZ/phGBJ2yLNtc3yV6xlzS2gR+pC8n6XyZD4A/deCgjDCZf mzoXdX+yiUtabeVqFJkv72cluB7lsACtNiPLYHNOkhMWuju6S+hy54/E1E8TxvDAMmeC yWod0npFqS/T09ilGorkeSHQgOYADLS+m1gIejkZXw0mhVX/1rIMGTZFUo+bt93LHv4k Jmaw== X-Gm-Message-State: ANoB5pkfrGCZodFM1hklvVyMrqvgtFg77zq2kdAfiFs6bZOwuxA7Lfpy k2r5lrfrt4HoDxxsuemdyTI3IuRw2gvxZg== X-Google-Smtp-Source: AA0mqf7cNiFVgcQaKcXhM8qipZBKDXWM26x5mhrM9hN3H3THprFLduOIWJMQimHTPe72DgXvhqMIpA== X-Received: by 2002:a17:906:ee2:b0:78d:f454:ba04 with SMTP id x2-20020a1709060ee200b0078df454ba04mr22179997eji.3.1671046368301; Wed, 14 Dec 2022 11:32:48 -0800 (PST) Original-Received: from ars3 ([2a02:8109:8ac0:56d0::4ddd]) by smtp.gmail.com with ESMTPSA id sb25-20020a1709076d9900b007c0f5d6f754sm6261479ejc.79.2022.12.14.11.32.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Dec 2022 11:32:47 -0800 (PST) In-Reply-To: <1d03758e-369a-c522-a91a-696243f1074f@yandex.ru> (Dmitry Gutov's message of "Wed, 14 Dec 2022 20:45:13 +0200") 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:250988 Archived-At: On Wed, 14 Dec 2022 at 20:45, Dmitry Gutov wrote: > On 14/12/2022 18:47, Augusto Stoffel wrote: >> On the other hand, your trick works by accident. If you switch between >> unrelated projects, then 'C-x p f M-p' brings up a non-existing file. >> One might say each project should have its own history, but then it's >> not clear whether/when equally named projects in different locations >> should count as "the same" project. > > Perhaps the first step to resolving all this is for project-find-file > to use a different history variable than find-file. This is fine by me, but do you feel confident such a variable will be a good design for the long run? In particular, have you discarded the idea of per-project history variables? The advantage of my suggestion (filter the file-name-history on the fly) is that no new variables need to be defined, so nothing needs to be obsoleted and phased out if we change our minds. > Which makes sense, given that one (usually) uses relative file names, > and the other -- absolute ones. > > Maybe project--read-file-absolute could continue using the current > variable, too. > > As a result, all projects will share history, for good and > bad. Perhaps next we could do something about that, e.g. if the > history iteration could allow pre-filtering, we could also filter out > non-existing files. This kind of filtering would be slower than the one I proposed, and prohibitively slow over Tramp, I think.