aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2013-07-24 15:29:15 +0200
committerMichael Albinus2013-07-24 15:29:15 +0200
commitd5d3c58aac3fa748bd6b81c79b0c435bbf1c4cbc (patch)
tree120baf49fd9b76e5564693756d95a3258bb54d28
parent95e6e62b6445c92e725a44e3c725c93367722bf0 (diff)
downloademacs-d5d3c58aac3fa748bd6b81c79b0c435bbf1c4cbc.tar.gz
emacs-d5d3c58aac3fa748bd6b81c79b0c435bbf1c4cbc.zip
* filenotify.el (file-notify-supported-p):
* net/tramp-sh.el (tramp-sh-handle-file-notify-supported-p): Remove functions. * autorevert.el (auto-revert-use-notify): (auto-revert-notify-add-watch): * net/tramp.el (tramp-file-name-for-operation): * net/tramp-adb.el (tramp-adb-file-name-handler-alist): * net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): * net/tramp-sh.el (tramp-sh-file-name-handler-alist): * net/tramp-smb.el (tramp-smb-file-name-handler-alist): Remove `file-notify-supported-p' entry.
-rw-r--r--lisp/ChangeLog15
-rw-r--r--lisp/autorevert.el7
-rw-r--r--lisp/filenotify.el20
-rw-r--r--lisp/net/tramp-adb.el1
-rw-r--r--lisp/net/tramp-gvfs.el1
-rw-r--r--lisp/net/tramp-sh.el10
-rw-r--r--lisp/net/tramp-smb.el1
-rw-r--r--lisp/net/tramp.el7
8 files changed, 27 insertions, 35 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 886c3075653..bd7c43983fe 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,18 @@
12013-07-24 Michael Albinus <michael.albinus@gmx.de>
2
3 * filenotify.el (file-notify-supported-p):
4 * net/tramp-sh.el (tramp-sh-handle-file-notify-supported-p):
5 Remove functions.
6
7 * autorevert.el (auto-revert-use-notify):
8 (auto-revert-notify-add-watch):
9 * net/tramp.el (tramp-file-name-for-operation):
10 * net/tramp-adb.el (tramp-adb-file-name-handler-alist):
11 * net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist):
12 * net/tramp-sh.el (tramp-sh-file-name-handler-alist):
13 * net/tramp-smb.el (tramp-smb-file-name-handler-alist):
14 Remove `file-notify-supported-p' entry.
15
12013-07-24 Glenn Morris <rgm@gnu.org> 162013-07-24 Glenn Morris <rgm@gnu.org>
2 17
3 * printing.el: Replace all uses of deleted ps-windows-system, 18 * printing.el: Replace all uses of deleted ps-windows-system,
diff --git a/lisp/autorevert.el b/lisp/autorevert.el
index 5c593e2ef71..1617a31cd82 100644
--- a/lisp/autorevert.el
+++ b/lisp/autorevert.el
@@ -271,9 +271,7 @@ This variable becomes buffer local when set in any fashion.")
271 :type 'boolean 271 :type 'boolean
272 :version "24.4") 272 :version "24.4")
273 273
274(defcustom auto-revert-use-notify 274(defcustom auto-revert-use-notify t
275 ;; We use the support of the local filesystem as default.
276 (file-notify-supported-p temporary-file-directory)
277 "If non-nil Auto Revert Mode uses file notification functions. 275 "If non-nil Auto Revert Mode uses file notification functions.
278You should set this variable through Custom." 276You should set this variable through Custom."
279 :group 'auto-revert 277 :group 'auto-revert
@@ -512,8 +510,7 @@ will use an up-to-date value of `auto-revert-interval'"
512 (set (make-local-variable 'auto-revert-use-notify) nil)) 510 (set (make-local-variable 'auto-revert-use-notify) nil))
513 511
514 (when (and buffer-file-name auto-revert-use-notify 512 (when (and buffer-file-name auto-revert-use-notify
515 (not auto-revert-notify-watch-descriptor) 513 (not auto-revert-notify-watch-descriptor))
516 (file-notify-supported-p buffer-file-name))
517 (setq auto-revert-notify-watch-descriptor 514 (setq auto-revert-notify-watch-descriptor
518 (ignore-errors 515 (ignore-errors
519 (file-notify-add-watch 516 (file-notify-add-watch
diff --git a/lisp/filenotify.el b/lisp/filenotify.el
index c9a7e106faa..d2f37b99107 100644
--- a/lisp/filenotify.el
+++ b/lisp/filenotify.el
@@ -190,17 +190,6 @@ car of that event, which is the symbol `file-notify'."
190 (funcall callback (list desc action file file1)) 190 (funcall callback (list desc action file file1))
191 (funcall callback (list desc action file))))))) 191 (funcall callback (list desc action file)))))))
192 192
193(defun file-notify-supported-p (file)
194 "Returns non-nil if filesystem pertaining to FILE could be watched."
195 (unless (stringp file)
196 (signal 'wrong-type-argument (list file)))
197 (setq file (expand-file-name file))
198
199 (let ((handler (find-file-name-handler file 'file-notify-supported-p)))
200 (if handler
201 (funcall handler 'file-notify-supported-p file)
202 (and file-notify--library t))))
203
204(defun file-notify-add-watch (file flags callback) 193(defun file-notify-add-watch (file flags callback)
205 "Add a watch for filesystem events pertaining to FILE. 194 "Add a watch for filesystem events pertaining to FILE.
206This arranges for filesystem events pertaining to FILE to be reported 195This arranges for filesystem events pertaining to FILE to be reported
@@ -274,10 +263,11 @@ FILE is the name of the file whose event is being reported."
274 '("No file notification package available"))) 263 '("No file notification package available")))
275 264
276 ;; Determine low-level function to be called. 265 ;; Determine low-level function to be called.
277 (setq func (cond 266 (setq func
278 ((eq file-notify--library 'gfilenotify) 'gfile-add-watch) 267 (cond
279 ((eq file-notify--library 'inotify) 'inotify-add-watch) 268 ((eq file-notify--library 'gfilenotify) 'gfile-add-watch)
280 ((eq file-notify--library 'w32notify) 'w32notify-add-watch))) 269 ((eq file-notify--library 'inotify) 'inotify-add-watch)
270 ((eq file-notify--library 'w32notify) 'w32notify-add-watch)))
281 271
282 ;; Determine respective flags. 272 ;; Determine respective flags.
283 (if (eq file-notify--library 'gfilenotify) 273 (if (eq file-notify--library 'gfilenotify)
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index d2acea0b1b1..82b017fa230 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -110,7 +110,6 @@
110 (file-modes . tramp-handle-file-modes) 110 (file-modes . tramp-handle-file-modes)
111 (file-notify-add-watch . tramp-handle-file-notify-add-watch) 111 (file-notify-add-watch . tramp-handle-file-notify-add-watch)
112 (file-notify-rm-watch . ignore) 112 (file-notify-rm-watch . ignore)
113 (file-notify-supported-p . ignore)
114 (expand-file-name . tramp-adb-handle-expand-file-name) 113 (expand-file-name . tramp-adb-handle-expand-file-name)
115 (find-backup-file-name . tramp-handle-find-backup-file-name) 114 (find-backup-file-name . tramp-handle-find-backup-file-name)
116 (directory-files . tramp-handle-directory-files) 115 (directory-files . tramp-handle-directory-files)
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index c6c5a9543cb..e25c9bd4caf 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -437,7 +437,6 @@ Every entry is a list (NAME ADDRESS).")
437 (file-newer-than-file-p . tramp-handle-file-newer-than-file-p) 437 (file-newer-than-file-p . tramp-handle-file-newer-than-file-p)
438 (file-notify-add-watch . tramp-handle-file-notify-add-watch) 438 (file-notify-add-watch . tramp-handle-file-notify-add-watch)
439 (file-notify-rm-watch . ignore) 439 (file-notify-rm-watch . ignore)
440 (file-notify-supported-p . ignore)
441 (file-ownership-preserved-p . ignore) 440 (file-ownership-preserved-p . ignore)
442 (file-readable-p . tramp-gvfs-handle-file-readable-p) 441 (file-readable-p . tramp-gvfs-handle-file-readable-p)
443 (file-regular-p . tramp-handle-file-regular-p) 442 (file-regular-p . tramp-handle-file-regular-p)
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index d2fc1b9979e..c92eacd4473 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -867,8 +867,7 @@ of command line.")
867 (set-file-acl . tramp-sh-handle-set-file-acl) 867 (set-file-acl . tramp-sh-handle-set-file-acl)
868 (vc-registered . tramp-sh-handle-vc-registered) 868 (vc-registered . tramp-sh-handle-vc-registered)
869 (file-notify-add-watch . tramp-sh-handle-file-notify-add-watch) 869 (file-notify-add-watch . tramp-sh-handle-file-notify-add-watch)
870 (file-notify-rm-watch . tramp-sh-handle-file-notify-rm-watch) 870 (file-notify-rm-watch . tramp-sh-handle-file-notify-rm-watch))
871 (file-notify-supported-p . tramp-sh-handle-file-notify-supported-p))
872 "Alist of handler functions. 871 "Alist of handler functions.
873Operations not mentioned here will be handled by the normal Emacs functions.") 872Operations not mentioned here will be handled by the normal Emacs functions.")
874 873
@@ -3499,13 +3498,6 @@ Fall back to normal file name handler if no Tramp handler exists."
3499 (tramp-message proc 6 (format "Kill %S" proc)) 3498 (tramp-message proc 6 (format "Kill %S" proc))
3500 (kill-process proc)) 3499 (kill-process proc))
3501 3500
3502(defun tramp-sh-handle-file-notify-supported-p (file-name)
3503 "Like `file-notify-supported-p' for Tramp files."
3504 (with-parsed-tramp-file-name (expand-file-name file-name) nil
3505 (and (or (tramp-get-remote-gvfs-monitor-dir v)
3506 (tramp-get-remote-inotifywait v))
3507 t)))
3508
3509;;; Internal Functions: 3501;;; Internal Functions:
3510 3502
3511(defun tramp-maybe-send-script (vec script name) 3503(defun tramp-maybe-send-script (vec script name)
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index ad22ab98e43..fee34f856dd 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -211,7 +211,6 @@ See `tramp-actions-before-shell' for more info.")
211 (file-newer-than-file-p . tramp-handle-file-newer-than-file-p) 211 (file-newer-than-file-p . tramp-handle-file-newer-than-file-p)
212 (file-notify-add-watch . tramp-handle-file-notify-add-watch) 212 (file-notify-add-watch . tramp-handle-file-notify-add-watch)
213 (file-notify-rm-watch . ignore) 213 (file-notify-rm-watch . ignore)
214 (file-notify-supported-p . ignore)
215 (file-ownership-preserved-p . ignore) 214 (file-ownership-preserved-p . ignore)
216 (file-readable-p . tramp-handle-file-exists-p) 215 (file-readable-p . tramp-handle-file-exists-p)
217 (file-regular-p . tramp-handle-file-regular-p) 216 (file-regular-p . tramp-handle-file-regular-p)
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 9c19a160a0b..db6a1e381a6 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1980,7 +1980,7 @@ ARGS are the arguments OPERATION has been called with."
1980 ;; Emacs 22+ only. 1980 ;; Emacs 22+ only.
1981 'set-file-times 1981 'set-file-times
1982 ;; Emacs 24+ only. 1982 ;; Emacs 24+ only.
1983 'file-acl 'file-notify-add-watch 'file-notify-supported-p 1983 'file-acl 'file-notify-add-watch
1984 'file-selinux-context 'set-file-acl 'set-file-selinux-context 1984 'file-selinux-context 'set-file-acl 'set-file-selinux-context
1985 ;; XEmacs only. 1985 ;; XEmacs only.
1986 'abbreviate-file-name 'create-file-buffer 1986 'abbreviate-file-name 'create-file-buffer
@@ -2036,8 +2036,9 @@ ARGS are the arguments OPERATION has been called with."
2036 default-directory) 2036 default-directory)
2037 ;; PROC. 2037 ;; PROC.
2038 ((eq operation 'file-notify-rm-watch) 2038 ((eq operation 'file-notify-rm-watch)
2039 (with-current-buffer (process-buffer (nth 0 args)) 2039 (when (processp (nth 0 args))
2040 default-directory)) 2040 (with-current-buffer (process-buffer (nth 0 args))
2041 default-directory)))
2041 ;; Unknown file primitive. 2042 ;; Unknown file primitive.
2042 (t (error "unknown file I/O primitive: %s" operation)))) 2043 (t (error "unknown file I/O primitive: %s" operation))))
2043 2044