]> 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)
committerMichael Albinus <michael.albinus@gmx.de>
Fri, 26 Jan 2018 10:57:41 +0000 (11:57 +0100)
* 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 c4c82077016516040b537d9ace365c07bf9634e8..98a8f9a070b5c9af6bc86c47b928b0180d8cfd98 100644 (file)
@@ -339,14 +339,12 @@ be invoked with the right arguments."
                         (verify-visited-file-modtime nil))))))))
 
 (ert-deftest files-file-name-non-special-notify-handlers ()
-  :expected-result :failed
   (files-tests--with-temp-file tmpfile
     (let* ((nospecial (concat "/:" tmpfile))
            (watch (file-notify-add-watch nospecial '(change) #'ignore)))
       (should (file-notify-valid-p watch))
       (file-notify-rm-watch watch))))
 
-
 (ert-deftest files-file-name-non-special-handlers ()
   (files-tests--with-temp-file tmpfile
     (files-tests--with-temp-dir tmpdir