all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Philip Kaludercic <philipk@posteo.net>
Cc: 50297@debbugs.gnu.org, Theodor Thornhill <theo@thornhill.no>
Subject: bug#50297: 28.0.50; Aggregate project functions for project.el
Date: Fri, 3 Sep 2021 03:55:24 +0300	[thread overview]
Message-ID: <729bfc0b-cb5f-c278-a4a4-60e4ef723f0f@yandex.ru> (raw)
In-Reply-To: <87mtovds0o.fsf@posteo.net>

On 02.09.2021 16:30, Philip Kaludercic wrote:

>>> - project-find-projects-under
>>>     Select a directory with projects to index all at once.
>>
>> I wonder how popular this is going to be. Do you have a flat directory
>> with projects which you only want scanned one time?
> 
> I clone most code into a directory, and I have seen others do so
> too. That being said, it might just be something unusual in the big
> picture.

I think it's usual enough, but since we try to enable all kinds of 
practices, we should try to handle as many as feasible.

I'm mostly worried about the semantics here: we say we scan all the 
projects in said directory, but we can miss some (or many). That can be 
fixed with an edit to the docstring, of course (e.g. "directly below").

>> Another issue, is that it's not going to find nested projects (and
>> project.el does support those).
> 
> My first implementation of the command tried to so something like that,
> but it was rather slow (even if I currently only have 20 projects
> checked out), and indexed a lot of projects that I wasn't interested
> in. Maybe I can look into how it can be accelerated or only search for
> nested projects when a prefix argument is supplied/not supplied.

It might be fine as it is, behavior-wise. It never occurred to me to ask 
or search for such functionality, though, so me might want to wait for 
others to chime in (who will want to use this). I'm usually fine with 
'C-x C-f' when visiting a project the first time.

>> Suppose we do add it, how about the name
>> 'project-remember-projects-under'? By analogy with
>> 'project-remember-project'.
> 
> I like it.
> 
>> Adding a new arg for the latter is fine by me either way.
>>
>>> - project-remove-zombie-projects
>>>     Check if all known projects still exist and remove those
>>>     that don't anymore
>>
>> Perhaps we should rename 'project-remove-known-project' to
>> 'project-forget-known-project'? That would make for a nice symmetry.
>>
>> Then this function could be called 'project-forget-zombie-projects'.
> 
> This also make sense. Initially I wanted to name the command that way,
> but then decided to go with "remove" to keep the naming consistent.

We might encounter some resistance (the command has been with us for 
half a year), but let's try it, at least. We can also ask Theodor 
whether he has already used the current name, 
project-remove-known-project, in some Lisp code.

>> I'm thinking about this about the slight connotation of 'remove' which
>> can mean removing from disk.
>>
>> Another approach would be to call this or similar code automatically
>> before saving the list (and cap the number of remembered projects),
>> but that comes with its own tradeoffs.
> 
> I can try it out, but I fear it might lead to annoying pauses,
> especially when a project was indexed via TRAMP.

We could skip remote projects entirely in that function (leaving it to 
the user to 'forget' them manually), or only do it for already connected 
hosts. The latter could still take some time, though.

Do you expect project-forget-zombie-projects to be useful to remote 
hosts as well? Do you also have directories on remote hosts that contain 
many projects?

>>> Especially the last two are useful to maintain a clean project list
>>> without having to manually remove every project one by one.
>>
>> What if the goal was to maintain a clean project list but minimize the
>> manual management of it by the user?
>>
>> Can you imagine a solution for that? What would be the downsides,
>> compared to the present proposal?
> 
> I can imagine zombie projects being cleaned up automatically, but
> the motivation to write project-remove-projects-under was to remove
> projects that were falsely indexed.

Could you elaborate? Falsely meaning projects you simply don't want to 
return to? A whole directory of them?

> An entirely different approach might be to implement a tabulated list
> major mode to manage projects, comparable to package-list.

I don't object to supporting this approach, built-in or in a third-party 
package, as long as we're reasonably sure there is no low-touch, 
automatic solution we can use with a similar success for the problem in 
question.

If there's none, or if we found such, and then figured that some manual 
management on top of it can still be useful, that is fine.





  parent reply	other threads:[~2021-09-03  0:55 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-31 12:47 bug#50297: 28.0.50; Aggregate project functions for project.el Philip Kaludercic
2021-09-01  1:07 ` Dmitry Gutov
2021-09-02 13:30   ` Philip Kaludercic
2021-09-02 14:45     ` Philip Kaludercic
2021-09-02 15:56       ` Juri Linkov
2021-09-03  1:02       ` Dmitry Gutov
2021-09-03  0:55     ` Dmitry Gutov [this message]
2021-09-22  0:31 ` Dmitry Gutov
2021-09-22  7:15   ` Philip Kaludercic
2021-09-22 12:13     ` Dmitry Gutov
2021-09-22 16:00   ` Juri Linkov
2021-09-22 16:44     ` Philip Kaludercic
2021-09-22 17:34       ` Dmitry Gutov
2021-09-22 18:06         ` Philip Kaludercic
2021-09-22 18:25           ` Dmitry Gutov
2021-09-22 18:53             ` Philip Kaludercic
2021-09-22 18:55   ` Philip Kaludercic
2021-09-23  2:44     ` Dmitry Gutov
2021-09-23 10:46       ` Philip Kaludercic
2021-09-23 11:56         ` Dmitry Gutov
2021-09-23 12:08           ` Philip Kaludercic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=729bfc0b-cb5f-c278-a4a4-60e4ef723f0f@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=50297@debbugs.gnu.org \
    --cc=philipk@posteo.net \
    --cc=theo@thornhill.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.