From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#8174: 24.0.50; `replace-match' doesn't work right with propertized text Date: Fri, 4 Mar 2011 14:16:06 -0800 Message-ID: <3DD5910E07E34DD4B7A6E4B75B340674@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1299278226 9239 80.91.229.12 (4 Mar 2011 22:37:06 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 4 Mar 2011 22:37:06 +0000 (UTC) To: 8174@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 04 23:37:02 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 1PvdcL-0006Mh-08 for geb-bug-gnu-emacs@m.gmane.org; Fri, 04 Mar 2011 23:37:01 +0100 Original-Received: from localhost ([127.0.0.1]:52771 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PvdcK-0001pl-5R for geb-bug-gnu-emacs@m.gmane.org; Fri, 04 Mar 2011 17:37:00 -0500 Original-Received: from [140.186.70.92] (port=59461 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PvdcE-0001pg-1V for bug-gnu-emacs@gnu.org; Fri, 04 Mar 2011 17:36:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PvdcC-0002ei-RJ for bug-gnu-emacs@gnu.org; Fri, 04 Mar 2011 17:36:53 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54019) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PvdcC-0002ec-Lm for bug-gnu-emacs@gnu.org; Fri, 04 Mar 2011 17:36:52 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PvdJx-00082l-Re; Fri, 04 Mar 2011 17:18:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 04 Mar 2011 22:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 8174 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: Original-Received: via spool by submit@debbugs.gnu.org id=B.129927704930879 (code B ref -1); Fri, 04 Mar 2011 22:18:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 Mar 2011 22:17:29 +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 1PvdJQ-00081z-Mf for submit@debbugs.gnu.org; Fri, 04 Mar 2011 17:17:28 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PvdJO-00081n-HV for submit@debbugs.gnu.org; Fri, 04 Mar 2011 17:17:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PvdJI-00075s-8x for submit@debbugs.gnu.org; Fri, 04 Mar 2011 17:17:21 -0500 Original-Received: from lists.gnu.org ([199.232.76.165]:39657) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PvdJI-00075m-4c for submit@debbugs.gnu.org; Fri, 04 Mar 2011 17:17:20 -0500 Original-Received: from [140.186.70.92] (port=40780 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PvdJG-0005ER-U3 for bug-gnu-emacs@gnu.org; Fri, 04 Mar 2011 17:17:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PvdJF-00075V-HH for bug-gnu-emacs@gnu.org; Fri, 04 Mar 2011 17:17:18 -0500 Original-Received: from rcsinet10.oracle.com ([148.87.113.121]:36854) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PvdJF-00075L-Bf for bug-gnu-emacs@gnu.org; Fri, 04 Mar 2011 17:17:17 -0500 Original-Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id p24MHEAR029954 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 4 Mar 2011 22:17:16 GMT Original-Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id p24MAw1p017463 for ; Fri, 4 Mar 2011 22:17:13 GMT Original-Received: from abhmt013.oracle.com by acsmt354.oracle.com with ESMTP id 1110830181299276966; Fri, 04 Mar 2011 14:16:06 -0800 Original-Received: from dradamslap1 (/10.159.50.152) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 04 Mar 2011 14:16:05 -0800 X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcvaucGpW6txojTYSEuRWQfvN4ED7w== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 X-Source-IP: acsmt354.oracle.com [141.146.40.154] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090209.4D7164EA.0063,ss=1,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 04 Mar 2011 17:18:01 -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:44635 Archived-At: C-x C-f foo.txt Type this text (between the lines) into buffer foo.txt: -------------------------------- toto titi tata tutu tete (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'. Instead, the image is displayed at a different location: in place of the "ursi" in `save-excursion'. If you put the cursor at the beginning of the displayed image (just after the `c' of `save-excursion') and hit `C-u C-x =', you'll see something like this in *Help*, with the image appearing after `character: ' in *Help* (i.e. in place of `A'): character: A (65, #o101, #x41) preferred charset: ascii (ASCII (ISO646 IRV)) code point: 0x41 syntax: w which means: word category: .:Base, a:ASCII, l:Latin, r:Roman buffer code: #x41 file code: #x41 (encoded by coding system iso-latin-1-dos) display: by this font (glyph code) uniscribe:-outline-Courier New-normal-normal-normal-mono-13-*-*-*-c-*-iso8859-1 (#x24) Character code properties: customize what to show name: LATIN CAPITAL LETTER A general-category: Lu (Letter, Uppercase) There are text properties here: display [Show] fontified t rear-nonsticky (display) [back] If you click the `Show' button for property `display' then you see, correctly, the image spec for the thumbnail image - e.g., (image :type jpeg :file "c:/.emacs.d/image-dired/abc_33e34a7116fe5da6ff6a9103c8774f02.thumb.jpg") Similarly for each of the `A's that replaced `ursi'. IOW, each character `A' of the replacement has the proper `display' property. But the the image position is incorrect. The wrong text seems to have been replaced by `replace-match'. In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600) of 2011-02-28 on 3249CTO Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (4.4) --no-opt --cflags -Ic:/imagesupport/include'