Subject: bug#34138: 27.0.50; Delayed display of PDF file images

From: martin rudalics <[email-masked]>
Date: Sun, 20 Jan 2019 10:17:37 +0100

> Since a recent commit, I'm seeing a delay in the display of PDF files as
 > images (both with -Q and with my initializations).  I see this in both
 > doc-view-mode and pdf-view-mode (from the pdf-tools package, available
 > from MELPA).  In doc-view-mode, on visiting a PDF file, it at first
 > appears as raw PDF, as when visiting it in fundamental-mode, and only
 > after a few seconds does the image appear.

I cannot see how 'doc-view-mode' could be possibly affected by the
changes you identified below.  It doesn't run any of the affected
hooks.  Have you tried running 'doc-view-mode' without loading
'pdf-view-mode'?

 > The same happens in
 > pdf-view-mode but there the delay is much longer -- with some files it
 > takes close to a minute on my machine before the image is displayed,
 > unless I provide keyboard input, which makes the image appear
 > immediately.

These might be related although going through the sources of
‘pdf-view-mode’ I cannot see any problem.  'pdf-util-window-attach'
uses a workaround for deleting a window after running
'window-configuration-change-hook' and there I see a different source
of trouble:

'display-buffer-split-below-and-attach' calls 'window--display-buffer'
with a fifth argument and that has been changed in another commit.
Please remove the display-buffer-mark-dedicated argument in that call
and see whether the problem persists.  CC-ing Andreas to make an
appropriate change in pdf-util.el.

 > In addition, in pdf-view-mode this appears in *Message*:
 > Error during redisplay: (eval (pdf-misc-size-indication)) signaled
 > (error "Invalid image specification: nil").

This should come from the 'image-display-size' call in
'pdf-view-image-size'.  Could you get a backtrace for it?

 > In doc-view-mode there is
 > no such error message.  Git bisect pinpoints this commit:
 >
 > e567ac1495..: Martin Rudalics 2019-01-11 Run window change functions
 > during redisplay

martin