Subject: bug#14110: 24.3.50; Add command to open files outside of Emacs (use xdg-open, open etc)

From: Jambunathan K <[email-masked]>
Date: Fri, 05 Apr 2013 10:28:01 +0530

Eli Zaretskii <[email-masked]> writes:

>> From: Jambunathan K <[email-masked]>
>> Date: Thu, 04 Apr 2013 23:22:37 +0530
>> Cc: [email-masked]
>> 
>> The alist is already maintained by the user's desktop (likely via
>> Explore->`Open with' -> `Always use this application for these files').
>> Emacs should at no point in time have any knowledge of this association.
>
> Emacs can easily know about the associations, at least on Windows.

On my Debian/Squeeze, this is what I have ended up with.

,----
| $ xdg-mime query filetype images/vanilla-emacs.png 
| image/png; charset=binary
`----

,----
| $ xdg-mime query default image/png
| gimp.desktop
`----

,----
| $ dpkg -L gimp | grep desktop
| /usr/lib/gimp/2.0/plug-ins/file-desktop-link
| /usr/share/applications/gimp.desktop
`----

,----
| $ cat /usr/share/applications/gimp.desktop | grep Exec
| Exec=gimp-2.6 %U
| TryExec=gimp-2.6
`----

,----
| $ gimp-
| gimp-2.6          gimp-console      gimp-console-2.6 
`----

There should be a way to go directly from *.desktop file to Exec entry.
I haven't figured it out or it is in the works.

Surprisingly, the above sequence fails for ODT files.

,----
| $ xdg-mime query filetype book.odt
| application/vnd.oasis.opendocument.text; charset=binary
`----

,----
| $ xdg-mime query default application/vnd.oasis.opendocument.text
| <NOTHING WHATSOEVER>
`----

I believe xdg-stuff is in it's initial stages and not so reliable at
this moment.