aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2010-11-20 16:35:45 +0200
committerEli Zaretskii2010-11-20 16:35:45 +0200
commit0e7c0582af3a7ee210dfa6a1ab6c41b23bea1951 (patch)
tree4831c496fc6ccd8138cec8302150ae04b4f85719
parent568a887f62c573f3e8edd9f02169102f35c1090f (diff)
downloademacs-0e7c0582af3a7ee210dfa6a1ab6c41b23bea1951.tar.gz
emacs-0e7c0582af3a7ee210dfa6a1ab6c41b23bea1951.zip
Make glyphless-char-display-control a defcustom.
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.
-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 @@
12010-11-20 Eli Zaretskii <eliz@gnu.org>
2
3 * international/characters.el (glyphless-char-display-control):
4 Make it a defcustom, with update-glyphless-char-display as its
5 :set attribute.
6 (top level): Don't call update-glyphless-char-display.
7
12010-11-20 Michael Albinus <michael.albinus@gmx.de> 82010-11-20 Michael Albinus <michael.albinus@gmx.de>
2 9
3 Sync with Tramp 2.2.0. 10 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."
1293 (aset char-acronym-table (+ #xE0021 i) (format " %c TAG" (+ 33 i)))) 1293 (aset char-acronym-table (+ #xE0021 i) (format " %c TAG" (+ 33 i))))
1294(aset char-acronym-table #xE007F "->|TAG") ; CANCEL TAG 1294(aset char-acronym-table #xE007F "->|TAG") ; CANCEL TAG
1295 1295
1296;;; Control of displaying glyphless characters. 1296(defun update-glyphless-char-display (&optional variable value)
1297(defvar glyphless-char-display-control
1298 '((format-control . thin-space)
1299 (no-font . hex-code))
1300 "List of directives to control display of glyphless characters.
1301
1302Each element has the form (GROUP . METHOD), where GROUP is a
1303symbol specifying the character group, and METHOD is a symbol
1304specifying the method of displaying characters belonging to that
1305group.
1306
1307GROUP must be one of these symbols:
1308 `c0-control': U+0000..U+001F.
1309 `c1-control': U+0080..U+009F.
1310 `format-control': Characters of Unicode General Category `Cf',
1311 such as U+200C (ZWNJ), U+200E (LRM), but
1312 excluding characters that have graphic images,
1313 such as U+00AD (SHY).
1314 `no-font': characters for which no suitable font is found.
1315 For character terminals, characters that cannot
1316 be encoded by `terminal-coding-system'.
1317
1318METHOD must be one of these symbols:
1319 `zero-width': don't display.
1320 `thin-space': display a thin (1-pixel width) space. On character
1321 terminals, display as 1-character space.
1322 `empty-box': display an empty box.
1323 `acronym': display an acronym of the character in a box. The
1324 acronym is taken from `char-acronym-table', which see.
1325 `hex-code': display the hexadecimal character code in a box.
1326
1327Just setting this variable does not take effect. Call the
1328function `update-glyphless-char-display' (which see) after
1329setting this variable.")
1330
1331(defun update-glyphless-char-display ()
1332 "Make the setting of `glyphless-char-display-control' take effect. 1297 "Make the setting of `glyphless-char-display-control' take effect.
1333This function updates the char-table `glyphless-char-display'." 1298This function updates the char-table `glyphless-char-display'."
1334 (dolist (elt glyphless-char-display-control) 1299 (when value
1300 (set-default variable value))
1301 (dolist (elt value)
1335 (let ((target (car elt)) 1302 (let ((target (car elt))
1336 (method (cdr elt))) 1303 (method (cdr elt)))
1337 (or (memq method '(zero-width thin-space empty-box acronym hex-code)) 1304 (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'."
1365 (t 1332 (t
1366 (error "Invalid glyphless character group: %s" target)))))) 1333 (error "Invalid glyphless character group: %s" target))))))
1367 1334
1368(update-glyphless-char-display) 1335;;; Control of displaying glyphless characters.
1336(defcustom glyphless-char-display-control
1337 '((format-control . thin-space)
1338 (no-font . hex-code))
1339 "List of directives to control display of glyphless characters.
1340
1341Each element has the form (GROUP . METHOD), where GROUP is a
1342symbol specifying the character group, and METHOD is a symbol
1343specifying the method of displaying characters belonging to that
1344group.
1345
1346GROUP must be one of these symbols:
1347 `c0-control': U+0000..U+001F.
1348 `c1-control': U+0080..U+009F.
1349 `format-control': Characters of Unicode General Category `Cf',
1350 such as U+200C (ZWNJ), U+200E (LRM), but
1351 excluding characters that have graphic images,
1352 such as U+00AD (SHY).
1353 `no-font': characters for which no suitable font is found.
1354 For character terminals, characters that cannot
1355 be encoded by `terminal-coding-system'.
1356
1357METHOD must be one of these symbols:
1358 `zero-width': don't display.
1359 `thin-space': display a thin (1-pixel width) space. On character
1360 terminals, display as 1-character space.
1361 `empty-box': display an empty box.
1362 `acronym': display an acronym of the character in a box. The
1363 acronym is taken from `char-acronym-table', which see.
1364 `hex-code': display the hexadecimal character code in a box."
1365
1366 :type '(alist :key-type (symbol :tag "Character Group")
1367 :value-type (symbol :tag "Display Method"))
1368 :options '((c0-control
1369 (choice (const :tag "Don't display" zero-width)
1370 (const :tag "Display as thin space" thin-space)
1371 (const :tag "Display as empty box" empty-box)
1372 (const :tag "Display acronym" acronym)
1373 (const :tag "Display hex code in a box" hex-code)))
1374 (c1-control
1375 (choice (const :tag "Don't display" zero-width)
1376 (const :tag "Display as thin space" thin-space)
1377 (const :tag "Display as empty box" empty-box)
1378 (const :tag "Display acronym" acronym)
1379 (const :tag "Display hex code in a box" hex-code)))
1380 (format-control
1381 (choice (const :tag "Don't display" zero-width)
1382 (const :tag "Display as thin space" thin-space)
1383 (const :tag "Display as empty box" empty-box)
1384 (const :tag "Display acronym" acronym)
1385 (const :tag "Display hex code in a box" hex-code)))
1386 (no-font
1387 (choice (const :tag "Don't display" zero-width)
1388 (const :tag "Display as thin space" thin-space)
1389 (const :tag "Display as empty box" empty-box)
1390 (const :tag "Display acronym" acronym)
1391 (const :tag "Display hex code in a box" hex-code))))
1392 :set 'update-glyphless-char-display
1393 :group 'display)
1394
1369 1395
1370;;; Setting word boundary. 1396;;; Setting word boundary.
1371 1397