summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorRobert Pluim <rpluim@gmail.com>2021-12-01 17:11:07 +0100
committerRobert Pluim <rpluim@gmail.com>2021-12-01 17:30:35 +0100
commit0f6bf308ab302cb8850e97bd7e41a4b432fcfeca (patch)
tree274f1cab468f51ceed1b47164e5717056eee3f97 /lisp
parent93824a760edb738ad12000dace1958a629d97f7b (diff)
downloademacs-0f6bf308ab302cb8850e97bd7e41a4b432fcfeca.tar.gz
emacs-0f6bf308ab302cb8850e97bd7e41a4b432fcfeca.tar.bz2
emacs-0f6bf308ab302cb8850e97bd7e41a4b432fcfeca.zip
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'.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/international/characters.el53
1 files changed, 18 insertions, 35 deletions
diff --git a/lisp/international/characters.el b/lisp/international/characters.el
index 9e0cc88d804..3b8924f5035 100644
--- a/lisp/international/characters.el
+++ b/lisp/international/characters.el
@@ -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)