unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: Mikhail P <mikpom@fastmail.com>, 45256@debbugs.gnu.org
Subject: bug#45256: Viewing images over network using TRAMP (errors and unexpected prompts)
Date: Fri, 18 Dec 2020 10:29:40 +0200	[thread overview]
Message-ID: <87ft431pqj.fsf@mail.linkov.net> (raw)
In-Reply-To: <87zh2by1wm.fsf@gmx.de> (Michael Albinus's message of "Fri, 18 Dec 2020 09:05:45 +0100")

>> 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.

Actually, the previous timer has not done any job, it's just waiting
for idle time to call the timer function that will do the job.
If a previous timer function (not timer) is stuck in file-readable-p,
this is a separate case for slow connections that is handled
by the lock in the timer function.

>> 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.

But maybe using the image data from the buffer is much faster to display
the image (image data was already inserted to the image buffer by previous
remote file-reading operation), than to read the image data from the
remote file again by internal image-displaying functions.

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

There is no need to protect the whole timer function
that doesn't use remote calls, so I protected only the
image-toggle-display-image call in the timer function.





  reply	other threads:[~2020-12-18  8:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-15 12:17 bug#45256: Viewing images over network using TRAMP (errors and unexpected prompts) Mikhail P
2020-12-16  9:08 ` Michael Albinus
2020-12-16 20:52   ` Juri Linkov
2020-12-17  8:44     ` Michael Albinus
2020-12-17 21:59       ` Juri Linkov
2020-12-18  8:05         ` Michael Albinus
2020-12-18  8:29           ` Juri Linkov [this message]
2020-12-18  9:58             ` Michael Albinus
2020-12-19 20:19               ` Juri Linkov
2020-12-22 14:49                 ` Mikhail Pomaznoy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ft431pqj.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=45256@debbugs.gnu.org \
    --cc=michael.albinus@gmx.de \
    --cc=mikpom@fastmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).