summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/international/characters.el102
2 files changed, 71 insertions, 38 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index bf1de5f9ffe..345f31fc8ff 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
+2010-11-20 Eli Zaretskii <eliz@gnu.org>
+
+ * international/characters.el (glyphless-char-display-control):
+ Make it a defcustom, with update-glyphless-char-display as its
+ :set attribute.
+ (top level): Don't call update-glyphless-char-display.
+
2010-11-20 Michael Albinus <michael.albinus@gmx.de>
Sync with Tramp 2.2.0.
diff --git a/lisp/international/characters.el b/lisp/international/characters.el
index 379ce76c4b2..73185d78f2b 100644
--- a/lisp/international/characters.el
+++ b/lisp/international/characters.el
@@ -1293,45 +1293,12 @@ Setup char-width-table appropriate for non-CJK language environment."
(aset char-acronym-table (+ #xE0021 i) (format " %c TAG" (+ 33 i))))
(aset char-acronym-table #xE007F "->|TAG") ; CANCEL TAG
-;;; Control of displaying glyphless characters.
-(defvar glyphless-char-display-control
- '((format-control . thin-space)
- (no-font . hex-code))
- "List of directives to control display of glyphless characters.
-
-Each element has the form (GROUP . METHOD), where GROUP is a
-symbol specifying the character group, and METHOD is a symbol
-specifying the method of displaying characters belonging to that
-group.
-
-GROUP must be one of these symbols:
- `c0-control': U+0000..U+001F.
- `c1-control': U+0080..U+009F.
- `format-control': Characters of Unicode General Category `Cf',
- such as U+200C (ZWNJ), U+200E (LRM), but
- excluding characters that have graphic images,
- such as U+00AD (SHY).
- `no-font': characters for which no suitable font is found.
- For character terminals, characters that cannot
- be encoded by `terminal-coding-system'.
-
-METHOD must be one of these symbols:
- `zero-width': don't display.
- `thin-space': display a thin (1-pixel width) space. On character
- terminals, display as 1-character space.
- `empty-box': display an empty box.
- `acronym': display an acronym of the character in a box. The
- acronym is taken from `char-acronym-table', which see.
- `hex-code': display the hexadecimal character code in a box.
-
-Just setting this variable does not take effect. Call the
-function `update-glyphless-char-display' (which see) after
-setting this variable.")
-
-(defun update-glyphless-char-display ()
+(defun update-glyphless-char-display (&optional variable value)
"Make the setting of `glyphless-char-display-control' take effect.
This function updates the char-table `glyphless-char-display'."
- (dolist (elt glyphless-char-display-control)
+ (when value
+ (set-default variable value))
+ (dolist (elt value)
(let ((target (car elt))
(method (cdr elt)))
(or (memq method '(zero-width thin-space empty-box acronym hex-code))
@@ -1365,7 +1332,66 @@ This function updates the char-table `glyphless-char-display'."
(t
(error "Invalid glyphless character group: %s" target))))))
-(update-glyphless-char-display)
+;;; Control of displaying glyphless characters.
+(defcustom glyphless-char-display-control
+ '((format-control . thin-space)
+ (no-font . hex-code))
+ "List of directives to control display of glyphless characters.
+
+Each element has the form (GROUP . METHOD), where GROUP is a
+symbol specifying the character group, and METHOD is a symbol
+specifying the method of displaying characters belonging to that
+group.
+
+GROUP must be one of these symbols:
+ `c0-control': U+0000..U+001F.
+ `c1-control': U+0080..U+009F.
+ `format-control': Characters of Unicode General Category `Cf',
+ such as U+200C (ZWNJ), U+200E (LRM), but
+ excluding characters that have graphic images,
+ such as U+00AD (SHY).
+ `no-font': characters for which no suitable font is found.
+ For character terminals, characters that cannot
+ be encoded by `terminal-coding-system'.
+
+METHOD must be one of these symbols:
+ `zero-width': don't display.
+ `thin-space': display a thin (1-pixel width) space. On character
+ terminals, display as 1-character space.
+ `empty-box': display an empty box.
+ `acronym': display an acronym of the character in a box. The
+ acronym is taken from `char-acronym-table', which see.
+ `hex-code': display the hexadecimal character code in a box."
+
+ :type '(alist :key-type (symbol :tag "Character Group")
+ :value-type (symbol :tag "Display Method"))
+ :options '((c0-control
+ (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)))
+ (c1-control
+ (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)))
+ (format-control
+ (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)
+ (const :tag "Display as empty box" empty-box)
+ (const :tag "Display acronym" acronym)
+ (const :tag "Display hex code in a box" hex-code))))
+ :set 'update-glyphless-char-display
+ :group 'display)
+
;;; Setting word boundary.