tramp-devel
[Top][All Lists]
Advanced

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

tramp (2.2.12); New variable `auto-revert-remote-files' isn't used by tr


From: Pierre Téchoueyres
Subject: tramp (2.2.12); New variable `auto-revert-remote-files' isn't used by tramp `tramp-sh-handle-file-notify-add-watch'
Date: Wed, 19 Aug 2015 20:58:42 +0200

        Hello everybody,
        Emacs 24.4 introduced a variable to allow / disallow reverting
of remote files. Tramp doesn't use it and then it's impossible to block
remote revert.

        Here is a small patch to use this var (I think this should work
with previous versions of Emacs) :

*** /home/ptechoueyres/Travail/build/tramp-2.2.12/lisp/tramp-sh.20150819.pte    
2015-06-01 10:03:40.000000000 +0200
--- /home/ptechoueyres/Travail/build/tramp-2.2.12/lisp/tramp-sh.el      
2015-08-19 20:48:06.015688236 +0200
***************
*** 3617,3622 ****
--- 3617,3624 ----
  (defun tramp-sh-handle-file-notify-add-watch (file-name flags _callback)
    "Like `file-notify-add-watch' for Tramp files."
    (setq file-name (expand-file-name file-name))
+   (when (or (not (boundp 'auto-revert-remote-files))
+           auto-revert-remote-files)
    (with-parsed-tramp-file-name file-name nil
      (let* ((default-directory (file-name-directory file-name))
           command events filter p sequence)
***************
*** 3657,3663 ****
        (tramp-set-connection-property p "vector" v)
        (tramp-compat-set-process-query-on-exit-flag p nil)
        (set-process-filter p filter)
!       p))))
  
  (defun tramp-sh-file-gvfs-monitor-dir-process-filter (proc string)
    "Read output from \"gvfs-monitor-dir\" and add corresponding file-notify 
events."
--- 3659,3665 ----
        (tramp-set-connection-property p "vector" v)
        (tramp-compat-set-process-query-on-exit-flag p nil)
        (set-process-filter p filter)
!       p)))))
  
  (defun tramp-sh-file-gvfs-monitor-dir-process-filter (proc string)
    "Read output from \"gvfs-monitor-dir\" and add corresponding file-notify 
events."



reply via email to

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