From 80ff0c71ad4aab1c55b37a823302b451044954bf Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Tue, 23 Jul 2013 16:06:02 +0200 Subject: [PATCH] * net/tramp.el (tramp-handle-file-notify-add-watch): New defun. * net/tramp-adb.el (tramp-adb-file-name-handler-alist): * net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): * net/tramp-smb.el (tramp-smb-file-name-handler-alist): Use it. --- lisp/ChangeLog | 8 ++++++++ lisp/net/tramp-adb.el | 4 ++-- lisp/net/tramp-gvfs.el | 4 ++-- lisp/net/tramp-smb.el | 4 ++-- lisp/net/tramp.el | 8 ++++++++ 5 files changed, 22 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b30163526b..71e1777ef7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2013-07-23 Michael Albinus + + * net/tramp.el (tramp-handle-file-notify-add-watch): New defun. + + * net/tramp-adb.el (tramp-adb-file-name-handler-alist): + * net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): + * net/tramp-smb.el (tramp-smb-file-name-handler-alist): Use it. + 2013-07-23 Juanma Barranquero * desktop.el (desktop-clear): Simplify; remove useless checks diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 56c0ee2dc2..d2acea0b1b 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -108,9 +108,9 @@ (file-writable-p . tramp-adb-handle-file-writable-p) (file-local-copy . tramp-adb-handle-file-local-copy) (file-modes . tramp-handle-file-modes) - (file-notify-add-watch . ignore) + (file-notify-add-watch . tramp-handle-file-notify-add-watch) (file-notify-rm-watch . ignore) - (file-notify-supported-p . ignore) + (file-notify-supported-p . ignore) (expand-file-name . tramp-adb-handle-expand-file-name) (find-backup-file-name . tramp-handle-find-backup-file-name) (directory-files . tramp-handle-directory-files) diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 526408140c..c6c5a9543c 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -435,9 +435,9 @@ Every entry is a list (NAME ADDRESS).") (file-name-nondirectory . tramp-handle-file-name-nondirectory) ;; `file-name-sans-versions' performed by default handler. (file-newer-than-file-p . tramp-handle-file-newer-than-file-p) - (file-notify-add-watch . ignore) + (file-notify-add-watch . tramp-handle-file-notify-add-watch) (file-notify-rm-watch . ignore) - (file-notify-supported-p . ignore) + (file-notify-supported-p . ignore) (file-ownership-preserved-p . ignore) (file-readable-p . tramp-gvfs-handle-file-readable-p) (file-regular-p . tramp-handle-file-regular-p) diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index d9bb5057e7..ad22ab98e4 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -209,9 +209,9 @@ See `tramp-actions-before-shell' for more info.") (file-name-nondirectory . tramp-handle-file-name-nondirectory) ;; `file-name-sans-versions' performed by default handler. (file-newer-than-file-p . tramp-handle-file-newer-than-file-p) - (file-notify-add-watch . ignore) + (file-notify-add-watch . tramp-handle-file-notify-add-watch) (file-notify-rm-watch . ignore) - (file-notify-supported-p . ignore) + (file-notify-supported-p . ignore) (file-ownership-preserved-p . ignore) (file-readable-p . tramp-handle-file-exists-p) (file-regular-p . tramp-handle-file-regular-p) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index fd5435bd3d..9c19a160a0 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3278,6 +3278,14 @@ beginning of local filename are not substituted." ;; for backward compatibility. (expand-file-name "~/")) +(defun tramp-handle-file-notify-add-watch (filename flags callback) + "Like `file-notify-add-watch' for Tramp files." + ;; This is the default handler. Some packages might have its own one. + (setq filename (expand-file-name filename)) + (with-parsed-tramp-file-name filename nil + (tramp-error + v 'file-notify-error "File notification not supported for `%s'" filename))) + ;;; Functions for establishing connection: ;; The following functions are actions to be taken when seeing certain -- 2.20.1