all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
To: Yair F <yair.f.lists@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: How is a composition being done?
Date: Tue, 10 Aug 2010 10:13:05 +0900	[thread overview]
Message-ID: <tl7pqxrqnha.fsf@m17n.org> (raw)
In-Reply-To: <AANLkTimpeNRRJkaZdkCj3ryvFKQQ3DCW9vVszs27YKQ=@mail.gmail.com> (message from Yair F on Mon, 9 Aug 2010 21:29:45 +0300)

In article <AANLkTimpeNRRJkaZdkCj3ryvFKQQ3DCW9vVszs27YKQ=@mail.gmail.com>, Yair F <yair.f.lists@gmail.com> 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
handa@m17n.org



  reply	other threads:[~2010-08-10  1:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-09 18:29 How is a composition being done? Yair F
2010-08-10  1:13 ` Kenichi Handa [this message]
2010-08-10 11:52   ` James Cloos
2010-08-12  6:25     ` Kenichi Handa
2010-08-13 11:58       ` James Cloos
2010-08-16  7:22         ` Kenichi Handa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tl7pqxrqnha.fsf@m17n.org \
    --to=handa@m17n.org \
    --cc=emacs-devel@gnu.org \
    --cc=yair.f.lists@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.