Index: lisp/tramp-cache.el =================================================================== RCS file: /cvsroot/tramp/tramp/lisp/tramp-cache.el,v retrieving revision 2.24 retrieving revision 2.25 diff -c -r2.24 -r2.25 *** lisp/tramp-cache.el 3 Dec 2006 11:55:27 -0000 2.24 --- lisp/tramp-cache.el 1 Feb 2007 22:46:31 -0000 2.25 *************** *** 1,7 **** ;;; -*- mode: Emacs-Lisp; coding: iso-2022-7bit; -*- ;;; tramp-cache.el --- file information caching for Tramp ! ;; Copyright (C) 2000, 2005, 2006 by Free Software Foundation, Inc. ;; Author: Daniel Pittman ;; Michael Albinus --- 1,7 ---- ;;; -*- mode: Emacs-Lisp; coding: iso-2022-7bit; -*- ;;; tramp-cache.el --- file information caching for Tramp ! ;; Copyright (C) 2000, 2005, 2006, 2007 by Free Software Foundation, Inc. ;; Author: Daniel Pittman ;; Michael Albinus *************** *** 45,51 **** ;; `file-attributes'. ;; ;; - The key is a process. This are temporary properties related to ! ;; an open connection. Examples: "scripts" keeps to shell script ;; definitions already sent to the remote shell, "last-cmd-time" is ;; the time stamp a command has been sent to the remote process. --- 45,51 ---- ;; `file-attributes'. ;; ;; - The key is a process. This are temporary properties related to ! ;; an open connection. Examples: "scripts" keeps shell script ;; definitions already sent to the remote shell, "last-cmd-time" is ;; the time stamp a command has been sent to the remote process. *************** *** 167,175 **** table) result))) ! ;; Reverting a buffer should also flush file properties. They could ! ;; have been changed outside Tramp. ! (defun tramp-cache-before-revert-function () "Flush all Tramp cache properties from buffer-file-name." (let ((bfn (buffer-file-name))) (when (and (stringp bfn) (tramp-tramp-file-p bfn)) --- 167,175 ---- table) result))) ! ;; Reverting or killing a buffer should also flush file properties. ! ;; They could have been changed outside Tramp. ! (defun tramp-flush-file-function () "Flush all Tramp cache properties from buffer-file-name." (let ((bfn (buffer-file-name))) (when (and (stringp bfn) (tramp-tramp-file-p bfn)) *************** *** 177,187 **** (localname (tramp-file-name-localname v))) (tramp-flush-file-property v localname))))) ! (add-hook 'before-revert-hook 'tramp-cache-before-revert-function) (add-hook 'tramp-cache-unload-hook '(lambda () (remove-hook 'before-revert-hook ! 'tramp-cache-before-revert-function))) ;;; -- Properties -- --- 177,190 ---- (localname (tramp-file-name-localname v))) (tramp-flush-file-property v localname))))) ! (add-hook 'before-revert-hook 'tramp-flush-file-function) ! (add-hook 'kill-buffer-hook 'tramp-flush-file-function) (add-hook 'tramp-cache-unload-hook '(lambda () (remove-hook 'before-revert-hook ! 'tramp-flush-file-function) ! (remove-hook 'kill-buffer-hook ! 'tramp-flush-file-function))) ;;; -- Properties --