emacs-devel
[Top][All Lists]
Advanced

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

Re: Question about composite.c


From: Gerry Agbobada
Subject: Re: Question about composite.c
Date: Tue, 21 Jan 2020 19:57:07 +0100

> Can you tell what kind of ligatures you wanted to support that
> required such a non-trivial regexp?

This was mainly to set the composition table once in my .el files and be
able to change fonts and stylistic sets without having to update the table.

Therefore, the main goal was to "catch common programming ligatures
starting with ?*"

> Also, why did you need to use a separate char-table instead of
> composition-function-table?

I used another char-table so the variable is easily accessible to modify
parts of it. Then again, maybe a poor design decision, but just a design
decision.

> It's not just an empty string, it's a _unibyte_ string.  How did that
> happen?

That's the main part I was trying to understand, since I could not
reproduce it in an easy way, I was wondering if an empty string can be
unibyte or multibyte. I have my answer now :)

> More importantly, please don't use prettify-symbols-mode, which are
> based on static compositions, together with automatic compositions.
> Static compositions are an obsolete feature, it lacks support for some
> modern Emacs features (e.g., bidirectional text), and we should remove
> it from Emacs at some future point -- but not before we implement a
> replacement for it using composition-function-table and related
> machinery.  Mixing these two incompatible compositions is asking for
> trouble.  If you turn off prettify-symbols-mode, does the problem go
> away?

I'll test it (I don't have a build to test it currently), but I suspect that it
would stop. I'll send an update if you're interested, but I don't think
this was my main question so I'll leave that unanswered if you think
the answer is not important.

> This cannot be right.  We cannot meaningfully compose unibyte text,
> because it is not made of characters, it is made of raw bytes, and
> therefore you cannot meaningfully reference composition-function-table
> by such raw bytes.  The errors are correct, and must stay that way.
> You need to debug this further to understand how come you ended up in
> this condition, and then fix whatever root cause caused that.
> [...]
> There's no problem with empty strings here, as long as they are
> multibyte.

That the main point I don't understand : is there a way to mark an empty
string as a multibyte string ? I found out about Lisp_String.size_byte but I
didn't find the code where strings were transformed into Lisp_String objects.

At least now I know I can continue investigating on the elisp side, thanks for
your answers !

Gerry



reply via email to

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