Add glyphless-char-display-control for Variation Selectors

* lisp/international/characters.el (update-glyphless-char-display):
(glyphless-char-display-control): Add control knob for U+FE00 through
U+FE0F, defaulting to 'thin-space'.
* doc/lispref/display.texi (Glyphless Chars): Document it.
This commit is contained in:
Robert Pluim 2021-09-24 14:13:24 +02:00
parent dd60f94747
commit 950831c369
2 changed files with 19 additions and 1 deletions

View file

@ -7952,6 +7952,11 @@ Characters of Unicode General Category [Cf], such as U+200E
@sc{left-to-right mark}, but excluding characters that have graphic
images, such as U+00AD @sc{soft hyphen}.
@item variation-selectors
Unicode VS-1 through VS-16 (U+FE00 through U+FE0F), which are used to
select between different glyphs for the same codepoints (typically
emojis).
@item no-font
Characters for which there is no suitable font, or which cannot be
encoded by the terminal's coding system.

View file

@ -1540,6 +1540,9 @@ option `glyphless-char-display'."
((eq target 'c1-control)
(glyphless-set-char-table-range glyphless-char-display
#x80 #x9F method))
((eq target 'variation-selectors)
(glyphless-set-char-table-range glyphless-char-display
#xFE00 #xFE0F method))
((eq target 'format-control)
(when unicode-category-table
(map-char-table
@ -1575,6 +1578,7 @@ option `glyphless-char-display'."
;;; Control of displaying glyphless characters.
(defcustom glyphless-char-display-control
'((format-control . thin-space)
(variation-selectors . thin-space)
(no-font . hex-code))
"List of directives to control display of glyphless characters.
@ -1590,6 +1594,9 @@ GROUP must be one of these symbols:
such as U+200C (ZWNJ), U+200E (LRM), but
excluding characters that have graphic images,
such as U+00AD (SHY).
`variation-selectors': U+FE00..U+FE0F, used for choosing between
glyph variations (e.g. Emoji vs Text
presentation).
`no-font': characters for which no suitable font is found.
For character terminals, characters that cannot
be encoded by `terminal-coding-system'.
@ -1607,7 +1614,7 @@ Do not set its value directly from Lisp; the value takes effect
only via a custom `:set'
function (`update-glyphless-char-display'), which updates
`glyphless-char-display'."
:version "24.1"
:version "28.1"
:type '(alist :key-type (symbol :tag "Character Group")
:value-type (symbol :tag "Display Method"))
:options '((c0-control
@ -1628,6 +1635,12 @@ function (`update-glyphless-char-display'), which updates
(const :tag "Display as empty box" empty-box)
(const :tag "Display acronym" acronym)
(const :tag "Display hex code in a box" hex-code)))
(variation-selectors
(choice (const :tag "Don't display" zero-width)
(const :tag "Display as thin space" thin-space)
(const :tag "Display as empty box" empty-box)
(const :tag "Display acronym" acronym)
(const :tag "Display hex code in a box" hex-code)))
(no-font
(choice (const :tag "Don't display" zero-width)
(const :tag "Display as thin space" thin-space)