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: Ihor Radchenko
Subject: Re: [DISCUSSION, default settings] Using mailcap as default handler for opening file links
Date: Tue, 13 Feb 2024 11:27:37 +0000

Max Nikulin <manikulin@gmail.com> writes:

>> 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).

I am mostly going to address user confusion about mailcap - (1) a number
of people are using DMs that rely on FreeDesktop and xdg-open; they get
surprised when .mailcap is used - I've seen a number of questions in
IRC/Matrix and on reddit related to how Org mode opens file links; (2)
Emacs' mailcap does not implement the specification fully - only a
subset of mailcap format is obeyed.

So, I do not feel that Emacs' implementation of mailcap support is a
good default for most users.

> Did you intentionally mentioned "xdg-mime"?

No. I meant xdg-open.

> ... 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.

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

> An advantage of mailcap.el is that it should allow users have 
> Emacs-specific Emacs-wide configuration for viewers.

Yes, but mailcap is not documented in Emacs manual.
FYI, I first heard that .mailcap files are a thing when I encountered
org-file-apps.

> ... In principle it 
> should be more reliable when invoking emacs through xdg-open when Emacs 
> is configured as a handler for some media types.

I doubt so. There are problems with mailcap.el and there might be
problems with Emacs media type configuration. I prefer xdg.

> 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 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?

> I have not had a look into xdg.el yet.

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

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

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