Subject: Re: bug#63744: 28.2; fix dired-guess-default

From: Michael Heerdegen <[email-masked]>
Date: Tue, 30 May 2023 02:24:25 +0200

Eli Zaretskii <[email-masked]> writes:

> I understand all that.  But you are evidently still not understanding
> what I'm asking.

If interested - else feel free to ignore.

If this didn't answer your question:

> Can't you generate the entire value of dired-guess-shell-alist-user
> dynamically, including the RE part?

then you meant to recompute the variable's value every time the user wants
to open a file with dired?

It's a defcustom so Emacs should not change the value at all.
And recomputing the whole value every time is much slower than computing
a list of defaults for one class of files matched by the regexp.  The
conditions that need to be checked are very different for different file
types in a typical scenario, and the suggested design is more efficient:
first look at the file type by matching the RE part, then decide, at the
moment of user request, what applications are appropriate for this type
of file (and only for this type) in this moment.

Michael.