From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Antoine Levitt Newsgroups: gmane.emacs.devel Subject: Re: Emacs inotify support? Date: Sat, 12 Sep 2009 18:36:47 +0200 Message-ID: <6fa54e4e0909120936s24634600sf00a818aabd308ce@mail.gmail.com> References: <6fa54e4e0909111554g4165418albbdffc142b3b52ee@mail.gmail.com> <83tyz8z3sl.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=00032557f4baebcbe1047364091e X-Trace: ger.gmane.org 1252774026 20121 80.91.229.12 (12 Sep 2009 16:47:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 12 Sep 2009 16:47:06 +0000 (UTC) Cc: lennart.borgman@gmail.com, joakim@verona.se, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 12 18:46:59 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MmVkU-00005C-8l for ged-emacs-devel@m.gmane.org; Sat, 12 Sep 2009 18:46:54 +0200 Original-Received: from localhost ([127.0.0.1]:47475 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MmVkT-0003n6-BD for ged-emacs-devel@m.gmane.org; Sat, 12 Sep 2009 12:46:53 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MmVal-00045K-3X for emacs-devel@gnu.org; Sat, 12 Sep 2009 12:36:51 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MmVak-00042x-0B for emacs-devel@gnu.org; Sat, 12 Sep 2009 12:36:50 -0400 Original-Received: from [199.232.76.173] (port=39846 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MmVaj-00042e-OK for emacs-devel@gnu.org; Sat, 12 Sep 2009 12:36:49 -0400 Original-Received: from qw-out-1920.google.com ([74.125.92.145]:51196) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MmVai-0001LS-4y; Sat, 12 Sep 2009 12:36:48 -0400 Original-Received: by qw-out-1920.google.com with SMTP id 5so716170qwf.24 for ; Sat, 12 Sep 2009 09:36:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type; bh=o/8tCSlPCkVszNx/xx9W/0b8BRCdYOJsnbAcuBIbUww=; b=bn2I4We3pyRNEKWOUzJwARDXlY5nLwKzYN+uyLLdGpPVAoaAC9nNlVQ6EBVhYs7eVT 54nRYcAczmOrIaArIy5tdPSe4mXsqKBW6lIi5Q3QLxI9UPz14waQpHk7YEAYy5DRmMl3 9Ock1vwS3OVGZTmwEeeECwijEdMOTjfKlqqE8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=lzmNbd8TOX4tnHYDmM2V6sbG4QUUDH6KsUck27x6NVjD1I8UTgpXc34BEYnFuEjhT1 RzTL6KXLAxWr+KurLbsDX7yNC5+Ibcz+wdzwOMQIuzdEkB0XRP7wzBN9AvuVuiB4hAu5 oqizff+eE5Kak/nEW+L6r8Da66bl12cuT6+2Q= Original-Received: by 10.229.69.83 with SMTP id y19mr1502861qci.50.1252773407213; Sat, 12 Sep 2009 09:36:47 -0700 (PDT) In-Reply-To: <83tyz8z3sl.fsf@gnu.org> X-Google-Sender-Auth: 15405a2d7510bbd1 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:115234 Archived-At: --00032557f4baebcbe1047364091e Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 2009/9/12 Lennart Borgman > > On Sat, Sep 12, 2009 at 12:54 AM, Antoine Levitt > wrote: > > and what would happen on very frequently modified > > files (ie would I be able to view a log file without being flooded by > > notifications). > > Is not this a case when you want notifications? > Imagine a log file on a web server, when there is a new line each second. With a na=EFve implementation (current dialog each time the file changes), = you wouldn't be able to do anything because notifications would be too frequent= . > > Date: Sat, 12 Sep 2009 00:54:50 +0200 > > From: Antoine Levitt > > Cc: joakim@verona.se, Emacs Development > > > > if a user has a buffer open with some file > > and that file changes outside emacs, he won't be notified of changes until > > he actually tries to modify it. Ideal case : emacs would monitor every file > > used by buffers, and notify of changes with the current dialog (continue, > > refresh, etc) in visible buffers. > > This use-case does not need any help from the OS to implement the > feature in Emacs. It should be quite easy to write a function that > runs off the idle timer and checks each file that Emacs visits. > > The OP was talking about detecting changes in files that Emacs does > not know about, including in files that are created while Emacs runs. Indeed. If possible, polling should be avoided, though. And if inotify or similar notification systems are implemented, it would be easy to support both files and directories. --00032557f4baebcbe1047364091e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
2009/9/12 Lennart Borgman <= lennart.borg= man@gmail.com>
On Sat, Sep 12, 2009 at 12:54 AM, Antoine Levitt
<antoine.l= evitt@gmail.com> wrote:
> and what would happen on very frequently modified
> files (ie would I be able to view a log file without being flooded by<= br> > notifications).

Is not this a case when you want notification= s?
Imagine a log file on a web server, when there is a new line each second. With a na=EFve implementation (current dialog each time the file changes), you wouldn't be able to do anything because notifications would be too frequent.




> > Date: Sat, 12 Sep 2009 00:54:50 +0200
> > Fr= om: Antoine Levitt <antoine.levitt@gmail.com>
> > Cc: joakim@verona.se, Emacs Develo= pment <emacs-de= vel@gnu.org>
> >
> > if a user has a buffer open = with some file
> > and that file changes outside emacs, he won'= ;t be notified of changes until
> > he actually tries to modify it= . Ideal case : emacs would monitor every file
> > used by buffers, and notify of changes with the current dialog (c= ontinue,
> > refresh, etc) in visible buffers.
>
<= div class=3D"im">> This use-case does not need any help from the OS to i= mplement the
> feature in Emacs.=A0 It should be quite easy to write a function that<= br> > runs off the idle timer and checks each file that Emacs visits.
>= ;
> The OP was talking about detecting changes in files that Emacs d= oes
> not know about, including in files that are created while Emacs= runs.

Indeed. If possible, polling should be avoided, though. And if in= otify
or similar notification systems are implemented, it would be easy = to
support both files and directories.
--00032557f4baebcbe1047364091e--