From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: OSX FSEvents file watching support Date: Thu, 18 Jul 2019 12:35:49 +0300 Message-ID: <83lfwvy9ai.fsf@gnu.org> References: <0ce358e3-9333-4717-97d5-f03d882bc2d0@www.fastmail.com> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="228085"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel@gnu.org To: "Muir Manders" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 18 11:36:02 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ho2pW-000x6e-8f for ged-emacs-devel@m.gmane.org; Thu, 18 Jul 2019 11:36:02 +0200 Original-Received: from localhost ([::1]:35848 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1ho2pU-000294-SV for ged-emacs-devel@m.gmane.org; Thu, 18 Jul 2019 05:36:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44272) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1ho2pS-00028y-3M for emacs-devel@gnu.org; Thu, 18 Jul 2019 05:35:58 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:50982) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ho2pR-0002xh-RT; Thu, 18 Jul 2019 05:35:57 -0400 Original-Received: from [176.228.60.248] (port=4759 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ho2pR-0006wQ-2Q; Thu, 18 Jul 2019 05:35:57 -0400 In-reply-to: <0ce358e3-9333-4717-97d5-f03d882bc2d0@www.fastmail.com> (muir@mnd.rs) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:238631 Archived-At: > Date: Tue, 16 Jul 2019 21:18:29 -0700 > From: "Muir Manders" > > I am interested in adding support in Emacs for Mac OS "FSEvents" file watching. FSEvents allows for > efficient recursive directory watching, which would be a boon for packages like lsp-mode. > > I seem to have three options: > > 1. Write a new backend for filenotify.el. The existing backends explicitly don't support recursive watching, so > I'm not sure if it makes sense to have one special backend that does support recursive watching. What do you mean by "recursive watching"? w32notify.c supports watching changes in all the subdirectories, recursively, of a specified directory. Is that what you mean? > 2. Publish a dynamic module that wraps the FSEvents API. It seems like most OSX distributions of Emacs > have module support enabled, but I'm afraid there might be other challenges with this approach I don't know > yet. I don't think modules can currently inject events into the Emacs event queue. > 3. Publish an elisp package that calls out to an existing program that supports FSEvents like "fswatch". This > approach probably has the least friction, but doesn't allow for tweaking FSEvents settings, and might have > performance disadvantages. How would that work, implementation-wise? Filesystem events are supposed to be eventually injected into the input queue; how would you go about doing that when an external porgram does the watching?