Subject: bug#54017: add regexp translation option to read-regexp

From: Juri Linkov <[email-masked]>
Date: Thu, 17 Feb 2022 10:24:14 +0200

>> This user option already exists. It's name is 'search-default-mode'.
>
> Does that option affect every command where read regexp is used?
> Because this bug is about that.
>
> So regexp translation for occur, flush/keep-lines, highlight-regexp,
> dired-mark-files-regexp, etc., so anywhere where read-regexp is used.

Sorry, I misread your feature request, I thought it's continuation
of adding custom regexp types to search/replace.  You are right
that read-regexp misses support for custom regexp formats.

It's easy to add regexp translation to the return value of read-regexp.
But there is one complication: the default value returned by
read-regexp-defaults-function might be a function like
find-tag-default-as-regexp that returns a regexp in the
default format created by regexp-quote.

Do you agree that a pair of two translation functions should be provided:
one to translate a custom regexp syntax to the default regexp syntax
(to be used on the return value of read-regexp), and another translation
from the default regexp syntax to the custom regexp syntax (to be used
to translate the default regexp value added to the minibuffer)?