diff options
| author | Michael Albinus | 2010-08-05 10:15:22 +0200 |
|---|---|---|
| committer | Michael Albinus | 2010-08-05 10:15:22 +0200 |
| commit | 39e1bf0b6aeee1ea39361cfb95c723abf569a7e3 (patch) | |
| tree | d14ef771e6a4466dce4daee419b865c4d52d898c | |
| parent | 3d15fe78eb01bbdae62666b2b7d8c13da92ac05f (diff) | |
| download | emacs-39e1bf0b6aeee1ea39361cfb95c723abf569a7e3.tar.gz emacs-39e1bf0b6aeee1ea39361cfb95c723abf569a7e3.zip | |
* 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.
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 21 |
2 files changed, 23 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c6476ca1df5..27e66a84f86 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2010-08-05 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/tramp.el (tramp-handle-dired-uncache): Flush directory | ||
| 4 | cache, not only file cache. | ||
| 5 | (tramp-process-sentinel): New defun. | ||
| 6 | (tramp-handle-start-file-process): Use it, in order to invalidate | ||
| 7 | file caches. | ||
| 8 | |||
| 1 | 2010-08-03 Leo <sdl.web@gmail.com> | 9 | 2010-08-03 Leo <sdl.web@gmail.com> |
| 2 | 10 | ||
| 3 | * server.el (server-start): Simplify loop. | 11 | * server.el (server-start): Simplify loop. |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index aca0238e5b6..65713580b1b 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -4234,7 +4234,7 @@ This is like `dired-recursive-delete-directory' for Tramp files." | |||
| 4234 | ;; DIR-P is valid for XEmacs only. | 4234 | ;; DIR-P is valid for XEmacs only. |
| 4235 | (with-parsed-tramp-file-name | 4235 | (with-parsed-tramp-file-name |
| 4236 | (if (or dir-p (file-directory-p dir)) dir (file-name-directory dir)) nil | 4236 | (if (or dir-p (file-directory-p dir)) dir (file-name-directory dir)) nil |
| 4237 | (tramp-flush-file-property v localname))) | 4237 | (tramp-flush-directory-property v localname))) |
| 4238 | 4238 | ||
| 4239 | ;; Pacify byte-compiler. The function is needed on XEmacs only. I'm | 4239 | ;; Pacify byte-compiler. The function is needed on XEmacs only. I'm |
| 4240 | ;; not sure at all that this is the right way to do it, but let's hope | 4240 | ;; not sure at all that this is the right way to do it, but let's hope |
| @@ -4503,6 +4503,14 @@ beginning of local filename are not substituted." | |||
| 4503 | (with-parsed-tramp-file-name default-directory nil | 4503 | (with-parsed-tramp-file-name default-directory nil |
| 4504 | (tramp-find-executable v command (tramp-get-remote-path v) t))) | 4504 | (tramp-find-executable v command (tramp-get-remote-path v) t))) |
| 4505 | 4505 | ||
| 4506 | (defun tramp-process-sentinel (proc event) | ||
| 4507 | "Flush file caches." | ||
| 4508 | (unless (memq (process-status proc) '(run open)) | ||
| 4509 | (with-current-buffer (process-buffer proc) | ||
| 4510 | (with-parsed-tramp-file-name default-directory nil | ||
| 4511 | (tramp-message v 5 "Sentinel called: `%s' `%s'" proc event) | ||
| 4512 | (tramp-flush-directory-property v ""))))) | ||
| 4513 | |||
| 4506 | ;; We use BUFFER also as connection buffer during setup. Because of | 4514 | ;; We use BUFFER also as connection buffer during setup. Because of |
| 4507 | ;; this, its original contents must be saved, and restored once | 4515 | ;; this, its original contents must be saved, and restored once |
| 4508 | ;; connection has been setup. | 4516 | ;; connection has been setup. |
| @@ -4546,11 +4554,12 @@ beginning of local filename are not substituted." | |||
| 4546 | (unless (process-get (tramp-get-connection-process v) 'remote-tty) | 4554 | (unless (process-get (tramp-get-connection-process v) 'remote-tty) |
| 4547 | (tramp-error | 4555 | (tramp-error |
| 4548 | v 'file-error "pty association is not supported for `%s'" name))) | 4556 | v 'file-error "pty association is not supported for `%s'" name))) |
| 4549 | ;; Set query flag for this process. | 4557 | (let ((p (tramp-get-connection-process v))) |
| 4550 | (tramp-set-process-query-on-exit-flag | 4558 | ;; Set sentinel and query flag for this process. |
| 4551 | (tramp-get-connection-process v) t) | 4559 | (set-process-sentinel p 'tramp-process-sentinel) |
| 4552 | ;; Return process. | 4560 | (tramp-set-process-query-on-exit-flag p t) |
| 4553 | (tramp-get-connection-process v)) | 4561 | ;; Return process. |
| 4562 | p)) | ||
| 4554 | ;; Save exit. | 4563 | ;; Save exit. |
| 4555 | (with-current-buffer (tramp-get-connection-buffer v) | 4564 | (with-current-buffer (tramp-get-connection-buffer v) |
| 4556 | (if (string-match tramp-temp-buffer-name (buffer-name)) | 4565 | (if (string-match tramp-temp-buffer-name (buffer-name)) |