Hi Reuben,

Reuben Thomas <r...@sc3d.org> writes:

> Value: ((auto-mode . emacs)
>  ("\\.mm\\'" . default)
>  ("\\.x?html?\\'" . default)
>  ("\\.pdf\\'" . default)
>  (t . "xdg-open %s")
>  (system . "xdg-open %s"))
>  
>
>     What I've found is that, since .pdf documents can be opened in
>     Emacs
>     and since org-file-apps contains (auto-mode . emacs) as its first
>     element, then changing the system's value to xdg-open after that
>     will
>     fail because (auto-mode . emacs) is applied first.
>
>
> That's interesting, but I'm no less confused. With the value above,
> PDF files *are* opened with xdg-open.

Okay, see those two bits of `org-file-apps' docstring:

`auto-mode'    Matches files that are matched by any entry in `auto-mode-alist',
               so all files Emacs knows how to handle.  Using this with
               command `emacs' will open most files in Emacs.  Beware that this
               will also open html files inside Emacs, unless you add
               ("html" . default) to the list as well.
               
So (auto-mode . emacs) says to open .pdf files in emacs... but 
("\\.pdf\\'" . default) says to open .pdf files using the "default"
application:

 `default'     Use the default application for this file type, which is the
               association for t in the list

Since you have (t . "xdg-open %s"), xdg-open is used.

Yep, it's all a bit tricky...

-- 
 Bastien

Reply via email to