Subject: bug#16090: 24.3.50; [PATCH] error when jumping to a doc-view bookmark

From: Andreas Politz <[email-masked]>
Date: Tue, 10 Dec 2013 23:16:52 +0100

Tassilo Horn <[email-masked]> writes:

> Andreas Politz <[email-masked]> writes:
>> and this
>>
>> (with-current-buffer (find-file-noselect "some.pdf")
>>   (doc-view-goto-page 2)
>>   (pop-to-buffer (current-buffer)))
>>
>> also displays the first page.
>
> No, if some.pdf hasn't been open yet, it'll show page 2.  [...]

>> [...] shouldn't it read the winprop page?
>
> That happens during the second time the function is called with a real
> window by making the overlay showing the image with that window's page
> visible.

I am using a non-temporary cache directory and this makes a difference.

If the document is not yet converted when opening it, it works as you
said.  But if it is, the code which would insert the image after the
conversion never runs and the winprops for the popped up window look
like this:

(#<window 24 on some.pdf>
          (info . #("Page 2 of 4.\n" 0 12 (face bold)))
          (page . 2)
          (overlay . #<overlay in no buffer>))

,with overlay properties (shortened)

(help-echo "Page 2 of 4."
 display "Welcome to DocView! ..."
 window t
 doc-view t)

Then the last sexp in doc-view-new-window-function switches to the first
page, without using the page property.

-ap