From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Uwe Brauer Newsgroups: gmane.emacs.devel Subject: Re: BIDI, LaTeX (auctex) and the =?utf-8?B?wqtldmlswrs=?= backslash Date: Sat, 21 May 2016 17:44:32 +0000 Message-ID: <87y4732tmn.fsf@mat.ucm.es> References: <874m9r4it5.fsf@mat.ucm.es> <83iny771sf.fsf@gnu.org> Reply-To: Uwe Brauer 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 1463852696 28444 80.91.229.3 (21 May 2016 17:44:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 May 2016 17:44:56 +0000 (UTC) Cc: Uwe Brauer , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 21 19:44:49 2016 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 1b4AxE-0004Bf-TV for ged-emacs-devel@m.gmane.org; Sat, 21 May 2016 19:44:49 +0200 Original-Received: from localhost ([::1]:40851 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4AxD-000170-Rt for ged-emacs-devel@m.gmane.org; Sat, 21 May 2016 13:44:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4Ax8-00015k-3y for emacs-devel@gnu.org; Sat, 21 May 2016 13:44:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b4Ax4-00087G-EK for emacs-devel@gnu.org; Sat, 21 May 2016 13:44:41 -0400 Original-Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:38545) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4Ax3-00086v-Hs for emacs-devel@gnu.org; Sat, 21 May 2016 13:44:38 -0400 Original-Received: by mail-wm0-x235.google.com with SMTP id n129so22626193wmn.1 for ; Sat, 21 May 2016 10:44:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mat.ucm.es; s=google; h=from:to:cc:subject:references:reply-to:date:message-id:user-agent :mime-version:content-transfer-encoding; bh=EDQP3PZbtz9iceW6cQF7ArXNIuEqamiy/gCmZdqwN80=; b=CqfnZrz0YeEbPEIEx2JdJdbRYaSQaeokEi2+6dXkmRoTneR6sqWA5i5nhCRP/S4ptx zicvBARYJIAOP+bpCq9nA8DRre+zOR1/Fe3WcomJPwZ+BI69bV5rT3GAPIXTWSwfPn2Q aboq8vufWcGWM9azV+ygR42yZsKzBdEusmNGY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:reply-to:date :message-id:user-agent:mime-version:content-transfer-encoding; bh=EDQP3PZbtz9iceW6cQF7ArXNIuEqamiy/gCmZdqwN80=; b=bT8epFnCYn8fRtPPV7D5NNafr3SEndH41ssXj6i1Hm7RMvrTiIutDP9FlKxcpwAVaO an4P36uO/+AxAsbWtoS34n6vzY7fWhtviJlBH/UgiEyrN/oswmxBNpI7UgGblG+QNnnt O5iO3Z6HGd7lAld8whGm2dXpyphYcDL/nCn1vbUONLUZHCozxGy9GIf3Fk1O0n0CqN+Y gY97GuyrZLKfDnTWVnrwhiDt4QGGo5bpbd/Nrb5InvlmdO9d8fOvJ0vuS4lpjO+YSPXN mwHVE84A47OUkV8REcHXHNv9alzijKkEISets0/1LSvTp7ib13bcPB3DCQTQXOoHQO5v YKBw== X-Gm-Message-State: AOPr4FUhlZcpUy8fw4KDVgMy1ABeEr+rUaCesBhX6fZIEZpH/gYMsQNI/n6rzfqjWn2DYLrC X-Received: by 10.194.139.104 with SMTP id qx8mr8532290wjb.14.1463852676080; Sat, 21 May 2016 10:44:36 -0700 (PDT) Original-Received: from Burrurr (84.red-79-153-137.dynamicip.rima-tde.net. [79.153.137.84]) by smtp.gmail.com with ESMTPSA id m14sm4356208wmc.4.2016.05.21.10.44.34 (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 21 May 2016 10:44:34 -0700 (PDT) X-Mailer: emacs 25.1.50.1 (via feedmail 11-beta-1 I) X-Hashcash: 1:20:160521:oub@mat.ucm.es::cOVeCCoTUjEWHLQd:000005N X-Hashcash: 1:20:160521:eliz@gnu.org::Pt2zSe04iQPMOz1x:000000BdN X-Hashcash: 1:20:160521:emacs-devel@gnu.org::TACEscxzo8MjPxfg:0000000000000000000000000000000000000000006Vek User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::235 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:203930 Archived-At: >>> "Eli" =3D=3D Eli Zaretskii writes: >> From: Uwe Brauer >> Date: Sat, 21 May 2016 13:55:18 +0000 >> Cc: auctex-devel >>=20 >> In my understanding UTF distinguish between > What is "UTF" in this context? My bad I mean Unicode. >> - LTR chars such as a,b,c >>=20 >> - RLT chars such as =D7=90,=D7=91,=D7=92 >>=20 >> - =C2=ABneutral=C2=BB chars such as (),\ etc. > You should read the description of UBA, the Unicode Bidirectional > Algorithm (which Emacs implements). There you will see that there are > actually 4 classes of characters: > . string (LTR and RTL) > . weak (numbers, number separators, diacriticals) > . neutral (punctuation and whitespace) > . formatting control characters (RLM etc.) > So: > (get-char-code-property ?\\ 'bidi-class) =3D> ON > ("ON" stands for "other neutral", see the node "Character Properties" > in the ELisp manual.) >> - set bidi-paragraph-direction to left (shown in the next >> screenshot.) The display is correct, however typing Hebrew, when >> bidi-paragraph-direction is set to left is as unpleasant as >> writing English with bidi-paragraph-direction set to right. >>=20 >> - use LRM chars before the backslash (see the last screenshot; >> having set `glyphless-char-display-control' to `acronym'. >> This looks well to but adding these chars is cumbersome. >>=20 >> - hack auctex (CC to the auctex list): a new variable is >> introduced, say bidi-support, which is per default nil, but if it >> is t, then LRM chars are inserted before a backslash. I am >> pretty sure the auctex team will not like this idea very much. >>=20 >> - back emacs: in a LaTeX buffer, backslash is considered as LTR, I >> don't know whether this can be done one the lisp level or whether >> it can be done at all. >>=20 >> Comments? > The last one is possible, of course (this is Emacs), but that way lies > madness: arbitrarily changing bidirectional properties of characters > will bite you elsewhere, because the corresponding tables are global. So that cannot be restricted just to LaTeX mayor modes? In any case how could I change the backslash on a lisp level, ie change (get-char-code-property ?\\ 'bidi-class) >From ON to whatever is necessary. I just would like to check and see what happens > The other 3 alternatives are indeed the available solutions. > Personally, I recommend the 1st one; I see no problem with typing > RTL text in a left-to-right paragraph (and vice versa), and don't > understand what unpleasant things you bump into when doing that. > TeX files are fundamentally left-to-right, as any program text, so > that would be my suggestion. Well I don't like the cursor movements in such a situation and that is why for the moment I use the LRM chars, which don't cause any problem at least not using unicode and xelatex. Again thanks for all your efforts for providing BIDI support.