From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Spencer Baugh Newsgroups: gmane.emacs.bugs Subject: bug#63870: 29.0.90; project.el can't dynamically populate the project list Date: Tue, 27 Jun 2023 15:29:48 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37455"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 63870@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 27 21:30:11 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 1qEEOB-0009bK-O6 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 27 Jun 2023 21:30:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qEEO8-0008UX-Qa; Tue, 27 Jun 2023 15:30:08 -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 1qEEO3-0008UH-G2 for bug-gnu-emacs@gnu.org; Tue, 27 Jun 2023 15:30:06 -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 1qEEO2-0007XC-Md for bug-gnu-emacs@gnu.org; Tue, 27 Jun 2023 15:30:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qEEO2-0001E8-Fz for bug-gnu-emacs@gnu.org; Tue, 27 Jun 2023 15:30:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Jun 2023 19:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63870 X-GNU-PR-Package: emacs Original-Received: via spool by 63870-submit@debbugs.gnu.org id=B63870.16878941964677 (code B ref 63870); Tue, 27 Jun 2023 19:30:02 +0000 Original-Received: (at 63870) by debbugs.gnu.org; 27 Jun 2023 19:29:56 +0000 Original-Received: from localhost ([127.0.0.1]:49561 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEENv-0001DN-Vt for submit@debbugs.gnu.org; Tue, 27 Jun 2023 15:29:56 -0400 Original-Received: from mxout5.mail.janestreet.com ([64.215.233.18]:34791) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEENt-0001DA-V1 for 63870@debbugs.gnu.org; Tue, 27 Jun 2023 15:29:54 -0400 In-Reply-To: (Dmitry Gutov's message of "Sat, 17 Jun 2023 05:55:59 +0300") 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:264176 Archived-At: Dmitry Gutov writes: > Hi! > > On 03/06/2023 14:55, Spencer Baugh wrote: >> I'd like a customization point where I can supply a function (or list of >> functions) which project-known-project-roots should run to produce an >> additional list of project root directories, which should then be >> appended to project--list. > > Are you sure the existing functions won't cut it? Such as > project-remember-project and project-forget-project. > > The names might seem a little wrong, but keeping in mind that > project--list is about having a list of projects "remembered" > somewhere, they're probably fine. And you could let-bind project--list > somewhere at the top level in your function/command/etc, so the list > is not altered in the end. Oh, certainly project-{remember,forget}-project work, indeed I've used them in the patch I just posted. I think I was unclear about what I wanted, perhaps that patch clarifies what exactly I was looking for. >> I don't need project.el to specifically remember these projects; they'll >> be remembered automatically as users use them, and completing-read will >> nicely deduplicate the project roots anyway. > > We could add some var like project-list-no-write, so that dynamic > changes don't get written to disk. > > Unless you want to keep the "dynamic" list to be used by regular > commands, that is. > > In that case, the above will probably not suffice. We could go with > your approach, or even add some project-list-sources hook. > > But how would the entries from different sources (e.g. the list file > and your dynamic list) combined? How will they be sorted? > > In case we can't come up with a generic way, we could simply add a > generic storage abstraction (similar to xref-history-storage), which > you would override/advise to combine the lists as needed for your > usage. I don't think these changes are necessary after all. (Which is good, because they would add a fair bit of complexity.) This file-notify approach I think should work perfectly for a wide variety of uses.