From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Filipe Moreira Newsgroups: gmane.emacs.bugs Subject: bug#22429: Force character to be recognized as LTR inside RTL paragraph Date: Fri, 22 Jan 2016 15:15:51 +0000 Message-ID: References: <56a13f4844c61b5100000006@polymail.io> <83mvry6nq1.fsf@gnu.org> <83a8nx7ly4.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11470ed235f96a0529edb40d X-Trace: ger.gmane.org 1453475844 15785 80.91.229.3 (22 Jan 2016 15:17:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 22 Jan 2016 15:17:24 +0000 (UTC) Cc: 22429@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 22 16:17:16 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1aMdSc-0003E3-PH for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 Jan 2016 16:17:15 +0100 Original-Received: from localhost ([::1]:54311 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMdSb-0002Ao-Hu for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 Jan 2016 10:17:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43273) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMdSU-0002A6-Sj for bug-gnu-emacs@gnu.org; Fri, 22 Jan 2016 10:17:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMdSQ-0008A7-Mi for bug-gnu-emacs@gnu.org; Fri, 22 Jan 2016 10:17:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41535) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMdSQ-0008A3-Je for bug-gnu-emacs@gnu.org; Fri, 22 Jan 2016 10:17:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aMdSQ-0005Ba-B8 for bug-gnu-emacs@gnu.org; Fri, 22 Jan 2016 10:17:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Filipe Moreira Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 22 Jan 2016 15:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22429 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22429-submit@debbugs.gnu.org id=B22429.145347580619910 (code B ref 22429); Fri, 22 Jan 2016 15:17:02 +0000 Original-Received: (at 22429) by debbugs.gnu.org; 22 Jan 2016 15:16:46 +0000 Original-Received: from localhost ([127.0.0.1]:57988 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMdS6-0005B0-8b for submit@debbugs.gnu.org; Fri, 22 Jan 2016 10:16:46 -0500 Original-Received: from mail-qk0-f177.google.com ([209.85.220.177]:34682) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMdS0-0005Aj-K7 for 22429@debbugs.gnu.org; Fri, 22 Jan 2016 10:16:40 -0500 Original-Received: by mail-qk0-f177.google.com with SMTP id x1so29720801qkc.1 for <22429@debbugs.gnu.org>; Fri, 22 Jan 2016 07:16:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=LS1m+H7VTGIfd9xgL0qawcjkuSpDTd/uoUH7femgMUc=; b=R47ki8w7LKs7lVfbatG2IVhluFJcfBeOrOE5Et3LvJ5LdKfcXpUjYbj3Zn/j5/mLO0 B9gspDO76M1DawA1UBSA6UDmQO2esRqbvpjeuLfz6/oy4FEpF0kE4lsbcX4xtlepRDpG F4EQdTiWslTlNLQ8f/DSsNZQNwWLFUOOPiAweZZpU0cEU97wHV4ugMaOqAnaY/ejve2X XbOhVUXvgqIpnY5C/CaXIIL4s6SjF02aM2XuhYQFhpsR4USF/NW6CYrdy2ydhyc6X5oE 3zKXeNFLgFIuvW9R5gVItVTJbUNcL8pcFK88eVfSmDKBIIC+2JQXYwM9qBhe+9xeHw2l ZZHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=LS1m+H7VTGIfd9xgL0qawcjkuSpDTd/uoUH7femgMUc=; b=Nob8GWK49m4Gv3gbQ85fnANLY1wd3nUe+0Xacb7W4y9VmV4CEUHjZerbDLMIou6i4R 0JJ6UKE7Dd+Q9L+koaDwkixkmnoQpZlCKSS4gRpAzp3o414xRF7cHrsmkuvnFFisq9K0 nZbMz5p688n+ns4pqsLuRZ72ksts96XKi940g2f0edrwEDaCLYzEqUIgathWgCmVRt5o o9JwoxzlNY4V00X+g6loGHKSQyMuwkL2FnpfruoDJDD67aZSpFsiq6cjGaU/b2defduZ wgSugWFhJWgUWP1On9gAY01prPopHm1FN6jIvg3cKwJZcU9eVc6nVc9OZznpI976Cg6j 3f7A== X-Gm-Message-State: AG10YOT3JcGbJw4fgDv258+Z3nrYaAbxMjTzbHfnFFRyJPmwn4OZ0Tp9BFE7pckQeXA73BVDa1EPw79g7LVEnw== X-Received: by 10.55.53.208 with SMTP id c199mr4311743qka.109.1453475790975; Fri, 22 Jan 2016 07:16:30 -0800 (PST) Original-Received: by 10.55.135.199 with HTTP; Fri, 22 Jan 2016 07:15:51 -0800 (PST) In-Reply-To: <83a8nx7ly4.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:111857 Archived-At: --001a11470ed235f96a0529edb40d Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, Jan 22, 2016 at 2:01 PM, Eli Zaretskii wrote: > > From: Filipe Moreira > > Date: Fri, 22 Jan 2016 11:54:45 +0000 > > Cc: 22429@debbugs.gnu.org > > > > Emacs being Emacs, you can programmatically change the bidirectiona= l > > class of every character, but that change has global effect: it wil= l > > affect the directionality of that character everywhere in the Emacs > > session. So this is not recommended. > > > > Also this is not recommended, I would be willing to have the bidi class > > property of some characters set to left-to-right, like the example of > the slash > > character. > > Can you tell why? There are ways to produce the display you expect > without changing the character properties; I described 3 such ways. > If you change the properties, the text will only display correctly on > your system, any other user who displays your text, either in Emacs or > in other editor that supports bidirectional display, will see the text > in the same jumbled order you wanted to avoid. So I see very little > sense in such changes. > > > Can you point somewhere regarding this? I saw the > > get-char-code-property function but could not find anyway to > > actually change the setting. > > You want put-char-code-property. Again, I very much recommend not to > do that. > > > \begin{hebrew} > > \pstart > > > > =D7=91=D6=BC=D6=B0=D7=A8=D6=B5=D7=90=D7=A9=D7=81=D6=B4=D6=96=D7=99= =D7=AA=E2=80=AA\footnoteA{This is a Hebrew related footnote}=E2=80=AC =D7= =91=D6=BC=D6=B8=D7=A8=D6=B8=D6=A3=D7=90 > =D7=90=D6=B1=D7=9C=D6=B9=D7=94=D6=B4=D6=91=D7=99=D7=9D =D7=90=D6=B5=D6=A5= =D7=AA =D7=94=D6=B7=D7=A9=D6=BC=D7=81=D6=B8=D7=9E=D6=B7=D6=96=D7=99=D6=B4= =D7=9D =D7=95=D6=B0=D7=90=D6=B5=D6=A5=D7=AA > > =D7=94=D6=B8=D7=90=D6=B8=D6=BD=D7=A8=D6=B6=D7=A5=D7=83 > > > > \pend > > \end{hebrew} > > > > > > In this example the direction of the surrounding Hebrew text has been > changed. > > The word =D7=91=D6=BC=D6=B0=D7=A8=D6=B5=D7=90=D7=A9=D7=81=D6=B4=D6=96= =D7=99=D7=AA should come before (i.e. on the right) of the word > =D7=91=D6=BC=D6=B8=D7=A8=D6=B8=D6=A3=D7=90. So > > while the footnote command is correctly shown as LTR the Hebrew text ha= s > been > > changed. I don't think is is the expected. See the updated image > > ( > http://emacs.stackexchange.com/questions/19696/handling-left-to-right-ins= ide-right-to-left-paragraphs-using-emacs-and-auctex > ) > > that shows TextEdit correct handling of this. > > What version of Emacs do you have? The above renders correctly for > me, both in Emacs 24.5 and in the development version. The word > =D7=91=D6=BC=D6=B0=D7=A8=D6=B5=D7=90=D7=A9=D7=81=D6=B4=D6=96=D7=99=D7=AA = is shown to the right of the footnote, and all the rest is > shown to the left of it. Maybe you have an older Emacs which somehow > has a bug? > I have just tested wrapping the footnote command within LTM (on both ends) in a clean Emacs 24.5.1 (started with -Q) and it worked! This wasn't working on my normal environment so I will need to investigate why that is. > > > Is there any change of having a way to set the unicode bidirectionally > of a > > character within each separate mode? Could this be considered a feature= ? > > I think it would be a misfeature, for the reasons explained above. > It's the same as using a private font to display some character in a > different shape -- you are the only one who will enjoy that shape. > > However, nothing prevents a mode from using put-char-code-property in > some ingenious ways to do what you want. > I appreciate your help. This is all new to me and I've already learned a lot from you and others regarding this. Thank you for making Emacs so great. --001a11470ed235f96a0529edb40d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Fri, Jan 22, = 2016 at 2:01 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> From: Filipe Moreira <famoreira@gmail.com>
> Date: Fri, 22 Jan 2016 11:54:45 +0000
> Cc: 22429@debbugs.gnu.org=
>
>=C2=A0 =C2=A0 =C2=A0Emacs being Emacs, you can programmatically change = the bidirectional
>=C2=A0 =C2=A0 =C2=A0class of every character, but that change has globa= l effect: it will
>=C2=A0 =C2=A0 =C2=A0affect the directionality of that character everywh= ere in the Emacs
>=C2=A0 =C2=A0 =C2=A0session. So this is not recommended.
>
> Also this is not recommended, I would be willing to have the bidi clas= s
> property of some characters set to left-to-right, like the example of = the slash
> character.

Can you tell why?=C2=A0 There are ways to produce the display you ex= pect
without changing the character properties; I described 3 such ways.
If you change the properties, the text will only display correctly on
your system, any other user who displays your text, either in Emacs or
in other editor that supports bidirectional display, will see the text
in the same jumbled order you wanted to avoid.=C2=A0 So I see very little sense in such changes.

> Can you point somewhere regarding this? I saw the
> get-char-code-property function but could not find anyway to
> actually change the setting.

You want put-char-code-property.=C2=A0 Again, I very much recommend = not to
do that.

>=C2=A0 =C2=A0 =C2=A0\begin{hebrew}
>=C2=A0 =C2=A0 =C2=A0\pstart
>
>=C2=A0 =C2=A0 =C2=A0=D7=91=D6=BC=D6=B0=D7=A8=D6=B5=D7=90=D7=A9=D7=81=D6= =B4=D6=96=D7=99=D7=AA=E2=80=AA\footnoteA{This is a Hebrew related footnote}= =E2=80=AC =D7=91=D6=BC=D6=B8=D7=A8=D6=B8=D6=A3=D7=90 =D7=90=D6=B1=D7=9C=D6= =B9=D7=94=D6=B4=D6=91=D7=99=D7=9D =D7=90=D6=B5=D6=A5=D7=AA =D7=94=D6=B7=D7= =A9=D6=BC=D7=81=D6=B8=D7=9E=D6=B7=D6=96=D7=99=D6=B4=D7=9D =D7=95=D6=B0=D7= =90=D6=B5=D6=A5=D7=AA
>=C2=A0 =C2=A0 =C2=A0=D7=94=D6=B8=D7=90=D6=B8=D6=BD=D7=A8=D6=B6=D7=A5=D7= =83
>
>=C2=A0 =C2=A0 =C2=A0\pend
>=C2=A0 =C2=A0 =C2=A0\end{hebrew}
>
>
> In this example the direction of the surrounding Hebrew text has been = changed.
> The word =D7=91=D6=BC=D6=B0=D7=A8=D6=B5=D7=90=D7=A9=D7=81=D6=B4=D6=96= =D7=99=D7=AA should come before (i.e. on the right) of the word =D7=91=D6= =BC=D6=B8=D7=A8=D6=B8=D6=A3=D7=90. So
> while the footnote command is correctly shown as LTR the Hebrew text h= as been
> changed. I don't think is is the expected. See the updated image > (http://emacs.stackexchange.com/questions/1969= 6/handling-left-to-right-inside-right-to-left-paragraphs-using-emacs-and-au= ctex)
> that shows TextEdit correct handling of this.

What version of Emacs do you have?=C2=A0 The above renders correctly= for
me, both in Emacs 24.5 and in the development version.=C2=A0 The word
=D7=91=D6=BC=D6=B0=D7=A8=D6=B5=D7=90=D7=A9=D7=81=D6=B4=D6=96=D7=99=D7=AA is= shown to the right of the footnote, and all the rest is
shown to the left of it.=C2=A0 Maybe you have an older Emacs which somehow<= br> has a bug?

I have just tested wrapping = the footnote command within LTM (on both ends) in a clean Emacs 24.5.1 (sta= rted with -Q) and it worked! This wasn't working on my normal environme= nt so I will need to investigate why that is.=C2=A0
=C2=A0
<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex">
> Is there any change of having a way to set the unicode bidirectionally= of a
> character within each separate mode? Could this be considered a featur= e?

I think it would be a misfeature, for the reasons explained above. It's the same as using a private font to display some character in a different shape -- you are the only one who will enjoy that shape.

However, nothing prevents a mode from using put-char-code-property in
some ingenious ways to do what you want.

I appreciate your help. This is all new to me and I've already learne= d a lot from you and others regarding this. Thank you for making Emacs so g= reat.=C2=A0

--001a11470ed235f96a0529edb40d--