unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#64367: 28.2; doc string of `text-property-search-forward'
@ 2023-06-30 15:07 Drew Adams
  2023-07-01  9:32 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Drew Adams @ 2023-06-30 15:07 UTC (permalink / raw)
  To: 64367

The signature is this:

(text-property-search-forward PROPERTY
   &optional VALUE PREDICATE NOT-CURRENT)

The arguments should be described in order.

But the first line of the doc string - the most important - says this:

 Search for the next region of text where PREDICATE is true.

Not only is PREDICATE optional; it is not even the first optional arg.
The first line should describe the _default_ behavior (nil VALUE, nil
PREDICATE).  Something like this:

 Search forward for text where PROPERTY is non-nil.

Then go on to introduce, first VALUE, then PREDICATE, then NOT-CURRENT.

In GNU Emacs 28.2 (build 2, x86_64-w64-mingw32)
 of 2022-09-13
Windowing system distributor `Microsoft Corp.', version 10.0.19045
Configured using:
 `configure --with-modules --without-dbus --with-native-compilation
 --without-compress-install CFLAGS=-O2'






^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#64367: 28.2; doc string of `text-property-search-forward'
  2023-06-30 15:07 bug#64367: 28.2; doc string of `text-property-search-forward' Drew Adams
@ 2023-07-01  9:32 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2023-07-01  9:32 UTC (permalink / raw)
  To: Drew Adams; +Cc: 64367-done

> From: Drew Adams <drew.adams@oracle.com>
> Date: Fri, 30 Jun 2023 15:07:02 +0000
> 
> The signature is this:
> 
> (text-property-search-forward PROPERTY
>    &optional VALUE PREDICATE NOT-CURRENT)
> 
> The arguments should be described in order.

Only preferably so.  It is not always possible to do so, and thus it
is not a hard requirement.

In this case, I see no way of describing the arguments in order and
still producing a useful doc string, let alone its first line.

> But the first line of the doc string - the most important - says this:
> 
>  Search for the next region of text where PREDICATE is true.
> 
> Not only is PREDICATE optional; it is not even the first optional arg.
> The first line should describe the _default_ behavior (nil VALUE, nil
> PREDICATE).

Now fixed on the emacs-29 branch.

> Something like this:
> 
>  Search forward for text where PROPERTY is non-nil.

This loses information and is also inaccurate, so I used a different
text:

  Search for next region of text where PREDICATE returns non-nil for PROPERTY.

Closing.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-01  9:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-30 15:07 bug#64367: 28.2; doc string of `text-property-search-forward' Drew Adams
2023-07-01  9:32 ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).