[Top][All Lists]

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

Re: [PATCH] Add option COUNT argument to text-property-search functions

From: Lars Ingebrigtsen
Subject: Re: [PATCH] Add option COUNT argument to text-property-search functions
Date: Sat, 31 Jul 2021 13:36:59 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Protesilaos Stavrou <info@protesilaos.com> writes:

> The idea is to have a command that moves point.  So it could accept a
> numeric argument to go to the COUNTth match, like 're-search-forward'.

I grepped through the Emacs sources, and the COUNT parameter to
`re-search-forward' was used in 2% of the usage cases, which is about
10000% more than I had imagined -- so perhaps it does make sense to add
a COUNT parameter to `text-property-search-*' (especially for symmetry
with `re-search-*').

But I'm for composability and trying to keeping function interfaces
simple and easy to reason about -- there's a tendency to stuff more and
more functionality down into functions when it's trivial to just use the
functions instead.  And these functions already have plenty of optional
parameters (and will probably grow even more in the future, if Emacs
history repeats itself), so I'm still not very excited about adding

(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]