unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Howard Melman <hmelman@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 48317@debbugs.gnu.org
Subject: bug#48317: 27.1; text-property-search-forward moves point to end when not found
Date: Mon, 10 May 2021 09:06:08 -0400	[thread overview]
Message-ID: <4E8819BD-AA07-4870-8A90-98FB1F3D45E4@gmail.com> (raw)
In-Reply-To: <87mtt3c62q.fsf@gnus.org>

On May 10, 2021, at 5:05 AM, Lars Ingebrigtsen <larsi@gnus.org> wrote:

> I think the doc string is wrong -- you rewrote it in 165890a and further
> in df05c26.  The original doc string was correct, I think:
> 
> +Some convenience values for PREDICATE can also be used.  `t'
> +means the same as `equal'.  `nil' means almost the same as \"not
> +equal\", but will also end the match if the value of PROPERTY
> +changes.  See the manual for extensive examples.
> 
> The code performs as originally documented in the test case from Howard,
> as far as I can tell.

Ok, setting property to t solves both of my cases.

What threw me (and I still think is problematic) is this line from the docstring:

    If not found, return nil and don't move point.

And this line from the manual:

     If the text property can’t be found, the function returns ‘nil’.

Which I assume also infers point is not moved. 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 still think there's a bug here:

    ;; We're standing in the property we're looking for, so find the
    ;; end.
    ((and (text-property--match-p value (get-text-property (point) property)
                                  predicate)
          (not not-current))
     (text-property--find-end-forward (point) property value predicate))

Because this solves my problem:

    ((and (get-text-property (point) property)
          (text-property--match-p value (get-text-property (point) property)
                                  predicate)
          (not not-current))
     (text-property--find-end-forward (point) property value predicate))

Howard




  reply	other threads:[~2021-05-10 13:06 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-09 16:41 bug#48317: 27.1; text-property-search-forward moves point to end when not found Howard Melman
2021-05-09 17:07 ` Eli Zaretskii
     [not found]   ` <616F7732-ED83-40F0-A460-9298608EAD91@gmail.com>
2021-05-09 17:48     ` Eli Zaretskii
     [not found]       ` <8877DDB9-7D2B-4DCC-8374-EB8391134EAC@gmail.com>
2021-05-09 18:33         ` Eli Zaretskii
2021-05-09 19:48           ` Howard Melman
2021-05-10  9:05           ` Lars Ingebrigtsen
2021-05-10 13:06             ` Howard Melman [this message]
2021-05-11 12:32               ` Lars Ingebrigtsen
2021-05-11 12:48                 ` Eli Zaretskii
2021-05-11 13:14                   ` Lars Ingebrigtsen
2021-05-11 14:20                 ` Howard Melman
2021-05-11 16:36                   ` Lars Ingebrigtsen
2021-05-11 19:28                     ` Howard Melman
2021-05-11 23:18                       ` Stephen Berman
2021-05-12 14:16                       ` Lars Ingebrigtsen
2021-05-12 16:29                         ` Howard Melman
2021-05-12 16:55                           ` Lars Ingebrigtsen
     [not found]                             ` <5AA9C2CD-D20B-4B9D-83D6-9002E9396558@gmail.com>
2022-05-13 18:32                               ` Howard Melman
2022-05-14  2:19                                 ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E8819BD-AA07-4870-8A90-98FB1F3D45E4@gmail.com \
    --to=hmelman@gmail.com \
    --cc=48317@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).