Subject: bug#45256: Viewing images over network using TRAMP (errors and unexpected prompts)

From: Michael Albinus <[email-masked]>
Date: Fri, 18 Dec 2020 09:05:45 +0100

Juri Linkov <[email-masked]> writes:

Hi Juri,

> Additionally to these changes, I also added canceling the previous timer
> before starting a new timer to avoid several simultaneously started timers.
> This improved responsiveness in non-remote case.  In remote case it helps
> a little too, but still needs the lock for extremely slow connections.

Why cancelling the *previous* timer? It has done already part of the
job, so I would expect it will finish faster than a newly started timer.

> Here is a complete patch (BTW, I'm not sure if the check for file-remote-p
> can be removed now):

Yes. file-readable-p has performed already a remote operation (it runs
"test -r <filename>"), so a test file-remote-p doesn't make sense.

You haven't protected the timer function against the
remote-file-error. Are you sure it cannot happen?

Best regards, Michael.