GNU bug report logs - #8174
24.0.50; `replace-match' doesn't work right with propertized text

Previous Next

Package: emacs;

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


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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: 8174 <at> debbugs.gnu.org
Subject: Re: bug#8174: 24.0.50;
	`replace-match' doesn't work right with propertized text
Date: Fri, 04 Mar 2011 23:18:10 -0500
> (defun foo ()
>   (interactive)
>   (require 'image-dired)
>   (save-excursion
>     (goto-char (point-min))
>     (re-search-forward "tata")
>     (let* ((file  "@@@@@")
>     (strg  (apply #'propertize "AAAAAA"
>     `(display ,(image-dired-get-thumbnail-image file)
>        rear-nonsticky (display)))))
>       (replace-match strg))))
> --------------------------------
 
> Replace `@@@@@' in `foo's definition by a real image-file absolute file
> name, and then evaluate the definition.  Then `M-x foo RET'.
 
> I would expect the text `tata' to be replaced by the propertized string,
> whose text is `AAAAAAA' and whose properties are as indicated.  IOW, I
> would expect to see the image displayed in place of `tata'.

First things first: (ignoring the lack of check that re-search-forward
indeed succeeded) 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.


        Stefan




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.