emacs-devel
[Top][All Lists]
Advanced

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

Re: auto-revert-mode and tramp file handlers


From: Luc Teirlinck
Subject: Re: auto-revert-mode and tramp file handlers
Date: Tue, 11 May 2004 23:45:47 -0500 (CDT)

Kai Grossjohann wrote:

   I'm not sure how to change Tramp to make this better: it often happens
   that a connection is closed merely because a timeout has expired.  In
   that case, just silently reopening the connection appears to be the
   right approach.  But I confess that I haven't thought a lot about your
   problem.  So it's quite likely that there are good solutions that I'm
   not seeing.

   But I do realize that there is a problem here.  Perhaps it is best to
   make it easy for the user to customize "no auto-revert on remote
   files".

   What do people think?

Not just auto-revert, but _very many_ places in the Emacs code call
file-exists-p and its many friends in situations where the file
usually is local but could be remote.  Usually, the purpose seems to
be to prevent a relatively time consuming operation and/or prevent an
error, in case the file does not exist (or is not readable or
whatever).  I do believe that in many of these places, the person who
put in those calls did not realize that that call could take more than
a full minute of real time, regardless of the CPU power of the
machine, and could then throw an error instead of returning nil if the
file "does not exist" (because of being unreachable).

One interpretation is that all such calls are bugs that one way or
the other should be fixed.  (Presumably by calling file-remote-p
before calling file-exists-p and friends, and doing something ad hoc
if the return value is t.)  Another interpretation is that a handler
for these functions should not take a full minute of real time and
should not throw an error when the docstring suggests a return value
of nil.

Is there no way that tramp could detect that the user is off line in a
fraction of a second (as ssh apparently can) and if so, return nil for
file-exists-p and other functions that expect a return value of nil in
this case?

Sincerely,

Luc.





reply via email to

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