emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Re: Passing an option to org-file-apps?


From: Jose A. Ortega Ruiz
Subject: [Orgmode] Re: Passing an option to org-file-apps?
Date: Sun, 07 Sep 2008 16:25:32 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

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/address@hidden 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 <address@hidden> 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)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]