emacs-bidi
[Top][All Lists]
Advanced

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

Re: [emacs-bidi] adding LRM in visual-to-logical transform


From: Eli Zaretskii
Subject: Re: [emacs-bidi] adding LRM in visual-to-logical transform
Date: Sun, 18 Nov 2001 18:38:42 +0200

> From: Alex Schroeder <address@hidden>
> Date: Sun, 18 Nov 2001 15:08:31 +0100
> 
> "Eli Zaretskii" <address@hidden> writes:
> 
> > The current plan calls for ignoring non-displayed characters (such as
> > formatting codes) as part of the search algorithm in search.c.  Since
> > you type the search string in logical order and the buffer is in
> > logical order, there's no need for any bidi conversions for the
> > search
> 
> This assumes that there is only logical representation for a given
> string visible to the user.  You didn't mention anything like that
> until now, however.  Will there be such a canonicalization?  If not,
> then the user might see something in the window, and search for it
> with a string that *looks* the same -- but differs in logical
> representation, and thus Emacs will not find it.

I think there's some kind of misunderstanding; perhaps you could give
an example of the case you had in mind (logical buffer contents, its
visual appearance, and the search string typed by the user).

In general, the logical order is the order in which text is typed and
read.  Since the buffer text is stored in the logical order, and the
user--by definition--types the search string in logical order as
well, we can ignore the bidi aspects of the text when we search.

For example, imagine a buffer text like this:

    abcdABCDxyz

which displayed (in a left-to-right paragraph) like this:

    abcdDCBAxyz

If the user wants to search for a part of text indicated below:

    abcdDCBAxyz
        <----->

she will type "C-s ABCDxyz", because that's the order the text is
read.  The search string will be displayed in the echo area as

    I-search: DCBAxyz

but you can see that "ABCDxyz" is exactly how the text is stored in
the buffer, so Emacs doesn't need to consider the bidi aspects when
it searches for the string.

The only exception from this rule are the characters that are not
displayed, like RLE, PDF, etc.  That's why I said that the search
algorithm needs to ignore them.

(Actually, I left out a few more bidi-related aspects, like the
paragraph direction which determines whether the search string is
displayed as a left-to-right or right-to-left paragraph.  So it's not
very accurate to say that search can *ignore* the bidi aspects.)

Did you perhaps assume that a user would like to type "C-s DCBAxyz"?

If not, what other logical representation could there be which looks
the same on the screen, after we ignore the formatting codes?



reply via email to

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