bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Lars Ingebrigtsen
Subject: bug#46088: 26.3; doc string of `read-regexp'
Date: Wed, 27 Jan 2021 03:37:51 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Drew Adams <drew.adams@oracle.com> 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]