From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.bugs Subject: bug#22736: 25.0.91; file-notify calls wrong callbacks Date: Thu, 18 Feb 2016 20:04:40 +0100 Message-ID: <877fi1x2k7.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1455822394 23006 80.91.229.3 (18 Feb 2016 19:06:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Feb 2016 19:06:34 +0000 (UTC) To: 22736@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 18 20:06:22 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1aWTu6-0001KU-Al for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Feb 2016 20:06:18 +0100 Original-Received: from localhost ([::1]:44567 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWTu2-0003D0-2a for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Feb 2016 14:06:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53991) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWTtw-0003BS-1c for bug-gnu-emacs@gnu.org; Thu, 18 Feb 2016 14:06:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWTtq-00039E-UA for bug-gnu-emacs@gnu.org; Thu, 18 Feb 2016 14:06:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36076) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWTtq-000397-Pt for bug-gnu-emacs@gnu.org; Thu, 18 Feb 2016 14:06:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aWTtq-0002aM-JG for bug-gnu-emacs@gnu.org; Thu, 18 Feb 2016 14:06:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Tassilo Horn Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 18 Feb 2016 19:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 22736 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14558223119878 (code B ref -1); Thu, 18 Feb 2016 19:06:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Feb 2016 19:05:11 +0000 Original-Received: from localhost ([127.0.0.1]:33203 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aWTsw-0002ZB-Td for submit@debbugs.gnu.org; Thu, 18 Feb 2016 14:05:10 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:34418) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aWTsr-0002Yb-MY for submit@debbugs.gnu.org; Thu, 18 Feb 2016 14:05:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWTsi-0002fW-PC for submit@debbugs.gnu.org; Thu, 18 Feb 2016 14:04:56 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:59223) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWTsi-0002fS-Lb for submit@debbugs.gnu.org; Thu, 18 Feb 2016 14:04:52 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53597) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWTse-00022O-Qb for bug-gnu-emacs@gnu.org; Thu, 18 Feb 2016 14:04:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWTsZ-0002dC-NM for bug-gnu-emacs@gnu.org; Thu, 18 Feb 2016 14:04:48 -0500 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:34498) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWTsZ-0002cz-Ir for bug-gnu-emacs@gnu.org; Thu, 18 Feb 2016 14:04:43 -0500 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 3094D2097E for ; Thu, 18 Feb 2016 14:04:43 -0500 (EST) Original-Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Thu, 18 Feb 2016 14:04:43 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=6S iHl1SShHcndKB4ebnAlqv3OVI=; b=f6glohnSr26twwRLYg2hyyG4kCb3f8VfMF P5/5uxlbEB8qNTwqOfvl2XAIFQfsIUI9aV+0BSVPe3BgiTrms0zV99LcphKKxtJ6 e32pDU9bgEL3ezSfYuYP92C8HD4T8izEv+eN/sDtLcplGWkQUj0n69Bjx2RXk9O/ c+fsFzEx0= X-Sasl-enc: X6aGphDtr50M+JX+GEAt7IPX9l2y5J3LPEH91bJm9hxa 1455822282 Original-Received: from thinkpad-t440p (unknown [2.163.102.192]) by mail.messagingengine.com (Postfix) with ESMTPA id 61256C00014 for ; Thu, 18 Feb 2016 14:04:42 -0500 (EST) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.91 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:113253 Archived-At: I use inotify as `file-notify--library' on a GNU/Linux box and a very recent emacs-25 branch version of emacs. The problem is that when there is a directory watch on some directory and a file watch on a file in that directory, the callback for the directory watch gets an event with the descriptor of the file watch. For example, here's an entry from my `file-notify-descriptors' hashtable. 3 ("/home/horn/Repos/el/emacs/lisp" (nil . magit-filenotify--callback) ("filenotify.el" . auto-revert-notify-handler)) As you can see, the emacs/lisp directory is watched and changes are to be reported to `magit-filenotify--callback'. When that registered the watch, it was told the descriptor is (3). Additionally, the file filenotify.el in that directory has a watch, too. Changes are to be handled by `auto-revert-notify-handler', and the descriptor at registration time was the cons (3 . "filenotify.el"). So now I change filenotify.el and save. What happens is that `magit-filenotify--callback' is called with an event whose descriptor is (3 . "filenotify.el"). That's wrong. Callbacks should not have to explicitly ignore events they haven't registered for. And the docs also state that the callbacks are called with events whose descriptors are the same objects as the one returned by `file-notify-add-watch'. In GNU Emacs 25.0.91.3 (x86_64-unknown-linux-gnu, GTK+ Version 3.18.7) of 2016-02-18 built on thinkpad-t440p Repository revision: fa8fd65ef40eacb808583a968c3621c228bf021c Windowing system distributor 'The X.Org Foundation', version 11.0.11801000 System Description: Arch Linux Configured using: 'configure --with-modules --with-xwidgets 'CFLAGS=-g -ggdb3 -Og'' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 MODULES XWIDGETS Important settings: value of $LC_MONETARY: de_DE.utf8 value of $LC_NUMERIC: de_DE.utf8 value of $LC_TIME: de_DE.utf8 value of $LANG: en_US.utf8 locale-coding-system: utf-8-unix Major mode: Summary Minor modes in effect: debbugs-gnu-summary-mode: t hl-line-mode: t magit-auto-revert-mode: t global-git-commit-mode: t async-bytecomp-package-mode: t diff-auto-refine-mode: t global-company-mode: t shell-dirtrack-mode: t global-aggressive-indent-mode: t pdf-occur-global-minor-mode: t recentf-mode: t beacon-mode: t global-subword-mode: t subword-mode: t save-place-mode: t savehist-mode: t show-paren-mode: t ivy-mode: t minibuffer-depth-indicate-mode: t electric-pair-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t global-prettify-symbols-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t column-number-mode: t line-number-mode: t transient-mark-mode: t Recent messages: [2 times] Auto-Revert mode enabled in current buffer [2 times] Mark set Quit Contacting host: debbugs.gnu.org:80 [3 times] 20160218T194758.086> Opening nndoc server on /tmp/gnus-temp-group-53519uC-ephemeral... 20160218T194758.086> Opening nndoc server on /tmp/gnus-temp-group-53519uC-ephemeral...done EVENT: ((3) changed "/home/horn/Repos/el/emacs/lisp/#filenotify.el#") DATA: ("/home/horn/Repos/el/emacs/lisp/" #) Load-path shadows: None found. Features: (shadow emacsbug sendmail sort smiley gnus-cite gnus-bcklg nndoc url-handlers gnus-dup mm-archive debbugs-gnu debbugs soap-client warnings rng-xsd rng-dt rng-util xsd-regexp gnus-async qp gnus-ml hl-line nndraft nnmh rot13 utf-7 network-stream nsm starttls nnml nnnil gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-cache gnus-demon nntp spam spam-stat gnus-uu yenc gnus-msg gnus-gravatar mail-extr gravatar gnus-topic nnir gnus-registry registry eieio-compat eieio-base th-private eieio-opt speedbar sb-image ezimage dframe character-fold misearch multi-isearch linum magit-filenotify magit-blame magit-stash magit-bisect magit-remote magit-commit magit-sequence magit magit-apply magit-wip magit-log magit-diff smerge-mode magit-core magit-autorevert autorevert filenotify magit-process magit-popup magit-mode magit-git crm magit-section magit-utils git-commit log-edit pcvs-util add-log with-editor async-bytecomp async smex ido vc vc-dispatcher vc-git diff-mode colir color company-oddmuse company-keywords company-etags company-gtags company-dabbrev-code company-dabbrev company-files company-capf company-cmake company-xcode company-clang company-semantic company-eclim company-template company-css company-nxml company-bbdb highlight-indent-guides company stratego-mode tg-mode generic preview-latex tex-site auto-loads clj-refactor pkg-info url-http url-auth url-gw json map lisp-mnt epl inflections html-mode-expansions sgml-mode edn peg multiple-cursors-core s dash cider tramp-sh cider-debug cider-browse-ns cider-inspector cider-mode cider-resolve cider-interaction arc-mode archive-mode cider-overlays cider-repl cider-test cider-stacktrace cider-doc org-table the-org-mode-expansions org org-macro org-footnote org-pcomplete org-list org-faces org-entities org-version ob-emacs-lisp ob ob-tangle ob-ref ob-lob ob-table ob-exp org-src ob-keys ob-comint ob-core ob-eval org-compat org-macs org-loaddefs cal-menu calendar cal-loaddefs cider-grimoire cider-popup cider-eldoc cider-client cider-common cider-util nrepl-client tramp tramp-compat tramp-loaddefs trampver ucs-normalize shell pcomplete queue ewoc cider-compat spinner clojure-mode-expansions clojure-mode align paredit aggressive-indent epa-file epa rdictcc google-contacts-message google-contacts xml url-cache url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util google-oauth google-contacts-gnus gnus-art mm-uu mml2015 mm-view mml-smime smime dig mailcap gnus-sum gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source tls gnutls utf7 netrc nnoo parse-time gnus-spec gnus-int gnus-range gnus-win gnus gnus-ems nnheader dired-x em-term term ehelp esh-opt esh-ext esh-util highlight-symbol boxquote rect ecomplete message rfc822 mml mml-sec epg mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev mail-utils gmm-utils mailheader server yasnippet disp-table noutline outline pdf-occur ibuf-ext ibuffer tablist tablist-filter semantic/wisent/comp semantic/wisent semantic/wisent/wisent semantic/util-modes semantic/util semantic semantic/tag semantic/lex semantic/fw mode-local find-func cedet dired pdf-isearch let-alist pdf-misc imenu pdf-tools compile comint ansi-color cus-edit cus-start cus-load pdf-view bookmark pp jka-compr pdf-cache pdf-info tq pdf-util format-spec image-mode browse-kill-ring derived recentf tree-widget wid-edit expand-region text-mode-expansions er-basic-expansions expand-region-core expand-region-custom beacon seq highlight-parentheses easy-mmode cl iedit iedit-lib hydra lv counsel etags xref project swiper cap-words superword subword saveplace savehist paren ivy delsel ffap thingatpt url-parse auth-source eieio byte-opt bytecomp byte-compile cl-extra cconv eieio-core cl-macs gv gnus-util mm-util help-fns help-mode mail-prsvr password-cache url-vars icomplete mb-depth ace-window avy ring smart-mode-line-respectful-theme smart-mode-line-dark-theme cl-seq smart-mode-line rich-minority rx bs windmove elec-pair edmacro kmacro cl-loaddefs cl-lib subr-x pcase tsdh-dark-theme finder-inf memory-usage-autoloads advice info package easymenu epg-config time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify dynamic-setting system-font-setting font-render-setting xwidget-internal move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 818216 119839) (symbols 48 60404 16) (miscs 40 525 1053) (strings 32 194650 65781) (string-bytes 1 6408650) (vectors 16 87142) (vector-slots 8 2026074 102176) (floats 8 1116 652) (intervals 56 8874 4719) (buffers 976 43) (heap 1024 110928 12933))