all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nick Dokos <ndokos@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Doc-view at specific page number
Date: Tue, 17 Sep 2019 19:28:21 -0400	[thread overview]
Message-ID: <871rwea4fe.fsf@alphaville.usersys.redhat.com> (raw)
In-Reply-To: 875zlqag3y.fsf@alphaville.usersys.redhat.com

Nick Dokos <ndokos@gmail.com> 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	other threads:[~2019-09-17 23:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-17  6:22 Doc-view at specific page number Jean Louis
2019-09-17 19:16 ` Nick Dokos
2019-09-17 23:28   ` Nick Dokos [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871rwea4fe.fsf@alphaville.usersys.redhat.com \
    --to=ndokos@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.