Subject: bug#48317: 27.1; text-property-search-forward moves point to end when not found

From: Howard Melman <[email-masked]>
Date: Tue, 11 May 2021 10:20:01 -0400

On May 11, 2021, at 8:32 AM, Lars Ingebrigtsen <[email-masked]> wrote:
> 
>> If no region has the named property I can't see how it can be found
>> and therefore point should not be moved.  In fact I don't see how predicate
>> even comes into play in this case.
> 
> I'm sorry, I don't follow you.  It this still about
> 
>  (text-property-search-forward 'facet 'foo)
> 
> ?  That works as designed, as far as I can tell.  (But not as documented
> in the Emacs 27.1 doc string.)

Yes, Note that says "facet" and not "face"

To be more clear, I find when calling:

  (text-property-search-forward 'unused-property 'my-package-face)

when no text in the buffer has the property unused-property, that
calling text-property-search-forward moves point to eob.

Is this intended behavior?  If so I don't understand why. 

If I set the predicate to t point is not moved which is what I want,
but I don't see why that should be the case.  Does Emacs check for
properties with equal?

I think the bug is in the test commented as "We're standing in the
property we're looking for, so find the end" because the test is
matched because

    (get-text-property (point) property)

returns nil and text-property--match-p is called with

    (my-package-face nil nil) 

and returns non-nil.  I don't think this test should match
because point is not in the property unused-property.

Howard