diff options
| author | Michael Albinus | 2018-01-26 11:57:41 +0100 |
|---|---|---|
| committer | Noam Postavsky | 2018-02-01 20:15:12 -0500 |
| commit | e08de2bae2a8e91c0245259dfcbfdca1d191a119 (patch) | |
| tree | a79bfb9080a90f31c8106898b1418bf8addb9e74 | |
| parent | 00c65bcf4ee8ca4ce04ad46907de29c832b8310b (diff) | |
| download | emacs-e08de2bae2a8e91c0245259dfcbfdca1d191a119.tar.gz emacs-e08de2bae2a8e91c0245259dfcbfdca1d191a119.zip | |
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.
| -rw-r--r-- | lisp/filenotify.el | 5 | ||||
| -rw-r--r-- | test/lisp/files-tests.el | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lisp/filenotify.el b/lisp/filenotify.el index 562ac266e44..442dc891571 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." | |||
| 307 | (unless (functionp callback) | 307 | (unless (functionp callback) |
| 308 | (signal 'wrong-type-argument `(,callback))) | 308 | (signal 'wrong-type-argument `(,callback))) |
| 309 | 309 | ||
| 310 | (let* ((handler (find-file-name-handler file 'file-notify-add-watch)) | 310 | (let* ((quoted (file-name-quoted-p file)) |
| 311 | (file (file-name-unquote file)) | ||
| 312 | (file-name-handler-alist (if quoted nil file-name-handler-alist)) | ||
| 313 | (handler (find-file-name-handler file 'file-notify-add-watch)) | ||
| 311 | (dir (directory-file-name | 314 | (dir (directory-file-name |
| 312 | (if (file-directory-p file) | 315 | (if (file-directory-p file) |
| 313 | file | 316 | file |
diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el index a72f5754aa6..6b394cd5b7b 100644 --- a/test/lisp/files-tests.el +++ b/test/lisp/files-tests.el | |||
| @@ -533,7 +533,6 @@ be invoked with the right arguments." | |||
| 533 | (should-not (file-newer-than-file-p nospecial nospecial)))) | 533 | (should-not (file-newer-than-file-p nospecial nospecial)))) |
| 534 | 534 | ||
| 535 | (ert-deftest files-file-name-non-special-notify-handlers () | 535 | (ert-deftest files-file-name-non-special-notify-handlers () |
| 536 | :expected-result :failed | ||
| 537 | (files-tests--with-temp-non-special (tmpfile nospecial) | 536 | (files-tests--with-temp-non-special (tmpfile nospecial) |
| 538 | (let ((watch (file-notify-add-watch nospecial '(change) #'ignore))) | 537 | (let ((watch (file-notify-add-watch nospecial '(change) #'ignore))) |
| 539 | (should (file-notify-valid-p watch)) | 538 | (should (file-notify-valid-p watch)) |