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