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: Wed, 28 Jun 2023 08:37:58 -0400 Message-ID: References: <83sfabvngh.fsf@gnu.org> <83edlvvky4.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25391"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 63870@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 28 14:39:14 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 1qEUS2-0006RH-QD for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 28 Jun 2023 14:39:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qEURr-00007g-5k; Wed, 28 Jun 2023 08:39:03 -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 1qEURq-00007G-Co for bug-gnu-emacs@gnu.org; Wed, 28 Jun 2023 08:39:02 -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 1qEURq-0002oN-2Z for bug-gnu-emacs@gnu.org; Wed, 28 Jun 2023 08:39:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qEURp-0005kq-To for bug-gnu-emacs@gnu.org; Wed, 28 Jun 2023 08:39:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 28 Jun 2023 12:39:01 +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.168795588622036 (code B ref 63870); Wed, 28 Jun 2023 12:39:01 +0000 Original-Received: (at 63870) by debbugs.gnu.org; 28 Jun 2023 12:38:06 +0000 Original-Received: from localhost ([127.0.0.1]:50240 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEUQv-0005jL-Ss for submit@debbugs.gnu.org; Wed, 28 Jun 2023 08:38:06 -0400 Original-Received: from mxout5.mail.janestreet.com ([64.215.233.18]:54261) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEUQu-0005is-0n for 63870@debbugs.gnu.org; Wed, 28 Jun 2023 08:38:04 -0400 In-Reply-To: <83edlvvky4.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 28 Jun 2023 15:18: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:264211 Archived-At: Eli Zaretskii writes: >> From: Spencer Baugh >> Cc: 63870@debbugs.gnu.org >> Date: Wed, 28 Jun 2023 08:05:23 -0400 >> >> Eli Zaretskii writes: >> >> > Beware of watching a tree recursively: file notifications are not very >> > scalable, for more than one reason. For example, the inotify backend >> > consumes a file descriptor and a slot in the descriptor set monitored >> > by pselect per each file/directory you watch. And watching many >> > directories can overwhelm Emacs if some program (even unrelated to >> > Emacs) performs many file operations in that directory; VCS programs >> > are notorious in this regard, e.g., when you update from upstream. >> >> Absolutely. I am trying to be careful about this: project-watch >> shouldn't create watches on VCS directories. > > But below you explicitly give an example where it will. And given the > fact that the majority of project.el projects use VCS as its backend, > I'd say we are already there... No: the watch on a directory is removed once the directory becomes a VCS directory. >> > Are you sure this feature justifies the risks? When would someone >> > want to use it, while simultaneously limiting the value of RECURSIVE >> > to some small integer? (And what is considered "small" for these >> > purposes?) >> >> Imagine, for example, that a user has a directory ~/src. They make all >> their VCS clones directly under ~/src: ~/src/emacs, ~/src/glibc, etc. >> And when they work on a new project, they create that new clone under >> ~/src. >> >> If the user wanted all these VCS clones to show up in Emacs as soon as >> they're made, they could run (project-watch "~/src" 1). This would >> create a watch on ~/src, which would create watches on new empty >> directories under ~/src (e.g. ~/src/gdb); the watch on ~/src/gdb would >> stop if and when ~/src/gdb becomes a project (as defined above). >> >> So in the steady state, if ~/src contains only projects, Emacs would run >> exactly one watch, the one on ~/src. This is definitely okay. >> >> If, instead, ~/src has a two-level structure, where ~/src/emacs is not >> itself a clone but instead contains a clone for each branch, >> e.g. ~/src/emacs/emacs-29 and ~/src/emacs/trunk, then a user might run >> (project-watch "~/src" 2). Then in the steady state there would be one >> watch on ~/src and one watch on each subdirectory of ~/src, >> e.g. ~/src/emacs. (This is the setup I personally have.) > > If you want to support one or two levels of recursion, let's support > just that and remove the too-general RECURSIVE argument. If you think > there might be important use cases where there's more than one or two > levels of recursion, please describe them. Hm, well, I assume some users might use even more structure than this; for example, some might have ~/src/gnu/emacs/emacs-29. Then they'd want 3 levels of recursion. > 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...