From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: RFC: Syntax for page numbers in file: links? Date: Tue, 5 Jan 2010 13:32:43 +0100 Message-ID: <08E7D2DE-403D-4273-B88E-F87F8291C548@gmail.com> References: <4B3FE803.6090400@jboecker.de> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NS8aj-0005RU-Ca for emacs-orgmode@gnu.org; Tue, 05 Jan 2010 07:32:53 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NS8ae-0005Km-Bw for emacs-orgmode@gnu.org; Tue, 05 Jan 2010 07:32:52 -0500 Received: from [199.232.76.173] (port=34926 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NS8ae-0005KQ-4K for emacs-orgmode@gnu.org; Tue, 05 Jan 2010 07:32:48 -0500 Received: from mail-ew0-f224.google.com ([209.85.219.224]:54135) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NS8ad-0007qW-N8 for emacs-orgmode@gnu.org; Tue, 05 Jan 2010 07:32:48 -0500 Received: by ewy24 with SMTP id 24so19106057ewy.26 for ; Tue, 05 Jan 2010 04:32:46 -0800 (PST) In-Reply-To: <4B3FE803.6090400@jboecker.de> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: =?ISO-8859-1?Q?Jan_B=F6cker?= Cc: Org Mode On Jan 3, 2010, at 1:42 AM, Jan B=F6cker wrote: > 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 =20= > 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 =20 > 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 =20= > 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 =20 > 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:[: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) Yes, I think that would make sense. > - the same syntax could also be used to integrate evince and Xournal I have yesterday implemented modifies for file link: file+sys: now forces opening a file with the system's open command file+emacs: forces opening in Emacs. I guess it would make sense to make more of these, so that one could select a specific viewer for selected files, what do you think? > > - 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. This is not easy at all, but I am sure it can be done. > > - 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? Line numbers is a rotten concept - I am not even sure we should support it at all. > > - 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?) You need to do this in the org-docview code. > > - 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 =20 > syntax > to specify a "target location", maybe attributes such as > [[file:/path/to/file][page=3D5,line=3D3][Description]] > [[file:notes.txt][search=3D"The quick brown fox"][Description]] > > This may obviously create more problems with backward compatibility. I am not sure if it makes sense to handle more that a page number, =20 really. > Luckily, there has been no release featuring docview: links yet, so > there still is a chance to correct this mistake without breaking too =20= > much. Well, the next release is not far off.... > 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, Yes, why not. > but that number would still need to be passed to an external =20 > application > and cause doc-view-goto-page to be called when visiting a PDF in =20 > 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 > > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode - Carsten