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 basic file system watching support. Date: Tue, 11 Dec 2012 12:15:25 +0200 Message-ID: <83a9tkao8y.fsf@gnu.org> References: <6218185.ViukoKRdFp@descartes> <1604303.YKOVcvQH0F@descartes> <8738zd6n1t.fsf@gmx.de> <83ip899fd7.fsf@gnu.org> <87y5h557cx.fsf@gmx.de> <83fw3d9elh.fsf@gnu.org> <87pq2h5660.fsf@gmx.de> <83ehix9bcs.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1355220979 1958 80.91.229.3 (11 Dec 2012 10:16:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 11 Dec 2012 10:16:19 +0000 (UTC) Cc: ruediger@c-plusplus.de, sdl.web@gmail.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: michael.albinus@gmx.de Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 11 11:16:29 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 1TiMsz-00081q-Iv for ged-emacs-devel@m.gmane.org; Tue, 11 Dec 2012 11:16:25 +0100 Original-Received: from localhost ([::1]:40354 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiMsm-0005Il-Lh for ged-emacs-devel@m.gmane.org; Tue, 11 Dec 2012 05:16:12 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:50783) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiMsL-0004X0-Dt for emacs-devel@gnu.org; Tue, 11 Dec 2012 05:15:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TiMsA-0003vw-O1 for emacs-devel@gnu.org; Tue, 11 Dec 2012 05:15:45 -0500 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:44632) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiMsA-0003vb-Fv for emacs-devel@gnu.org; Tue, 11 Dec 2012 05:15:34 -0500 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0MEV009002OZXY00@a-mtaout21.012.net.il> for emacs-devel@gnu.org; Tue, 11 Dec 2012 12:15:32 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MEV009Q135VTM40@a-mtaout21.012.net.il>; Tue, 11 Dec 2012 12:15:31 +0200 (IST) In-reply-to: <83ehix9bcs.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.169 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:155462 Archived-At: > Date: Tue, 11 Dec 2012 11:39:15 +0200 > From: Eli Zaretskii > Cc: ruediger@c-plusplus.de, emacs-devel@gnu.org, monnier@iro.umontreal.ca, > sdl.web@gmail.com > > > --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. > > IMO, this design is wrong. Tramp is just one more back-end for this > feature, in addition to two others: inotify and w32notify. So I think > Tramp handlers should be called from a higher-level code, one that > calls whichever back-end is appropriate. Otherwise, we will need to > implement the Tramp support twice, in 2 different sets of primitives. Moreover, Tramp shouldn't use Qinotify_* symbols, but some (currently non-existent) platform-independent symbols, e.g. Qfile_notify_*. Otherwise, a Windows user will not be able to use this feature in conjunction with remote files residing on Posix hosts, because Qinotify_* are only defined when Emacs is built with local inotify support, which is impossible on Windows. Again, this calls for some design discussions.