all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Uwe Brauer <oub@mat.ucm.es>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Uwe Brauer <oub@mat.ucm.es>, emacs-devel@gnu.org
Subject: Re: BIDI, LaTeX (auctex) and the «evil» backslash
Date: Sat, 21 May 2016 17:44:32 +0000	[thread overview]
Message-ID: <87y4732tmn.fsf@mat.ucm.es> (raw)
In-Reply-To: 83iny771sf.fsf@gnu.org

>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:

   >> From: Uwe Brauer <oub@mat.ucm.es>
   >> Date: Sat, 21 May 2016 13:55:18 +0000
   >> Cc: auctex-devel <auctex-devel@gnu.org>
   >> 
   >> In my understanding UTF distinguish between

   > What is "UTF" in this context?

My bad I mean Unicode.

   >> -  LTR chars such as a,b,c
   >> 
   >> -  RLT chars such as א,ב,ג
   >> 
   >> -  «neutral» 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) => 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.
   >> 
   >> -  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.
   >> 
   >> -  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.
   >> 
   >> -  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.
   >> 
   >> 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.



  parent reply	other threads:[~2016-05-21 17:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-21 13:55 BIDI, LaTeX (auctex) and the «evil» backslash Uwe Brauer
2016-05-21 17:34 ` Eli Zaretskii
2016-05-21 17:37   ` Eli Zaretskii
2016-05-21 17:44   ` Uwe Brauer [this message]
2016-05-21 18:34     ` Eli Zaretskii
2016-05-21 20:20       ` Uwe Brauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y4732tmn.fsf@mat.ucm.es \
    --to=oub@mat.ucm.es \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.