[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [emacs-bidi] Bidirectional editing in Emacs -- main design decisions
From: |
Eli Zaretskii |
Subject: |
Re: [emacs-bidi] Bidirectional editing in Emacs -- main design decisions |
Date: |
Wed, 18 May 2016 21:07:05 +0300 |
> Date: Wed, 18 May 2016 05:29:21 -0700 (MST)
> From: mhsekhavat <address@hidden>
>
> Eli Zaretskii wrote
> > If Emacs would follow UAX#9 to the letter, each line could have different
> > base direction,
> > which is, of course, intolerable. We could avoid this nonsense by
> > using the "soft newline" or similar features, but I firmly believe
> > that Emacs should DTRT with bidirectional text even in the simplest
> > modes, including the Fundamental mode, where every newline is hard.
> >
> > Fortunately, UAX#9 acknowledges that applications could have other
> > ideas about what is a "paragraph". It calls this ``higher
> > protocol''. So I decided to use such a higher protocol -- namely,
> > the Emacs definition of a paragraph, as determined by the
> > `paragraph-start' and `paragraph-separate' regexps. Therefore, the
> > first strong directional character after `paragraph-start' or
> > `paragraph-separate' determines the paragraph direction, and that
> > direction is kept for all the lines of the paragraph, until another
> > `paragraph-separate' is found. (Of course, this means that
> > inserting a single character near the beginning of a paragraph
> > might affect the display of all the lines in that paragraph, so
> > some of the current redisplay optimizations which deal with changes
> > to a single line need to be disabled in this case.)
>
> I agree that most of the time, having different base direction for each line
> is nonsense. But there are cases where the text does not have "paragraph"s,
> but consists of a number of sentences, each in a line. So an empty line does
> not semantically mean paragraph separator and a right-to-left line appears
> just after a left-to-right line.
Emacs doesn't support such "paragraphs".
> How can I set variables `paragraph-start` and `paragraph-separate` so that
> each line have different direction? I tried setting `paragraph-start` to "."
> and `paragraph-separate` to "$" but didn't work?
You can't, sorry. The values are hard-coded, and don't follow the
buffer-local values (I tried doing that once, but ended up with
unusable Emacs in modes that change these variables too much).
What is the real-life use case that requires this? What kind of text
are we talking about?