unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Helmut Eller <eller.helmut@gmail.com>
Cc: gerd.moellmann@gmail.com, emacs-devel@gnu.org
Subject: Re: MPS: composition
Date: Mon, 29 Apr 2024 09:21:18 +0300	[thread overview]
Message-ID: <86zftcsn8h.fsf@gnu.org> (raw)
In-Reply-To: <87bk5t9v1j.fsf@gmail.com> (message from Helmut Eller on Sun, 28 Apr 2024 20:55:20 +0200)

> 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.



  reply	other threads:[~2024-04-29  6:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-28 12:49 MPS: composition Gerd Möllmann
2024-04-28 13:21 ` Helmut Eller
2024-04-28 14:03   ` Eli Zaretskii
2024-04-28 18:55     ` Helmut Eller
2024-04-29  6:21       ` Eli Zaretskii [this message]
2024-04-29  7:21         ` Helmut Eller
2024-04-28 14:07   ` Gerd Möllmann

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=86zftcsn8h.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=eller.helmut@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=gerd.moellmann@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).