[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: MPS: composition
From: |
Eli Zaretskii |
Subject: |
Re: MPS: composition |
Date: |
Mon, 29 Apr 2024 09:21:18 +0300 |
> From: Helmut Eller <eller.helmut@gmail.com>
> Cc: gerd.moellmann@gmail.com, emacs-devel@gnu.org
> Date: Sun, 28 Apr 2024 20:55:20 +0200
>
> > Replacing that with an integer would be somewhat tricky. The
> > requirement here is that if any part of the composition changes, the
> > key should be different, or else the results of the composition will
> > not follow the changes.
>
> You mean, it is explicitly allowed to change part of the key while it is
> in the hash table?
The composable character sequences and the rules to compose them are
defined by Lisp data structures, and those can be modified by Lisp
programs, yes.
As a simple example, consider automatic compositions, produced by
auto-composition-mode. These compositions are defined by
composition-function-table. It is a char-table, where each composable
character has a non-nil entry. We have such rules defined by default
for several languages which require that, but a Lisp program or the
user are allowed to add or modify those rules as they see fit, and
Emacs should not reuse stale cached compositions when the rules
change. A simple practical example is to define rules for ligatures,
when certain sequences of ASCII characters, like "-->", are displayed
as corresponding font ligatures. The rules for ligation, encoded in
composition-function-table, can easily change during an Emacs session.
We have clear-composition-cache to make sure stale cached compositions
don't get in the way, but that is a drastic measure, so we use it very
sparingly.