all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Auto-revert on remote files: disabling timers temporarily?
@ 2004-05-30 15:58 Michael Albinus
  2004-05-31  1:59 ` Luc Teirlinck
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Michael Albinus @ 2004-05-30 15:58 UTC (permalink / raw)


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.

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2004-06-01  5:41 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-30 15:58 Auto-revert on remote files: disabling timers temporarily? Michael Albinus
2004-05-31  1:59 ` Luc Teirlinck
2004-05-31  8:51   ` Michael Albinus
2004-05-31 20:15     ` Luc Teirlinck
2004-05-31 20:43       ` Michael Albinus
2004-05-31 21:06         ` Luc Teirlinck
2004-05-31 21:15           ` Michael Albinus
2004-05-31 21:20             ` Luc Teirlinck
2004-06-01  0:18             ` Luc Teirlinck
2004-05-31 21:12         ` Luc Teirlinck
2004-05-31 21:20           ` Michael Albinus
2004-05-31 21:55             ` Luc Teirlinck
2004-05-31 22:18               ` Kim F. Storm
2004-05-31 23:05                 ` Luc Teirlinck
2004-05-31 23:08                 ` Luc Teirlinck
2004-05-31 23:24                 ` Luc Teirlinck
2004-05-31 23:58                 ` Luc Teirlinck
2004-05-31 22:12             ` Luc Teirlinck
     [not found]             ` <200405312331.i4VNVIw27988@raven.dms.auburn.edu>
2004-06-01  5:41               ` Michael Albinus
2004-05-31  2:31 ` Luc Teirlinck
2004-05-31  3:10 ` Luc Teirlinck

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.