From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?=C3=93scar_Fuentes?= Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Added inotify support. Date: Wed, 03 Oct 2012 01:46:33 +0200 Message-ID: <87obkkcu92.fsf@wanadoo.es> References: <2181827.T3JxG88qQt@descartes> <83lifoa7hr.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1349221670 10135 80.91.229.3 (2 Oct 2012 23:47:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 2 Oct 2012 23:47:50 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 03 01:47:55 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 1TJCBp-0007Y7-8F for ged-emacs-devel@m.gmane.org; Wed, 03 Oct 2012 01:47:49 +0200 Original-Received: from localhost ([::1]:33375 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJCBj-0001nN-O1 for ged-emacs-devel@m.gmane.org; Tue, 02 Oct 2012 19:47:43 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJCBh-0001nI-58 for emacs-devel@gnu.org; Tue, 02 Oct 2012 19:47:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TJCBg-0002mS-2E for emacs-devel@gnu.org; Tue, 02 Oct 2012 19:47:41 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:37787) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJCBf-0002mO-Rf for emacs-devel@gnu.org; Tue, 02 Oct 2012 19:47:39 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TJCBb-0006Xq-Sd for emacs-devel@gnu.org; Wed, 03 Oct 2012 01:47:35 +0200 Original-Received: from 161.red-83-34-29.dynamicip.rima-tde.net ([83.34.29.161]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 03 Oct 2012 01:47:35 +0200 Original-Received: from ofv by 161.red-83-34-29.dynamicip.rima-tde.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 03 Oct 2012 01:47:35 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 37 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 161.red-83-34-29.dynamicip.rima-tde.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) Cancel-Lock: sha1:yDJerPsHqw8QyaPedhATcR9aksA= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:153966 Archived-At: Eli Zaretskii writes: > Btw, what are Emacs use cases for using this kind of feature? Apart from those mentioned on the original message (dired or magit's (or vc-dir) status view) I'll like to mention auto-revert-mode. Currently auto-revert is a bit of a hack, in the sense that Emacs implements a poor man's method for being aware of file changes. Checking the timestamps every N seconds is cumbersome and has annoying side-effects compared to the Right Thing. > Watching a directory or even a single file can easily flood Emacs with > many events, There are users that turn on auto-revert-mode on all file buffers. When you accumulated quite a few buffers, checking all the associated timestamps can be a bit lengthy and disruptive, so auto-revert-stop-on-user-input was introduced (another hack). Plus, waiting 5 seconds for checking for changes is, sometimes, annoyingly long, and decreasing that value may end on too much workload for Emacs. > and in some extreme cases (like watching /tmp, especially > using IN_ACCESS) so many that it will probably make Emacs unusable. > (The equivalent Windows APIs give you an even longer rope, in that you > can watch a directory and all its subdirectories, recursively, with a > single watch handle.) Also, a typical file operation can be presented > 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? You are leaving this case to extremes. Emacs already allows you to do very silly things. Let's not throw out useful features simply because they might be abused.