From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#8174: 24.0.50; `replace-match' doesn't work right with propertized text Date: Fri, 04 Mar 2011 23:18:10 -0500 Message-ID: References: <3DD5910E07E34DD4B7A6E4B75B340674@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1299299848 31844 80.91.229.12 (5 Mar 2011 04:37:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 5 Mar 2011 04:37:28 +0000 (UTC) Cc: 8174@debbugs.gnu.org To: "Drew Adams" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 05 05:37:23 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PvjF5-00074Q-2X for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Mar 2011 05:37:23 +0100 Original-Received: from localhost ([127.0.0.1]:43268 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PvjF4-0002Xb-IW for geb-bug-gnu-emacs@m.gmane.org; Fri, 04 Mar 2011 23:37:22 -0500 Original-Received: from [140.186.70.92] (port=60888 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PvjEe-0002Ky-Vh for bug-gnu-emacs@gnu.org; Fri, 04 Mar 2011 23:36:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PvjEd-0002Tr-UB for bug-gnu-emacs@gnu.org; Fri, 04 Mar 2011 23:36:56 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33677) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PvjEd-0002Ti-Si for bug-gnu-emacs@gnu.org; Fri, 04 Mar 2011 23:36:55 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PvixK-0007kj-Hf; Fri, 04 Mar 2011 23:19:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Mar 2011 04:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8174 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8174-submit@debbugs.gnu.org id=B8174.129929869829747 (code B ref 8174); Sat, 05 Mar 2011 04:19:02 +0000 Original-Received: (at 8174) by debbugs.gnu.org; 5 Mar 2011 04:18:18 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pviwc-0007jk-1k for submit@debbugs.gnu.org; Fri, 04 Mar 2011 23:18:18 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pviwa-0007jZ-6p for 8174@debbugs.gnu.org; Fri, 04 Mar 2011 23:18:16 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAApIcU3O+LeP/2dsb2JhbACmY3W+BoVhBIUcj3A X-IronPort-AV: E=Sophos;i="4.62,268,1297054800"; d="scan'208";a="94482148" Original-Received: from 206-248-183-143.dsl.teksavvy.com (HELO ceviche.home) ([206.248.183.143]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 04 Mar 2011 23:18:10 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 3EBE1660D6; Fri, 4 Mar 2011 23:18:10 -0500 (EST) In-Reply-To: <3DD5910E07E34DD4B7A6E4B75B340674@us.oracle.com> (Drew Adams's message of "Fri, 4 Mar 2011 14:16:06 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 04 Mar 2011 23:19:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:44644 Archived-At: > (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