Subject: Re: bug#46088: 26.3; doc string of `read-regexp'

From: Lars Ingebrigtsen <[email-masked]>
Date: Wed, 27 Jan 2021 03:37:51 +0100

Drew Adams <[email-masked]> writes:

> A. This is unclear, to me:
>
>  If DEFAULTS is a non-nil symbol, then if `read-regexp-defaults-function'
>  is non-nil, we use that in place of DEFAULTS in the following:
>    If DEFAULTS is the symbol `regexp-history-last', we use the first
>    element of HISTORY (if specified) or `regexp-history'.
>    If DEFAULTS is a function, we call it with no arguments and use
>    what it returns, which should be either nil, a string, or a list of strings.

That is pretty hard to parse, but the semantics are pretty convoluted,
too.  It's saying that if DEFAULTS is a symbol, then the actual value
used comes from `read-regexp-defaults-function' in the two cases
described.  That is, if `read-regexp-defaults-function' is non-nil.

I've now tried to reformulate this in Emacs 28, but it's a case of the
code being easier to read than trying to actually describe the semantics.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no