summaryrefslogtreecommitdiff
path: root/lisp/net/tramp.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/net/tramp.el')
-rw-r--r--lisp/net/tramp.el17
1 files changed, 13 insertions, 4 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 3513701d20e..db6a1e381a6 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1980,8 +1980,8 @@ ARGS are the arguments OPERATION has been called with."
;; Emacs 22+ only.
'set-file-times
;; Emacs 24+ only.
- 'file-acl 'file-notify-add-watch 'file-selinux-context
- 'set-file-acl 'set-file-selinux-context
+ 'file-acl 'file-notify-add-watch
+ 'file-selinux-context 'set-file-acl 'set-file-selinux-context
;; XEmacs only.
'abbreviate-file-name 'create-file-buffer
'dired-file-modtime 'dired-make-compressed-filename
@@ -2036,8 +2036,9 @@ ARGS are the arguments OPERATION has been called with."
default-directory)
;; PROC.
((eq operation 'file-notify-rm-watch)
- (with-current-buffer (process-buffer (nth 0 args))
- default-directory))
+ (when (processp (nth 0 args))
+ (with-current-buffer (process-buffer (nth 0 args))
+ default-directory)))
;; Unknown file primitive.
(t (error "unknown file I/O primitive: %s" operation))))
@@ -3278,6 +3279,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