tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tramp does not see directory changes


From: Michael Albinus
Subject: Re: tramp does not see directory changes
Date: Tue, 30 Oct 2007 14:11:40 +0100
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (hpux)

Piotr Romanus <address@hidden> writes:

> This creates problems with eshell: I copied a file from my local host
> to a remote host. Subsequent ls would show the changes :(. I also
> tried deleting a file on the remote with the same results.
>
> Is there anyway to foce tramp to refresh directory or disable caching
> when in eshell?

The appended patch shall cure it. Could you, please, test it?

> Thanks,
>
> Piotr

Best regards, Michael.

*** /media/disk/tramp/lisp/tramp-cache.el       Fri Sep 28 16:34:14 2007
--- /home/albinus/src/tramp/lisp/tramp-cache.el Tue Oct 30 14:03:58 2007
***************
*** 162,179 ****
  ;; 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))
        (let* ((v (tramp-dissect-file-name bfn))
             (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)))
  
--- 162,184 ----
  ;; They could have been changed outside Tramp.
  (defun tramp-flush-file-function ()
    "Flush all Tramp cache properties from buffer-file-name."
!   (let ((bfn (if (stringp (buffer-file-name))
!                (buffer-file-name)
!              default-directory)))
!     (when (tramp-tramp-file-p bfn)
        (let* ((v (tramp-dissect-file-name bfn))
             (localname (tramp-file-name-localname v)))
        (tramp-flush-file-property v localname)))))
  
  (add-hook 'before-revert-hook 'tramp-flush-file-function)
+ (add-hook 'eshell-pre-command-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 'eshell-pre-command-hook
+                         'tramp-flush-file-function)
             (remove-hook 'kill-buffer-hook
                          'tramp-flush-file-function)))
  





reply via email to

[Prev in Thread] Current Thread [Next in Thread]