unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dmitry@gutov.dev>
To: Eli Zaretskii <eliz@gnu.org>, Spencer Baugh <sbaugh@janestreet.com>
Cc: 63870@debbugs.gnu.org
Subject: bug#63870: 29.0.90; project.el can't dynamically populate the project list
Date: Tue, 18 Jul 2023 05:21:37 +0300	[thread overview]
Message-ID: <9a053f1f-2c7b-0b50-3a8e-7949fbbac7d1@gutov.dev> (raw)
In-Reply-To: <83bkgzvj7h.fsf@gnu.org>

On 28/06/2023 15:56, Eli Zaretskii wrote:
>>> Once again, this is dangerous; users could easily shoot themselves in
>>> the foot, because not many are aware of the pitfall of using file
>>> notifications for many directories.  It makes no sense to warn against
>>> something and at the same time let callers easily stumble upon that.
>> I agree with that, I suppose.  Personally I would be fine with a
>> mandatory 1 or 2 levels of recursion, since I only need 2.  Do you have
>> a suggestion for what that interface could look like?  It feels a bit
>> awkward...
> I'd actually begin by not providing even 1 level.  Let the callers
> call this new function  explicitly for every directory which they want
> watching.  If someone ever complains that this is somehow inconvenient
> (although I don't see why: directory-files is simple to use), then we
> could consider extending the API.

That sounds about right. But I might go a little further in this 
reasoning... (*)

> But that's MO; please wait for Dmitry to chime in.

[ Sorry for the late response, I'm still uncertain about this patch. ]

(*) ... and ask whether this functionality makes sense built-in.

I appreciate that it's succinct, documented and doesn't take a lot of 
space. But would we say that it covers a significantly general use case? 
Do we know many other developers who would appreciate it? Do a lot of 
devs at Jane Street use Emacs and this same workflow? Should we ask 
people somewhere (emacs-devel/Reddit/etc) whether they will find it useful?

If it's just for one user at this point, then it shouldn't be difficult 
to maintain this code inside the init dir.

Here's also some alternative I could potentially suggest: if you have 
some code which checks out new branches for development, or projects to 
start work on, and it's written in Elisp too, could it just call 
project-remember-project at the end? That would circumvent the need for 
using file watches altogether.

Or if we do add this to project.el, we should try to make it safe for an 
average user even with a different directory structure. Suppose they 
have a dir D which they call project-watch on, and then they copy a big 
non-project directory inside. That should trigger many filenotify 
events, and since no search would result in success, I suppose the watch 
stays on, and every directory gets scanned up until the root. So an 
easy-to-enable recursive behavior seems dangerous for this case.

Needless to say, the user could call this function, spend time on other 
stuff, forget, and then get surprised by things taking longer than expected.





  reply	other threads:[~2023-07-18  2:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-03 11:55 bug#63870: 29.0.90; project.el can't dynamically populate the project list Spencer Baugh
2023-06-15 19:30 ` Spencer Baugh
2023-06-16  5:45   ` Eli Zaretskii
2023-06-17  2:55 ` Dmitry Gutov
2023-06-27 19:29   ` Spencer Baugh
2023-06-27 19:27 ` Spencer Baugh
2023-06-28 11:24   ` Eli Zaretskii
2023-06-28 12:05     ` Spencer Baugh
2023-06-28 12:18       ` Eli Zaretskii
2023-06-28 12:37         ` Spencer Baugh
2023-06-28 12:56           ` Eli Zaretskii
2023-07-18  2:21             ` Dmitry Gutov [this message]
2023-07-18 16:28               ` Spencer Baugh
2023-07-18 17:41                 ` Juri Linkov
2023-07-27  1:59                   ` Dmitry Gutov
2023-07-27  1:57                 ` Dmitry Gutov

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=9a053f1f-2c7b-0b50-3a8e-7949fbbac7d1@gutov.dev \
    --to=dmitry@gutov.dev \
    --cc=63870@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=sbaugh@janestreet.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).