emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to open pdf file links with evince under linux?..
@ 2010-03-23  9:17 Leo Alekseyev
  2010-03-23 20:44 ` Jan Böcker
  0 siblings, 1 reply; 4+ messages in thread
From: Leo Alekseyev @ 2010-03-23  9:17 UTC (permalink / raw)
  To: emacs-orgmode

When using org mode under windows, links to local PDF files bring up
Acrobat.  However, under linux, these links just spawn a new empty
buffer in emacs in fundamental mode.  How can I make PDF links bring
up evince?...

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

* Re: How to open pdf file links with evince under linux?..
  2010-03-23  9:17 How to open pdf file links with evince under linux? Leo Alekseyev
@ 2010-03-23 20:44 ` Jan Böcker
  2010-03-29 15:20   ` Daniel Martins
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Böcker @ 2010-03-23 20:44 UTC (permalink / raw)
  To: Leo Alekseyev; +Cc: emacs-orgmode

On 23.03.2010 10:17, Leo Alekseyev wrote:
> When using org mode under windows, links to local PDF files bring up
> Acrobat.  However, under linux, these links just spawn a new empty
> buffer in emacs in fundamental mode.  How can I make PDF links bring
> up evince?...
> 

As far as I know, Org uses the system defaults when it does not know how
to open a file, and when the system does not know, Org opens the file in
emacs. Under linux, that system default is the mailcap database, but I
have no idea how to configure that. (It doesn't even appear to exist on
my system.)

But we can tell Org directly what to do with PDF files: take a look at
the variable org-file-apps (M-x customize-variable org-file-apps).

Each entry in this list consists of (selector, action) pairs where the
action tells Org how to open a file, and the selector (in most cases a
regular expression matched against the file name) specifies what kind of
files to open in this way.

Add the following entry:

Extension:	\.pdf\'
Command:	evince %s

Links to PDF files should now open in evince.


If you pull the current git version of Org, you could add a second entry:

Extension:	\.pdf::\([0-9]+\)\'
Command:	evince %s -p %1

This would allow you to link to a specific page of a PDF like this:
[[file:/path/to/document.pdf::21]]
(Shameless plug for a patch of mine that just got accepted.)


HTH, Jan

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

* Re: How to open pdf file links with evince under linux?..
  2010-03-23 20:44 ` Jan Böcker
@ 2010-03-29 15:20   ` Daniel Martins
  2010-03-29 17:31     ` Matt Lundin
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Martins @ 2010-03-29 15:20 UTC (permalink / raw)
  To: Jan Böcker; +Cc: emacs-orgmode, Leo Alekseyev


[-- Attachment #1.1: Type: text/plain, Size: 2072 bytes --]

well,

my values are

org-file-apps is a variable defined in `org.el'.
Its value is
((auto-mode . emacs)
 ("\\.x?html?\\'" . default))


which does not help very much since i think is scary to change the auto-mode
in emacs

I have the same annoying problem reported by Jan

2010/3/23 Jan Böcker <jan.boecker@jboecker.de>

> On 23.03.2010 10:17, Leo Alekseyev wrote:
> > When using org mode under windows, links to local PDF files bring up
> > Acrobat.  However, under linux, these links just spawn a new empty
> > buffer in emacs in fundamental mode.  How can I make PDF links bring
> > up evince?...
> >
>
> As far as I know, Org uses the system defaults when it does not know how
> to open a file, and when the system does not know, Org opens the file in
> emacs. Under linux, that system default is the mailcap database, but I
> have no idea how to configure that. (It doesn't even appear to exist on
> my system.)
>
> But we can tell Org directly what to do with PDF files: take a look at
> the variable org-file-apps (M-x customize-variable org-file-apps).
>
> Each entry in this list consists of (selector, action) pairs where the
> action tells Org how to open a file, and the selector (in most cases a
> regular expression matched against the file name) specifies what kind of
> files to open in this way.
>
> Add the following entry:
>
> Extension:      \.pdf\'
> Command:        evince %s
>
> Links to PDF files should now open in evince.
>
>
> If you pull the current git version of Org, you could add a second entry:
>
> Extension:      \.pdf::\([0-9]+\)\'
> Command:        evince %s -p %1
>
> This would allow you to link to a specific page of a PDF like this:
> [[file:/path/to/document.pdf::21]]
> (Shameless plug for a patch of mine that just got accepted.)
>
>
> HTH, 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
>

[-- Attachment #1.2: Type: text/html, Size: 2702 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

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

* Re: How to open pdf file links with evince under linux?..
  2010-03-29 15:20   ` Daniel Martins
@ 2010-03-29 17:31     ` Matt Lundin
  0 siblings, 0 replies; 4+ messages in thread
From: Matt Lundin @ 2010-03-29 17:31 UTC (permalink / raw)
  To: Daniel Martins; +Cc: emacs-orgmode, Leo Alekseyev

Hi Daniel,

Daniel Martins <danielemc@gmail.com> writes:

> my values are
>
> org-file-apps is a variable defined in `org.el'.
> Its value is
> ((auto-mode . emacs)
>  ("\\.x?html?\\'" . default))

It looks as if you have changed this variable somehow. The default value
is:
((auto-mode . emacs)
 ("\\.mm\\'" . default)
 ("\\.x?html?\\'" . default)
 ("\\.pdf\\'" . default))

With the default settings you have two options:

1. Add the following line to ~/.mailcap (user only) or /etc/mailcap
   (typical location of system-wide settings on Linux).

application/pdf; evince %s

2. Change the default settings per Jan's instructions:

> > 2010/3/23 Jan Böcker <jan.boecker@jboecker.de>
> >
> >     But we can tell Org directly what to do with PDF files: take a
> >     look at the variable org-file-apps (M-x customize-variable
> >     org-file-apps).
> >    
> >     Each entry in this list consists of (selector, action) pairs where
> >     the action tells Org how to open a file, and the selector (in most
> >     cases a regular expression matched against the file name)
> >     specifies what kind of files to open in this way.
> >    
> >     Add the following entry:
> >    
> >     Extension:      \.pdf\'
> >     Command:        evince %s
> >    
> >     Links to PDF files should now open in evince.

> which does not help very much since i think is scary to change the
> auto-mode in emacs

Changing the pdf setting in this way does nothing to the
auto-mode-alist. The auto-mode cons cell simply instructs org-mode to
open any file matching a regexp in auto-mode-alist within emacs.

> I have the same annoying problem reported by Jan

Could you explain what problem you mean here? I believe it was Leo who
reported the problem, while Jan offered a solution.

Best,
Matt

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

end of thread, other threads:[~2010-03-29 17:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-23  9:17 How to open pdf file links with evince under linux? Leo Alekseyev
2010-03-23 20:44 ` Jan Böcker
2010-03-29 15:20   ` Daniel Martins
2010-03-29 17:31     ` Matt Lundin

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