From: "Jan Böcker" <jan.boecker@jboecker.de>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: RFC: Syntax for page numbers in file: links?
Date: Sun, 03 Jan 2010 01:42:43 +0100 [thread overview]
Message-ID: <4B3FE803.6090400@jboecker.de> (raw)
Hello List,
During the discussion in the "protocol for PDFs?" thread, I realized
that docview: links are an almost exact copy of file: links, the only
single difference being that file: takes a line number and docview:
links take a page number.
Up until now, (docview:) links to PDF files have been the only link type
known to me which took a page number. With the upcoming integration of
Xournal and Org that Daniel M. German is working on, there will already
be two of those.
Daniel also wants to add org-store-link functionality to evince, so he
needs a link type with page numbers for PDFs, too. I could (and have in
a proof-of-concept version) modify org-docview.el to open PDFs with an
external viewer, but I think what really should happen is the following:
- We need a syntax to specify an (optional) page number for file:
links, and make the line number optional as well.
This might look something like this:
- file:<path>[:page][::line]
- file:~/some-file.txt::23 some-file.txt, line 23
- file:~/document.pdf:4 document.pdf, page 4
- file:~/document.odf:3::5 document.odf, page 3, line 5
This is only what comes to my mind immediately about one possibility
of encoding this.
- org-docview-store-link should return links in the new syntax
(e.g. file:~/some-doc.pdf:5 instead of docview:~/some-doc.pdf::5)
- the same syntax could also be used to integrate evince and Xournal
- org-file-apps should allow to specify how to pass a page number to
an external program. Unlike the file name, this is an optional
argument, as a link may not specify a page number at all.
I do not know how to do this in an elegant way, maybe let
the user specify multiple entries - one for links with a page
number, one for links without.
- the same should apply to line numbers - maybe someone will integrate
Org with Open Office or some heretic wants to open all text files in
zile, who knows?
- if a link with a page number is opened, org-file-apps specifies
"Visit with Emacs", and emacs decides to open it in doc-view-mode,
doc-view-goto-page should be called with the page number. (I imagine
this would be possible using the right hooks?)
- Line number and page number also seem somewhat arbitrary as the only
pieces of data available to point to a specific location inside a
document. There are HTML fragment identifiers, which AFAIK work in
http: links but do not in file: links.
One might also imagine specifying a precise position in a PDF
using a line number and a percentage to indicate how far the
page should be scrolled down.
So if it is feasible at all, we might want an even more general syntax
to specify a "target location", maybe attributes such as
[[file:/path/to/file][page=5,line=3][Description]]
[[file:notes.txt][search="The quick brown fox"][Description]]
This may obviously create more problems with backward compatibility.
Luckily, there has been no release featuring docview: links yet, so
there still is a chance to correct this mistake without breaking too much.
If there will be no special syntax for page numbers, we could also
interpret the line number as a page number for PDF and Xournal files,
but that number would still need to be passed to an external application
and cause doc-view-goto-page to be called when visiting a PDF in emacs.
I really do not want to create another file: link type with
org-docview.el, which is why I ask y'all to comment!
- Jan
next reply other threads:[~2010-01-03 0:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-03 0:42 Jan Böcker [this message]
2010-01-03 20:14 ` RFC: Syntax for page numbers in file: links? Samuel Wales
2010-01-05 12:32 ` Carsten Dominik
2010-01-05 17:05 ` Jan Böcker
2010-01-06 9:05 ` Carsten Dominik
2010-01-06 11:07 ` Jan Böcker
2010-01-06 11:08 ` Carsten Dominik
2010-01-07 1:24 ` Torsten Wagner
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=4B3FE803.6090400@jboecker.de \
--to=jan.boecker@jboecker.de \
--cc=emacs-orgmode@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 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).