all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dima Kogan <dima@secretsauce.net>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: 18958@debbugs.gnu.org
Subject: bug#18958: 25.0.50; auto-revert-mode reacts slowly even if using an event-driven backend
Date: Fri, 20 Feb 2015 19:38:39 -0800	[thread overview]
Message-ID: <87k2zc9bda.fsf@secretsauce.net> (raw)
In-Reply-To: <87lhjsaoje.fsf@secretsauce.net>

[-- Attachment #1: Type: text/plain, Size: 1257 bytes --]

Dima Kogan <dima@secretsauce.net> 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.




[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-notification-handler-is-now-installed-when-auto-reve.patch --]
[-- Type: text/x-diff, Size: 1793 bytes --]

From bb2dec478fce20a25a737f16f26c0b338d599552 Mon Sep 17 00:00:00 2001
From: Dima Kogan <dima@secretsauce.net>
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


  parent reply	other threads:[~2015-02-21  3:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-05 19:01 bug#18958: 25.0.50; auto-revert-mode reacts slowly even if using an event-driven backend Dima Kogan
2014-11-07 20:01 ` Stefan Monnier
2015-02-19 20:41 ` Michael Albinus
2015-02-20  9:59   ` Dima Kogan
2015-02-20 10:25     ` Michael Albinus
2015-02-21  3:38     ` Dima Kogan [this message]
2015-02-21  9:57       ` Michael Albinus
2015-02-21 11:39         ` Eli Zaretskii
2015-02-21 12:43           ` Michael Albinus
2015-02-28 15:31             ` Eli Zaretskii
2015-02-21 22:38         ` Dima Kogan
2015-02-22  9:53           ` Michael Albinus
2015-02-22 15:57             ` Eli Zaretskii
2015-02-23  3:47             ` Dima Kogan
2015-02-23 16:05               ` Michael Albinus
2015-02-23 19:51                 ` Dima Kogan
2015-02-24  8:42                   ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k2zc9bda.fsf@secretsauce.net \
    --to=dima@secretsauce.net \
    --cc=18958@debbugs.gnu.org \
    --cc=michael.albinus@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.