[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r100975: * net/tramp.el (tramp-handle
From: |
Michael Albinus |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r100975: * net/tramp.el (tramp-handle-dired-uncache): Flush directory |
Date: |
Thu, 05 Aug 2010 10:15:22 +0200 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 100975
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Thu 2010-08-05 10:15:22 +0200
message:
* net/tramp.el (tramp-handle-dired-uncache): Flush directory
cache, not only file cache.
(tramp-process-sentinel): New defun.
(tramp-handle-start-file-process): Use it, in order to invalidate
file caches.
modified:
lisp/ChangeLog
lisp/net/tramp.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2010-08-03 12:22:23 +0000
+++ b/lisp/ChangeLog 2010-08-05 08:15:22 +0000
@@ -1,3 +1,11 @@
+2010-08-05 Michael Albinus <address@hidden>
+
+ * net/tramp.el (tramp-handle-dired-uncache): Flush directory
+ cache, not only file cache.
+ (tramp-process-sentinel): New defun.
+ (tramp-handle-start-file-process): Use it, in order to invalidate
+ file caches.
+
2010-08-03 Leo <address@hidden>
* server.el (server-start): Simplify loop.
=== modified file 'lisp/net/tramp.el'
--- a/lisp/net/tramp.el 2010-07-29 13:13:11 +0000
+++ b/lisp/net/tramp.el 2010-08-05 08:15:22 +0000
@@ -4234,7 +4234,7 @@
;; DIR-P is valid for XEmacs only.
(with-parsed-tramp-file-name
(if (or dir-p (file-directory-p dir)) dir (file-name-directory dir)) nil
- (tramp-flush-file-property v localname)))
+ (tramp-flush-directory-property v localname)))
;; Pacify byte-compiler. The function is needed on XEmacs only. I'm
;; not sure at all that this is the right way to do it, but let's hope
@@ -4503,6 +4503,14 @@
(with-parsed-tramp-file-name default-directory nil
(tramp-find-executable v command (tramp-get-remote-path v) t)))
+(defun tramp-process-sentinel (proc event)
+ "Flush file caches."
+ (unless (memq (process-status proc) '(run open))
+ (with-current-buffer (process-buffer proc)
+ (with-parsed-tramp-file-name default-directory nil
+ (tramp-message v 5 "Sentinel called: `%s' `%s'" proc event)
+ (tramp-flush-directory-property v "")))))
+
;; We use BUFFER also as connection buffer during setup. Because of
;; this, its original contents must be saved, and restored once
;; connection has been setup.
@@ -4546,11 +4554,12 @@
(unless (process-get (tramp-get-connection-process v) 'remote-tty)
(tramp-error
v 'file-error "pty association is not supported for `%s'" name)))
- ;; Set query flag for this process.
- (tramp-set-process-query-on-exit-flag
- (tramp-get-connection-process v) t)
- ;; Return process.
- (tramp-get-connection-process v))
+ (let ((p (tramp-get-connection-process v)))
+ ;; Set sentinel and query flag for this process.
+ (set-process-sentinel p 'tramp-process-sentinel)
+ (tramp-set-process-query-on-exit-flag p t)
+ ;; Return process.
+ p))
;; Save exit.
(with-current-buffer (tramp-get-connection-buffer v)
(if (string-match tramp-temp-buffer-name (buffer-name))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r100975: * net/tramp.el (tramp-handle-dired-uncache): Flush directory,
Michael Albinus <=