GNU bug report logs -
#40053
28.0; text-property-search-forward skips first region
Previous Next
Reported by: Dustin Lacewell <dlacewell <at> gmail.com>
Date: Fri, 13 Mar 2020 17:36:01 UTC
Severity: normal
Tags: notabug
Found in version 28.0
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 40053 in the body.
You can then email your comments to 40053 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#40053
; Package
emacs
.
(Fri, 13 Mar 2020 17:36:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Dustin Lacewell <dlacewell <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Fri, 13 Mar 2020 17:36:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
The following code does not do what I would expect:
(with-current-buffer (get-buffer-create "*Test*")
(erase-buffer)
(insert " ")
(insert-text-button "Button1"
'foo 'bar)
(insert " ")
(insert-text-button "Button2"
'foo 'bar)
(beginning-of-buffer)
(text-property-search-forward 'foo 'bar nil t)
(display-buffer (current-buffer)))
I would expect the point to land on the first button. However, it lands on
the second.
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#40053
; Package
emacs
.
(Fri, 13 Mar 2020 18:47:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 40053 <at> debbugs.gnu.org (full text, mbox):
On Fri, 13 Mar 2020 12:35:25 -0500 Dustin Lacewell <dlacewell <at> gmail.com> wrote:
> The following code does not do what I would expect:
>
> (with-current-buffer (get-buffer-create "*Test*")
> (erase-buffer)
> (insert " ")
> (insert-text-button "Button1"
> 'foo 'bar)
> (insert " ")
> (insert-text-button "Button2"
> 'foo 'bar)
> (beginning-of-buffer)
> (text-property-search-forward 'foo 'bar nil t)
> (display-buffer (current-buffer)))
>
> I would expect the point to land on the first button. However, it
> lands on the second.
Actually, if text-property-search-forward succeeds it moves to the end
of the propertized region, so in this case, just after the first
button. And that's what happens with this sexp:
(text-property-search-forward 'foo 'bar t t)
But you've called it with the argument PREDICATE nil, which means the
search succeeds if the value of the propertized text does not match the
VALUE argument, i.e. in this case if 'bar does not match 'bar. Since
this is false, the search stops, leaving point at the last position
where the value of 'foo changed, which is the beginning of the second
button.
Steve Berman
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#40053
; Package
emacs
.
(Sat, 14 Mar 2020 11:39:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 40053 <at> debbugs.gnu.org (full text, mbox):
Stephen Berman <stephen.berman <at> gmx.net> writes:
> But you've called it with the argument PREDICATE nil, which means the
> search succeeds if the value of the propertized text does not match the
> VALUE argument, i.e. in this case if 'bar does not match 'bar. Since
> this is false, the search stops, leaving point at the last position
> where the value of 'foo changed, which is the beginning of the second
> button.
Yup. So I don't think there's any bug here, and I'm closing this bug
report. If there's still something to fix here, respond, and the bug
report will be reopened.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Added tag(s) notabug.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Sat, 14 Mar 2020 11:39:02 GMT)
Full text and
rfc822 format available.
bug closed, send any further explanations to
40053 <at> debbugs.gnu.org and Dustin Lacewell <dlacewell <at> gmail.com>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Sat, 14 Mar 2020 11:39:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sun, 12 Apr 2020 11:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 5 years and 70 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.