From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: How is a composition being done? Date: Tue, 10 Aug 2010 10:13:05 +0900 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1281402805 15571 80.91.229.12 (10 Aug 2010 01:13:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 10 Aug 2010 01:13:25 +0000 (UTC) Cc: emacs-devel@gnu.org To: Yair F Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 10 03:13:24 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OidP6-0003xT-8V for ged-emacs-devel@m.gmane.org; Tue, 10 Aug 2010 03:13:20 +0200 Original-Received: from localhost ([127.0.0.1]:42488 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OidP5-00076A-GQ for ged-emacs-devel@m.gmane.org; Mon, 09 Aug 2010 21:13:19 -0400 Original-Received: from [140.186.70.92] (port=53595 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OidOz-00075v-KG for emacs-devel@gnu.org; Mon, 09 Aug 2010 21:13:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OidOx-0001sZ-Ve for emacs-devel@gnu.org; Mon, 09 Aug 2010 21:13:13 -0400 Original-Received: from mx1.aist.go.jp ([150.29.246.133]:47013) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OidOx-0001sF-ET for emacs-devel@gnu.org; Mon, 09 Aug 2010 21:13:11 -0400 Original-Received: from rqsmtp1.aist.go.jp (rqsmtp1.aist.go.jp [150.29.254.115]) by mx1.aist.go.jp with ESMTP id o7A1D6W4021473; Tue, 10 Aug 2010 10:13:07 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp1.aist.go.jp by rqsmtp1.aist.go.jp with ESMTP id o7A1D6qM026018; Tue, 10 Aug 2010 10:13:06 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp1.aist.go.jp with ESMTP id o7A1D6tN023756; Tue, 10 Aug 2010 10:13:06 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken with local (Exim 4.71) (envelope-from ) id 1OidOs-0005ZI-3m; Tue, 10 Aug 2010 10:13:06 +0900 In-Reply-To: (message from Yair F on Mon, 9 Aug 2010 21:29:45 +0300) X-detected-operating-system: by eggs.gnu.org: Solaris 9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:128523 Archived-At: In article , Yair F 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