From unknown Fri Sep 12 09:56:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18958: 25.0.50; auto-revert-mode reacts slowly even if using an event-driven backend Resent-From: Dima Kogan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 05 Nov 2014 19:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18958 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 18958@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.141521409425583 (code B ref -1); Wed, 05 Nov 2014 19:02:02 +0000 Received: (at submit) by debbugs.gnu.org; 5 Nov 2014 19:01:34 +0000 Received: from localhost ([127.0.0.1]:50349 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xm5pm-0006eY-3Z for submit@debbugs.gnu.org; Wed, 05 Nov 2014 14:01:34 -0500 Received: from eggs.gnu.org ([208.118.235.92]:51636) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xm5pj-0006eQ-Vj for submit@debbugs.gnu.org; Wed, 05 Nov 2014 14:01:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xm5pe-0002zi-8D for submit@debbugs.gnu.org; Wed, 05 Nov 2014 14:01:31 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:39983) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xm5pe-0002zc-5v for submit@debbugs.gnu.org; Wed, 05 Nov 2014 14:01:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53167) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xm5pZ-0000aF-0U for bug-gnu-emacs@gnu.org; Wed, 05 Nov 2014 14:01:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xm5pT-0002sg-Sh for bug-gnu-emacs@gnu.org; Wed, 05 Nov 2014 14:01:20 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:49474) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xm5pT-0002ro-FE for bug-gnu-emacs@gnu.org; Wed, 05 Nov 2014 14:01:15 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id AC75320706 for ; Wed, 5 Nov 2014 14:01:13 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute6.internal (MEProxy); Wed, 05 Nov 2014 14:01:13 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=x-sasl-enc:from:to:subject:date:message-id:mime-version :content-type; s=mesmtp; bh=urVA5/lrmutaZT24g3D3dmYihys=; b=CfMJ LEdRM5vliBBx0BqW1hZgrFhkHG6pzUHFduw1GlsDVPwUhERxP6YYowU+AgiPtYuv 39cUjEaNCGYWlz/TJ6UZRLVHiQ69k/MSqMINNPgtUPpza22enKKmbi1beg7s2/5+ 4Y3tM5Ng42ECejIoBgZGB/sS2MGyNyOgLhZAt5E= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:from:to:subject:date :message-id:mime-version:content-type; s=smtpout; bh=urVA5/lrmut aZT24g3D3dmYihys=; b=ICSL10XGg6ZACd+YejGE/T66E9EDGHy2hfnhEMO5DrQ lAq7/Kr6CubX7iHyaJq0Fak/SFYVfWflJmD+tcjbrikWnxGV1lKjkCuQ13fa7w2w z2FV4WVVZmhNDDl6DYJQvSWmVIfqouZSaa+CK+PGxQn8e+FX7N87YFdFTNeOZdcI = X-Sasl-enc: nEW11O+zykyz4LeVlavBZ0uH1f9n3CBNXBB/hbhkbbIP 1415214073 Received: from shorty.local (unknown [76.91.145.213]) by mail.messagingengine.com (Postfix) with ESMTPA id 648B268019B for ; Wed, 5 Nov 2014 14:01:13 -0500 (EST) Received: from dima by shorty.local with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1Xm5pQ-0007v5-BS for bug-gnu-emacs@gnu.org; Wed, 05 Nov 2014 11:01:12 -0800 From: Dima Kogan Date: Wed, 05 Nov 2014 11:01:12 -0800 Message-ID: <878ujpcw07.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --=-=-= Content-Type: text/plain This is a tracker entry for a report and patch in an emacs-devel mailing list thread: http://lists.gnu.org/archive/html/emacs-devel/2014-10/msg00727.html The issue is that auto-revert-mode reacts to modifications on a timer, even if its backend is event-driven. There is a prototype patch in that thread, attached here also. On Linux, the two available backends have issues, so this patch wouldn't be completely effective until those are resolved. The gfile backend has a problem where emacs isn't using glib correctly, and the gfile backend itself, in turn, adds artificial delays in how it deals with inotify. Those are discussed (and partly patched) here: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18861 The inotify backend has an issue where it doesn't deal with more than one monitored file in a directory correctly: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18880 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-auto-revert-mode-can-now-revert-immediately-in-respo.patch >From 567d8469dfb143786890c65de58bf2ce887e9ebd Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Fri, 24 Oct 2014 19:44:43 -0700 Subject: [PATCH] auto-revert-mode can now revert immediately in response to a change event If we have file notifications, we want to update the auto-revert buffers immediately when a notification occurs. Since file updates can happen very often, we want to skip some revert operations so that we don't spend all our time reverting the buffer. We do this by reverting immediately in response to the first in a flurry of notifications. We suppress subsequent notifications until the next time `auto-revert-buffers' is called (this happens on a timer with a period set by `auto-revert-interval'). --- lisp/autorevert.el | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/lisp/autorevert.el b/lisp/autorevert.el index f1074e2..7de6ec1 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el @@ -531,6 +531,34 @@ will use an up-to-date value of `auto-revert-interval'" ;; Fallback to file checks. (set (make-local-variable 'auto-revert-use-notify) nil)))) + + +;; If we have file notifications, we want to update the auto-revert buffers +;; immediately when a notification occurs. Since file updates can happen very +;; often, we want to skip some revert operations so that we don't spend all our +;; time reverting the buffer. +;; +;; We do this by reverting immediately in response to the first in a flurry of +;; notifications. We suppress subsequent notifications until the next time +;; `auto-revert-buffers' is called (this happens on a timer with a period set by +;; `auto-revert-interval'). +(defvar auto-revert-buffers-counter 1 + "Incremented each time `auto-revert-buffers' is called") +(defvar auto-revert-buffers-counter-lockedout 0 + "Buffer-local value to indicate whether we should immediately +update the buffer on a notification event or not. If + + (= auto-revert-buffers-counter-lockedout + auto-revert-buffers-counter) + +then the updates are locked out, and we wait until the next call +of `auto-revert-buffers' to revert the buffer. If no lockout is +present, then we revert immediately and set the lockout, so that +no more reverts are possible until the next call of +`auto-revert-buffers'") +(make-variable-buffer-local 'auto-revert-buffers-counter-lockedout) + + (defun auto-revert-notify-handler (event) "Handle an EVENT returned from file notification." (with-demoted-errors @@ -566,6 +594,14 @@ will use an up-to-date value of `auto-revert-interval'" (file-name-nondirectory buffer-file-name))))) ;; Mark buffer modified. (setq auto-revert-notify-modified-p t) + + ;; Revert the buffer now if we're not locked out + (when (/= auto-revert-buffers-counter-lockedout + auto-revert-buffers-counter) + (auto-revert-handler) + (setq auto-revert-buffers-counter-lockedout + auto-revert-buffers-counter)) + ;; No need to check other buffers. (cl-return))))))))) @@ -686,6 +722,10 @@ are checked first the next time this function is called. This function is also responsible for removing buffers no longer in Auto-Revert mode from `auto-revert-buffer-list', and for canceling the timer when no buffers need to be checked." + + (setq auto-revert-buffers-counter + (1+ auto-revert-buffers-counter)) + (save-match-data (let ((bufs (if global-auto-revert-mode (buffer-list) -- 2.0.0 --=-=-=-- From unknown Fri Sep 12 09:56:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18958: 25.0.50; auto-revert-mode reacts slowly even if using an event-driven backend Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 07 Nov 2014 20:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18958 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dima Kogan Cc: 18958@debbugs.gnu.org Received: via spool by 18958-submit@debbugs.gnu.org id=B18958.141539048724609 (code B ref 18958); Fri, 07 Nov 2014 20:02:02 +0000 Received: (at 18958) by debbugs.gnu.org; 7 Nov 2014 20:01:27 +0000 Received: from localhost ([127.0.0.1]:53150 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xmpio-0006Oq-7K for submit@debbugs.gnu.org; Fri, 07 Nov 2014 15:01:26 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:29672) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xmpim-0006Oi-0U for 18958@debbugs.gnu.org; Fri, 07 Nov 2014 15:01:24 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aq8IAOatTlRLd+sd/2dsb2JhbABcgw6DYs83gxoEAgKBHBcBAXyEAwEBAwFWIwULCzQSFBgNJIhLCctyAQEBAQEBBAEBAQEekQgHhEsFi2STLoNJj0WBb4I0gWIfgnoBAQE X-IPAS-Result: Aq8IAOatTlRLd+sd/2dsb2JhbABcgw6DYs83gxoEAgKBHBcBAXyEAwEBAwFWIwULCzQSFBgNJIhLCctyAQEBAQEBBAEBAQEekQgHhEsFi2STLoNJj0WBb4I0gWIfgnoBAQE X-IronPort-AV: E=Sophos;i="5.04,797,1406606400"; d="scan'208";a="96232033" Received: from 75-119-235-29.dsl.teksavvy.com (HELO pastel.home) ([75.119.235.29]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 07 Nov 2014 15:01:23 -0500 Received: by pastel.home (Postfix, from userid 20848) id 38F598874; Fri, 7 Nov 2014 15:01:23 -0500 (EST) From: Stefan Monnier Message-ID: References: <878ujpcw07.fsf@secretsauce.net> Date: Fri, 07 Nov 2014 15:01:23 -0500 In-Reply-To: <878ujpcw07.fsf@secretsauce.net> (Dima Kogan's message of "Wed, 05 Nov 2014 11:01:12 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > The issue is that auto-revert-mode reacts to modifications on a timer, > even if its backend is event-driven. There is a prototype patch in that > thread, attached here also. The patch looks OK to me, tho please use defvar-local. Stefan From unknown Fri Sep 12 09:56:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18958: 25.0.50; auto-revert-mode reacts slowly even if using an event-driven backend In-Reply-To: <878ujpcw07.fsf@secretsauce.net> Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Feb 2015 20:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18958 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dima Kogan Cc: 18958@debbugs.gnu.org Received: via spool by 18958-submit@debbugs.gnu.org id=B18958.14243784854323 (code B ref 18958); Thu, 19 Feb 2015 20:42:01 +0000 Received: (at 18958) by debbugs.gnu.org; 19 Feb 2015 20:41:25 +0000 Received: from localhost ([127.0.0.1]:48985 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YOXuW-00017e-B9 for submit@debbugs.gnu.org; Thu, 19 Feb 2015 15:41:24 -0500 Received: from mout.gmx.net ([212.227.17.20]:50356) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YOXuT-00017W-Qv for 18958@debbugs.gnu.org; Thu, 19 Feb 2015 15:41:22 -0500 Received: from detlef.gmx.de ([79.195.7.129]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0MGEv5-1YIpGz1rE7-00F9i0; Thu, 19 Feb 2015 21:41:18 +0100 From: Michael Albinus References: <878ujpcw07.fsf@secretsauce.net> Date: Thu, 19 Feb 2015 21:41:17 +0100 Message-ID: <871tll63de.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:42o0/co4u4g4m9iKxjWLlSfcZC8GNfKNCJFTiydeyN93iJOSjVo reoERshZ6iDFMYujNibKl7+iUnj/lKazW2aBsRB/pvuyViXR+draj6BQoghi+UPX2sD6iFx NenqH+hZFUuCOmBm/Nz9sNYrhepiX5pDCifVyjToU6a4CoFQXkJ1jw0swCd1rbwX0UWcWXb eR8LRm3bftrCpT2u67e2Q== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Dima Kogan writes: Hi Dima, I'm sorry that I could not interact earlier. Meanwhile I have read all the threads about, and I believe your proposed patch is worth to be applied. > The issue is that auto-revert-mode reacts to modifications on a timer, > even if its backend is event-driven. There is a prototype patch in that > thread, attached here also. > > On Linux, the two available backends have issues, so this patch wouldn't > be completely effective until those are resolved. > > The gfile backend has a problem where emacs isn't using glib correctly, > and the gfile backend itself, in turn, adds artificial delays in how it > deals with inotify. Those are discussed (and partly patched) here: > > http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18861 > > The inotify backend has an issue where it doesn't deal with more than > one monitored file in a directory correctly: > > http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18880 Both bugs are fixed meanwhile. > From 567d8469dfb143786890c65de58bf2ce887e9ebd Mon Sep 17 00:00:00 2001 > From: Dima Kogan > Date: Fri, 24 Oct 2014 19:44:43 -0700 > Subject: [PATCH] auto-revert-mode can now revert immediately in response to a > change event I've applied your patch to the master branch (including Stefan's recommendation to use defvar-local). Could you, please, recheck that everything works as expected, also wrt the other two bugs you've mentioned? Best regards, Michael. From unknown Fri Sep 12 09:56:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18958: 25.0.50; auto-revert-mode reacts slowly even if using an event-driven backend Resent-From: Dima Kogan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Feb 2015 10:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18958 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Michael Albinus Cc: 18958@debbugs.gnu.org Received: via spool by 18958-submit@debbugs.gnu.org id=B18958.142442657015054 (code B ref 18958); Fri, 20 Feb 2015 10:03:01 +0000 Received: (at 18958) by debbugs.gnu.org; 20 Feb 2015 10:02:50 +0000 Received: from localhost ([127.0.0.1]:49132 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YOkQ5-0003uk-M2 for submit@debbugs.gnu.org; Fri, 20 Feb 2015 05:02:49 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:45815) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YOkQ3-0003uZ-LL for 18958@debbugs.gnu.org; Fri, 20 Feb 2015 05:02:48 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 8236320B7F for <18958@debbugs.gnu.org>; Fri, 20 Feb 2015 05:02:46 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Fri, 20 Feb 2015 05:02:47 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=x-sasl-enc:references:from:to:cc:subject:date:in-reply-to :message-id:mime-version:content-type; s=mesmtp; bh=foXxCBLFTuuS JiD8WiNrutw/cv0=; b=Jn1v0N23ekVCo261dTEpvub6+OrG+nyUdebF0sTLPEyz 39wnnNyjMWOWmbvQQpF0Xfw9LhewaYEYet2oI7C0hT6s+x9wiM+d+pugXTBGhH5Y tQe5I2qurVhATrLtT2/JMwrtfSwgq7UcoEujEKlFbVw8XxE9CV17d3ECDEdJ7K4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:references:from:to:cc:subject :date:in-reply-to:message-id:mime-version:content-type; s= smtpout; bh=foXxCBLFTuuSJiD8WiNrutw/cv0=; b=FBp2i2ERf4bdVWJLpkHw 7oid57YMaaibMl8FTWOlsWz2BJszgcdWOs2m2yp0oCWGga5olTLK9ZUyXU7luHmw vLwVE/jRY9HR2IsIVksNfgMcvLiYdywE8TVhQGjtx16dGwmzC5ziX3kWhQAo3fYV 6aHYrZF/pIpprU9gmPqm5ug= X-Sasl-enc: mCty1PS6C2hLGiEPE0Og9R976h/umh0Q4DOlW0KuYqJW 1424426566 Received: from shorty.local (unknown [76.91.145.213]) by mail.messagingengine.com (Postfix) with ESMTPA id C5B866801A8; Fri, 20 Feb 2015 05:02:46 -0500 (EST) Received: from ip6-localhost ([::1] helo=shorty) by shorty.local with esmtp (Exim 4.84) (envelope-from ) id 1YOkQ1-0002Ir-Lo; Fri, 20 Feb 2015 02:02:45 -0800 References: <878ujpcw07.fsf@secretsauce.net> <871tll63de.fsf@gmx.de> From: Dima Kogan Date: Fri, 20 Feb 2015 01:59:04 -0800 In-reply-to: <871tll63de.fsf@gmx.de> Message-ID: <87lhjsaoje.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Michael Albinus writes: > I've applied your patch to the master branch (including Stefan's > recommendation to use defvar-local). Could you, please, recheck that > everything works as expected, also wrt the other two bugs you've mentioned? Hi. Thanks for applying the patch. The basic inotify stuff appears to work now with multiple files, which is great. I haven't tested gfile yet. The notification throttling seems to have a problem. Recipe: 1. rm /tmp/tst; touch /tmp/tst 2. emacs -Q -nw /tmp/tst 3. M-x auto-revert-mode 4. In a separate shell: date >> /tmp/tst Most of the time I don't see the buffer update, not even after waiting a bit. After a manual revert, auto-revert-mode does do what it's supposed to. I haven't debugged this yet. Will do this tomorrow if you don't beat me to it. Thanks again dima From unknown Fri Sep 12 09:56:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18958: 25.0.50; auto-revert-mode reacts slowly even if using an event-driven backend Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Feb 2015 10:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18958 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dima Kogan Cc: 18958@debbugs.gnu.org Received: via spool by 18958-submit@debbugs.gnu.org id=B18958.142442796017269 (code B ref 18958); Fri, 20 Feb 2015 10:26:01 +0000 Received: (at 18958) by debbugs.gnu.org; 20 Feb 2015 10:26:00 +0000 Received: from localhost ([127.0.0.1]:49161 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YOkmV-0004UQ-3y for submit@debbugs.gnu.org; Fri, 20 Feb 2015 05:25:59 -0500 Received: from mout.gmx.net ([212.227.15.19]:63446) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YOkmS-0004UG-7u for 18958@debbugs.gnu.org; Fri, 20 Feb 2015 05:25:56 -0500 Received: from detlef.gmx.de ([79.195.25.115]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0MFuC6-1YIl1S1T3G-00EtRH; Fri, 20 Feb 2015 11:25:52 +0100 From: Michael Albinus References: <878ujpcw07.fsf@secretsauce.net> <871tll63de.fsf@gmx.de> <87lhjsaoje.fsf@secretsauce.net> Date: Fri, 20 Feb 2015 11:25:51 +0100 In-Reply-To: <87lhjsaoje.fsf@secretsauce.net> (Dima Kogan's message of "Fri, 20 Feb 2015 01:59:04 -0800") Message-ID: <874mqg2828.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:/cRNluA7PvBICuh+LaMJOdCsC+0fSvXJZvd3Jsry1KS73MzoeiF We7ZTV+5wmSIm1YYbAVhU5Chz2N1tUv7Ktbar8XdczguhlWpG0FerbOG4o9s4+/wTiunORy sTqLKXhC78V7W5NbLk+h+uMqhCYoT8e59H6QDjn1UKehR1sdt6J4vKtDLIuYUU6f/R4qPFN Bv+fa04ZsMdGQDR+C0DNw== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Dima Kogan writes: > The notification throttling seems to have a problem. Recipe: > > 1. rm /tmp/tst; touch /tmp/tst > 2. emacs -Q -nw /tmp/tst > 3. M-x auto-revert-mode > 4. In a separate shell: date >> /tmp/tst Well, yesterday I have used a slightly different test: 3. M-x auto-revert-tail-mode 4. In a separate shell: while /bin/true; do date >> /tmp/tst sleep 2 done You see in 5 sec intervals the autorevert due to the loop, and in the time between just one autorevert triggered directly by the notification event. > Thanks again > dima Best regards, Michael. From unknown Fri Sep 12 09:56:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18958: 25.0.50; auto-revert-mode reacts slowly even if using an event-driven backend Resent-From: Dima Kogan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Feb 2015 03:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18958 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Michael Albinus Cc: 18958@debbugs.gnu.org Received: via spool by 18958-submit@debbugs.gnu.org id=B18958.142449029428090 (code B ref 18958); Sat, 21 Feb 2015 03:45:02 +0000 Received: (at 18958) by debbugs.gnu.org; 21 Feb 2015 03:44:54 +0000 Received: from localhost ([127.0.0.1]:49784 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YP0zt-0007J0-RP for submit@debbugs.gnu.org; Fri, 20 Feb 2015 22:44:54 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:51775) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YP0zq-0007Ip-Jl for 18958@debbugs.gnu.org; Fri, 20 Feb 2015 22:44:51 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 1BF5120BEF for <18958@debbugs.gnu.org>; Fri, 20 Feb 2015 22:44:49 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute3.internal (MEProxy); Fri, 20 Feb 2015 22:44:49 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=x-sasl-enc:references:from:to:cc:subject:date:in-reply-to :message-id:mime-version:content-type; s=mesmtp; bh=ZJZZcLTdwD7C Ac5CDI1qWMemyiM=; b=iBBwPRsKNRkOsJBwHvs2cR15bPxc3RLeqwaCuR4t2Bpb mHjNp/h+0kiEriuSsLpnXcNGJi6MMp4w0kRtuzIJyLo9vV8yveN/fFPvu73VZPXg lrGVzb3MK4T44xMgktYdPJldmOtmDoX6gviZ80zj2kLJRaVlw0x3H5x4Mj9VeoI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:references:from:to:cc:subject :date:in-reply-to:message-id:mime-version:content-type; s= smtpout; bh=ZJZZcLTdwD7CAc5CDI1qWMemyiM=; b=tqXvub4bYNZyGH0ZXTQ0 gJ6uMtnM5xclRRu1Bmc7zJv8KZJjGchV3scZcZuYoFJyd9HMoV4e/4hpd40CB8GS P4TsikoGEmF7P1EdM+nWdHq1yN6G+627aeViGRs0v4RCEPzq7ZMKr5/qbBRXWUrT NO7eFlzlA13DEgIaaI9/C50= X-Sasl-enc: gJQ4/L0X503VzSOXKZ18qQwu7ZhRQh8xcwCv/Nz0JDGR 1424490289 Received: from shorty.local (unknown [76.91.145.213]) by mail.messagingengine.com (Postfix) with ESMTPA id 62E83680170; Fri, 20 Feb 2015 22:44:49 -0500 (EST) Received: from ip6-localhost ([::1] helo=shorty) by shorty.local with esmtp (Exim 4.84) (envelope-from ) id 1YP0zp-00088P-GM; Fri, 20 Feb 2015 19:44:49 -0800 References: <878ujpcw07.fsf@secretsauce.net> <871tll63de.fsf@gmx.de> <87lhjsaoje.fsf@secretsauce.net> From: Dima Kogan Date: Fri, 20 Feb 2015 19:38:39 -0800 In-reply-to: <87lhjsaoje.fsf@secretsauce.net> Message-ID: <87k2zc9bda.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --=-=-= Content-Type: text/plain Dima Kogan writes: > The notification throttling seems to have a problem. Recipe: Hi. I figured this out. The notification handler was being installed during a timer update, NOT when auto-revert-mode was initiated. So in order for the code to work you'd have to - M-x auto-revert-mode - wait for the timer. ~5 seconds or so - update file If you didn't wait, then this first update would be ignored. The code to install the handler when needed was already there, but for some reason it was disabled. Attaching a patch that makes it work for all of auto-revert-mode, auto-revert-tail-mode and global-auto-revert-mode. This patch removes (let (auto-revert-use-notify) ... ) wrappers to let the existing code to its thing, and for auto-revert-tail-mode this patch calls (auto-revert-buffers) instead of (auto-revert-handler), like the other two code paths already do. Truthfully, it probably does make sense to call (auto-revert-handler) for the two non-global functions, but the handler-install code would then need to be moved. I still need to double-check the gfile stuff, and I'll do that when I get your ok on this. The gfile also has a delay in glib itself, so this wouldn't be as nice as inotify until glib is patched. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-notification-handler-is-now-installed-when-auto-reve.patch >From bb2dec478fce20a25a737f16f26c0b338d599552 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Fri, 20 Feb 2015 19:38:17 -0800 Subject: [PATCH] notification handler is now installed when auto-revert-mode is entered --- lisp/autorevert.el | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lisp/autorevert.el b/lisp/autorevert.el index 02cef24..4dd021e 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el @@ -361,9 +361,8 @@ without being changed in the part that is already in the buffer." (delq (current-buffer) auto-revert-buffer-list))) (auto-revert-set-timer) (when auto-revert-mode - (let (auto-revert-use-notify) - (auto-revert-buffers) - (setq auto-revert-tail-mode nil)))) + (auto-revert-buffers) + (setq auto-revert-tail-mode nil))) ;;;###autoload @@ -417,8 +416,7 @@ Use `auto-revert-mode' for changes other than appends!" (y-or-n-p "File changed on disk, content may be missing. \ Perform a full revert? ") ;; Use this (not just revert-buffer) for point-preservation. - (let (auto-revert-use-notify) - (auto-revert-handler))) + (auto-revert-buffers)) ;; else we might reappend our own end when we save (add-hook 'before-save-hook (lambda () (auto-revert-tail-mode 0)) nil t) (or (local-variable-p 'auto-revert-tail-pos) ; don't lose prior position @@ -463,8 +461,7 @@ specifies in the mode line." :global t :group 'auto-revert :lighter global-auto-revert-mode-text (auto-revert-set-timer) (if global-auto-revert-mode - (let (auto-revert-use-notify) - (auto-revert-buffers)) + (auto-revert-buffers) (dolist (buf (buffer-list)) (with-current-buffer buf (when auto-revert-use-notify -- 2.0.0 --=-=-=-- From unknown Fri Sep 12 09:56:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18958: 25.0.50; auto-revert-mode reacts slowly even if using an event-driven backend Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Feb 2015 09:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18958 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dima Kogan Cc: 18958@debbugs.gnu.org Received: via spool by 18958-submit@debbugs.gnu.org id=B18958.142451264231746 (code B ref 18958); Sat, 21 Feb 2015 09:58:01 +0000 Received: (at 18958) by debbugs.gnu.org; 21 Feb 2015 09:57:22 +0000 Received: from localhost ([127.0.0.1]:49846 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YP6oL-0008Fx-U3 for submit@debbugs.gnu.org; Sat, 21 Feb 2015 04:57:22 -0500 Received: from mout.gmx.net ([212.227.15.15]:63722) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YP6oJ-0008Fp-BZ for 18958@debbugs.gnu.org; Sat, 21 Feb 2015 04:57:20 -0500 Received: from detlef.gmx.de ([79.195.9.157]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0MQiVh-1Xxr8u4ApB-00U35v; Sat, 21 Feb 2015 10:57:14 +0100 From: Michael Albinus References: <878ujpcw07.fsf@secretsauce.net> <871tll63de.fsf@gmx.de> <87lhjsaoje.fsf@secretsauce.net> <87k2zc9bda.fsf@secretsauce.net> Date: Sat, 21 Feb 2015 10:57:13 +0100 In-Reply-To: <87k2zc9bda.fsf@secretsauce.net> (Dima Kogan's message of "Fri, 20 Feb 2015 19:38:39 -0800") Message-ID: <87k2zbvb7q.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:ZTJEcteJYna90fR6TEOuzLdFDoN6Laph8Kals0npIwHpVYnKH81 MdqVcbhTcTKQeMQo3u48rI2gDuRBPyTXgyRqziiopu2C9FU4XuuhgCDU9NHDz6QBkOlZMl/ iNKBaeDG5B6oKNWiYU9Kx4elLpJKVwdHp3rgbWs/hGv6MHqMtx69IfTqH7+G4C+Vdv+QEcq su/S8eBJnWuu21se5oZYg== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Dima Kogan writes: Hi Dima, > I still need to double-check the gfile stuff, and I'll do that when I > get your ok on this. The gfile also has a delay in glib itself, so this > wouldn't be as nice as inotify until glib is patched. Thanks for this. I've committed your patch to the repo. Honestly, I don't remember why I have suppressed auto-revert-use-notify when initiating the auto-revert modes, maybe I was simply overcautious. If there are problems with this change, we will hear soon :-) Per default, I have enabled gfilenotify as notification library; it works also w/o problems. Of course, I cannot speak for w32notify, maybe somebody can run a short test. Best regards, Michael. From unknown Fri Sep 12 09:56:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18958: 25.0.50; auto-revert-mode reacts slowly even if using an event-driven backend Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Feb 2015 11:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18958 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Michael Albinus Cc: 18958@debbugs.gnu.org, dima@secretsauce.net Reply-To: Eli Zaretskii Received: via spool by 18958-submit@debbugs.gnu.org id=B18958.14245187488590 (code B ref 18958); Sat, 21 Feb 2015 11:40:02 +0000 Received: (at 18958) by debbugs.gnu.org; 21 Feb 2015 11:39:08 +0000 Received: from localhost ([127.0.0.1]:49879 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YP8Op-0002EU-Td for submit@debbugs.gnu.org; Sat, 21 Feb 2015 06:39:08 -0500 Received: from mtaout22.012.net.il ([80.179.55.172]:32973) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YP8On-0002EK-0L for 18958@debbugs.gnu.org; Sat, 21 Feb 2015 06:39:06 -0500 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0NK400200DFSQ300@a-mtaout22.012.net.il> for 18958@debbugs.gnu.org; Sat, 21 Feb 2015 13:39:03 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NK4002PIDP2QR00@a-mtaout22.012.net.il>; Sat, 21 Feb 2015 13:39:03 +0200 (IST) Date: Sat, 21 Feb 2015 13:39:03 +0200 From: Eli Zaretskii In-reply-to: <87k2zbvb7q.fsf@gmx.de> X-012-Sender: halo1@inter.net.il Message-id: <83mw47cx48.fsf@gnu.org> References: <878ujpcw07.fsf@secretsauce.net> <871tll63de.fsf@gmx.de> <87lhjsaoje.fsf@secretsauce.net> <87k2zc9bda.fsf@secretsauce.net> <87k2zbvb7q.fsf@gmx.de> X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Albinus > Date: Sat, 21 Feb 2015 10:57:13 +0100 > Cc: 18958@debbugs.gnu.org > > Per default, I have enabled gfilenotify as notification library; it > works also w/o problems. Of course, I cannot speak for w32notify, maybe > somebody can run a short test. If you can tell me what test to run, I can try doing that. Thanks. From unknown Fri Sep 12 09:56:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18958: 25.0.50; auto-revert-mode reacts slowly even if using an event-driven backend Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Feb 2015 12:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18958 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 18958@debbugs.gnu.org, dima@secretsauce.net Received: via spool by 18958-submit@debbugs.gnu.org id=B18958.142452262619880 (code B ref 18958); Sat, 21 Feb 2015 12:44:02 +0000 Received: (at 18958) by debbugs.gnu.org; 21 Feb 2015 12:43:46 +0000 Received: from localhost ([127.0.0.1]:49902 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YP9PO-0005AZ-6P for submit@debbugs.gnu.org; Sat, 21 Feb 2015 07:43:46 -0500 Received: from mout.gmx.net ([212.227.15.19]:62506) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YP9PL-0005AP-RP for 18958@debbugs.gnu.org; Sat, 21 Feb 2015 07:43:44 -0500 Received: from detlef.gmx.de ([79.195.9.157]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0MVvi4-1Y0p501M0e-00X5Ye; Sat, 21 Feb 2015 13:43:38 +0100 From: Michael Albinus References: <878ujpcw07.fsf@secretsauce.net> <871tll63de.fsf@gmx.de> <87lhjsaoje.fsf@secretsauce.net> <87k2zc9bda.fsf@secretsauce.net> <87k2zbvb7q.fsf@gmx.de> <83mw47cx48.fsf@gnu.org> Date: Sat, 21 Feb 2015 13:43:37 +0100 In-Reply-To: <83mw47cx48.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 21 Feb 2015 13:39:03 +0200") Message-ID: <87twyfh1ty.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:gqoPUdbMbv5gVTW7PrM1ihLYS6elo0hM0JHKEjE7Y1Efgphq4ra /+zscgiOWiPJ0HoUyv9+tv/IhOjf6EBriR5JTcKJva9pT9drJBcfo8/V1s9Oit6n4icw6BG oiC7JJ2rEVw4+wZT9nh8GbEf8YNZRbQnWz2lOwYr9N4VHCVeawHgdzjHxazNUR1iQuZnLny 5bH3hso/8llSw8z7MJWRw== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Eli Zaretskii writes: >> Per default, I have enabled gfilenotify as notification library; it >> works also w/o problems. Of course, I cannot speak for w32notify, maybe >> somebody can run a short test. > > If you can tell me what test to run, I can try doing that. I fear we have no ert test case yet, it is a matter of timing. Maybe I write something next days, or somebody else has a got idea how to do. Test: Open a file in Emacs, and enable auto-revert-mode or auto-revert-tail-mode. Change it outside Emacs. The reverted file shall be shown immediately in Emacs. Since it is not obvious whether the reversion was triggered by the notification event directly, or by the auto-revert-buffers call every auto-revert-interval seconds, you might run the test several times. Note, that a direct revert triggered by the notification event happens only once every auto-revert-interval period, in order to defend against fast series of notification events. Another test I would also like to see on w32 is for the change I've committed some few minutes ago: auto-revert of dired buffers. Call auto-revert-mode on a dired buffer, and create/delete a file in the respective directory outside Emacs. The dired buffer shall be reverted immediately as well. > Thanks. Thanks, Michael. From unknown Fri Sep 12 09:56:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18958: 25.0.50; auto-revert-mode reacts slowly even if using an event-driven backend Resent-From: Dima Kogan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Feb 2015 22:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18958 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Michael Albinus Cc: 18958@debbugs.gnu.org Received: via spool by 18958-submit@debbugs.gnu.org id=B18958.142455861012113 (code B ref 18958); Sat, 21 Feb 2015 22:44:02 +0000 Received: (at 18958) by debbugs.gnu.org; 21 Feb 2015 22:43:30 +0000 Received: from localhost ([127.0.0.1]:50428 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YPIll-00039G-2Z for submit@debbugs.gnu.org; Sat, 21 Feb 2015 17:43:29 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:57794) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YPIlh-000396-SD for 18958@debbugs.gnu.org; Sat, 21 Feb 2015 17:43:27 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id ED2E2209BE for <18958@debbugs.gnu.org>; Sat, 21 Feb 2015 17:43:22 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Sat, 21 Feb 2015 17:43:23 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=x-sasl-enc:references:from:to:cc:subject:date:in-reply-to :message-id:mime-version:content-type; s=mesmtp; bh=Hb9+mIVM9eYm 4NhoamRW4JrGg5I=; b=Lns1nZkE/hjG6qdNLDlL6dMXOBi003NLICE2a7phNeB6 d52N1FuZvzC0hfFMgv9NBbNDyXcLKmB5O2vZtrFXT3GA1zUw1gEjOsUfHBXah+7Z TQjtZp0hJXR0sw9SaAdPOU2u5fQi5zqjelOIR0XWl6Hf10fGFIen75Qbfh+Ymsk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:references:from:to:cc:subject :date:in-reply-to:message-id:mime-version:content-type; s= smtpout; bh=Hb9+mIVM9eYm4NhoamRW4JrGg5I=; b=IsQWTQOyCdvy0OoFkJFe QewskFCNF4Oj+ziVNY9Y0nCWalbRM8IxnHAgWPq+63nH/4RkIsMOA/R/ryy5Q3QI y5fmXe5j9QOYIcRMyYTVSi8M7gT+WazHyYQsVrU+IJVwXdx/p38zV+d1XDLcWvM0 mvlyo6Oa10oc4Nns8ZkikI4= X-Sasl-enc: 4OeVLtWfP66hTkJuaJixrELdhZUY/fKj9G4G4F/Aepaw 1424558603 Received: from shorty.local (unknown [8.193.40.107]) by mail.messagingengine.com (Postfix) with ESMTPA id 28B0F6800C2; Sat, 21 Feb 2015 17:43:23 -0500 (EST) Received: from ip6-localhost ([::1] helo=shorty) by shorty.local with esmtp (Exim 4.84) (envelope-from ) id 1YPIlc-0005aX-Kr; Sat, 21 Feb 2015 14:43:20 -0800 References: <878ujpcw07.fsf@secretsauce.net> <871tll63de.fsf@gmx.de> <87lhjsaoje.fsf@secretsauce.net> <87k2zc9bda.fsf@secretsauce.net> <87k2zbvb7q.fsf@gmx.de> From: Dima Kogan Date: Sat, 21 Feb 2015 14:38:24 -0800 In-reply-to: <87k2zbvb7q.fsf@gmx.de> Message-ID: <87fv9yansn.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Michael Albinus writes: > Per default, I have enabled gfilenotify as notification library; it > works also w/o problems. Hi. I just tested auto-revert-mode with gfilenotify, and it does appear to work. Thank you very much for merging those patches! Where available I think it would be better for us to use inotify instead of gfilenotify, however, because glib currently has a minimum 1-second delay: https://bugzilla.gnome.org/show_bug.cgi?id=739322 In a perfect world, this 1-second delay would be removed upstream, and we'd use gfilenotify for everything. In the meantime, is gfilenotify better in any way on Linux? If the notifications are unavailable for some reason (network-mounted file for instance), then emacs simply decays to the normal polled notifications, right? From unknown Fri Sep 12 09:56:15 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Dima Kogan Subject: bug#18958: closed (Re: bug#18958: 25.0.50; auto-revert-mode reacts slowly even if using an event-driven backend) Message-ID: References: <87fv9ygtmo.fsf@gmx.de> <878ujpcw07.fsf@secretsauce.net> X-Gnu-PR-Message: they-closed 18958 X-Gnu-PR-Package: emacs Reply-To: 18958@debbugs.gnu.org Date: Sun, 22 Feb 2015 09:54:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1424598842-18550-1" This is a multi-part message in MIME format... ------------=_1424598842-18550-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #18958: 25.0.50; auto-revert-mode reacts slowly even if using an event-driv= en backend which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 18958@debbugs.gnu.org. --=20 18958: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D18958 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1424598842-18550-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 18958-done) by debbugs.gnu.org; 22 Feb 2015 09:53:14 +0000 Received: from localhost ([127.0.0.1]:50501 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YPTDt-0004oB-RJ for submit@debbugs.gnu.org; Sun, 22 Feb 2015 04:53:14 -0500 Received: from mout.gmx.net ([212.227.15.15]:63005) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YPTDr-0004o2-0B for 18958-done@debbugs.gnu.org; Sun, 22 Feb 2015 04:53:11 -0500 Received: from detlef.gmx.de ([79.195.3.46]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0Md3li-1Y8UKn2qhO-00IFUf; Sun, 22 Feb 2015 10:53:07 +0100 From: Michael Albinus To: Dima Kogan Subject: Re: bug#18958: 25.0.50; auto-revert-mode reacts slowly even if using an event-driven backend References: <878ujpcw07.fsf@secretsauce.net> <871tll63de.fsf@gmx.de> <87lhjsaoje.fsf@secretsauce.net> <87k2zc9bda.fsf@secretsauce.net> <87k2zbvb7q.fsf@gmx.de> <87fv9yansn.fsf@secretsauce.net> Date: Sun, 22 Feb 2015 10:53:03 +0100 In-Reply-To: <87fv9yansn.fsf@secretsauce.net> (Dima Kogan's message of "Sat, 21 Feb 2015 14:38:24 -0800") Message-ID: <87fv9ygtmo.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:pamnzjDNjhrYeOjzL6ToFjdUq1DEX1WEOhceET06kw1eUza5oJ1 J8aitJWg5rQcXQnlDeJlVhFbzEzvtNr1zYSmj5ND2qWRWWn3KhsdAia5DCjSykjawiMbA8e 5J6RoX2KWuEtIq2ZnCMGl5p0f2ZCuQZ9vJUBhnwViGRFoaPkBMT+WDl1WgKkxrLZc6Mm8Ea Y88URKcgD246bgHzbMtmw== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18958-done Cc: 18958-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Dima Kogan writes: > Hi. I just tested auto-revert-mode with gfilenotify, and it does appear > to work. Thank you very much for merging those patches! I'm marking this bug as closed. > In a perfect world, this 1-second delay would be removed upstream, and > we'd use gfilenotify for everything. In the meantime, is gfilenotify > better in any way on Linux? If the notifications are unavailable for > some reason (network-mounted file for instance), then emacs simply > decays to the normal polled notifications, right? You mean auto-revert, right? And yes, if `file-notify-add-watch' doesn't return a proper watch descriptor, auto-revert falls back to its polling mode. glib is said to use also polling for file systems where you don't have native file notification support. This would make it superior to inotify for mounted filesystems, and alike. Best regards, Michael. ------------=_1424598842-18550-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 5 Nov 2014 19:01:34 +0000 Received: from localhost ([127.0.0.1]:50349 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xm5pm-0006eY-3Z for submit@debbugs.gnu.org; Wed, 05 Nov 2014 14:01:34 -0500 Received: from eggs.gnu.org ([208.118.235.92]:51636) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xm5pj-0006eQ-Vj for submit@debbugs.gnu.org; Wed, 05 Nov 2014 14:01:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xm5pe-0002zi-8D for submit@debbugs.gnu.org; Wed, 05 Nov 2014 14:01:31 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:39983) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xm5pe-0002zc-5v for submit@debbugs.gnu.org; Wed, 05 Nov 2014 14:01:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53167) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xm5pZ-0000aF-0U for bug-gnu-emacs@gnu.org; Wed, 05 Nov 2014 14:01:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xm5pT-0002sg-Sh for bug-gnu-emacs@gnu.org; Wed, 05 Nov 2014 14:01:20 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:49474) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xm5pT-0002ro-FE for bug-gnu-emacs@gnu.org; Wed, 05 Nov 2014 14:01:15 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id AC75320706 for ; Wed, 5 Nov 2014 14:01:13 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute6.internal (MEProxy); Wed, 05 Nov 2014 14:01:13 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=x-sasl-enc:from:to:subject:date:message-id:mime-version :content-type; s=mesmtp; bh=urVA5/lrmutaZT24g3D3dmYihys=; b=CfMJ LEdRM5vliBBx0BqW1hZgrFhkHG6pzUHFduw1GlsDVPwUhERxP6YYowU+AgiPtYuv 39cUjEaNCGYWlz/TJ6UZRLVHiQ69k/MSqMINNPgtUPpza22enKKmbi1beg7s2/5+ 4Y3tM5Ng42ECejIoBgZGB/sS2MGyNyOgLhZAt5E= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:from:to:subject:date :message-id:mime-version:content-type; s=smtpout; bh=urVA5/lrmut aZT24g3D3dmYihys=; b=ICSL10XGg6ZACd+YejGE/T66E9EDGHy2hfnhEMO5DrQ lAq7/Kr6CubX7iHyaJq0Fak/SFYVfWflJmD+tcjbrikWnxGV1lKjkCuQ13fa7w2w z2FV4WVVZmhNDDl6DYJQvSWmVIfqouZSaa+CK+PGxQn8e+FX7N87YFdFTNeOZdcI = X-Sasl-enc: nEW11O+zykyz4LeVlavBZ0uH1f9n3CBNXBB/hbhkbbIP 1415214073 Received: from shorty.local (unknown [76.91.145.213]) by mail.messagingengine.com (Postfix) with ESMTPA id 648B268019B for ; Wed, 5 Nov 2014 14:01:13 -0500 (EST) Received: from dima by shorty.local with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1Xm5pQ-0007v5-BS for bug-gnu-emacs@gnu.org; Wed, 05 Nov 2014 11:01:12 -0800 From: Dima Kogan To: bug-gnu-emacs@gnu.org Subject: 25.0.50; auto-revert-mode reacts slowly even if using an event-driven backend Date: Wed, 05 Nov 2014 11:01:12 -0800 Message-ID: <878ujpcw07.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --=-=-= Content-Type: text/plain This is a tracker entry for a report and patch in an emacs-devel mailing list thread: http://lists.gnu.org/archive/html/emacs-devel/2014-10/msg00727.html The issue is that auto-revert-mode reacts to modifications on a timer, even if its backend is event-driven. There is a prototype patch in that thread, attached here also. On Linux, the two available backends have issues, so this patch wouldn't be completely effective until those are resolved. The gfile backend has a problem where emacs isn't using glib correctly, and the gfile backend itself, in turn, adds artificial delays in how it deals with inotify. Those are discussed (and partly patched) here: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18861 The inotify backend has an issue where it doesn't deal with more than one monitored file in a directory correctly: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18880 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-auto-revert-mode-can-now-revert-immediately-in-respo.patch >From 567d8469dfb143786890c65de58bf2ce887e9ebd Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Fri, 24 Oct 2014 19:44:43 -0700 Subject: [PATCH] auto-revert-mode can now revert immediately in response to a change event If we have file notifications, we want to update the auto-revert buffers immediately when a notification occurs. Since file updates can happen very often, we want to skip some revert operations so that we don't spend all our time reverting the buffer. We do this by reverting immediately in response to the first in a flurry of notifications. We suppress subsequent notifications until the next time `auto-revert-buffers' is called (this happens on a timer with a period set by `auto-revert-interval'). --- lisp/autorevert.el | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/lisp/autorevert.el b/lisp/autorevert.el index f1074e2..7de6ec1 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el @@ -531,6 +531,34 @@ will use an up-to-date value of `auto-revert-interval'" ;; Fallback to file checks. (set (make-local-variable 'auto-revert-use-notify) nil)))) + + +;; If we have file notifications, we want to update the auto-revert buffers +;; immediately when a notification occurs. Since file updates can happen very +;; often, we want to skip some revert operations so that we don't spend all our +;; time reverting the buffer. +;; +;; We do this by reverting immediately in response to the first in a flurry of +;; notifications. We suppress subsequent notifications until the next time +;; `auto-revert-buffers' is called (this happens on a timer with a period set by +;; `auto-revert-interval'). +(defvar auto-revert-buffers-counter 1 + "Incremented each time `auto-revert-buffers' is called") +(defvar auto-revert-buffers-counter-lockedout 0 + "Buffer-local value to indicate whether we should immediately +update the buffer on a notification event or not. If + + (= auto-revert-buffers-counter-lockedout + auto-revert-buffers-counter) + +then the updates are locked out, and we wait until the next call +of `auto-revert-buffers' to revert the buffer. If no lockout is +present, then we revert immediately and set the lockout, so that +no more reverts are possible until the next call of +`auto-revert-buffers'") +(make-variable-buffer-local 'auto-revert-buffers-counter-lockedout) + + (defun auto-revert-notify-handler (event) "Handle an EVENT returned from file notification." (with-demoted-errors @@ -566,6 +594,14 @@ will use an up-to-date value of `auto-revert-interval'" (file-name-nondirectory buffer-file-name))))) ;; Mark buffer modified. (setq auto-revert-notify-modified-p t) + + ;; Revert the buffer now if we're not locked out + (when (/= auto-revert-buffers-counter-lockedout + auto-revert-buffers-counter) + (auto-revert-handler) + (setq auto-revert-buffers-counter-lockedout + auto-revert-buffers-counter)) + ;; No need to check other buffers. (cl-return))))))))) @@ -686,6 +722,10 @@ are checked first the next time this function is called. This function is also responsible for removing buffers no longer in Auto-Revert mode from `auto-revert-buffer-list', and for canceling the timer when no buffers need to be checked." + + (setq auto-revert-buffers-counter + (1+ auto-revert-buffers-counter)) + (save-match-data (let ((bufs (if global-auto-revert-mode (buffer-list) -- 2.0.0 --=-=-=-- ------------=_1424598842-18550-1-- From unknown Fri Sep 12 09:56:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18958: 25.0.50; auto-revert-mode reacts slowly even if using an event-driven backend Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Feb 2015 15:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18958 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Michael Albinus Cc: 18958@debbugs.gnu.org, michael.albinus@gmx.de, dima@secretsauce.net Reply-To: Eli Zaretskii Received: via spool by 18958-submit@debbugs.gnu.org id=B18958.142462067029923 (code B ref 18958); Sun, 22 Feb 2015 15:58:02 +0000 Received: (at 18958) by debbugs.gnu.org; 22 Feb 2015 15:57:50 +0000 Received: from localhost ([127.0.0.1]:50805 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YPYuj-0007mZ-Ou for submit@debbugs.gnu.org; Sun, 22 Feb 2015 10:57:50 -0500 Received: from mtaout28.012.net.il ([80.179.55.184]:56110) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YPYug-0007mJ-H0 for 18958@debbugs.gnu.org; Sun, 22 Feb 2015 10:57:48 -0500 Received: from conversion-daemon.mtaout28.012.net.il by mtaout28.012.net.il (HyperSendmail v2007.08) id <0NK600A00JXVN700@mtaout28.012.net.il> for 18958@debbugs.gnu.org; Sun, 22 Feb 2015 17:56:09 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout28.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NK6003MYK9LV170@mtaout28.012.net.il>; Sun, 22 Feb 2015 17:56:09 +0200 (IST) Date: Sun, 22 Feb 2015 17:57:47 +0200 From: Eli Zaretskii In-reply-to: <87fv9ygtmo.fsf@gmx.de> X-012-Sender: halo1@inter.net.il Message-id: <838ufqc51g.fsf@gnu.org> References: <878ujpcw07.fsf@secretsauce.net> <871tll63de.fsf@gmx.de> <87lhjsaoje.fsf@secretsauce.net> <87k2zc9bda.fsf@secretsauce.net> <87k2zbvb7q.fsf@gmx.de> <87fv9yansn.fsf@secretsauce.net> <87fv9ygtmo.fsf@gmx.de> X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Albinus > Date: Sun, 22 Feb 2015 10:53:03 +0100 > Cc: 18958-done@debbugs.gnu.org > > glib is said to use also polling for file systems where you don't have > native file notification support. This would make it superior to inotify > for mounted filesystems, and alike. The native Windows port of glib either crashes or simply doesn't generate notifications when file notifications are requested. From unknown Fri Sep 12 09:56:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18958: 25.0.50; auto-revert-mode reacts slowly even if using an event-driven backend Resent-From: Dima Kogan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 Feb 2015 03:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18958 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Michael Albinus Cc: 18958-done@debbugs.gnu.org Received: via spool by 18958-done@debbugs.gnu.org id=D18958.14246635972996 (code D ref 18958); Mon, 23 Feb 2015 03:54:02 +0000 Received: (at 18958-done) by debbugs.gnu.org; 23 Feb 2015 03:53:17 +0000 Received: from localhost ([127.0.0.1]:50971 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YPk56-0000mF-L7 for submit@debbugs.gnu.org; Sun, 22 Feb 2015 22:53:16 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:45482) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YPk54-0000m7-C2 for 18958-done@debbugs.gnu.org; Sun, 22 Feb 2015 22:53:15 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 5718520737 for <18958-done@debbugs.gnu.org>; Sun, 22 Feb 2015 22:53:13 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Sun, 22 Feb 2015 22:53:14 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=x-sasl-enc:references:from:to:cc:subject:date:in-reply-to :message-id:mime-version:content-type; s=mesmtp; bh=URle4HAsSO6j SU1hzYvbRxrjPG4=; b=RGy+A4m7M5G+giauvjSzVBxd91mv4VpHVcD9Ufh3Ki7k 2W/M6MFOYs8hC3IpytvbqAecSdcFQW71tvJqRhpTSdksTt1wSg0lErv/6KKeOP+a eRtkegQEdew2gEClwl1yS8xEtOpvk7nhcmYcD7rJsx2CneVMoeHGs5pFvJjUY8U= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:references:from:to:cc:subject :date:in-reply-to:message-id:mime-version:content-type; s= smtpout; bh=URle4HAsSO6jSU1hzYvbRxrjPG4=; b=txJGG/9SoDoMhblOJ5Uc NmaCGx4QxE/5kuFCuCLqAeeRWWuDcUB+AaLJ5N6W+l8b2MKjJUEJrXswoG6T5c3l Efp3ykhi/7S0GCwl6ms9DoHj5JK7UXt6eyHKMWWke8Wke8UnL98+xqc6gePnKP6p cHUvMUN7Q7tBIRwTC97x/9A= X-Sasl-enc: ky3q7dNUurWK9waE4PVwMyHQMMgWxDhgqY5NktDfqL2N 1424663593 Received: from shorty.local (unknown [76.91.145.213]) by mail.messagingengine.com (Postfix) with ESMTPA id A7D53C00297; Sun, 22 Feb 2015 22:53:13 -0500 (EST) Received: from ip6-localhost ([::1] helo=shorty) by shorty.local with esmtp (Exim 4.84) (envelope-from ) id 1YPk53-0003fv-2n; Sun, 22 Feb 2015 19:53:13 -0800 References: <878ujpcw07.fsf@secretsauce.net> <871tll63de.fsf@gmx.de> <87lhjsaoje.fsf@secretsauce.net> <87k2zc9bda.fsf@secretsauce.net> <87k2zbvb7q.fsf@gmx.de> <87fv9yansn.fsf@secretsauce.net> <87fv9ygtmo.fsf@gmx.de> From: Dima Kogan Date: Sun, 22 Feb 2015 19:47:35 -0800 In-reply-to: <87fv9ygtmo.fsf@gmx.de> Message-ID: <87bnkl9tcm.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Michael Albinus writes: > Dima Kogan writes: > >> In a perfect world, this 1-second delay would be removed upstream, and >> we'd use gfilenotify for everything. In the meantime, is gfilenotify >> better in any way on Linux? If the notifications are unavailable for >> some reason (network-mounted file for instance), then emacs simply >> decays to the normal polled notifications, right? > > You mean auto-revert, right? And yes, if `file-notify-add-watch' doesn't > return a proper watch descriptor, auto-revert falls back to its polling > mode. Yes, I meant auto-revert. > glib is said to use also polling for file systems where you don't have > native file notification support. This would make it superior to inotify > for mounted filesystems, and alike. But how is it superior? Didn't you just say that when inotify fails then emacs polls, just as would happen with gfilenotify? To confirm, I just used an inotify-configured emacs to auto-revert on a file mounted on a network samba mount. As expected, the auto-revert-mode does work, but in a polled instead of event-driven fashion. So unless I'm missing something, then when you run the current emacs code on Linux both inotify and gfile work the same way EXCEPT gfile always has a 1-second notification delay while inotify does not. I'm probably missing something. From unknown Fri Sep 12 09:56:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18958: 25.0.50; auto-revert-mode reacts slowly even if using an event-driven backend Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 Feb 2015 16:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18958 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dima Kogan Cc: 18958-done@debbugs.gnu.org Received: via spool by 18958-done@debbugs.gnu.org id=D18958.142470751112290 (code D ref 18958); Mon, 23 Feb 2015 16:06:01 +0000 Received: (at 18958-done) by debbugs.gnu.org; 23 Feb 2015 16:05:11 +0000 Received: from localhost ([127.0.0.1]:51568 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YPvVO-0003CA-T7 for submit@debbugs.gnu.org; Mon, 23 Feb 2015 11:05:11 -0500 Received: from mout.gmx.net ([212.227.15.19]:53348) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YPvVL-0003C0-Pq for 18958-done@debbugs.gnu.org; Mon, 23 Feb 2015 11:05:08 -0500 Received: from detlef.gmx.de ([79.195.29.42]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0MMTEM-1YSg7o120U-008Ira; Mon, 23 Feb 2015 17:05:06 +0100 From: Michael Albinus References: <878ujpcw07.fsf@secretsauce.net> <871tll63de.fsf@gmx.de> <87lhjsaoje.fsf@secretsauce.net> <87k2zc9bda.fsf@secretsauce.net> <87k2zbvb7q.fsf@gmx.de> <87fv9yansn.fsf@secretsauce.net> <87fv9ygtmo.fsf@gmx.de> <87bnkl9tcm.fsf@secretsauce.net> Date: Mon, 23 Feb 2015 17:05:04 +0100 In-Reply-To: <87bnkl9tcm.fsf@secretsauce.net> (Dima Kogan's message of "Sun, 22 Feb 2015 19:47:35 -0800") Message-ID: <87a9041umn.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:0DMnQAWKsCTfYVv/Bp/dsTLgEmHtISJU9WE1DUQHNch2RswFkq7 dUJ2XFULBVVBepc6V1zgpAIlhErfZbF1wLDqxX0ljP/5JoHu9ODdDUGUNv3QLAvDyLZzJmL ZRagk782tjcgkZGPhA2plBoti99F8f7Ah776lHtvrcquMgPzYOYKPK6YidsWY/hg+dmw6Ts hVk87/983KXjnw3sQZ6bg== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Dima Kogan writes: >> glib is said to use also polling for file systems where you don't have >> native file notification support. This would make it superior to inotify >> for mounted filesystems, and alike. > > But how is it superior? Didn't you just say that when inotify fails then > emacs polls, just as would happen with gfilenotify? To confirm, I just > used an inotify-configured emacs to auto-revert on a file mounted on a > network samba mount. As expected, the auto-revert-mode does work, but in > a polled instead of event-driven fashion. So unless I'm missing > something, then when you run the current emacs code on Linux both > inotify and gfile work the same way EXCEPT gfile always has a 1-second > notification delay while inotify does not. I'm probably missing > something. I meant gfilenotify is superior to inotify wrt file notifications due to its polling feature. That does not mean auto-revert, since Emacs has its own polling mechanism here. Best regards, Michael. From unknown Fri Sep 12 09:56:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18958: 25.0.50; auto-revert-mode reacts slowly even if using an event-driven backend Resent-From: Dima Kogan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 Feb 2015 19:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18958 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Michael Albinus Cc: 18958-done@debbugs.gnu.org Received: via spool by 18958-done@debbugs.gnu.org id=D18958.142472117923191 (code D ref 18958); Mon, 23 Feb 2015 19:53:02 +0000 Received: (at 18958-done) by debbugs.gnu.org; 23 Feb 2015 19:52:59 +0000 Received: from localhost ([127.0.0.1]:55862 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YPz3q-00061z-Se for submit@debbugs.gnu.org; Mon, 23 Feb 2015 14:52:59 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:40265) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YPz3o-00061q-DN for 18958-done@debbugs.gnu.org; Mon, 23 Feb 2015 14:52:57 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 3AA842094E for <18958-done@debbugs.gnu.org>; Mon, 23 Feb 2015 14:52:55 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Mon, 23 Feb 2015 14:52:55 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=x-sasl-enc:references:from:to:cc:subject:date:in-reply-to :message-id:mime-version:content-type; s=mesmtp; bh=9Lvj4O2eKthh epG4XjQfM8ahyEA=; b=qn/p/dhuNUKzQ4rrNJKvSvGT+zK5Ufo83phRaa5QNsyZ IByMW49K7yWQpmF+WaBIDc+HhJtJ2vwQOc7lCzVxwQQucDCITdDduTs0Y21nQ1wF R/8CBLYMPuL8sW4nEnUl8FzJvUeu6dhO4A9WNA0/QWH1mL3sGVVQ7HaispLkcNk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:references:from:to:cc:subject :date:in-reply-to:message-id:mime-version:content-type; s= smtpout; bh=9Lvj4O2eKthhepG4XjQfM8ahyEA=; b=l6Fwd9UyXECfNJ0L5QS4 Qoue5gMGUvSZzB3KId/3Cz96UGmOJL7AXUYm/T+5wn+a+20GM2rgp4JqLv6P/6Em xFOT2CdTA3UCGPuay8EqjxNsMDIgJ42h63HP+xQn+nY7T697SjkDSWqC0cDCGRdr o5EtfRcBLw6veFc0eNKVz3A= X-Sasl-enc: KWaR4GZZAP9WBprRV1Z4kv1yypFalQoYvMVx4zk1nJhN 1424721175 Received: from shorty.local (unknown [76.91.145.213]) by mail.messagingengine.com (Postfix) with ESMTPA id A45BBC0029D; Mon, 23 Feb 2015 14:52:55 -0500 (EST) Received: from ip6-localhost ([::1] helo=shorty) by shorty.local with esmtp (Exim 4.84) (envelope-from ) id 1YPz3n-0000tL-5l; Mon, 23 Feb 2015 11:52:55 -0800 References: <878ujpcw07.fsf@secretsauce.net> <871tll63de.fsf@gmx.de> <87lhjsaoje.fsf@secretsauce.net> <87k2zc9bda.fsf@secretsauce.net> <87k2zbvb7q.fsf@gmx.de> <87fv9yansn.fsf@secretsauce.net> <87fv9ygtmo.fsf@gmx.de> <87bnkl9tcm.fsf@secretsauce.net> <87a9041umn.fsf@gmx.de> From: Dima Kogan Date: Mon, 23 Feb 2015 11:51:56 -0800 In-reply-to: <87a9041umn.fsf@gmx.de> Message-ID: <87a9049zhk.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Michael Albinus writes: > I meant gfilenotify is superior to inotify wrt file notifications due to > its polling feature. That does not mean auto-revert, since Emacs has its > own polling mechanism here. Ah, ok. This is true. Would you be opposed to setting the default to "inotify" on Linux since this currently provides a better user experience there? From unknown Fri Sep 12 09:56:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18958: 25.0.50; auto-revert-mode reacts slowly even if using an event-driven backend Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 Feb 2015 08:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18958 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dima Kogan Cc: 18958@debbugs.gnu.org Received: via spool by 18958-submit@debbugs.gnu.org id=B18958.142476735432317 (code B ref 18958); Tue, 24 Feb 2015 08:43:02 +0000 Received: (at 18958) by debbugs.gnu.org; 24 Feb 2015 08:42:34 +0000 Received: from localhost ([127.0.0.1]:56178 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YQB4c-0008PB-Bn for submit@debbugs.gnu.org; Tue, 24 Feb 2015 03:42:34 -0500 Received: from mout.gmx.net ([212.227.17.21]:60637) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YQB4a-0008Os-B7 for 18958@debbugs.gnu.org; Tue, 24 Feb 2015 03:42:33 -0500 Received: from detlef.gmx.de ([79.195.27.28]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0LzXTy-1XVgjJ3Guw-014mOn; Tue, 24 Feb 2015 09:42:19 +0100 From: Michael Albinus References: <878ujpcw07.fsf@secretsauce.net> <871tll63de.fsf@gmx.de> <87lhjsaoje.fsf@secretsauce.net> <87k2zc9bda.fsf@secretsauce.net> <87k2zbvb7q.fsf@gmx.de> <87fv9yansn.fsf@secretsauce.net> <87fv9ygtmo.fsf@gmx.de> <87bnkl9tcm.fsf@secretsauce.net> <87a9041umn.fsf@gmx.de> <87a9049zhk.fsf@secretsauce.net> Date: Tue, 24 Feb 2015 09:42:18 +0100 In-Reply-To: <87a9049zhk.fsf@secretsauce.net> (Dima Kogan's message of "Mon, 23 Feb 2015 11:51:56 -0800") Message-ID: <87vbirr991.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:A4U2nVslpWj2+m2UD7VbssHvTVOWuuw5MKJHHnchNa46aI0mXlK 6KwnpdUs8uFJSqnI0kXUhT8uDKHqIwD0KNKsHn4okoB89RjyfuoegsEDYldI0grfGbN3ir3 xSftQIj/S19NasiKT7bleWa1mdmhoN8UdXzqtdUwr8ZydrhEl/nybzdv3cDvw/JwRmABOfn CBWeWFGWJqit5c+NlVHSQ== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Dima Kogan writes: >> I meant gfilenotify is superior to inotify wrt file notifications due to >> its polling feature. That does not mean auto-revert, since Emacs has its >> own polling mechanism here. > > Ah, ok. This is true. Would you be opposed to setting the default to > "inotify" on Linux since this currently provides a better user > experience there? I believe this was discussed already back in 2013, when I've contributed gfilenotify.c. I cannot find the emails, likely there's something in the archives. What's the default must be decided by Stefan anyway, as the Emacs maintainer. Personally, I can live with this 1sec delay of glib. And glib is linked to Emacs also for other reasons, if not configured off. Maybe it's better to discuss this on emacs-devel, but in this bug. Best regards, Michael. From unknown Fri Sep 12 09:56:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18958: 25.0.50; auto-revert-mode reacts slowly even if using an event-driven backend Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 Feb 2015 15:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18958 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Michael Albinus Cc: 18958@debbugs.gnu.org, dima@secretsauce.net Reply-To: Eli Zaretskii Received: via spool by 18958-submit@debbugs.gnu.org id=B18958.14251374772667 (code B ref 18958); Sat, 28 Feb 2015 15:32:01 +0000 Received: (at 18958) by debbugs.gnu.org; 28 Feb 2015 15:31:17 +0000 Received: from localhost ([127.0.0.1]:60790 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRjML-0000gx-2O for submit@debbugs.gnu.org; Sat, 28 Feb 2015 10:31:17 -0500 Received: from mtaout20.012.net.il ([80.179.55.166]:40926) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRjMI-0000gd-Rl for 18958@debbugs.gnu.org; Sat, 28 Feb 2015 10:31:15 -0500 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NKH00H00N25C100@a-mtaout20.012.net.il> for 18958@debbugs.gnu.org; Sat, 28 Feb 2015 17:31:08 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NKH00HXQN3V9840@a-mtaout20.012.net.il>; Sat, 28 Feb 2015 17:31:08 +0200 (IST) Date: Sat, 28 Feb 2015 17:31:02 +0200 From: Eli Zaretskii In-reply-to: <87twyfh1ty.fsf@gmx.de> X-012-Sender: halo1@inter.net.il Message-id: <83385qt5mx.fsf@gnu.org> References: <878ujpcw07.fsf@secretsauce.net> <871tll63de.fsf@gmx.de> <87lhjsaoje.fsf@secretsauce.net> <87k2zc9bda.fsf@secretsauce.net> <87k2zbvb7q.fsf@gmx.de> <83mw47cx48.fsf@gnu.org> <87twyfh1ty.fsf@gmx.de> X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Albinus > Cc: dima@secretsauce.net, 18958@debbugs.gnu.org > Date: Sat, 21 Feb 2015 13:43:37 +0100 > > Eli Zaretskii writes: > > >> Per default, I have enabled gfilenotify as notification library; it > >> works also w/o problems. Of course, I cannot speak for w32notify, maybe > >> somebody can run a short test. > > > > If you can tell me what test to run, I can try doing that. > > I fear we have no ert test case yet, it is a matter of timing. Maybe I > write something next days, or somebody else has a got idea how to do. > > Test: Open a file in Emacs, and enable auto-revert-mode or > auto-revert-tail-mode. Change it outside Emacs. The reverted file shall > be shown immediately in Emacs. I compared with Emacs 24.4.90, and indeed the master version shows the updated contents much faster. > Another test I would also like to see on w32 is for the change I've > committed some few minutes ago: auto-revert of dired buffers. Call > auto-revert-mode on a dired buffer, and create/delete a file in the > respective directory outside Emacs. The dired buffer shall be reverted > immediately as well. Likewise: the 25.0.50 version reverts immediately, while 24.4.90 sometimes waits for several seconds (as expected). So it looks like things work on w32 as intended; thanks.