GNU bug report logs -
#8174
24.0.50; `replace-match' doesn't work right with propertized text
Previous Next
Reported by: "Drew Adams" <drew.adams <at> oracle.com>
Date: Fri, 4 Mar 2011 22:18:01 UTC
Severity: normal
Found in version 24.0.50
Done: "Drew Adams" <drew.adams <at> oracle.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> > (re-search-forward "tata")
> > (let* ((file "@@@@@")
> > (strg (apply #'propertize "AAAAAA"
> > `(display ,(image-dired-get-thumbnail-image file)
> > rear-nonsticky (display)))))
> > (replace-match strg))))
>
> First things first: (ignoring the lack of check that
> re-search-forward indeed succeeded)
The real code uses (when (re-search-forward... nil t)...).
> the only things allowed between the string match and
> the use of the match-data are a few Emacs primitives known to
> leave the match-data untouched. image-dired-get-thumbnail-image
> is not one of those primitives.
Yes, that's the problem here, so no bug. I was not expecting to need to wrap
the `(apply... )' in `save-match-data'. Usually I can pretty much tell when the
match data gets modified, but I guess I should have looked closer at
`image-dired-get-thumbnail-image'.
This bug report was last modified 14 years and 141 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.