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, 27 Oct 2022 19:07:35 +0300 Message-ID: References: <8735budxiz.fsf@gmail.com> <83a662dvgo.fsf@gnu.org> <871qqvj6qb.fsf@gmail.com> <42bb91a0-60ff-2e51-dcdc-c1e1f80e31ec@yandex.ru> <837d0lmmpi.fsf@gnu.org> <1cce089a-546e-7f13-0907-3d36452aef10@yandex.ru> <87wn8libr6.fsf@gmail.com> <87o7txi7k8.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="12593"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Cc: Eli Zaretskii , 58447@debbugs.gnu.org To: Augusto Stoffel Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 27 18:09: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 1oo5Rs-00033h-GD for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 27 Oct 2022 18:09:40 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oo5QQ-0006cS-T0; Thu, 27 Oct 2022 12:08:10 -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 1oo5QI-0006Wn-4y for bug-gnu-emacs@gnu.org; Thu, 27 Oct 2022 12:08:03 -0400 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 1oo5QH-0004Y2-Tb for bug-gnu-emacs@gnu.org; Thu, 27 Oct 2022 12:08:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oo5QH-0007Zd-OC for bug-gnu-emacs@gnu.org; Thu, 27 Oct 2022 12:08:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Oct 2022 16:08: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.166688686529082 (code B ref 58447); Thu, 27 Oct 2022 16:08:01 +0000 Original-Received: (at 58447) by debbugs.gnu.org; 27 Oct 2022 16:07:45 +0000 Original-Received: from localhost ([127.0.0.1]:59049 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo5Q1-0007Z0-C0 for submit@debbugs.gnu.org; Thu, 27 Oct 2022 12:07:45 -0400 Original-Received: from mail-wr1-f43.google.com ([209.85.221.43]:38822) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo5Q0-0007Yk-3t for 58447@debbugs.gnu.org; Thu, 27 Oct 2022 12:07:44 -0400 Original-Received: by mail-wr1-f43.google.com with SMTP id a14so3069462wru.5 for <58447@debbugs.gnu.org>; Thu, 27 Oct 2022 09:07:44 -0700 (PDT) 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=yz+Z72vsOjd+M0jAAzH3mnyNpjptK3Ldk949Vt8JIow=; b=WPb4adWt4wU85RG06y0JNU+cOUldFNeYjJIXF3dOYUOhyPUlExJR45/XoADpmfmaZm BUxcwKGAsySmqtvSl+JosGhofms5mG5ASITdIL2gmL09n3XjQ8y/EEWxqf6r2LSEfDNT aaMMPbMqm4l1TpGzwyesk5O6KvgdP27gSZAQXE95733aB+oyugSFIu2pYUNM0ki2hWyI P7kISzcKPCOGThL9RdmBzOi2QSpO8nd+GZvbq+AP72pJvwfkdeNA4CynMIvfCxg6wjKM XKhYH3M6gCoIjgYRQz67eSW7GboOUA+yHFQT8csBspuZk4inlKy67uEptejZvZWhI6gT yYlQ== 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=yz+Z72vsOjd+M0jAAzH3mnyNpjptK3Ldk949Vt8JIow=; b=CFewUYB2MX55wtwYiwoxWP+psbv/4q3mR4f8GJcmaFVz40KbwoYr3h9fj485RVaW6S QPfvJf2LHfy+U7hS+BiRPD3PDIa+exxZ/g8zbHazF1jo8lm9seLdiceANCd2ZNYjZGeL 4rV9/M4DgtcCocDLt8KzgtT/Vz/gSK7SLGLPqgDscr9AcskdpkWAbXNenwlQ/7NFjLNb n5iwF8+a3qVRVfXh1AQdYFLiem0YKfTjt91A2+PcykK/Lx+5hQAWDV1hf/nmlF6o+MR4 vtju6sQlnj4Qv2kSCoWDUoyM0Byhegod0sFDdadAUnaptvmYpT+2Ub4t9aPN8gmHNVuC qTEw== X-Gm-Message-State: ACrzQf2plGHAjObeJl2E2b6AeR3s3Ar9zSfTPPsH+ukIqP0/AHQNrswJ zKCoPejld3IlB8iF7NYalYk= X-Google-Smtp-Source: AMsMyM4cVIqhnB3OHHvOqoLEVZ6qkeiMbjJD+IzLwGpDoQM8V+iXIGroEnuidYLVaqAACwTGLFwktQ== X-Received: by 2002:a05:6000:1d82:b0:22c:ae77:c8dc with SMTP id bk2-20020a0560001d8200b0022cae77c8dcmr33255999wrb.413.1666886858263; Thu, 27 Oct 2022 09:07:38 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id e30-20020a5d595e000000b002366d1cc198sm1462491wri.41.2022.10.27.09.07.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Oct 2022 09:07:37 -0700 (PDT) Content-Language: en-US In-Reply-To: <87o7txi7k8.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: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246316 Archived-At: On 27.10.2022 18:56, Augusto Stoffel wrote: > On Thu, 27 Oct 2022 at 18:36, Dmitry Gutov wrote: > >> On 27.10.2022 17:26, Augusto Stoffel wrote: >>> One thing to consider here is compatibility with savehist-mode and the >>> like. I guess the only simple way to achieve this is with one global >>> variable per project. >> I suppose interning a symbol with the project root directory in its >> name could work. > The project root directory or the project name? I'd say the latter. We don't have a "project name" generic yet. There is a bug open. And even so, unrelated projects could declare equal names, couldn't they? > If you have two copies of the same project in two different places > (which I often have -- a local copy and one in a remote compute > machine), then the shell and compilation buffers are shared. One can > argue whether this is good or bad (I find it okay, with some caveats), > but for the sake of consistency the history variable should also be > shared among copies of the same project. I imagined the project names would be used in the project selector instead of their root directories, not in addition to them. So they'd have to be unique even across "copied projects". But you can bring up that idea in bug#48747. >> Passing it to completing-read will unavoidably result in relative >> names still, though. But it won't be so much of a problem anymore. > If we settle for one history variable per project, then I'd say yes, the > entries should be relative file names. Ok. >>> And then there would be the issue of when to >>> garbage-collect the saved save pertaining to old projects. >> Inside project--remove-from-project-list? Either one specific project, >> or doing a full scan of obarray. > Okay, if "garbage collection" of projects is already a thing, then we > just have to extend it to contemplate the history variable. There is no "garbage collection" point exactly, but we could pivot to making one. The main reason I didn't do that is scanning the full project list with file-readable-p check will likely become slow quickly enough, especially in the presence of remote projects.