characters.el: remove repetition in glyphless-char-display-control

* lisp/international/characters.el (glyphless-char-display-method):
New custom widget for the different options for displaying glyphless
characters.
(glyphless-char-display-control): Use 'glyphless-char-display-method'.
This commit is contained in:
Robert Pluim 2021-12-01 17:11:07 +01:00
parent 93824a760e
commit 0f6bf308ab

View file

@ -1576,6 +1576,19 @@ option `glyphless-char-display'."
(set-char-table-range chartable (cons from to) method)))
;;; Control of displaying glyphless characters.
(define-widget 'glyphless-char-display-method 'lazy
"Display method for glyphless characters."
:group 'mule
:format "%v"
:value 'thin-space
:type
'(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)))
(defcustom glyphless-char-display-control
'((format-control . thin-space)
(variation-selectors . thin-space)
@ -1619,41 +1632,11 @@ function (`update-glyphless-char-display'), which updates
:version "28.1"
:type '(alist :key-type (symbol :tag "Character Group")
:value-type (symbol :tag "Display Method"))
:options '((c0-control
(choice :value thin-space
(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)))
(c1-control
(choice :value thin-space
(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)))
(format-control
(choice :value thin-space
(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)))
(variation-selectors
(choice :value thin-space
(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 :value hex-code
(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))))
:options '((c0-control glyphless-char-display-method)
(c1-control glyphless-char-display-method)
(format-control glyphless-char-display-method)
(variation-selectors glyphless-char-display-method)
(no-font (glyphless-char-display-method :value hex-code)))
:set 'update-glyphless-char-display
:group 'display)