unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Filipp Gunbin <fgunbin@fastmail.fm>
To: 20000@debbugs.gnu.org
Subject: bug#20000: 25.0.50; auto-revert tries to install notification handler on remote files
Date: Wed, 04 Mar 2015 15:10:46 +0300	[thread overview]
Message-ID: <m2pp8pvu7t.fsf@fastmail.fm> (raw)

Hi,

Most lines of the patch are whitespace changes, the only important thing
is that upper-level `when' is changed to `if'.

Ok to commit?

Filipp


diff --git a/lisp/autorevert.el b/lisp/autorevert.el
index 6489a3e..357916c 100644
--- a/lisp/autorevert.el
+++ b/lisp/autorevert.el
@@ -503,36 +503,37 @@
   "Enable file notification for current buffer's associated file."
   ;; We can assume that `buffer-file-name' and
   ;; `auto-revert-use-notify' are non-nil.
-  (when (or (string-match auto-revert-notify-exclude-dir-regexp
-			  (expand-file-name default-directory))
-	    (file-symlink-p (or buffer-file-name default-directory)))
-    ;; Fallback to file checks.
-    (set (make-local-variable 'auto-revert-use-notify) nil))
-
-  (when (not auto-revert-notify-watch-descriptor)
-    (setq auto-revert-notify-watch-descriptor
-	  (ignore-errors
-	    (if buffer-file-name
-		(file-notify-add-watch
-		 (expand-file-name buffer-file-name default-directory)
-		 '(change attribute-change)
-		 'auto-revert-notify-handler)
-	      (file-notify-add-watch
-	       (expand-file-name default-directory)
-	       '(change)
-	       'auto-revert-notify-handler))))
-    (if auto-revert-notify-watch-descriptor
-	(progn
-	  (puthash
-	   auto-revert-notify-watch-descriptor
-	   (cons (current-buffer)
-		 (gethash auto-revert-notify-watch-descriptor
-			  auto-revert-notify-watch-descriptor-hash-list))
-	   auto-revert-notify-watch-descriptor-hash-list)
-	  (add-hook (make-local-variable 'kill-buffer-hook)
-		    'auto-revert-notify-rm-watch))
+  (if (or (string-match auto-revert-notify-exclude-dir-regexp
+			(expand-file-name default-directory))
+	  (file-symlink-p (or buffer-file-name default-directory)))
+
       ;; Fallback to file checks.
-      (set (make-local-variable 'auto-revert-use-notify) nil))))
+      (set (make-local-variable 'auto-revert-use-notify) nil)
+
+    (when (not auto-revert-notify-watch-descriptor)
+      (setq auto-revert-notify-watch-descriptor
+	    (ignore-errors
+	      (if buffer-file-name
+		  (file-notify-add-watch
+		   (expand-file-name buffer-file-name default-directory)
+		   '(change attribute-change)
+		   'auto-revert-notify-handler)
+		(file-notify-add-watch
+		 (expand-file-name default-directory)
+		 '(change)
+		 'auto-revert-notify-handler))))
+      (if auto-revert-notify-watch-descriptor
+	  (progn
+	    (puthash
+	     auto-revert-notify-watch-descriptor
+	     (cons (current-buffer)
+		   (gethash auto-revert-notify-watch-descriptor
+			    auto-revert-notify-watch-descriptor-hash-list))
+	     auto-revert-notify-watch-descriptor-hash-list)
+	    (add-hook (make-local-variable 'kill-buffer-hook)
+		      'auto-revert-notify-rm-watch))
+	;; 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





             reply	other threads:[~2015-03-04 12:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-04 12:10 Filipp Gunbin [this message]
2015-03-04 14:04 ` bug#20000: 25.0.50; auto-revert tries to install notification handler on remote files Michael Albinus
2015-03-04 14:17   ` Filipp Gunbin
2015-03-04 14:32     ` Michael Albinus
2015-03-04 14:59       ` Filipp Gunbin
2015-03-04 15:46         ` Michael Albinus
2015-03-04 16:40           ` Filipp Gunbin

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=m2pp8pvu7t.fsf@fastmail.fm \
    --to=fgunbin@fastmail.fm \
    --cc=20000@debbugs.gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).