emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DISCUSSION, default settings] Using mailcap as default handler for


From: Max Nikulin
Subject: Re: [DISCUSSION, default settings] Using mailcap as default handler for opening file links
Date: Tue, 13 Feb 2024 22:44:36 +0700
User-agent: Mozilla Thunderbird

On 13/02/2024 18:27, Ihor Radchenko wrote:
Max Nikulin writes:

I am mostly going to address user confusion about mailcap

XDG configuration and so xdg-open behavior is often confusing to users as well, especially in the cases of KDE and no DE. In GNOME it is alleviated by a step with the application chooser if default application has not been set yet.

(1) a number
of people are using DMs that rely on FreeDesktop and xdg-open;

DM is display manager. Even DE (desktop environment) is not necessary, some toolkits and applications have their own implementations of XDG specs.

(2) Emacs' mailcap does not implement the specification fully - only a
subset of mailcap format is obeyed.

Agree. On the other hand, mailcap.el is aware that Emacs can handle some files internally. This feature should be preserved in some way. In addition, mailcap has to be used if neither DISPLAY nor WAYLAND_DISPLAY is set for current terminal.

xdg-mime is more close to the file(1) tool

That might be a good alternative to file indeed; although file is
probably more widely installed.

xdg-mime and xdg-open belong to the same package. In the case of no DE xdg-mime calls file(1) (if mimetype(1) is not installed).

Yes, but mailcap is not documented in Emacs manual.

(info "emacs-mailcap") However it is not as useful as it should be.

Is it necessary to modify Org? Maybe an alternative is to add "xdg-open
%s" for */* to `mailcap-user-mime-data'.

Do you mean changing the default value of `mailcap-mime-data'?

I am unsure what is a proper way to do it. I am not confident enough with the code that selects handlers for files.

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.

Is it related to the problem at hand?

- Eli had objections, but did not provide any details.
- Error handling code was dropped for the sake of Emacs-25.
- In the case of no DE, quit from emacs means terminating of started applications.
- I hope a bug I faced is exotic enough to never happen in real life.

Unfortunately another approach is a kind of trade-off, not an unambiguous advantage.

AFAIK, xdg.el does not support xdg-open functionality. We cannot use it
here.

`xdg-mime-apps' looks like a building block. However it is not enough and perhaps has enough bugs.

Ideally Emacs should provide API that uses either xdg.el or mailcap.el as backend depending on runtime and user configuration. Org is not the only package that needs it.

P.S.
Ihor, perhaps your clock is several minutes ahead.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]