[Top][All Lists]

[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: Wed, 17 Aug 2011 16:21:44 +0900

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

> I didn't mean to add each bidi type as a separate category (there are
> 19 of them, btw).

Oops, sorry I mis-counted them.

> I did mean to carefully define the most frequently
> needed categories, like the one which started this discussion, and add
> only those.  The gain would be that we won't need to use
> with-category-table around code which needs to search for characters
> by their bidi types, and we will be able to combine bidi-related
> categories with other standard categories in the same regular
> expression.

> One possible set of categories is just the 3 bidi categories defined
> by UAX#9: Strong, Weak, and Neutral.  We'd probably need to split the
> first one in two, depending on directionality, so Strong_R, Strong_L,
> Weak, and Neutral would be my initial guess.

Ah, I see.  It may be ok to add just a few categories to the
standard categories table.

> However, we should gather more experience before we decide.

> > In addtion, adding them to the standard category table means
> > we can't select a proper category mnemonic character.

> ?? We can use any one that is currently unused, no?  Those that are
> used are shown by describe-categories, right?

Yes.  I just thought that it's difficult to find proper
mnemonics for all 19 bidi classes among the unsed ones.

By the way, Stefan' suggestion of extending regexp is also
worth considering (though I have no idea what kind of format
we can use for them).

One more tip: It may be a little bit faster to use a
bidi-specific category table with with-category-table
because, in most cases, we can find a category set for a
specific character faster.  In a bidi-specific category
table, most characters (e.g. all han characters) will have
the same category set and thus the set is recorded for a
group of characters.

Kenichi Handa

reply via email to

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