unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / 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 15:16:01 -0400	[thread overview]
Message-ID: <875zlqag3y.fsf@alphaville.usersys.redhat.com> (raw)
In-Reply-To: courier.000000005D807BB2.000032F9@protected.rcdrun.com

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.

I tested the hook setting but not the rest of it: caveat emptor.
-- 
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 19:16 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 [this message]
2019-09-17 23:28   ` Nick Dokos

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=875zlqag3y.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).