From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#45256: Viewing images over network using TRAMP (errors and unexpected prompts) Date: Fri, 18 Dec 2020 10:29:40 +0200 Organization: LINKOV.NET Message-ID: <87ft431pqj.fsf@mail.linkov.net> References: <461b6a4f-9709-c71b-0ec3-f70d08674c9e@fastmail.com> <87360615l3.fsf@gmx.de> <87zh2djyc2.fsf@mail.linkov.net> <87czz8zusu.fsf@gmx.de> <87mtycgkkk.fsf@mail.linkov.net> <87zh2by1wm.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36421"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: Mikhail P , 45256@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 18 09:34:10 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kqBDG-0009NL-Ug for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Dec 2020 09:34:10 +0100 Original-Received: from localhost ([::1]:52874 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqBDF-00051y-Ns for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Dec 2020 03:34:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49524) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqBD8-00051m-Jm for bug-gnu-emacs@gnu.org; Fri, 18 Dec 2020 03:34:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54298) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kqBD8-0002Ez-32 for bug-gnu-emacs@gnu.org; Fri, 18 Dec 2020 03:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kqBD7-0004Aa-UX for bug-gnu-emacs@gnu.org; Fri, 18 Dec 2020 03:34:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 18 Dec 2020 08:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45256 X-GNU-PR-Package: emacs Original-Received: via spool by 45256-submit@debbugs.gnu.org id=B45256.160828038315958 (code B ref 45256); Fri, 18 Dec 2020 08:34:01 +0000 Original-Received: (at 45256) by debbugs.gnu.org; 18 Dec 2020 08:33:03 +0000 Original-Received: from localhost ([127.0.0.1]:37611 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqBCA-00049J-K5 for submit@debbugs.gnu.org; Fri, 18 Dec 2020 03:33:02 -0500 Original-Received: from relay5-d.mail.gandi.net ([217.70.183.197]:50621) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqBC8-00048j-8r for 45256@debbugs.gnu.org; Fri, 18 Dec 2020 03:33:02 -0500 X-Originating-IP: 91.129.99.98 Original-Received: from mail.gandi.net (m91-129-99-98.cust.tele2.ee [91.129.99.98]) (Authenticated sender: juri@linkov.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 278341C0010; Fri, 18 Dec 2020 08:32:51 +0000 (UTC) In-Reply-To: <87zh2by1wm.fsf@gmx.de> (Michael Albinus's message of "Fri, 18 Dec 2020 09:05:45 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:196308 Archived-At: >> 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 "), 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.