From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] xwidget updated (1d8b8a2 -> 5f46725) Date: Sat, 17 Jan 2015 20:39:19 +0200 Message-ID: <83oapxz1yg.fsf@gnu.org> References: <20141226164113.11620.38682@vcs.savannah.gnu.org> <831tnjlpts.fsf@gnu.org> <83k31ajvdz.fsf@gnu.org> <83wq4v4rr9.fsf@gnu.org> <838uh21ly4.fsf@gnu.org> <83wq4lzp3j.fsf@gnu.org> <83r3utz3l4.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: ger.gmane.org 1421519997 27052 80.91.229.3 (17 Jan 2015 18:39:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 17 Jan 2015 18:39:57 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: joakim@verona.se Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 17 19:39:52 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YCYHl-00013U-3e for ged-emacs-devel@m.gmane.org; Sat, 17 Jan 2015 19:39:49 +0100 Original-Received: from localhost ([::1]:60000 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCYHk-00062W-AZ for ged-emacs-devel@m.gmane.org; Sat, 17 Jan 2015 13:39:48 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40049) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCYHX-00061P-HH for emacs-devel@gnu.org; Sat, 17 Jan 2015 13:39:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YCYHR-0006dh-Uo for emacs-devel@gnu.org; Sat, 17 Jan 2015 13:39:35 -0500 Original-Received: from mtaout24.012.net.il ([80.179.55.180]:34459) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCYHR-0006dJ-Ho for emacs-devel@gnu.org; Sat, 17 Jan 2015 13:39:29 -0500 Original-Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0NIC00K003E6Q000@mtaout24.012.net.il> for emacs-devel@gnu.org; Sat, 17 Jan 2015 20:31:23 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NIC00J1F3GB7K30@mtaout24.012.net.il>; Sat, 17 Jan 2015 20:31:23 +0200 (IST) In-reply-to: <83r3utz3l4.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.180 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:181380 Archived-At: > Date: Sat, 17 Jan 2015 20:04:07 +0200 > From: Eli Zaretskii > Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org >=20 > > From: joakim@verona.se > > Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org > > Date: Sat, 17 Jan 2015 18:40:48 +0100 > >=20 > > Now I tried the same test, but with an image. It behaves the same= way! >=20 > Hmm... yes, I see that, too. >=20 > > So this would seem to indicate a number of possibilities: > >=20 > > - My test is somewhow flawed. Perhaps (set (make-local-variable > > 'bidi-paragraph-direction) 'right-to-left) isnt supposed to aff= ect > > images and xwidgets etc. > >=20 > > - my xwidget code is so flawed that it affects the image code whe= re it > > shouldnt. (the code paths are supposed to be separate though) > >=20 > > - this is how its supposed to work, and everything is allright. >=20 > No, it's a bug, and I will fix it. OK, fixed on the emacs-24 branch with the attached patch. You need t= o do something similar with xwidget glyphs. I also attach a test file. Visit the file, modify the file names of the icons to point to your repository, then eval-region on the 4 put-text-property lines. You should see the images in the middle of the text, both in L2R and R2L lines. You can use this as a starting point for doing the same with xwidgets. Here's the patch: diff --git a/src/xdisp.c b/src/xdisp.c index a1cc286..b1125d3 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -25428,6 +25428,15 @@ and buffer to use as the context for the for= matting (defaults enum glyph_row_area area =3D it->area; =20 glyph =3D it->glyph_row->glyphs[area] + it->glyph_row->used[ar= ea]; + if (it->glyph_row->reversed_p) +=09{ +=09 struct glyph *g; + +=09 /* Make room for the new glyph. */ +=09 for (g =3D glyph - 1; g >=3D it->glyph_row->glyphs[it->area]; g= --) +=09 g[1] =3D *g; +=09 glyph =3D it->glyph_row->glyphs[it->area]; +=09} if (glyph < it->glyph_row->glyphs[area + 1]) =09{ =09 glyph->charpos =3D CHARPOS (it->position); And here's the test file: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D cut here =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D aaaaa bbbbbb aaaaa xxxxxx aaaaa yyyyyyyyy =D7=90=D7=90=D7=90=D7=90=D7=90 =D7=91=D7=91=D7=91=D7=91=D7=91 (put-text-property 8 9 'display '(image :type xpm :file "/path/to/ema= cs/trunk/etc/images/bookmark_add.xpm")) (put-text-property 23 24 'display '(image :type xpm :file "/path/to/e= macs/trunk/etc/images/refresh.xpm")) (put-text-property 37 38 'display '(image :type xpm :file "/path/to/e= macs/trunk/etc/images/data-save.xpm")) (put-text-property 54 55 'display '(image :type xpm :file "/path/to/e= macs/trunk/etc/images/data-save.xpm"))