emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Passing an option to org-file-apps?
@ 2008-07-17  3:30 anhnmncb
  2008-09-07  7:02 ` Carsten Dominik
  2008-09-07  8:33 ` Daniel Clemente
  0 siblings, 2 replies; 8+ messages in thread
From: anhnmncb @ 2008-07-17  3:30 UTC (permalink / raw)
  To: emacs-orgmode

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.

-- 
Regards,

  anhnmncb
 gpg key: 44A31344

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Passing an option to org-file-apps?
  2008-07-17  3:30 Passing an option to org-file-apps? anhnmncb
@ 2008-09-07  7:02 ` Carsten Dominik
  2008-09-07  8:33   ` Sebastian Rose
  2008-09-07 14:25   ` Jose A. Ortega Ruiz
  2008-09-07  8:33 ` Daniel Clemente
  1 sibling, 2 replies; 8+ messages in thread
From: Carsten Dominik @ 2008-09-07  7:02 UTC (permalink / raw)
  To: anhnmncb; +Cc: emacs-orgmode


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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Passing an option to org-file-apps?
  2008-07-17  3:30 Passing an option to org-file-apps? anhnmncb
  2008-09-07  7:02 ` Carsten Dominik
@ 2008-09-07  8:33 ` Daniel Clemente
  2008-09-11 10:16   ` anhnmncb
  1 sibling, 1 reply; 8+ messages in thread
From: Daniel Clemente @ 2008-09-07  8:33 UTC (permalink / raw)
  To: anhnmncb; +Cc: emacs-orgmode


Hi,

> Something like this:
>   [[file:~/doc/foo.pdf 25]]
> So org will invoke xpdf in this way: xpdf ~/doc/foo.pdf 25.
>
  Maybe it's better:
[[shell:xpdf ~/doc/foo.pdf 25]]

  since you want to pass „25“ to xpdf only. It is meaningless to pass the 25 *to the PDF*.


--
Daniel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Passing an option to org-file-apps?
  2008-09-07  7:02 ` Carsten Dominik
@ 2008-09-07  8:33   ` Sebastian Rose
  2008-09-07 14:25   ` Jose A. Ortega Ruiz
  1 sibling, 0 replies; 8+ messages in thread
From: Sebastian Rose @ 2008-09-07  8:33 UTC (permalink / raw)
  To: emacs-orgmode

Carsten Dominik wrote:
> 
> 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.

As you say 'xpdf' I assume you use GNU/Linux? evince goes to the last
visited page autmatically.


Sebastian

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Passing an option to org-file-apps?
  2008-09-07  7:02 ` Carsten Dominik
  2008-09-07  8:33   ` Sebastian Rose
@ 2008-09-07 14:25   ` Jose A. Ortega Ruiz
  1 sibling, 0 replies; 8+ messages in thread
From: Jose A. Ortega Ruiz @ 2008-09-07 14:25 UTC (permalink / raw)
  To: emacs-orgmode


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 <dominik@science.uva.nl> 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)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Passing an option to org-file-apps?
  2008-09-07  8:33 ` Daniel Clemente
@ 2008-09-11 10:16   ` anhnmncb
  2008-09-11 14:34     ` Jason F. McBrayer
  0 siblings, 1 reply; 8+ messages in thread
From: anhnmncb @ 2008-09-11 10:16 UTC (permalink / raw)
  To: emacs-orgmode

Daniel Clemente <n142857@gmail.com> writes:

> Hi,
>
>> Something like this:
>>   [[file:~/doc/foo.pdf 25]]
>> So org will invoke xpdf in this way: xpdf ~/doc/foo.pdf 25.
>>
>   Maybe it's better:
> [[shell:xpdf ~/doc/foo.pdf 25]]

Thanks, it works, but when xpdf is running, emacs gets no responce, I
have to quit xpdf.

>
>   since you want to pass „25“ to xpdf only. It is meaningless to pass the 25 *to the PDF*.
>
>
> --
> Daniel
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>

-- 
Regards,

  anhnmncb
 gpg key: 44A31344

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Re: Passing an option to org-file-apps?
  2008-09-11 10:16   ` anhnmncb
@ 2008-09-11 14:34     ` Jason F. McBrayer
  2008-09-12  9:29       ` anhnmncb
  0 siblings, 1 reply; 8+ messages in thread
From: Jason F. McBrayer @ 2008-09-11 14:34 UTC (permalink / raw)
  To: anhnmncb; +Cc: emacs-orgmode

anhnmncb <anhnmncb@gmail.com> writes:

> Daniel Clemente <n142857@gmail.com> writes:
>
>> Hi,
>>
>>> Something like this:
>>>   [[file:~/doc/foo.pdf 25]]
>>> So org will invoke xpdf in this way: xpdf ~/doc/foo.pdf 25.
>>>
>>   Maybe it's better:
>> [[shell:xpdf ~/doc/foo.pdf 25]]
>
> Thanks, it works, but when xpdf is running, emacs gets no responce, I
> have to quit xpdf.

Add an ampersand at the end of the command:
[[shell:xpdf ~/doc/foo.pdf 25 &]]

-- 
+-----------------------------------------------------------+
| Jason F. McBrayer                    jmcbray@carcosa.net  |
| If someone conquers a thousand times a thousand others in |
| battle, and someone else conquers himself, the latter one |
| is the greatest of all conquerors.  --- The Dhammapada    |

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Passing an option to org-file-apps?
  2008-09-11 14:34     ` Jason F. McBrayer
@ 2008-09-12  9:29       ` anhnmncb
  0 siblings, 0 replies; 8+ messages in thread
From: anhnmncb @ 2008-09-12  9:29 UTC (permalink / raw)
  To: emacs-orgmode

jmcbray@carcosa.net (Jason F. McBrayer) writes:

> anhnmncb <anhnmncb@gmail.com> writes:
>
>> Daniel Clemente <n142857@gmail.com> writes:
>>
>>> Hi,
>>>
>>>> Something like this:
>>>>   [[file:~/doc/foo.pdf 25]]
>>>> So org will invoke xpdf in this way: xpdf ~/doc/foo.pdf 25.
>>>>
>>>   Maybe it's better:
>>> [[shell:xpdf ~/doc/foo.pdf 25]]
>>
>> Thanks, it works, but when xpdf is running, emacs gets no responce, I
>> have to quit xpdf.
>
> Add an ampersand at the end of the command:
> [[shell:xpdf ~/doc/foo.pdf 25 &]]
Nice, I forgot it, thank you.

-- 
Regards,

  anhnmncb
 gpg key: 44A31344

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-09-12  9:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-17  3:30 Passing an option to org-file-apps? anhnmncb
2008-09-07  7:02 ` Carsten Dominik
2008-09-07  8:33   ` Sebastian Rose
2008-09-07 14:25   ` Jose A. Ortega Ruiz
2008-09-07  8:33 ` Daniel Clemente
2008-09-11 10:16   ` anhnmncb
2008-09-11 14:34     ` Jason F. McBrayer
2008-09-12  9:29       ` anhnmncb

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).