On 12/02/2024 19:36, Ihor Radchenko wrote:
Max Nikulin writes:
I believe, there are enough issues with mailcap implementation in Emacs,
but do we have some alternative?
[...]
I have been digging more on this issue recently, and I have found that
Carsten once attempted to tweak this default to use xdg-mime:
Have you faced another issue with mailcap? Frankly speaking, I am unsure
what particular issues we are going to address (file type, Emacs and Org
versions, OS).
Did you intentionally mentioned "xdg-mime"? While xdg-open tries to find
suitable .desktop file to open a file, xdg-mime is more close to the
file(1) tool, but it consults signatures from shared-mime-info and
site&user config files. In addition, unlike file(1), it uses file
extensions to guess media type.
An advantage of mailcap.el is that it should allow users have
Emacs-specific Emacs-wide configuration for viewers. In principle it
should be more reliable when invoking emacs through xdg-open when Emacs
is configured as a handler for some media types.
Is it necessary to modify Org? Maybe an alternative is to add "xdg-open
%s" for */* to `mailcap-user-mime-data'.
I believe that xdg-open issue has been fixed by you in
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=5db61eb0f
org.el: Avoid xdg-open silent failure
I am still not really comfortable due to the strategy to start external
processes diverged from methods used in browse-url.el.
I have not had a look into xdg.el yet.