Subject: bug#18132: Time for a smarter dired-guess-shell-alist-default? (dired-x.el)

From: Juri Linkov <[email-masked]>
Date: Sun, 24 Oct 2021 10:56:45 +0300

>>  I also want to be able to override xdg-open with customizations inside
>>  Emacs.
>>
>> This just adds complexity to the system.
>
> Yes, but the added complexity should be small, and I think we cannot
> do without that: tools like xdg-open will never be able to satisfy all
> the needs of Emacs users, because Emacs is not just a file manager
> capable of starting applications.

To add minimal complexity we could use as an example
the recent design of context-menu-functions that is a hook.

Then we could create a new customizable hook that can contain
a list of functions that return the command candidates depending
on the argument with file names.

Then its possible options for such hook could include:

- xdg-open-function
- mailcap-function that adds mailcap candidates
- dired-x-guess that adds existing dired-guess-shell-alist-default
- Windows-specific candidates from w32-shell-execute
- etc.