emacs-bidi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [emacs-bidi] Suboptimal display-reordering in minibuffer


From: Larry Denenberg
Subject: Re: [emacs-bidi] Suboptimal display-reordering in minibuffer
Date: Sat, 26 Jun 2010 15:17:01 -0400

>> Suppose . . . I type a Hebrew control character, say control-bet,
>> which has no command binding.  I quite properly get the message
>> "control-bet is undefined" in the minibuffer.  But because it starts
>> with a Hebrew character, it gets shoved against the right margin,
>> which is wrong.
>
>Why is it wrong?

I suppose I should be hesitant since I've been quite properly rebuked
for insufficiently reflective use of the words "quite properly" in
another thread, but I'll take a shot anyway:  It's wrong because this is
an LTR sentence that happens to start with an RTL character, so the bidi
code comes to the wrong conclusion about directionality.  If the message
were instead "Key control-bet is undefined" we'd agree that it's LTR
with a single inserted RTL, right?  Just because the RTL character is at
the beginning of the sentence doesn't make the sentence RTL.

Aren't problems like this the entire raison d'etre of the invisible RLM
and LRM characters?


>> Since system minibuffer are always in English, maybe the minibuffer
>> should never be in display reorder mode.
>
>What do you mean by ``minibuffer are always in English''?  The
>language and the paragraph direction are not necessarily related.

More precisely, I meant "the messages displayed by the minibuffer were
written in English with intended left-to-right logic; RTL characters in
these messages are implicitly quoted, carrying no semantic meaning".
Are there examples of minibuffer messages that we agree should be RTL?


>I think this is because the minibuffer and the echo area are not the
>same thing.  They just use the same portion of the Emacs display.

Absolutely correct.  Learn something new every day.


>Does it work to set bidi-display-reordering in two buffers named
>" *Echo Area 0*" and " *Echo Area 1*"?

Absolutely correct again!  So now I can have it if I really want it.


>> Another way to handle the case of an English paragraph that starts with
>> a Hebrew character is to insert an LRM.  In this case that would need to
>> be done by the code that finds character bindings.  I think that code
>> should indeed be sensitive to the fact that the unbound character it's
>> about to echo might set display direction.
>
>The main point here is deciding whether echo area messages should be
>displayed with left-to-right paragraph direction forced on the display
>engine.  Are we sure this is the case?  Cannot there be echo area
>messages that we want to display with the right-to-left direction?

Maybe.  I ask again, do we have an example?  What I'm saying here is
that certain parts of Emacs should be more careful in the face of bidi.
When Emacs wants to write "X is undefined" in the echo area with X
variable, maybe it should carefully put an LRM before the X because of
new potential side effects.  This is something like a web programmer
being super cautious about sanitizing values that users type in.
cf. http://xkcd.com/327/


>> Finally, an even more subtle (and unimportant) issue:  The actual
>> message I see looks like this: "is undefined ^ב”.  But I would have
>> expected "is undefined ב^”, no?  Shouldn't control-bet be written with
>> the uparrow on the right when in RTL mode?
>
>I don't know which one is the correct one.  Do we have any "prior art"
>in that some other applications display Ctrl-modified Hebrew
>characters?

Beats me.  I just learned on the other thread that Windows may not even
admit the existence of such characters.  I don't seem to be able to
insert them into a buffer.  Probably they don't have Unicode codepoints.
Maybe they don't make sense at all.  I will think about this further.

If there is such a thing as control-bet, then I think it should be
displayed as "ב^" in RTL text, and as "^ב" in LTR text.


>P.S. Thanks for starting these discussions.  Sometimes I think that no
>one is using the bidi features, which makes me wonder why I worked on
>them so hard.

You worked on them for the joy of solving the problem, I hope.  If you
think lots of people will be using them, I'm afraid you'll be sadly
disappointed.

I started using Emacs around 30 years ago, after grudgingly converting
from vi, which I grudgingly converted to from TECO.  I still read mail
and write in Emacs---it's what I know.  But I get mail in Hebrew and I
can't read it, nor answer without other tools.  I've been waiting for
emacs bidi for years.  I check around every few months, and only a
couple weeks ago that I saw that my wishes were finally fulfilled.  It's
now a joy to read and answer mail.  I'm very very grateful.

But I'm a dinosaur.  Are there really any new emacs users these days?
I'd be very, very surprised.

/Larry Denenberg
address@hidden
http://larry.denenberg.com/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]