[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: doc-view functions inside with-current-buffer do not work
From: |
Alexander Baier |
Subject: |
Re: doc-view functions inside with-current-buffer do not work |
Date: |
Mon, 03 Nov 2014 18:28:41 +0100 |
User-agent: |
Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.4 (gnu/linux) |
On 2014-11-03 17:57 Stefan Monnier wrote:
>> 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.
This works like a charm, thank you!
Regards,
--
Alexander Baier