GNU bug report logs - #37488
27.0.50; Inconsistent naming of arg of `text-property-search-forward' and `-backward'

Previous Next

Package: emacs;

Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>

Date: Mon, 23 Sep 2019 06:04:01 UTC

Severity: normal

Found in version 27.0.50

Done: Juanma Barranquero <lekktu <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #31 received at 37488 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: michael_heerdegen <at> web.de, Juanma Barranquero <lekktu <at> gmail.com>,
 37488 <at> debbugs.gnu.org
Subject: Re: bug#37488: 27.0.50; Inconsistent naming of arg of
 `text-property-search-forward' and `-backward'
Date: Wed, 25 Sep 2019 15:15:58 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>  . The original doc string said about nil as PREDICATE:
>
>      `nil' means almost the same as \"not equal\", but will also
>      end the match if the value of PROPERTY changes.
>
>    What does it mean to "end the match if the value changes"?  The
>    text went on to say "See the manual for extensive examples", but
>    the manual doesn't mention this aspect of nil, it just says "not
>    equal".

If point is inside a region where PROPERTY has a non-nil value, using
nil as the predicate will end the search when PROPERTY changes value.

>  . The doc string stated:
>
>      If NOT-CURRENT, if the match is under point, it will not be
>      returned, but instead the next instance is returned, if any.
>
>    But the code, AFAIU, just checks whether the value of PROPERTY at
>    point matches that of the found region, which doesn't necessarily
>    mean point is part of the region, it could just mean there are two
>    regions with matching values of PROPERTY, and point belongs to one
>    of them.  Right?

I'm not sure I understand the question...

What it's meant to do is basically how TAB works in buttons, which is a
common use case.  If you're looking for "o", and point is where "|" is
below, then it'll find the last "oo" section after the x-es:

oo|oxxxxxoo

>  . What is the reason for having VALUE an optional argument?  Is it a
>    frequent/useful operation to look for a VALUE of nil?

If PREDICATE is nil, then having to use an explicit nil VALUE isn't
necessary.

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




This bug report was last modified 5 years and 293 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.