[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master e08de2b 3/3: Handle quoted file names in filenotify
From: |
Noam Postavsky |
Subject: |
[Emacs-diffs] master e08de2b 3/3: Handle quoted file names in filenotify.el |
Date: |
Thu, 1 Feb 2018 20:16:03 -0500 (EST) |
branch: master
commit e08de2bae2a8e91c0245259dfcbfdca1d191a119
Author: Michael Albinus <address@hidden>
Commit: Noam Postavsky <address@hidden>
Handle quoted file names in filenotify.el
* lisp/filenotify.el (file-notify-add-watch): Do not save
quoted file names in `file-notify-descriptors'.
* test/lisp/files-tests.el
(files-file-name-non-special-notify-handlers): Do not expect
to fail.
---
lisp/filenotify.el | 5 ++++-
test/lisp/files-tests.el | 1 -
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/lisp/filenotify.el b/lisp/filenotify.el
index 562ac26..442dc89 100644
--- a/lisp/filenotify.el
+++ b/lisp/filenotify.el
@@ -307,7 +307,10 @@ FILE is the name of the file whose event is being
reported."
(unless (functionp callback)
(signal 'wrong-type-argument `(,callback)))
- (let* ((handler (find-file-name-handler file 'file-notify-add-watch))
+ (let* ((quoted (file-name-quoted-p file))
+ (file (file-name-unquote file))
+ (file-name-handler-alist (if quoted nil file-name-handler-alist))
+ (handler (find-file-name-handler file 'file-notify-add-watch))
(dir (directory-file-name
(if (file-directory-p file)
file
diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el
index a72f575..6b394cd 100644
--- a/test/lisp/files-tests.el
+++ b/test/lisp/files-tests.el
@@ -533,7 +533,6 @@ be invoked with the right arguments."
(should-not (file-newer-than-file-p nospecial nospecial))))
(ert-deftest files-file-name-non-special-notify-handlers ()
- :expected-result :failed
(files-tests--with-temp-non-special (tmpfile nospecial)
(let ((watch (file-notify-add-watch nospecial '(change) #'ignore)))
(should (file-notify-valid-p watch))