diff options
| author | Michael Albinus <michael.albinus@gmx.de> | 2018-02-02 18:51:25 +0100 |
|---|---|---|
| committer | Michael Albinus <michael.albinus@gmx.de> | 2018-02-02 18:51:25 +0100 |
| commit | 344750aef4a8e8c67b1857cf0fe413ba855026d6 (patch) | |
| tree | 2f404f189bb3876ca5ea46848a3b007d40d95562 /test | |
| parent | b86b8ee07237a3c4653a63e436d2127685cadffb (diff) | |
| download | emacs-344750aef4a8e8c67b1857cf0fe413ba855026d6.tar.gz | |
Handle quoted remote file names for file notifications
* lisp/filenotify.el (file-notify-add-watch): Do not suppress
other file name handlers when FILE is quoted.
* test/lisp/filenotify-tests.el
(file-notify-test-remote-temporary-file-directory):
Beware quoted `temporary-file-directory'.
* test/lisp/files-tests.el
(files-tests-file-name-non-special-quote-unquote): Improve test.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/filenotify-tests.el | 5 | ||||
| -rw-r--r-- | test/lisp/files-tests.el | 9 |
2 files changed, 11 insertions, 3 deletions
diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el index f2feef6132b..219fa746119 100644 --- a/test/lisp/filenotify-tests.el +++ b/test/lisp/filenotify-tests.el @@ -57,9 +57,10 @@ 'tramp-default-host-alist `("\\`mock\\'" nil ,(system-name))) ;; Emacs' Makefile sets $HOME to a nonexistent value. Needed in - ;; batch mode only, therefore. + ;; batch mode only, therefore. `temporary-file-directory' might + ;; be quoted, so we unquote it just in case. (unless (and (null noninteractive) (file-directory-p "~/")) - (setenv "HOME" temporary-file-directory)) + (setenv "HOME" (file-name-unquote temporary-file-directory))) (format "/mock::%s" temporary-file-directory))) "Temporary directory for Tramp tests.") diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el index 6b394cd5b7b..90e5ebf2153 100644 --- a/test/lisp/files-tests.el +++ b/test/lisp/files-tests.el @@ -268,7 +268,14 @@ be $HOME." (should (file-name-quoted-p (file-name-quote temporary-file-directory))) (should (equal temporary-file-directory (file-name-unquote - (file-name-quote temporary-file-directory)))))) + (file-name-quote temporary-file-directory)))) + ;; It does not hurt to quote/unquote a file several times. + (should (equal (file-name-quote temporary-file-directory) + (file-name-quote + (file-name-quote temporary-file-directory)))) + (should (equal (file-name-unquote temporary-file-directory) + (file-name-unquote + (file-name-unquote temporary-file-directory)))))) (ert-deftest files-tests--file-name-non-special--subprocess () "Check that Bug#25949 is fixed." |
