On Mon, Mar 12 2012, Nick Dokos wrote: > prad <p...@towardsfreedom.com> wrote: > > >> here's what i found in /etc/mailcap >> >> application/pdf; /usr/bin/xpdf '%s'; test=test "$DISPLAY" != ""; >> description=Portable Document Format; nametemplate=%s.pdf >> >> application/x-pdf; /usr/bin/xpdf '%s'; test=test "$DISPLAY" != ""; >> description=Portable Document Format; nametemplate=%s.pdf >> >> application/pdf; evince '%s'; test=test -n "$DISPLAY"; nametemplate=%s.pdf >> >> however, i'm not sure how to interpret this. >> > > I'm no expert but I believe that the first entry that matches wins: for > "application/pdf" e.g. in this case, if /usr/bin/xpdf is present and > executable and the display test succeeeds, xpdf will be used. Otherwise > it's going to search further: if evince is present and the display test > succeeds, evince will be used. > > You probably want to experiment by adding entries to ~/.mailcap, so that > you don't mess up the system one: entries in ~/.mailcap override. I just > have the bare minimum in mine: > > application/pdf; xpdf -q %s > > Next question: since xpdf is available and /etc/mailcap prefers it, why > is nautilus using evince? Doesn't it use mailcap? I guess not, although > I don't know for sure[fn:1], but it wouldn't surprise me if it did its > own thing: there are way too many cooks in this kitchen.
I think most linux desktop environments use something like xdg-open or gnome-open to determine defaults applications, all my defaults seem to live in /usr/local/share/applications, which can be overridden in the home directory. Nautilus ought to use gnome-open. I've tweaked most of my "open-in-external-blah" functions (in dired and gnus, for example) to use xdg-open, so the same defaults are used in all my applications, including emacs. -- GNU Emacs 24.0.94.1 (i686-pc-linux-gnu, GTK+ Version 2.24.10) of 2012-03-06 on pellet Org-mode version 7.8.03 (release_7.8.03.573.g86131)