From: "Jan Böcker" <jan.boecker@jboecker.de>
To: nicholas.dokos@hp.com
Cc: emacs-orgmode@gnu.org, Joe Riel <joer@san.rr.com>
Subject: Re: Specify page number in hyperlink [to pdf]
Date: Fri, 30 Apr 2010 15:05:10 +0200 [thread overview]
Message-ID: <4BDAD586.1060201@jboecker.de> (raw)
In-Reply-To: <26943.1272615034@gamaville.dokosmarshall.org>
On 30.04.2010 10:10, Nick Dokos wrote:
> Joe Riel <joer@san.rr.com> wrote:
>
>> Jan Böcker wrote:
>> A related question; can this extension be used with link abbreviations?
>>
>> I tried
>>
>> #+LINK: sample file:/home/joe/sample.pdf
>>
>> with
>>
>> [[sample::3]]
>>
>> but that does not work.
>>
>
>
> This happens in org-link-expand-abbrev: it splits sample::3 into
> "sample" and "3", looks up "sample" in org-link-abbrev-alist and
> performs the replacement, then returns the concatenation of that with
> the "3" part, thereby eliminating the "::" marker that would trigger the
> further processing necessary to open the pdf file at the given page.
>
> You could try
>
> #+LINK: sample file:/home/joe/sample.pdf::%s
>
> This will work with the [[sample::3]] link, but not with [[sample]].
Because org-link-expand-abbrev only swallows up to two colons, this
would work (but does look rather silly):
[[sample::::3]]
The following will work with [[sample::3]] and [[sample]], but relies on
the fact that evince, when asked to display page 0, ignores the invalid
page number and just displays page 1 instead:
#+LINK: sample file:/home/joe/sample.pdf::0%s
>
> Alternatively, you could modify the function to keep the "::" marker
> (at least conditionally: leave it there if it's already there). That
> would make both of the above work and I think all the examples of
> section 4.6 would work as well. Here is a very lighly tested patch:
>
> [snip]
Nick, the only thing I can think of right now that this would break is
[[bugzilla::129]] (assuming the settings from manual section 4.6).
However, AFAIK this is undocumented behaviour, because the manual does
not mention that an extra ":" between linkword and tag will be silently
ignored.
I agree that applying your patch would be the way to go (this problem is
not related to the extended regex features in org-file-apps; it also
happens when linking to a line number in a plain text file).
Actually, it's half bugfix half new feature:
the bug here is that [[sample:::3]] does not work (one would assume it
does from reading the manual), and the feature is that instead of
accepting that, the patch requires [[sample::3]] instead.
So +1 from me to apply the patch.
- Jan
next prev parent reply other threads:[~2010-04-30 13:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-28 18:30 Specify page number in hyperlink [to pdf] Joe Riel
2010-04-29 19:22 ` Jan Böcker
2010-04-30 4:27 ` Joe Riel
2010-04-30 4:43 ` Joe Riel
2010-04-30 8:10 ` Nick Dokos
2010-04-30 13:05 ` Jan Böcker [this message]
2010-04-30 15:24 ` Nick Dokos
2010-04-30 15:28 ` Carsten Dominik
2010-04-30 14:28 ` Joe Riel
2010-04-30 16:03 ` Nick Dokos
2010-04-30 17:23 ` Joe Riel
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.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BDAD586.1060201@jboecker.de \
--to=jan.boecker@jboecker.de \
--cc=emacs-orgmode@gnu.org \
--cc=joer@san.rr.com \
--cc=nicholas.dokos@hp.com \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
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).