From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: joakim@verona.se Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] xwidget updated (1d8b8a2 -> 5f46725) Date: Sun, 18 Jan 2015 00:08:24 +0100 Message-ID: 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> <83oapxz1yg.fsf@gnu.org> 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 1421536159 6279 80.91.229.3 (17 Jan 2015 23:09:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 17 Jan 2015 23:09:19 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 18 00:09:19 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 1YCcUY-0003Sh-F3 for ged-emacs-devel@m.gmane.org; Sun, 18 Jan 2015 00:09:18 +0100 Original-Received: from localhost ([::1]:60474 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCcUW-0005si-Q4 for ged-emacs-devel@m.gmane.org; Sat, 17 Jan 2015 18:09:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCcUJ-0005sd-Om for emacs-devel@gnu.org; Sat, 17 Jan 2015 18:09:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YCcUE-0002oM-8p for emacs-devel@gnu.org; Sat, 17 Jan 2015 18:09:03 -0500 Original-Received: from mx1.bahnhof.se ([213.80.101.11]:43806) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCcU8-0002nx-7d; Sat, 17 Jan 2015 18:08:52 -0500 Original-Received: from localhost (mf.bahnhof.se [213.80.101.20]) by mx1-reinject (Postfix) with ESMTP id EF3D740BE2; Sun, 18 Jan 2015 00:08:49 +0100 (CET) X-Virus-Scanned: by amavisd-new using ClamAV at bahnhof.se (MF1) Original-Received: from mf1.bahnhof.se ([127.0.0.1]) by localhost (mf1.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id O4z62LlJay-V; Sun, 18 Jan 2015 00:08:45 +0100 (CET) Original-Received: from mta.verona.se (h-235-62.a149.priv.bahnhof.se [85.24.235.62]) by mf1.bahnhof.se (Postfix) with ESMTP id 3DE03330AE1; Sun, 18 Jan 2015 00:08:44 +0100 (CET) Original-Received: from localhost (unknown [127.0.0.1]) by mta.verona.se (Postfix) with ESMTP id 93275529CD1; Sat, 17 Jan 2015 23:08:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at verona.se Original-Received: from mta.verona.se ([127.0.0.1]) by localhost (exodia.verona.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JugHoWF5Qpeg; Sun, 18 Jan 2015 00:08:25 +0100 (CET) Original-Received: from exodia.verona.se (www.verona.se [192.168.200.15]) by mta.verona.se (Postfix) with ESMTP id E8E13529CCE; Sun, 18 Jan 2015 00:08:24 +0100 (CET) In-Reply-To: <83oapxz1yg.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 17 Jan 2015 20:39:19 +0200") User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 213.80.101.11 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:181389 Archived-At: Eli Zaretskii writes: >> 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 affect >> > images and xwidgets etc. >> >=20 >> > - my xwidget code is so flawed that it affects the image code where 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 to > 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. Ok, this patch works, so I consider bidi done for xwidgets now. Thanks! > > 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 formatt= ing (defaults > enum glyph_row_area area =3D it->area; >=20=20 > glyph =3D it->glyph_row->glyphs[area] + it->glyph_row->used[area]; > + if (it->glyph_row->reversed_p) > + { > + struct glyph *g; > + > + /* Make room for the new glyph. */ > + for (g =3D glyph - 1; g >=3D it->glyph_row->glyphs[it->area]; g--) > + g[1] =3D *g; > + glyph =3D it->glyph_row->glyphs[it->area]; > + } > if (glyph < it->glyph_row->glyphs[area + 1]) > { > 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/emacs/t= runk/etc/images/bookmark_add.xpm")) > > (put-text-property 23 24 'display '(image :type xpm :file "/path/to/emacs= /trunk/etc/images/refresh.xpm")) > > (put-text-property 37 38 'display '(image :type xpm :file "/path/to/emacs= /trunk/etc/images/data-save.xpm")) > > (put-text-property 54 55 'display '(image :type xpm :file "/path/to/emacs= /trunk/etc/images/data-save.xpm")) --=20 Joakim Verona