There is some inconsistency in naming and behaviour in Emacs master.
We have `forward-char', `backward-char', `delete-char', `backward-delete-char' commands.ย All of them use "char" in their names, however, `forward-char' and `backward-char' treats "char" differently than `delete-char' and `backward-delete-char'.
Let me explain.ย Emacs has support for composed characters to display multiple characters composed into a single glyph.ย Almost the same is done for multi-character emojis such as ๐ท๐บ or ๐จโ๐ฉโ๐งโ๐ฆ - multiple unicode chars are composed into single glyph representing some emoji.ย Now, if you put point under composed character or emoji and run `forward-char' or `backward-char' it moves point to the whole glyph, however, if you run `delete-char' (when point is under composed char) or `backward-delete-char'(when point just after the glyph) it will delete only single character from multiple character representation, so pressing `C-d' under ๐ท๐บ will magically turn Russian flag into ๐บ.ย This is very misleading behaviour especially when invisible characters are used in the emojis
Maybe introduce "glyph" term meaning graphical representation of chars sequence, displayed in the buffer and operated as a whole thing?
For example these things creates a glyph in a buffer:
1) (compose-chars ?a ?b)
2) (concat "\x1F1F7" "\x1F1FA")
3) (propertize "aaaa" 'display "B")
In this case, we can rename `forward-char' to `forward-glyph' keeping naming and behaviour in consistency.
And also it will be possible to write something like `string-glyph-length' to return 1 for "๐จโ๐ฉโ๐งโ๐ฆ" instead of 7 as `length' returns now.
What do you think?
Thanks