emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: doc-view functions inside with-current-buffer do not work


From: Stefan Monnier
Subject: Re: doc-view functions inside with-current-buffer do not work
Date: Mon, 03 Nov 2014 11:57:40 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

> Consider the following steps:

> - Define this function:
> #+BEGIN_SRC emacs-lisp
>   (defun my-doc-view-goto-page (n)
>     (with-current-buffer (get-buffer "test.pdf")
>       (doc-view-goto-page n)))
> #+END_SRC

Just like point and goto-char, the page displayed by doc-view can be
different in different windows, so selecting the buffer is not enough
for doc-view-goto-page to know which window should be affected.

You need with-selected-window instead of with-current-buffer.


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]