emacs-devel
[Top][All Lists]
Advanced

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

Re: How is a composition being done?


From: Kenichi Handa
Subject: Re: How is a composition being done?
Date: Tue, 10 Aug 2010 10:13:05 +0900

In article <address@hidden>, Yair F <address@hidden> writes:

> Trying to figure how to write composition expressions.

> Is the composition done forwards, that is when encountering a
> base character further marks are searched forward to check if
> they can be composed? Or is the composition is done backwards,
> that is when a composable mark is encountered Emacs searches
> backwards to find a base character it can compose to?

It's done both forward and backward in some sence.

When you do:

  (aset composition-function-table CH
        ([PATTERN1 2 FUNC1] [PATTERN2 0 FUNC2]))

Emacs searches for CH, and if it is found at position POS,
it checks if the buffer contents at (POS - 2) and after
matches with PATTERN1.  If matched, the matched part is
composed by FUNC.  If not, Emacs checks the buffer contents
at (POS - 0) and after matches with PATTERN2.  If matched,
the matched part is composed by FUNC2.

So, on setting composition-function-table, you must consider
two things; which character sequence must be composed
(i.e. determining PATTERN above), and which character should
trigger composition (i.e. determining CH above).

The smaller the set of characters triggering composition is,
the more efficently Emacs' redisplay routine works.

So, Hebrew (and Latin, etc.) makes only the combining
characters trigger composition.

By the way, if the docstring of composition-function-table
is not clear, could you please suggest improvement?

---
Kenichi Handa
address@hidden



reply via email to

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