]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix problem in remote file notification
authorMichael Albinus <michael.albinus@gmx.de>
Fri, 14 Jun 2019 17:45:00 +0000 (19:45 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Fri, 14 Jun 2019 17:45:00 +0000 (19:45 +0200)
* lisp/net/tramp-sh.el (tramp-sh-gio-monitor-process-filter)
(tramp-sh-gvfs-monitor-dir-process-filter)
(tramp-sh-inotifywait-process-filter): Do not kill the process.
Let `file-notify-rm-watch' do the job.

* test/lisp/filenotify-tests.el (file-notify-test03-events)
(file-notify-test05-file-validity)
(file-notify-test09-watched-file-in-watched-dir): Do not
special-case remote files.

lisp/net/tramp-sh.el
test/lisp/filenotify-tests.el

index 3d572ad0b6d736ee315971575d1631c3a5c42792..d7db69a5ddb5adc42d7df5536622974365d904a3 100644 (file)
@@ -3699,10 +3699,6 @@ Fall back to normal file name handler if no Tramp handler exists."
               (concat remote-prefix file)
               (when file1 (concat remote-prefix file1)))))
        (setq string (replace-match "" nil nil string))
-       ;; Remove watch when file or directory to be watched is deleted.
-       (when (and (member (cl-caadr object) '(moved deleted))
-                  (string-equal file (process-get proc 'watch-name)))
-         (delete-process proc))
        ;; Usually, we would add an Emacs event now.  Unfortunately,
        ;; `unread-command-events' does not accept several events at
        ;; once.  Therefore, we apply the handler directly.
@@ -3754,10 +3750,6 @@ file-notify events."
               (concat remote-prefix file)
               (when file1 (concat remote-prefix file1)))))
        (setq string (replace-match "" nil nil string))
-       ;; Remove watch when file or directory to be watched is deleted.
-       (when (and (member (cl-caadr object) '(moved deleted))
-                  (string-equal file (process-get proc 'watch-name)))
-         (delete-process proc))
        ;; Usually, we would add an Emacs event now.  Unfortunately,
        ;; `unread-command-events' does not accept several events at
        ;; once.  Therefore, we apply the handler directly.
@@ -3794,9 +3786,6 @@ file-notify events."
                  (replace-regexp-in-string "_" "-" (downcase x))))
               (split-string (match-string 1 line) "," 'omit))
              (match-string 3 line))))
-       ;; Remove watch when file or directory to be watched is deleted.
-       (when (member (cl-caadr object) '(move-self delete-self ignored))
-         (delete-process proc))
        ;; Usually, we would add an Emacs event now.  Unfortunately,
        ;; `unread-command-events' does not accept several events at
        ;; once.  Therefore, we apply the handler directly.
index 9dfa794e307cc68ba143bcab44efe63796a8ba2e..4396a693e3a64f4cc7ff28611310c7b74e126fee 100644 (file)
@@ -687,12 +687,11 @@ delivered."
              ((getenv "EMACS_EMBA_CI")
               '(created changed deleted))
             ;; There are two `deleted' events, for the file and for
-            ;; the directory.  Except for cygwin, kqueue and remote
-            ;; files.  And cygwin does not raise a `changed' event.
+            ;; the directory.  Except for cygwin and kqueue.  And
+            ;; cygwin does not raise a `changed' event.
             ((eq system-type 'cygwin)
              '(created deleted stopped))
-            ((or (string-equal (file-notify--test-library) "kqueue")
-                 (file-remote-p temporary-file-directory))
+            ((string-equal (file-notify--test-library) "kqueue")
              '(created changed deleted stopped))
             (t '(created changed deleted deleted stopped)))
          (write-region
@@ -743,9 +742,6 @@ delivered."
              ;; directory are not detected.
              ((getenv "EMACS_EMBA_CI")
               '(created changed created changed deleted deleted))
-             ;; Remote files return two `deleted' events.
-            ((file-remote-p temporary-file-directory)
-             '(created changed created changed deleted deleted stopped))
             (t '(created changed created changed
                  deleted deleted deleted stopped)))
          (write-region
@@ -795,13 +791,12 @@ delivered."
              ((getenv "EMACS_EMBA_CI")
               '(created changed renamed deleted))
             ;; There are two `deleted' events, for the file and for
-            ;; the directory.  Except for cygwin, kqueue and remote
-            ;; files.  And cygwin raises `created' and `deleted'
-            ;; events instead of a `renamed' event.
+            ;; the directory.  Except for cygwin and kqueue.  And
+            ;; cygwin raises `created' and `deleted' events instead
+            ;; of a `renamed' event.
             ((eq system-type 'cygwin)
              '(created created deleted deleted stopped))
-            ((or (string-equal (file-notify--test-library) "kqueue")
-                 (file-remote-p temporary-file-directory))
+            ((string-equal (file-notify--test-library) "kqueue")
              '(created changed renamed deleted stopped))
             (t '(created changed renamed deleted deleted stopped)))
          (write-region
@@ -1046,12 +1041,11 @@ delivered."
                '((deleted stopped)
                  (created deleted stopped)))
               ;; There are two `deleted' events, for the file and for
-              ;; the directory.  Except for cygwin, kqueue and remote
-              ;; files.  And cygwin does not raise a `changed' event.
+              ;; the directory.  Except for cygwin and kqueue.  And
+              ;; cygwin does not raise a `changed' event.
               ((eq system-type 'cygwin)
                '(created deleted stopped))
-              ((or (string-equal (file-notify--test-library) "kqueue")
-                   (file-remote-p temporary-file-directory))
+              ((string-equal (file-notify--test-library) "kqueue")
                '(created changed deleted stopped))
               (t '(created changed deleted deleted stopped)))
            (write-region
@@ -1415,9 +1409,6 @@ the file watch."
                   ;; directory are not detected.
                   ((getenv "EMACS_EMBA_CI")
                    '())
-                  ;; Remote files send just one `stopped' event.
-                  ((file-remote-p temporary-file-directory)
-                   '(stopped))
                   (t '(deleted stopped))))))
           (delete-directory file-notify--test-tmpfile 'recursive))
         (unless (getenv "EMACS_EMBA_CI")