[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bidi-display-reordering is now non-nil by default
From: |
Eli Zaretskii |
Subject: |
Re: bidi-display-reordering is now non-nil by default |
Date: |
Sun, 07 Aug 2011 22:32:40 +0300 |
> From: Chong Yidong <address@hidden>
> Cc: address@hidden, address@hidden,
> address@hidden
> Date: Sun, 07 Aug 2011 13:21:41 -0400
>
> (defun string-mark-left-to-right (str)
> "Return a string based on STR that can be embedded in LTR text.
> If STR ends in right-to-left (RTL) script, return a string
> consisting of STR followed by a left-to-right mark (LRM)
> character. Otherwise, return STR."
> (if --??--this-string-needs-an-lrm--??--
> (concat str "\u200E")
> str))
>
> (Can you tell us how to fill in the missing piece above?)
How about
(if t
?
Seriously, though: why do you need any conditions here? An LRM will
have no effect if str is not reordered, so why not put it there
unconditionally?
But if you insist on doing that only when str might need that, then I
think you want to check each character in str with
get-char-code-property, like this:
(get-char-code-property (aref str i) 'bidi-class)
If this returns 'R for any character, it means the string _might_ need
LRM to be appended.
- Re: bidi-display-reordering is now non-nil by default, (continued)
- Re: bidi-display-reordering is now non-nil by default, Chong Yidong, 2011/08/05
- Re: bidi-display-reordering is now non-nil by default, Eli Zaretskii, 2011/08/05
- Re: bidi-display-reordering is now non-nil by default, Chong Yidong, 2011/08/05
- Re: bidi-display-reordering is now non-nil by default, Eli Zaretskii, 2011/08/05
- Re: bidi-display-reordering is now non-nil by default, Chong Yidong, 2011/08/05
- Re: bidi-display-reordering is now non-nil by default, Jason Rumney, 2011/08/05
- Re: bidi-display-reordering is now non-nil by default, Eli Zaretskii, 2011/08/06
- Re: bidi-display-reordering is now non-nil by default, Chong Yidong, 2011/08/07
- Re: bidi-display-reordering is now non-nil by default,
Eli Zaretskii <=
- Re: bidi-display-reordering is now non-nil by default, Chong Yidong, 2011/08/09
- Re: bidi-display-reordering is now non-nil by default, Eli Zaretskii, 2011/08/09
- Re: bidi-display-reordering is now non-nil by default, David Kastrup, 2011/08/09
- Re: bidi-display-reordering is now non-nil by default, Eli Zaretskii, 2011/08/09
- Re: bidi-display-reordering is now non-nil by default, David Kastrup, 2011/08/09
- Re: bidi-display-reordering is now non-nil by default, Eli Zaretskii, 2011/08/09
- Re: bidi-display-reordering is now non-nil by default, David Kastrup, 2011/08/09
- Re: bidi-display-reordering is now non-nil by default, Richard Stallman, 2011/08/09
- Re: bidi-display-reordering is now non-nil by default, Stephen J. Turnbull, 2011/08/11
- Re: bidi-display-reordering is now non-nil by default, Chong Yidong, 2011/08/09