Finding a combination of diacritics for a character at a point in emacs

I am writing a function that returns linguistic information about a character at a point. This is easy for predefined characters. However, I want to explain diacritics. I believe that they are referred to as “labels” or “combination of characters” in Unicode (see Plane U + 0300 - U + 036F).

For example, to place centralization diacritics (U + 0306) on the symbol e:

e C-x 8 <RET> 0306 <RET>

Run C-u C-x =on the resulting character, and you will see something like "Composed with the following characters:"

Functions such as following-char, unfortunately, return only the base character, i.e. “e,” and any combination of diacritics is ignored. Is there any way to get them?

EDIT : slitvinov noted that the resulting glyph consists of two characters. If you place a dot in front of the glyph created by the above code and execute (point)before and after launch forward-char, you will see a dot increase by 2. I decided that I could crack the solution using this behavior, but it seems that inside a progn(or the definition of a function), forward-charonly moves the point forward one ... try in defunor with (progn (forward-char) (point)). Why could this be?

+5
source share
1 answer

I think it is diacritic econsidered as two characters. I put this combination in a file e(diacritic e)e.

ĕee
(char-after 1)
(char-after 2)
(char-after 3)
(char-after 4)

It gives me.

101 101 774 101

And 774 is the decimal form 0306.

+2
source

All Articles