From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Added inotify support. Date: Tue, 02 Oct 2012 23:28:48 +0200 Message-ID: <83lifoa7hr.fsf@gnu.org> References: <2181827.T3JxG88qQt@descartes> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: ger.gmane.org 1349213379 9352 80.91.229.3 (2 Oct 2012 21:29:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 2 Oct 2012 21:29:39 +0000 (UTC) Cc: emacs-devel@gnu.org, monnier@iro.umontreal.ca, sdl.web@gmail.com To: =?utf-8?Q?R=C3=BCdiger?= Sonderfeld Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 02 23:29:41 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TJA1N-0001zi-R7 for ged-emacs-devel@m.gmane.org; Tue, 02 Oct 2012 23:28:53 +0200 Original-Received: from localhost ([::1]:35665 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJA1I-0001TN-8g for ged-emacs-devel@m.gmane.org; Tue, 02 Oct 2012 17:28:48 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57438) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJA1F-0001T6-B2 for emacs-devel@gnu.org; Tue, 02 Oct 2012 17:28:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TJA1E-00064h-5r for emacs-devel@gnu.org; Tue, 02 Oct 2012 17:28:45 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:46891) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJA1D-00064d-Tv for emacs-devel@gnu.org; Tue, 02 Oct 2012 17:28:44 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MBA00000BMP7J00@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Tue, 02 Oct 2012 23:28:38 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MBA000I9BNQ2I20@a-mtaout20.012.net.il>; Tue, 02 Oct 2012 23:28:38 +0200 (IST) In-reply-to: <2181827.T3JxG88qQt@descartes> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.166 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:153961 Archived-At: > From: R=C3=BCdiger Sonderfeld > Date: Mon, 01 Oct 2012 16:09:55 +0200 > Cc: Leo , emacs-devel@gnu.org >=20 > On Monday 01 October 2012 00:38:09 Stefan Monnier wrote: > > If there's a good chance this won't work without breaking compati= bility, > > maybe a better option is to provide a low-level API that maps ver= y > > closely to inotify and then an Elisp layer on top which abstracts= away > > differences between different systems. In that case we can insta= ll the > > inotify support right away while we're still experimenting with t= he > > higher-level abstraction. >=20 > That's probably the best approach here. I changed the patch to pro= vide a low > level inotify interface. However I did not provide an inotify_init= (2) like=20 > function and instead initialization and closing of the inotify hand= le is done > internally. I don't think that this should be exposed to elisp eve= n in the=20 > low level interface. Btw, what are Emacs use cases for using this kind of feature? Watching a directory or even a single file can easily flood Emacs wit= h many events, and in some extreme cases (like watching /tmp, especiall= y using IN_ACCESS) so many that it will probably make Emacs unusable. (The equivalent Windows APIs give you an even longer rope, in that yo= u can watch a directory and all its subdirectories, recursively, with a single watch handle.) Also, a typical file operation can be presente= d as a series of notifications that are not easy to make sense of, unless you are a filesystem expert and know exactly what to expect. Maybe we should think a little more, before we expose all the guts of inotify to the Lisp level. It's not like anyone will write an OS in Emacs Lisp any time soon, is it?