emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Jan Böcker" <jan.boecker@jboecker.de>
To: Leo Alekseyev <dnquark@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: How to open pdf file links with evince under linux?..
Date: Tue, 23 Mar 2010 21:44:40 +0100	[thread overview]
Message-ID: <4BA92838.1010101@jboecker.de> (raw)
In-Reply-To: <4e3ad401003230217v78fc1112o5ff1b4fff7468472@mail.gmail.com>

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

  reply	other threads:[~2010-03-23 20:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2010-03-29 15:20   ` Daniel Martins
2010-03-29 17:31     ` Matt Lundin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BA92838.1010101@jboecker.de \
    --to=jan.boecker@jboecker.de \
    --cc=dnquark@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).