+2013-07-23 Michael Albinus <michael.albinus@gmx.de>
+
+ * 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 <lekktu@gmail.com>
* desktop.el (desktop-clear): Simplify; remove useless checks
(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)
(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)
(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)
;; 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