>>> https://lists.gnu.org/archive/html/bug-gnu-emacs/2021-10/msg01952.html
>>
>> This says two things:
>>
>> . some commands in the list are less capable then others
>> . XDG can do the job better
>>
>> To the first point, my response would be: put the better ones first in
>> the list, but leave the worse ones in the list for those users who
>> don't have the better alternatives.
>
> I completely agree. This is what I tried to do,
> but couldn't find a way to refactor this amalgamation
> in dired-guess-shell-alist-default. We need to split it
> to two parts, so users without XDG will have:
>
> 1. better ones from dired-guess-shell-alist-default
> 2. worse ones from dired-guess-shell-alist-default
>
> And users with XDG should be able to have:
>
> 1. better ones from dired-guess-shell-alist-default
> 2. XDG commands
> 3. worse ones from dired-guess-shell-alist-default
>
> Probably I'll move the worse ones to a new variable
> 'dired-guess-shell-alist-default-2'.
Ok, here is a new list 'dired-guess-shell-alist-optional'
that contains rare commands that don't exist on many systems.
So now the default order of a list of commands to select with M-n
for M-!, ! in Dired and the Dired context menu with this patch
is the following:
1. commands from dired-guess-shell-alist-user
2. commands from dired-guess-shell-alist-default
3. commands found by XDG on user's system
4. commands found by mailcap on user's system
5. rare commands from dired-guess-shell-alist-optional