]> git.eshelyaron.com Git - emacs.git/commitdiff
Handle quoted file names in filenotify.el
authorMichael Albinus <michael.albinus@gmx.de>
Fri, 26 Jan 2018 10:57:41 +0000 (11:57 +0100)
committerNoam Postavsky <npostavs@gmail.com>
Fri, 2 Feb 2018 01:15:12 +0000 (20:15 -0500)
* 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
test/lisp/files-tests.el

index 562ac266e447864c9f2194a18cf944c64336cb09..442dc8915711da464168cb71a812b0891d06f9b7 100644 (file)
@@ -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
index a72f5754aa63876dcdee0e8799fdcac48db72967..6b394cd5b7b1eebe9086a6d73e08bf50ed8f4ce4 100644 (file)
@@ -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))