emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] /srv/bzr/emacs/trunk r105429: New function `string-mar


From: Kenichi Handa
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r105429: New function `string-mark-left-to-right' for handling LRMs.
Date: Sat, 13 Aug 2011 16:42:43 +0900

In article <address@hidden>, Eli Zaretskii <address@hidden> writes:

> > From: Kenichi Handa <address@hidden>
> > Cc: address@hidden, address@hidden, address@hidden
> > Date: Sat, 13 Aug 2011 16:00:40 +0900
> > 
> > ;; For string...
> > (defun check-special-bidi-character (str)
> >   (with-category-table special-category-table-for-bidi
> >     (string-match "\\cr" str)))
> > 
> > (check-special-bidi-character "abc") => nil
> > (check-special-bidi-character "abc א")‎ => 4

> Thanks!  I think we should have a few of such category-tables in Emacs
> by default.

As categories are not exclusive (i.e. one character can have
multiple categories), I think you need just one
category-table.  In which, each character has a category
uniquely corresponding to a bidi class (L, AL, etc), in
addition, all some character has a category whose meaning
is, for instance (one of R, AL, or RLO).

For instance, if you define a cateogry ?R as bidi class R,
and define a category ?r as one of (R, AL, or RLO), the
character `א' has two categories ?R and ?r, which means

(with-category-table special-category-table-for-bidi
  (cons (string-match "\\cR" "א")  (string-match "\\cr" "א")))
  => (0 . 0)

As we can define 95 different categories in a single
category table, I think the number of categories are
sufficient.

---
Kenichi Handa
address@hidden



reply via email to

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