emacs-devel
[Top][All Lists]
Advanced

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

Re: bidi-display-reordering is now non-nil by default


From: Mohsen BANAN
Subject: Re: bidi-display-reordering is now non-nil by default
Date: Wed, 10 Aug 2011 19:45:25 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

>>>>> On Wed, 10 Aug 2011 12:52:24 -0400, Chong Yidong <address@hidden> said:

  Chong> Eli Zaretskii <address@hidden> writes:
  >> How is that different from using invisible properties in Info mode?
  >> You cut/paste from a manual, and the hidden text pops up
  >> "unexpectedly".

  Chong> And that is not a good thing.  There's no reason to make the problem
  Chong> worse if we can help it.

  Chong> I haven't seen an argument against the idea of introducing a
  Chong> `string-mark-left-to-right' function; is there any?

I am all for it.

Permit me to make a few additional very minor
suggestions that build on what you suggested.

 - Let's add a bidi- prefix to these function
   names.

 - Let's have two functions instead of one. 
   The one with -perhaps- does the if, the one 
   without does it always.

 - Let's put these is a file like bidi-kit.el
   somewhere on the trunk soon. So we can use them
   right away. It could be right next to
   bidi-menu.el starting point that suggested
   previously.

Note that when the -perhaps- version is used,
non-RTL script (e.g., ascii), remains pure ...

Thanks,

...Mohsen


--- starting point for bidi-kit.el starts ---


(defun bidi-string-perhaps-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--??--
    ...(get-char-code-property (aref str i)  'bidi-class)... Check for R...
      (concat str "\u200E")
    str))


(defun bidi-string-mark-left-to-right (str)
  "Return a string based on STR that can be embedded in LTR text.
Return a string
consisting of STR followed by a left-to-right mark (LRM)
character. 
       (concat str "\u200E"))


--- starting point for bidi-kit.el ends ---





reply via email to

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