[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#8174: 24.0.50; `replace-match' doesn't work right with propertized t

From: Stefan Monnier
Subject: bug#8174: 24.0.50; `replace-match' doesn't work right with propertized text
Date: Fri, 04 Mar 2011 23:18:10 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> (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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]