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

From: Eli Zaretskii <[email-masked]>
Date: Thu, 17 Feb 2022 11:18:10 +0200

> From: Juri Linkov <[email-masked]>
> Date: Thu, 17 Feb 2022 10:24:14 +0200
> Cc: [email-masked]
> 
> 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)?

Before we install something like this, we need to discuss the relevant
use cases and agree that it makes sense for us to support them.

I originally interpreted the OP's request as asking for a feature
where the user could use one of the regexp styles used by other
programs, such as BRE or ERE or maybe PCRE.  If this is indeed the
intent, then I'd rather we implemented support for only those specific
styles (or some subset of them).  It doesn't make sense to me to
support arbitrary translations of regular expressions, because I see
no valid use cases for such a general feature, and am unaware of any
other applications which support regular expressions that allow such
arbitrary translations.