From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Added basic file system watching support. Date: Tue, 11 Dec 2012 09:44:55 +0100 Message-ID: <87pq2h5660.fsf@gmx.de> References: <6218185.ViukoKRdFp@descartes> <1604303.YKOVcvQH0F@descartes> <8738zd6n1t.fsf@gmx.de> <83ip899fd7.fsf@gnu.org> <87y5h557cx.fsf@gmx.de> <83fw3d9elh.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1355215510 18518 80.91.229.3 (11 Dec 2012 08:45:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 11 Dec 2012 08:45:10 +0000 (UTC) Cc: ruediger@c-plusplus.de, emacs-devel@gnu.org, monnier@iro.umontreal.ca, sdl.web@gmail.com To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 11 09:45:23 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 1TiLSt-0001P1-8C for ged-emacs-devel@m.gmane.org; Tue, 11 Dec 2012 09:45:23 +0100 Original-Received: from localhost ([::1]:46851 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiLSg-0003sc-L6 for ged-emacs-devel@m.gmane.org; Tue, 11 Dec 2012 03:45:10 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:33456) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiLSd-0003q1-3y for emacs-devel@gnu.org; Tue, 11 Dec 2012 03:45:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TiLSX-0003Ap-BE for emacs-devel@gnu.org; Tue, 11 Dec 2012 03:45:07 -0500 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:60128) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1TiLSX-0003Ac-0m for emacs-devel@gnu.org; Tue, 11 Dec 2012 03:45:01 -0500 Original-Received: (qmail invoked by alias); 11 Dec 2012 08:44:59 -0000 Original-Received: from p57BB98D5.dip0.t-ipconnect.de (EHLO detlef.gmx.de) [87.187.152.213] by mail.gmx.net (mp034) with SMTP; 11 Dec 2012 09:44:59 +0100 X-Authenticated: #3708877 X-Provags-ID: V01U2FsdGVkX1+qT9VRJriqyxRG0k8PYVpR/QT/YCfuP5nRQzAG+8 lu3V2VnbzeaGWj In-Reply-To: <83fw3d9elh.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 11 Dec 2012 10:29:14 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 213.165.64.22 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:155459 Archived-At: Eli Zaretskii writes: > Then Tramp could maintain its own data structure for watched files, > and give each watch a unique identifier, like (FILENAME . NUMBER), or > just NUMBER, or whatever. That I do already in my inotify-add-watch handler. Of course. > IOW, the DESCRIPTOR is an opaque data type, which the implementation > back-end, and the back-end alone, can and should interpret. The point is, that something must trigger Tramp. In inotify-add-watch, I have added the following code (shortened, there's more): --8<---------------cut here---------------start------------->8--- /* If the file name has special constructs in it, call the corresponding file handler. */ handler = Ffind_file_name_handler (file_name, Qinotify_add_watch); if (!NILP (handler)) { return call4 (handler, Qinotify_add_watch, file_name, aspect, callback); } --8<---------------cut here---------------end--------------->8--- In inotify-rm-watch I couldn't add similar lines, because file_name is unknown. My proposal is either to add file_name as first argument of inotify-rm-watch, or to declare WATCH-DESCRIPTOR as a cons cell, which car is always the file name. Best regards, Michael.