emacs-devel
[Top][All Lists]
Advanced

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

Auto-revert on remote files: disabling timers temporarily?


From: Michael Albinus
Subject: Auto-revert on remote files: disabling timers temporarily?
Date: Sun, 30 May 2004 17:58:55 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

In parallel to Kai, I've tried to find another solution. What about
disabling timers during execution of a Tramp file name function?
Something like this:

(defun tramp-file-name-handler (operation &rest args)
  "Invoke Tramp file name handler.
Falls back to normal file name handler if no tramp file name handler exists."
  (save-match-data
    (let* ((filename (apply 'tramp-file-name-for-operation operation args))
           (foreign (tramp-find-foreign-file-name-handler filename)))
      (cond
       (foreign
        ;; Tramp functions called by timers would disturb process
        ;; communication.  Therefore, timers are disabled temporarily.
        (let ((tl timer-list))
          (unwind-protect
              (progn
                (setq timer-list nil)
                (apply foreign operation args))
            (setq timer-list tl))))
       (t (tramp-run-real-handler operation args))))))

Locally, it works fine for me, even with enabled auto-revert-mode for
remote files. But I have no idea about side effects. Are there obvious
objections against?

Best regards, Michael.




reply via email to

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