From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?q?R=C3=BCdiger_Sonderfeld?= Newsgroups: gmane.emacs.devel Subject: Re: [PATCH updated] Support for filesystem watching (inotify) Date: Sun, 5 Jun 2011 01:43:16 +0200 Message-ID: <201106050143.17405.ruediger@c-plusplus.de> References: <201106040034.15598.ruediger@c-plusplus.de> <201106041913.09203.ruediger@c-plusplus.de> <8762olmk6y.fsf@ambire.localdomain> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1307242250 16163 80.91.229.12 (5 Jun 2011 02:50:50 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 5 Jun 2011 02:50:50 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Thien-Thi Nguyen" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 05 04:50:44 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QT3QJ-00024Q-KZ for ged-emacs-devel@m.gmane.org; Sun, 05 Jun 2011 04:50:43 +0200 Original-Received: from localhost ([::1]:56655 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QT3QI-0007Jk-TK for ged-emacs-devel@m.gmane.org; Sat, 04 Jun 2011 22:50:42 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:47308) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QT0Uy-00011C-Id for emacs-devel@gnu.org; Sat, 04 Jun 2011 19:43:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QT0Ux-0005LN-DN for emacs-devel@gnu.org; Sat, 04 Jun 2011 19:43:20 -0400 Original-Received: from pseudoterminal.org ([213.239.220.147]:43152) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QT0Ux-0005LG-64 for emacs-devel@gnu.org; Sat, 04 Jun 2011 19:43:19 -0400 Original-Received: from liny.localnet (93-82-3-77.adsl.highway.telekom.at [93.82.3.77]) by pseudoterminal.org (Postfix) with ESMTPSA id 2A5578BCD61; Sun, 5 Jun 2011 01:43:18 +0200 (CEST) User-Agent: KMail/1.13.6 (Linux/2.6.38-8-generic; KDE/4.6.2; x86_64; ; ) In-Reply-To: <8762olmk6y.fsf@ambire.localdomain> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 213.239.220.147 X-Mailman-Approved-At: Sat, 04 Jun 2011 22:50:26 -0400 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:140184 Archived-At: Hi, thank your for your comments. I changed the arguments and changed an unkown= =20 aspect into an error. See my reply to Jan Dj=C3=A4rv for the version of the= patch=20 containing the changes. On Saturday 04 June 2011 22:10:45 Thien-Thi Nguyen wrote: > + /* TODO: check if file is already in the watch_list. */ >=20 > Moreover, you need to decide what to do given, for example: > (progn (file-watch "foo" 'modify 'notify-modify) > (file-watch "foo" 'move 'notify-move)) > Is this OK, is this an error, is this "close to" an error? > I think a simple "file is already in" check is insufficient. Yes, this is a bit complicated. The inotify API itself does not create a=20 separate event number if you try to watch the same file. But this could of= =20 course be done in the implementation by checking which callback corresponds= to=20 which event. But I'm not sure if this is the right way to handle it. =20 > + watch_list =3D Fcons(Fcons(make_number(watchdesc), Flist(2, args)), > watch_list); >=20 > You can use =E2=80=98acons=E2=80=99: (acons K V ALIST) =E2=89=A1 (cons (c= ons K V) ALIST). Sadly acons is not available from the C API.