help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Doc-view at specific page number


From: Nick Dokos
Subject: Re: Doc-view at specific page number
Date: Tue, 17 Sep 2019 19:28:21 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Nick Dokos <address@hidden> writes:

> Jean Louis <bugs@gnu.support> writes:
>
>> Is there any way to use doc-view to open PDF at specific page number?
>>
>> I know there is function doc-view-goto-page, I would like to open PDF
>> file at specific page number.
>>
>
> (add-hook 'doc-view-mode-hook (lambda () (doc-view-goto-page 10)))
>
> will open *every* PDF file at page 10 (not sure what happens if
> there is no page 10), but I presume you will want to make it
> interactive. So you can write a function that asks for the page
> number, and adds something like this to the doc-view-mode-hook,
> after cleaning up any previous such setting.

>Then add it as a -before  advice to find-file.

Scratch that - you'd hardly want to be asked another question every
time you call find-file. Maybe the thing to do is to add the function
to find-file-hook, but I thiink by that time the mode function has
been executed already, so the doc-view-mode-hook will not be run. But
maybe you can call doc-view-goto-page directly.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




reply via email to

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