- (when (windowp (car winprops))
- (if (stringp (overlay-get ol 'display))
- ;; We're not already displaying an image, so this is the
- ;; initial window showing the document.
- (run-with-timer nil nil
- (lambda ()
- ;; In case a conversion is running, the
- ;; refresh will happen as defined by
- ;; `doc-view-conversion-refresh-interval'.
- (unless doc-view-current-converter-processes
- (with-selected-window (car winprops)
- (doc-view-goto-page 1)))))
- ;; We've split the window showing the document. All we need
- ;; to do is selecting the new window to cause a redisplay to
- ;; make the image appear there, too.
- (run-with-timer nil nil
- (lambda ()
- (with-selected-window (car winprops))))))))
-
-(defvar doc-view-current-files nil
+ (when (and (windowp (car winprops))
+ (stringp (overlay-get ol 'display))
+ (null doc-view--current-converter-processes))
+ ;; We're not displaying an image yet, so let's do so. This happens when
+ ;; the buffer is displayed for the first time.
+ ;; Don't do it if there's a conversion is running, since in that case, it
+ ;; will be done later.
+ (with-selected-window (car winprops)
+ (doc-view-goto-page 1)))))
+
+(defvar-local doc-view--current-files nil