From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jose A. Ortega Ruiz" Subject: Re: Passing an option to org-file-apps? Date: Sun, 07 Sep 2008 16:25:32 +0200 Message-ID: <87k5doqbhf.fsf@mithrandir.homeunix.net> References: <87fxq9b327.fsf@gentoo.hasee.cpu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KcLs7-0003SP-0a for emacs-orgmode@gnu.org; Sun, 07 Sep 2008 11:08:15 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KcLs5-0003Rj-Go for emacs-orgmode@gnu.org; Sun, 07 Sep 2008 11:08:14 -0400 Received: from [199.232.76.173] (port=44559 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KcLs5-0003Re-0D for emacs-orgmode@gnu.org; Sun, 07 Sep 2008 11:08:13 -0400 Received: from main.gmane.org ([80.91.229.2]:53877 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KcLs4-0007uF-1e for emacs-orgmode@gnu.org; Sun, 07 Sep 2008 11:08:12 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1KcLs1-000779-Ta for emacs-orgmode@gnu.org; Sun, 07 Sep 2008 15:08:09 +0000 Received: from 201.red-81-34-21.dynamicip.rima-tde.net ([81.34.21.201]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 07 Sep 2008 15:08:09 +0000 Received: from jao by 201.red-81-34-21.dynamicip.rima-tde.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 07 Sep 2008 15:08:09 +0000 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: emacs-orgmode@gnu.org An easy way of getting the desired behaviour is to use a custom link type: (org-add-link-type "pdf" 'my-follow-pdf-link 'identity) (defun my-follow-pdf-link (link) "Follow links of the type path/to/file:line-no" (when (string-match "\\(.+\\)@\\([0-9]+\\)$" link) (start-process "*xpdf*" nil "xpdf" (match-string 1 link) (match-string 2 link)))) and then use [[pdf:~/doc/foo.pdf@25]]. One can easily write a function to fix HTML publishing if needed, and use it instead of 'identity' above. As you can see, there're many variations on this theme: custom links let you use any elisp you want. HTH, jao Carsten Dominik writes: > On Jul 17, 2008, at 5:30 AM, anhnmncb wrote: > >> Hi, list, >> I have an external link like this: >> [[file:~/doc/foo.pdf]] >> And I have configured to use xpdf to open it, but every time I open >> it, >> it always at the first page. >> >> If can I pass an option to xpdf, so after I finish reading, I change >> the >> page number, then next time I open it, it will automatically open that >> page for me? >> >> Something like this: >> [[file:~/doc/foo.pdf 25]] >> So org will invoke xpdf in this way: xpdf ~/doc/foo.pdf 25. > > Org has no mechanism to pass switches to external commands. But you > can try to find a pdf viewer that supports going back to a previous > location. For example, "Preview" in MacOS X does this, maybe there > are also open source programs that do it. > > - Carsten > -- In this age, the mere example of nonconformity, the mere refusal to bend the knee to custom, is itself a service. -John Stuart Mill, philosopher and economist (1806-1873)