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

From: Tassilo Horn <[email-masked]>
Date: Tue, 10 Dec 2013 21:07:25 +0100

Andreas Politz <[email-masked]> writes:

>>> The code is already equipped to handle non-displayed buffers (it
>>> keeps track of the "default current page" which is later used
>>> when/if the buffer gets displayed in a window).
>
> Where is this page read and gone to ? doc-view-new-window-function at
> most switches to the first page

Comment in the `message' in the first line.  You'll see that it's called
two times (once with t and once with a window in (car winprops)) if the
buffer hasn't been shown in some window already.

> 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.  In that case,
`image-mode-winprops-alist' default entry will look like this:

 (t
  (info .
	#("Page 2 of 6.\n" 0 12
	  (face bold)))
  (page . 2)
  (overlay . #<overlay in no buffer>))

> Is this a mistake in this function, i.e. 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.

Bye,
Tassilo