From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#34138: 27.0.50; Delayed display of PDF file images Date: Sun, 20 Jan 2019 18:55:16 +0100 Message-ID: <5C44B604.8040107@gmx.at> References: <871s58e4gh.fsf@gmx.net> <5C443CB1.3050208@gmx.at> <87h8e3h90z.fsf@gmx.net> <5C4483B7.1060604@gmx.at> <87d0orgz0a.fsf@gmx.net> NNTP-Posting-Host: ciao.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ciao.gmane.org 1548006966 115865 195.159.176.228 (20 Jan 2019 17:56:06 GMT) X-Complaints-To: usenet@ciao.gmane.org NNTP-Posting-Date: Sun, 20 Jan 2019 17:56:06 +0000 (UTC) Cc: 34138@debbugs.gnu.org, Andreas Politz , Tassilo Horn To: Stephen Berman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jan 20 18:56:03 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1glHKD-000U1W-Pf for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Jan 2019 18:56:02 +0100 Original-Received: from localhost ([127.0.0.1]:42572 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glHKM-0000CZ-M8 for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Jan 2019 12:56:10 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:36006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glHKF-00009s-Rm for bug-gnu-emacs@gnu.org; Sun, 20 Jan 2019 12:56:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1glHKE-0007Df-TI for bug-gnu-emacs@gnu.org; Sun, 20 Jan 2019 12:56:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39877) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1glHKE-0007DZ-QL for bug-gnu-emacs@gnu.org; Sun, 20 Jan 2019 12:56:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1glHKE-0008Pk-EW for bug-gnu-emacs@gnu.org; Sun, 20 Jan 2019 12:56:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Jan 2019 17:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34138 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 34138-submit@debbugs.gnu.org id=B34138.154800693032291 (code B ref 34138); Sun, 20 Jan 2019 17:56:02 +0000 Original-Received: (at 34138) by debbugs.gnu.org; 20 Jan 2019 17:55:30 +0000 Original-Received: from localhost ([127.0.0.1]:39158 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1glHJh-0008Ol-TX for submit@debbugs.gnu.org; Sun, 20 Jan 2019 12:55:30 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:41241) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1glHJf-0008OW-WE for 34138@debbugs.gnu.org; Sun, 20 Jan 2019 12:55:28 -0500 Original-Received: from [192.168.1.100] ([46.125.250.101]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LvlWS-1hH3rA1Euy-017YUP; Sun, 20 Jan 2019 18:55:20 +0100 In-Reply-To: <87d0orgz0a.fsf@gmx.net> X-Provags-ID: V03:K1:6/5GrkctPAiay2UasPGziQf8YEYN6tgIbpQp3h4fMQTqFddMUeB bBT4hHRlfq1E94vHjYq2n6WvGV71cdIHWZdxknjlD00qH8oLV8mjtD0fdE5ZVitl9YzgGzG 4j3RmM5NbLxwBmhvMoQ/OPq5IkVtB4SM0OZdQXNKS5NF6N4oRjyRYRMuF61MyiUQXTe2lp4 ENR845883DA+twzoD9IlQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:jysTcftK7eI=:uxJM3zBUTy3m6Pzw4CMgXg siFDCf21dmnFpwa0UiI1TyR8L2H4uxA7S26vg52OgIrS/2uy8Zxn8SvYPPm45wBK16dc/sssg vUv7HD+NhUpkdDznU9jLQYpjmBs7460dMZ4PF3bAJ8/VoqpgcI/8s9U+BEJUKE58Zy0ksdSJm Vtl0nkJErEZlRi9aGpmioUEoolZPsY0MjMDvsDUUGetPkNSa8klhRo3CgU9Rv56yaA0bVjmkV DRiC4iBgSEq4slQT3wPjM1+UFiWmOruw6EnWbInXu7HLqMhUC/lw8WdItqYqXp5BipodJkqSf lIOw98lW+fq6NE+HPIfMhiv0qEVh+EDoD6dCzS74WYS8+NMSAmaHWlwgajNp2bcH1WJE7mZPN 6lm7lzqv+khpq+czD9g3b01JjR0x0jo2wB+VHvb7kO/A/EWd2MP6J+fj+HqC247qypKCGQv31 Z7lOwbd2hAg6m79OQbOqYrcoppNlDcXPKk+6Y+qVstaEixxjF0PYu5O+7g/q31jJx5RXZv+eF w+rvwnCU4nOO+ev2en5BqGmbpB3ezJfsHkF+oXtEG4i92p3WgtsEMDKPKC4HrD53I467WtuBu 4DSUPYof1gH4GlKNsscWuekBq4RpFezMfllo13aaw3i46zny2ddjQfZZ06PpO0sceIBOZ6Zvv z0W32VHhnbGgpbFkdH3EziCo8EpVal3mf6tSOHJygZgq97CDkKFbDEQ7fTEw1l744N3BkOWTm bj14wglRmceAJHWjoNI1CEP++n/IWi0aWHcHNREBNsrITH7vCSkgbIs9hEgbYDFonGE8F0zK X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:154623 Archived-At: This > backtrace() > (let ((standard-output (get-buffer-create "*PDF test*"))) (backtrace)) > (cond ((and image slice) (if pixels (cons (nth 3 slice) (nth 4 slice)) (cons (/ (float (nth 3 slice)) (frame-char-width frame)) (/ (float (nth 4 slice)) (frame-char-height frame))))) (image (image-size image pixels frame)) (t (let ((standard-output (get-buffer-create "*PDF test*"))) (backtrace)))) > (let ((image (assoc 'image spec)) (slice (assoc 'slice spec))) (cond ((and image slice) (if pixels (cons (nth 3 slice) (nth 4 slice)) (cons (/ (float (nth 3 slice)) (frame-char-width frame)) (/ (float (nth 4 slice)) (frame-char-height frame))))) (image (image-size image pixels frame)) (t (let ((standard-output (get-buffer-create "*PDF test*"))) (backtrace))))) > (cond ((eq (car spec) 'xwidget) (let ((xwi (xwidget-info (xwidget-at (point-min))))) (cons (aref xwi 2) (aref xwi 3)))) ((eq (car spec) 'image) (image-size spec pixels frame)) (t (let ((image (assoc 'image spec)) (slice (assoc 'slice spec))) (cond ((and image slice) (if pixels (cons (nth 3 slice) (nth 4 slice)) (cons (/ (float (nth 3 slice)) (frame-char-width frame)) (/ (float (nth 4 slice)) (frame-char-height frame))))) (image (image-size image pixels frame)) (t (let ((standard-output (get-buffer-create "*PDF test*"))) (backtrace))))))) > image-display-size(nil t) > pdf-view-image-size(t) > pdf-misc-size-indication() > eval((pdf-misc-size-indication)) > redisplay_internal\ \(C\ function\)() > backtrace() > (let ((standard-output (get-buffer-create "*PDF test*"))) (backtrace)) > (cond ((and image slice) (if pixels (cons (nth 3 slice) (nth 4 slice)) (cons (/ (float (nth 3 slice)) (frame-char-width frame)) (/ (float (nth 4 slice)) (frame-char-height frame))))) (image (image-size image pixels frame)) (t (let ((standard-output (get-buffer-create "*PDF test*"))) (backtrace)))) > (let ((image (assoc 'image spec)) (slice (assoc 'slice spec))) (cond ((and image slice) (if pixels (cons (nth 3 slice) (nth 4 slice)) (cons (/ (float (nth 3 slice)) (frame-char-width frame)) (/ (float (nth 4 slice)) (frame-char-height frame))))) (image (image-size image pixels frame)) (t (let ((standard-output (get-buffer-create "*PDF test*"))) (backtrace))))) > (cond ((eq (car spec) 'xwidget) (let ((xwi (xwidget-info (xwidget-at (point-min))))) (cons (aref xwi 2) (aref xwi 3)))) ((eq (car spec) 'image) (image-size spec pixels frame)) (t (let ((image (assoc 'image spec)) (slice (assoc 'slice spec))) (cond ((and image slice) (if pixels (cons (nth 3 slice) (nth 4 slice)) (cons (/ (float (nth 3 slice)) (frame-char-width frame)) (/ (float (nth 4 slice)) (frame-char-height frame))))) (image (image-size image pixels frame)) (t (let ((standard-output (get-buffer-create "*PDF test*"))) (backtrace))))))) > image-display-size(nil t) > pdf-view-image-size(t) > pdf-misc-size-indication() > eval((pdf-misc-size-indication)) > posn-at-point(1 #) > window-in-direction(below #) reveals that the mode line is evaluated twice in your scenario - once to get a window in a direction (where we call 'posn-at-point' to tell where on your frame point currently is) and once from redisplay. I don't know yet why 'image-get-display-property' apparently fails but it looks like a good idea to me to wrap the 'image-display-size' call in 'pdf-view-image-size' in 'ignore-errors' - evaluating a mode line string should never throw an error (in paticular when it's only needed to guess the height of the mode line). martin