]> code.delx.au - gnu-emacs/blob - lisp/descr-text.el
Merged in changes from CVS trunk.
[gnu-emacs] / lisp / descr-text.el
1 ;;; descr-text.el --- describe text mode
2
3 ;; Copyright (c) 1994, 95, 96, 2001, 02, 03, 04 Free Software Foundation, Inc.
4
5 ;; Author: Boris Goldowsky <boris@gnu.org>
6 ;; Keywords: faces
7
8 ;; This file is part of GNU Emacs.
9
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
13 ;; any later version.
14
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
19
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
24
25 ;;; Commentary:
26
27 ;;; Describe-Text Mode.
28
29 ;;; Code:
30
31 (eval-when-compile (require 'button) (require 'quail))
32
33 (defun describe-text-done ()
34 "Delete the current window or bury the current buffer."
35 (interactive)
36 (if (> (count-windows) 1)
37 (delete-window)
38 (bury-buffer)))
39
40 (defvar describe-text-mode-map
41 (let ((map (make-sparse-keymap)))
42 (set-keymap-parent map widget-keymap)
43 map)
44 "Keymap for `describe-text-mode'.")
45
46 (defcustom describe-text-mode-hook nil
47 "List of hook functions ran by `describe-text-mode'."
48 :type 'hook
49 :group 'facemenu)
50
51 (defun describe-text-mode ()
52 "Major mode for buffers created by `describe-char'.
53
54 \\{describe-text-mode-map}
55 Entry to this mode calls the value of `describe-text-mode-hook'
56 if that value is non-nil."
57 (kill-all-local-variables)
58 (setq major-mode 'describe-text-mode
59 mode-name "Describe-Text")
60 (use-local-map describe-text-mode-map)
61 (widget-setup)
62 (add-hook 'change-major-mode-hook 'font-lock-defontify nil t)
63 (run-hooks 'describe-text-mode-hook))
64
65 ;;; Describe-Text Utilities.
66
67 (defun describe-text-widget (widget)
68 "Insert text to describe WIDGET in the current buffer."
69 (widget-create 'link
70 :notify `(lambda (&rest ignore)
71 (widget-browse ',widget))
72 (format "%S" (if (symbolp widget)
73 widget
74 (car widget))))
75 (widget-insert " ")
76 (widget-create 'info-link :tag "widget" "(widget)Top"))
77
78 (defun describe-text-sexp (sexp)
79 "Insert a short description of SEXP in the current buffer."
80 (let ((pp (condition-case signal
81 (pp-to-string sexp)
82 (error (prin1-to-string signal)))))
83 (when (string-match "\n\\'" pp)
84 (setq pp (substring pp 0 (1- (length pp)))))
85 (if (cond ((string-match "\n" pp)
86 nil)
87 ((> (length pp) (- (window-width) (current-column)))
88 nil)
89 (t t))
90 (widget-insert pp)
91 (widget-create 'push-button
92 :tag "show"
93 :action (lambda (widget &optional event)
94 (with-output-to-temp-buffer
95 "*Pp Eval Output*"
96 (princ (widget-get widget :value))))
97 pp))))
98
99 (defun describe-property-list (properties)
100 "Insert a description of PROPERTIES in the current buffer.
101 PROPERTIES should be a list of overlay or text properties.
102 The `category', `face' and `font-lock-face' properties are made
103 into widget buttons that call `describe-text-category' or
104 `describe-face' when pushed."
105 ;; Sort the properties by the size of their value.
106 (dolist (elt (sort (let ((ret nil)
107 (key nil)
108 (val nil)
109 (len nil))
110 (while properties
111 (setq key (pop properties)
112 val (pop properties)
113 len 0)
114 (unless (or (memq key '(category face font-lock-face
115 syntax-table))
116 (widgetp val))
117 (setq val (pp-to-string val)
118 len (length val)))
119 (push (list key val len) ret))
120 ret)
121 (lambda (a b)
122 (< (nth 2 a)
123 (nth 2 b)))))
124 (let ((key (nth 0 elt))
125 (value (nth 1 elt)))
126 (widget-insert (propertize (format " %-20s " key)
127 'font-lock-face 'italic))
128 (cond ((eq key 'category)
129 (widget-create 'link
130 :notify `(lambda (&rest ignore)
131 (describe-text-category ',value))
132 (format "%S" value)))
133 ((memq key '(face font-lock-face))
134 (widget-create 'link
135 :notify `(lambda (&rest ignore)
136 (describe-face ',value))
137 (format "%S" value)))
138 ((eq key 'syntax-table)
139 (widget-create 'push-button
140 :tag "show"
141 :action (lambda (widget &optional event)
142 (with-output-to-temp-buffer
143 "*Pp Eval Output*"
144 (pp (widget-get widget :value))))
145 value))
146 ((widgetp value)
147 (describe-text-widget value))
148 (t
149 (widget-insert value))))
150 (widget-insert "\n")))
151 \f
152 ;;; Describe-Text Commands.
153
154 (defun describe-text-category (category)
155 "Describe a text property category."
156 (interactive "S")
157 (save-excursion
158 (with-output-to-temp-buffer "*Help*"
159 (set-buffer standard-output)
160 (widget-insert "Category " (format "%S" category) ":\n\n")
161 (describe-property-list (symbol-plist category))
162 (describe-text-mode)
163 (goto-char (point-min)))))
164
165 ;;;###autoload
166 (defun describe-text-properties (pos &optional output-buffer)
167 "Describe widgets, buttons, overlays and text properties at POS.
168 Interactively, describe them for the character after point.
169 If optional second argument OUTPUT-BUFFER is non-nil,
170 insert the output into that buffer, and don't initialize or clear it
171 otherwise."
172 (interactive "d")
173 (if (>= pos (point-max))
174 (error "No character follows specified position"))
175 (if output-buffer
176 (describe-text-properties-1 pos output-buffer)
177 (if (not (or (text-properties-at pos) (overlays-at pos)))
178 (message "This is plain text.")
179 (let ((buffer (current-buffer))
180 (target-buffer "*Help*"))
181 (when (eq buffer (get-buffer target-buffer))
182 (setq target-buffer "*Help-2*"))
183 (save-excursion
184 (with-output-to-temp-buffer target-buffer
185 (set-buffer standard-output)
186 (setq output-buffer (current-buffer))
187 (widget-insert "Text content at position " (format "%d" pos) ":\n\n")
188 (with-current-buffer buffer
189 (describe-text-properties-1 pos output-buffer))
190 (describe-text-mode)
191 (goto-char (point-min))))))))
192
193 (defun describe-text-properties-1 (pos output-buffer)
194 (let* ((properties (text-properties-at pos))
195 (overlays (overlays-at pos))
196 (wid-field (get-char-property pos 'field))
197 (wid-button (get-char-property pos 'button))
198 (wid-doc (get-char-property pos 'widget-doc))
199 ;; If button.el is not loaded, we have no buttons in the text.
200 (button (and (fboundp 'button-at) (button-at pos)))
201 (button-type (and button (button-type button)))
202 (button-label (and button (button-label button)))
203 (widget (or wid-field wid-button wid-doc)))
204 (with-current-buffer output-buffer
205 ;; Widgets
206 (when (widgetp widget)
207 (newline)
208 (widget-insert (cond (wid-field "This is an editable text area")
209 (wid-button "This is an active area")
210 (wid-doc "This is documentation text")))
211 (widget-insert " of a ")
212 (describe-text-widget widget)
213 (widget-insert ".\n\n"))
214 ;; Buttons
215 (when (and button (not (widgetp wid-button)))
216 (newline)
217 (widget-insert "Here is a " (format "%S" button-type)
218 " button labeled `" button-label "'.\n\n"))
219 ;; Overlays
220 (when overlays
221 (newline)
222 (if (eq (length overlays) 1)
223 (widget-insert "There is an overlay here:\n")
224 (widget-insert "There are " (format "%d" (length overlays))
225 " overlays here:\n"))
226 (dolist (overlay overlays)
227 (widget-insert " From " (format "%d" (overlay-start overlay))
228 " to " (format "%d" (overlay-end overlay)) "\n")
229 (describe-property-list (overlay-properties overlay)))
230 (widget-insert "\n"))
231 ;; Text properties
232 (when properties
233 (newline)
234 (widget-insert "There are text properties here:\n")
235 (describe-property-list properties)))))
236 \f
237 (defcustom describe-char-unicodedata-file nil
238 "Location of Unicode data file.
239 This is the UnicodeData.txt file from the Unicode consortium, used for
240 diagnostics. If it is non-nil `describe-char-after' will print data
241 looked up from it. This facility is mostly of use to people doing
242 multilingual development.
243
244 This is a fairly large file, not typically present on GNU systems. At
245 the time of writing it is at
246 <URL:http://www.unicode.org/Public/UNIDATA/UnicodeData.txt>."
247 :group 'mule
248 :version "21.4"
249 :type '(choice (const :tag "None" nil)
250 file))
251
252 ;; We could convert the unidata file into a Lispy form once-for-all
253 ;; and distribute it for loading on demand. It might be made more
254 ;; space-efficient by splitting strings word-wise and replacing them
255 ;; with lists of symbols interned in a private obarray, e.g.
256 ;; "LATIN SMALL LETTER A" => '(LATIN SMALL LETTER A).
257
258 ;; Fixme: Check whether this needs updating for Unicode 4.
259 (defun describe-char-unicode-data (char)
260 "Return a list of Unicode data for unicode CHAR.
261 Each element is a list of a property description and the property value.
262 The list is null if CHAR isn't found in `describe-char-unicodedata-file'."
263 (when describe-char-unicodedata-file
264 (unless (file-exists-p describe-char-unicodedata-file)
265 (error "`unicodedata-file' %s not found" describe-char-unicodedata-file))
266 (with-current-buffer
267 ;; Find file in fundamental mode to avoid, e.g. flyspell turned
268 ;; on for .txt. Don't use RAWFILE arg in case of DOS line endings.
269 (let ((auto-mode-alist))
270 (find-file-noselect describe-char-unicodedata-file))
271 (goto-char (point-min))
272 (let ((hex (format "%04X" char))
273 found first last)
274 (if (re-search-forward (concat "^" hex) nil t)
275 (setq found t)
276 ;; It's not listed explicitly. Look for ranges, e.g. CJK
277 ;; ideographs, and check whether it's in one of them.
278 (while (and (re-search-forward "^\\([^;]+\\);[^;]+First>;" nil t)
279 (>= char (setq first
280 (string-to-number (match-string 1) 16)))
281 (progn
282 (forward-line 1)
283 (looking-at "^\\([^;]+\\);[^;]+Last>;")
284 (> char
285 (setq last
286 (string-to-number (match-string 1) 16))))))
287 (if (and (>= char first)
288 (<= char last))
289 (setq found t)))
290 (if found
291 (let ((fields (mapcar (lambda (elt)
292 (if (> (length elt) 0)
293 elt))
294 (cdr (split-string
295 (buffer-substring
296 (line-beginning-position)
297 (line-end-position))
298 ";")))))
299 ;; The length depends on whether the last field was empty.
300 (unless (or (= 13 (length fields))
301 (= 14 (length fields)))
302 (error "Invalid contents in %s" describe-char-unicodedata-file))
303 ;; The field names and values lists are slightly
304 ;; modified from Mule-UCS unidata.el.
305 (list
306 (list "Name" (let ((name (nth 0 fields)))
307 ;; Check for <..., First>, <..., Last>
308 (if (string-match "\\`\\(<[^,]+\\)," name)
309 (concat (match-string 1 name) ">")
310 name)))
311 (list "Category"
312 (cdr (assoc
313 (nth 1 fields)
314 '(("Lu" . "uppercase letter")
315 ("Ll" . "lowercase letter")
316 ("Lt" . "titlecase letter")
317 ("Mn" . "non-spacing mark")
318 ("Mc" . "spacing-combining mark")
319 ("Me" . "enclosing mark")
320 ("Nd" . "decimal digit")
321 ("Nl" . "letter number")
322 ("No" . "other number")
323 ("Zs" . "space separator")
324 ("Zl" . "line separator")
325 ("Zp" . "paragraph separator")
326 ("Cc" . "other control")
327 ("Cf" . "other format")
328 ("Cs" . "surrogate")
329 ("Co" . "private use")
330 ("Cn" . "not assigned")
331 ("Lm" . "modifier letter")
332 ("Lo" . "other letter")
333 ("Pc" . "connector punctuation")
334 ("Pd" . "dash punctuation")
335 ("Ps" . "open punctuation")
336 ("Pe" . "close punctuation")
337 ("Pi" . "initial-quotation punctuation")
338 ("Pf" . "final-quotation punctuation")
339 ("Po" . "other punctuation")
340 ("Sm" . "math symbol")
341 ("Sc" . "currency symbol")
342 ("Sk" . "modifier symbol")
343 ("So" . "other symbol")))))
344 (list "Combining class"
345 (cdr (assoc
346 (string-to-number (nth 2 fields))
347 '((0 . "Spacing")
348 (1 . "Overlays and interior")
349 (7 . "Nuktas")
350 (8 . "Hiragana/Katakana voicing marks")
351 (9 . "Viramas")
352 (10 . "Start of fixed position classes")
353 (199 . "End of fixed position classes")
354 (200 . "Below left attached")
355 (202 . "Below attached")
356 (204 . "Below right attached")
357 (208 . "Left attached (reordrant around \
358 single base character)")
359 (210 . "Right attached")
360 (212 . "Above left attached")
361 (214 . "Above attached")
362 (216 . "Above right attached")
363 (218 . "Below left")
364 (220 . "Below")
365 (222 . "Below right")
366 (224 . "Left (reordrant around single base \
367 character)")
368 (226 . "Right")
369 (228 . "Above left")
370 (230 . "Above")
371 (232 . "Above right")
372 (233 . "Double below")
373 (234 . "Double above")
374 (240 . "Below (iota subscript)")))))
375 (list "Bidi category"
376 (cdr (assoc
377 (nth 3 fields)
378 '(("L" . "Left-to-Right")
379 ("LRE" . "Left-to-Right Embedding")
380 ("LRO" . "Left-to-Right Override")
381 ("R" . "Right-to-Left")
382 ("AL" . "Right-to-Left Arabic")
383 ("RLE" . "Right-to-Left Embedding")
384 ("RLO" . "Right-to-Left Override")
385 ("PDF" . "Pop Directional Format")
386 ("EN" . "European Number")
387 ("ES" . "European Number Separator")
388 ("ET" . "European Number Terminator")
389 ("AN" . "Arabic Number")
390 ("CS" . "Common Number Separator")
391 ("NSM" . "Non-Spacing Mark")
392 ("BN" . "Boundary Neutral")
393 ("B" . "Paragraph Separator")
394 ("S" . "Segment Separator")
395 ("WS" . "Whitespace")
396 ("ON" . "Other Neutrals")))))
397 (list
398 "Decomposition"
399 (if (nth 4 fields)
400 (let* ((parts (split-string (nth 4 fields)))
401 (info (car parts)))
402 (if (string-match "\\`<\\(.+\\)>\\'" info)
403 (setq info (match-string 1 info))
404 (setq info nil))
405 (if info (setq parts (cdr parts)))
406 ;; Maybe printing ? for unrepresentable unicodes
407 ;; here and below should be changed?
408 (setq parts (mapconcat
409 (lambda (arg)
410 (string (or (decode-char
411 'ucs
412 (string-to-number arg 16))
413 ??)))
414 parts " "))
415 (concat info parts))))
416 (list "Decimal digit value"
417 (nth 5 fields))
418 (list "Digit value"
419 (nth 6 fields))
420 (list "Numeric value"
421 (nth 7 fields))
422 (list "Mirrored"
423 (if (equal "Y" (nth 8 fields))
424 "yes"))
425 (list "Old name" (nth 9 fields))
426 (list "ISO 10646 comment" (nth 10 fields))
427 (list "Uppercase" (and (nth 11 fields)
428 (string (or (decode-char
429 'ucs
430 (string-to-number
431 (nth 11 fields) 16))
432 ??))))
433 (list "Lowercase" (and (nth 12 fields)
434 (string (or (decode-char
435 'ucs
436 (string-to-number
437 (nth 12 fields) 16))
438 ??))))
439 (list "Titlecase" (and (nth 13 fields)
440 (string (or (decode-char
441 'ucs
442 (string-to-number
443 (nth 13 fields) 16))
444 ??)))))))))))
445
446 ;; Return information about how CHAR is displayed at the buffer
447 ;; position POS. If the selected frame is on a graphic display,
448 ;; return a cons (FONTNAME . GLYPH-CODE). Otherwise, return a string
449 ;; describing the terminal codes for the character.
450 (defun describe-char-display (pos char)
451 (if (display-graphic-p (selected-frame))
452 (internal-char-font pos char)
453 (let* ((coding (terminal-coding-system))
454 (encoded (encode-coding-char char coding)))
455 (if encoded
456 (encoded-string-description encoded coding)))))
457
458 \f
459 ;;;###autoload
460 (defun describe-char (pos)
461 "Describe the character after POS (interactively, the character after point).
462 The information includes character code, charset and code points in it,
463 syntax, category, how the character is encoded in a file,
464 character composition information (if relevant),
465 as well as widgets, buttons, overlays, and text properties."
466 (interactive "d")
467 (if (>= pos (point-max))
468 (error "No character follows specified position"))
469 (let* ((char (char-after pos))
470 (charset (char-charset char))
471 (composition (find-composition pos nil nil t))
472 (component-chars nil)
473 (display-table (or (window-display-table)
474 buffer-display-table
475 standard-display-table))
476 (disp-vector (and display-table (aref display-table char)))
477 (multibyte-p enable-multibyte-characters)
478 (overlays (mapcar #'(lambda (o) (overlay-properties o))
479 (overlays-at pos)))
480 item-list max-width unicode)
481
482 (if (or (< char 256)
483 (memq 'mule-utf-8 (find-coding-systems-region pos (1+ pos)))
484 (get-char-property pos 'untranslated-utf-8))
485 (setq unicode (or (get-char-property pos 'untranslated-utf-8)
486 (encode-char char 'ucs))))
487 (setq item-list
488 `(("character"
489 ,(format "%s (0%o, %d, 0x%x%s)"
490 (apply 'propertize (if (not multibyte-p)
491 (single-key-description char)
492 (if (< char 128)
493 (single-key-description char)
494 (string-to-multibyte
495 (char-to-string char))))
496 (text-properties-at pos))
497 char char char
498 (if unicode
499 (format ", U+%04X" unicode)
500 "")))
501 ("charset"
502 ,(symbol-name charset)
503 ,(format "(%s)" (charset-description charset)))
504 ("code point"
505 ,(let ((split (split-char char)))
506 (if (= (charset-dimension charset) 1)
507 (format "%d" (nth 1 split))
508 (format "%d %d" (nth 1 split) (nth 2 split)))))
509 ("syntax"
510 ,(let ((syntax (syntax-after pos)))
511 (with-temp-buffer
512 (internal-describe-syntax-value syntax)
513 (buffer-string))))
514 ("category"
515 ,@(let ((category-set (char-category-set char)))
516 (if (not category-set)
517 '("-- none --")
518 (mapcar #'(lambda (x) (format "%c:%s "
519 x (category-docstring x)))
520 (category-set-mnemonics category-set)))))
521 ,@(let ((props (aref char-code-property-table char))
522 ps)
523 (when props
524 (while props
525 (push (format "%s:" (pop props)) ps)
526 (push (format "%s;" (pop props)) ps))
527 (list (cons "Properties" (nreverse ps)))))
528 ("to input"
529 ,@(let ((key-list (and (eq input-method-function
530 'quail-input-method)
531 (quail-find-key char))))
532 (if (consp key-list)
533 (list "type"
534 (mapconcat #'(lambda (x) (concat "\"" x "\""))
535 key-list " or ")))))
536 ("buffer code"
537 ,(encoded-string-description
538 (string-as-unibyte (char-to-string char)) nil))
539 ("file code"
540 ,@(let* ((coding buffer-file-coding-system)
541 (encoded (encode-coding-char char coding)))
542 (if encoded
543 (list (encoded-string-description encoded coding)
544 (format "(encoded by coding system %S)" coding))
545 (list "not encodable by coding system"
546 (symbol-name coding)))))
547 ("display"
548 ,(cond
549 (disp-vector
550 (setq disp-vector (copy-sequence disp-vector))
551 (dotimes (i (length disp-vector))
552 (setq char (aref disp-vector i))
553 (aset disp-vector i
554 (cons char (describe-char-display pos char))))
555 (format "by display table entry [%s] (see below)"
556 (mapconcat #'(lambda (x) (format "?%c" (car x)))
557 disp-vector " ")))
558 (composition
559 (let ((from (car composition))
560 (to (nth 1 composition))
561 (next (1+ pos))
562 (components (nth 2 composition))
563 ch)
564 (setcar composition
565 (and (< from pos) (buffer-substring from pos)))
566 (setcar (cdr composition)
567 (and (< next to) (buffer-substring next to)))
568 (dotimes (i (length components))
569 (if (integerp (setq ch (aref components i)))
570 (push (cons ch (describe-char-display pos ch))
571 component-chars)))
572 (setq component-chars (nreverse component-chars))
573 (format "composed to form \"%s\" (see below)"
574 (buffer-substring from to))))
575 (t
576 (let ((display (describe-char-display pos char)))
577 (if (display-graphic-p (selected-frame))
578 (if display
579 (concat
580 "by this font (glyph code)\n"
581 (format " %s (0x%02X)"
582 (car display) (cdr display)))
583 "no font available")
584 (if display
585 (format "terminal code %s" display)
586 "not encodable for terminal"))))))
587 ,@(let ((unicodedata (and unicode
588 (describe-char-unicode-data unicode))))
589 (if unicodedata
590 (cons (list "Unicode data" " ") unicodedata)))))
591 (setq max-width (apply #'max (mapcar #'(lambda (x) (length (car x)))
592 item-list)))
593 (with-output-to-temp-buffer "*Help*"
594 (with-current-buffer standard-output
595 (set-buffer-multibyte multibyte-p)
596 (let ((formatter (format "%%%ds:" max-width)))
597 (dolist (elt item-list)
598 (when (cadr elt)
599 (insert (format formatter (car elt)))
600 (dolist (clm (cdr elt))
601 (when (>= (+ (current-column)
602 (or (string-match "\n" clm)
603 (string-width clm)) 1)
604 (window-width))
605 (insert "\n")
606 (indent-to (1+ max-width)))
607 (insert " " clm))
608 (insert "\n"))))
609
610 (save-excursion
611 (goto-char (point-min))
612 (re-search-forward "character:[ \t\n]+")
613 (setq pos (point)))
614 (if overlays
615 (mapc #'(lambda (props)
616 (let ((o (make-overlay pos (1+ pos))))
617 (while props
618 (overlay-put o (car props) (nth 1 props))
619 (setq props (cddr props)))))
620 overlays))
621
622 (when disp-vector
623 (insert
624 "\nThe display table entry is displayed by ")
625 (if (display-graphic-p (selected-frame))
626 (progn
627 (insert "these fonts (glyph codes):\n")
628 (dotimes (i (length disp-vector))
629 (insert (car (aref disp-vector i)) ?:
630 (propertize " " 'display '(space :align-to 5))
631 (if (cdr (aref disp-vector i))
632 (format "%s (0x%02X)" (cadr (aref disp-vector i))
633 (cddr (aref disp-vector i)))
634 "-- no font --")
635 "\n ")))
636 (insert "these terminal codes:\n")
637 (dotimes (i (length disp-vector))
638 (insert (car (aref disp-vector i))
639 (propertize " " 'display '(space :align-to 5))
640 (or (cdr (aref disp-vector i)) "-- not encodable --")
641 "\n"))))
642
643 (when composition
644 (insert "\nComposed")
645 (if (car composition)
646 (if (cadr composition)
647 (insert " with the surrounding characters \""
648 (car composition) "\" and \""
649 (cadr composition) "\"")
650 (insert " with the preceding character(s) \""
651 (car composition) "\""))
652 (if (cadr composition)
653 (insert " with the following character(s) \""
654 (cadr composition) "\"")))
655 (insert " by the rule:\n\t("
656 (mapconcat (lambda (x)
657 (format (if (consp x) "%S" "?%c") x))
658 (nth 2 composition)
659 " ")
660 ")")
661 (insert "\nThe component character(s) are displayed by ")
662 (if (display-graphic-p (selected-frame))
663 (progn
664 (insert "these fonts (glyph codes):")
665 (dolist (elt component-chars)
666 (insert "\n " (car elt) ?:
667 (propertize " " 'display '(space :align-to 5))
668 (if (cdr elt)
669 (format "%s (0x%02X)" (cadr elt) (cddr elt))
670 "-- no font --"))))
671 (insert "these terminal codes:")
672 (dolist (elt component-chars)
673 (insert "\n " (car elt) ":"
674 (propertize " " 'display '(space :align-to 5))
675 (or (cdr elt) "-- not encodable --"))))
676 (insert "\nSee the variable `reference-point-alist' for "
677 "the meaning of the rule.\n"))
678
679 (describe-text-properties pos (current-buffer))
680 (describe-text-mode)))))
681
682 (defalias 'describe-char-after 'describe-char)
683 (make-obsolete 'describe-char-after 'describe-char "21.5")
684
685 (provide 'descr-text)
686
687 ;;; arch-tag: fc55a498-f3e9-4312-b5bd-98cc02480af1
688 ;;; descr-text.el ends here