From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#26126: 26.0.50; file-notify-rm-watch removes arbitrary watches Date: Sat, 25 Mar 2017 18:09:34 +0100 Message-ID: <87efxl8er5.fsf@detlef> References: <87r31x9ulw.fsf@luca> <87shmcney8.fsf@detlef> <87efxw7xvc.fsf@luca> <87mvcjophx.fsf@detlef> <87tw6rssoi.fsf@luca> <87pohfkmvh.fsf@detlef> <87lgs2sobr.fsf@luca> <87y3w2gywc.fsf@detlef> <8737e8excq.fsf@luca> <877f3el80j.fsf@luca> <87a889jvvw.fsf@detlef> <87shm1fhx0.fsf@luca> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1490461814 30343 195.159.176.226 (25 Mar 2017 17:10:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 25 Mar 2017 17:10:14 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: 26126@debbugs.gnu.org To: Andreas Politz Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 25 18:10:11 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1crpCX-000757-Tg for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Mar 2017 18:10:06 +0100 Original-Received: from localhost ([::1]:38042 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1crpCd-0001bE-JE for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Mar 2017 13:10:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58107) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1crpCX-0001ZY-NV for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2017 13:10:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1crpCU-0008OH-Hl for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2017 13:10:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46342) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1crpCU-0008Nz-Ea for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2017 13:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1crpCU-00086q-8x for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2017 13:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Mar 2017 17:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26126 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 26126-submit@debbugs.gnu.org id=B26126.149046178431142 (code B ref 26126); Sat, 25 Mar 2017 17:10:02 +0000 Original-Received: (at 26126) by debbugs.gnu.org; 25 Mar 2017 17:09:44 +0000 Original-Received: from localhost ([127.0.0.1]:44541 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1crpCC-00086E-8R for submit@debbugs.gnu.org; Sat, 25 Mar 2017 13:09:44 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:57803) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1crpCA-000861-5c for 26126@debbugs.gnu.org; Sat, 25 Mar 2017 13:09:42 -0400 Original-Received: from detlef.gmx.de ([87.146.63.110]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MJSQ7-1ctlGW1Uhn-0035ha; Sat, 25 Mar 2017 18:09:35 +0100 In-Reply-To: <87shm1fhx0.fsf@luca> (Andreas Politz's message of "Sat, 25 Mar 2017 17:19:23 +0100") X-Provags-ID: V03:K0:nK+sv0wVUkZW+SZGaQRLIJj9SfStGR52nTRZWVZ+XFnhMciZzrD EI1XASbyW14deaKhX6/I1pPtUQIy9gR38gXgjeGXH4pDB4xM0sdFA9GyuXQ1hV5GlE2iG5q FNT3DnGk78WhRy06JHznE3viEamqJxMe8lg+0gja3RsIk2Op7fXFCyhFLvzzKMX1+qe6P6E Z0/73hrFatX2d1onz2KlQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:vQR1PHsL7VY=:yQ5+GLBfBcQbKNkIyByqYm cvNAr9Ol6MoZ5jCM5z9x0sMjI68kraUdpZYYjs8o/sHAV4CYrS/CD1/afG0rtVUM8PmTPsbyM 2744/EUIDKZLwrCJBE23c727iQIE8JHOnnkKXoSl7ZWUf7c6vW9v0ipqDbltsQdk3Zf/QnRNf rbNXVLhtRqhmhv1rRzk9pxQDxs8HtYMyM1QeM+sugsIMv0KwWNCUvCMSAawBgYp8qunPSaDmU MSrkyBW3258RhPK7Pqgumg0gcr86e2a5NGt6HK0bkbTN6wRS+U+33X7TEK+QcgaPEmGBnE1jq I+8k0lAj4hxQxRl78jgVW2mfWc3m1oCO5UpD78sAAVSIjy4lE8qzQUWtjDF2GV2dU3F/eb7O4 U3BzCCqoyoWqpddpbB4Mvq36U2rMdAudEyzJMvghOWbawBtJFYQ2oUyjL5zjbbBX1108ppgrP IPpZIbU89L0mMPI/vbQkGpZIokfiTR/EljVOH4CFV/g4pWKn3Tg8iQDa/8YLPODqlKJCkZI3s pjNW3Y5J9H7VV74EiaiNw0ixtdIrf0V9Y4uc2aQcRCKorJ6DqTi6glSRhTt8lpMnNRVXPb6g9 mTbP1scFejOcLRUzA2Pk4miNeq8MBjbH4oS7fJcBYMfDRZVTp0RZw1iLyBlfHl7NtlRv325ZR a1FrrK5CHRAN1+FX0b6jE0HamfPXfg4vMDEio5m/FENLBMo0rYYyECytVLbwWlDPpV3g1XbnG 4rfmWXMQ8C1HECQHu4brT7Wc8GxbtlHpE069a1ek/051B9cHzltNPlKDT1TIgDaErCW8tZ8+ X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:130943 Archived-At: Andreas Politz writes: > Anyway, here is the more progressive version of the patch, adding both > of the above points. (I guess, I'm to conservative sometimes and/or > seeing only problems everywhere.) Thanks! >> Well, I had always the hope to modify inotify watches in this case. If >> there is a watch with flags f1, and a new watch for the same file is >> requested with flags f2, and f2 contains a flag which is not part of f1, >> then either the existing watch shall be adapted, or the existing watch >> shall be removed, and a new shall be installed. Don't know what's >> possible in inotify. > > I implemented it by always using constantly watching for all events > (IN_ALL_EVENTS) and storing the given user-flags with the callback etc. > When an event occurs, I check whether it matches the given mask. Sounds good. > For that to work, I had to restrict the flag-usage by the user to those > not having an effect on the shared descriptor. What does this mean in practice? Any restriction we need to document? > I also added IN_EXCL_UNLINK as a default. This avoids reporting events > for already deleted filenames, which are still opened by some process, > which seems what we want as a default. OK. > I have no push privileges. I'm willing to push the patch in your name, if you provide me a ChangeLog style commit message. For the future, I recommend to obtain push privileges. Some nitpicks: > --- a/lisp/filenotify.el > +++ b/lisp/filenotify.el > +(defun file-notify--watch-absolute-filename (watch) This deserves a docstring. > +handler. The value in the hash table is file-notify--watch > +struct.") Please quote `file-notify--watch'. > (defun file-notify--rm-descriptor (descriptor) > +DESCRIPTOR should be an object returned by > +`file-notify-add-watch'. If it is registered in > +`file-notify-descriptors', a stopped event is sent." Don't reformat the docstring, keep the first line as complete sentence. > - (dolist (action actions) > + (while actions > + (let ((action (pop actions))) Being curious: why did you change this? > --- a/src/inotify.c > +++ b/src/inotify.c > @@ -264,10 +360,6 @@ close > The following symbols can also be added to a list of aspects: > > dont-follow > -excl-unlink > -mask-add > -oneshot > -onlydir Maybe we shall say explicitely, that those inotify events are not supported. > -COOKIE is an object that can be compared using `equal' to identify two matching > +COOKIE is an object that can be compared using `equal' to identify two matchingt Typo. > -ap Best regards, Michael.