Remove RCS keywords
[emacs.git] / lisp / descr-text.el
blobdfa87308fbe06dcb8415a8072c83a6a1242be7d7
1 ;;; descr-text.el --- describe text mode
3 ;; Copyright (C) 1994, 1995, 1996, 2001, 2002, 2003, 2004,
4 ;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
6 ;; Author: Boris Goldowsky <boris@gnu.org>
7 ;; Maintainer: FSF
8 ;; Keywords: faces, i18n, Unicode, multilingual
10 ;; This file is part of GNU Emacs.
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 3, or (at your option)
15 ;; any later version.
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
24 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 ;; Boston, MA 02110-1301, USA.
27 ;;; Commentary:
29 ;;; Describe-Text Mode.
31 ;;; Code:
33 (eval-when-compile (require 'quail))
34 (require 'help-fns)
36 ;;; Describe-Text Utilities.
38 (defun describe-text-widget (widget)
39 "Insert text to describe WIDGET in the current buffer."
40 (insert-text-button
41 (symbol-name (if (symbolp widget) widget (car widget)))
42 'action `(lambda (&rest ignore)
43 (widget-browse ',widget))
44 'help-echo "mouse-2, RET: browse this widget")
45 (insert " ")
46 (insert-text-button
47 "(widget)Top" 'type 'help-info 'help-args '("(widget)Top")))
49 (defun describe-text-sexp (sexp)
50 "Insert a short description of SEXP in the current buffer."
51 (let ((pp (condition-case signal
52 (pp-to-string sexp)
53 (error (prin1-to-string signal)))))
54 (when (string-match "\n\\'" pp)
55 (setq pp (substring pp 0 (1- (length pp)))))
56 (if (cond ((string-match "\n" pp)
57 nil)
58 ((> (length pp) (- (window-width) (current-column)))
59 nil)
60 (t t))
61 (insert pp)
62 (insert-text-button
63 "[Show]" 'action `(lambda (&rest ignore)
64 (with-output-to-temp-buffer
65 "*Pp Eval Output*"
66 (princ ',pp)))
67 'help-echo "mouse-2, RET: pretty print value in another buffer"))))
69 (defun describe-property-list (properties)
70 "Insert a description of PROPERTIES in the current buffer.
71 PROPERTIES should be a list of overlay or text properties.
72 The `category', `face' and `font-lock-face' properties are made
73 into help buttons that call `describe-text-category' or
74 `describe-face' when pushed."
75 ;; Sort the properties by the size of their value.
76 (dolist (elt (sort (let (ret)
77 (while properties
78 (push (list (pop properties) (pop properties)) ret))
79 ret)
80 (lambda (a b) (string< (prin1-to-string (nth 0 a) t)
81 (prin1-to-string (nth 0 b) t)))))
82 (let ((key (nth 0 elt))
83 (value (nth 1 elt)))
84 (insert (propertize (format " %-20s " key)
85 'face 'help-argument-name))
86 (cond ((eq key 'category)
87 (insert-text-button
88 (symbol-name value)
89 'action `(lambda (&rest ignore)
90 (describe-text-category ',value))
91 'help-echo "mouse-2, RET: describe this category"))
92 ((memq key '(face font-lock-face mouse-face))
93 (insert-text-button
94 (format "%S" value)
95 'type 'help-face 'help-args (list value)))
96 ((widgetp value)
97 (describe-text-widget value))
99 (describe-text-sexp value))))
100 (insert "\n")))
102 ;;; Describe-Text Commands.
104 (defun describe-text-category (category)
105 "Describe a text property category."
106 (interactive "SCategory: ")
107 (help-setup-xref (list #'describe-text-category category) (interactive-p))
108 (save-excursion
109 (with-output-to-temp-buffer "*Help*"
110 (set-buffer standard-output)
111 (insert "Category " (format "%S" category) ":\n\n")
112 (describe-property-list (symbol-plist category))
113 (goto-char (point-min)))))
115 ;;;###autoload
116 (defun describe-text-properties (pos &optional output-buffer)
117 "Describe widgets, buttons, overlays and text properties at POS.
118 Interactively, describe them for the character after point.
119 If optional second argument OUTPUT-BUFFER is non-nil,
120 insert the output into that buffer, and don't initialize or clear it
121 otherwise."
122 (interactive "d")
123 (if (>= pos (point-max))
124 (error "No character follows specified position"))
125 (if output-buffer
126 (describe-text-properties-1 pos output-buffer)
127 (if (not (or (text-properties-at pos) (overlays-at pos)))
128 (message "This is plain text.")
129 (let ((buffer (current-buffer))
130 (target-buffer "*Help*"))
131 (when (eq buffer (get-buffer target-buffer))
132 (setq target-buffer "*Help*<2>"))
133 (save-excursion
134 (with-output-to-temp-buffer target-buffer
135 (set-buffer standard-output)
136 (setq output-buffer (current-buffer))
137 (insert "Text content at position " (format "%d" pos) ":\n\n")
138 (with-current-buffer buffer
139 (describe-text-properties-1 pos output-buffer))
140 (goto-char (point-min))))))))
142 (defun describe-text-properties-1 (pos output-buffer)
143 (let* ((properties (text-properties-at pos))
144 (overlays (overlays-at pos))
145 (wid-field (get-char-property pos 'field))
146 (wid-button (get-char-property pos 'button))
147 (wid-doc (get-char-property pos 'widget-doc))
148 ;; If button.el is not loaded, we have no buttons in the text.
149 (button (and (fboundp 'button-at) (button-at pos)))
150 (button-type (and button (button-type button)))
151 (button-label (and button (button-label button)))
152 (widget (or wid-field wid-button wid-doc)))
153 (with-current-buffer output-buffer
154 ;; Widgets
155 (when (widgetp widget)
156 (newline)
157 (insert (cond (wid-field "This is an editable text area")
158 (wid-button "This is an active area")
159 (wid-doc "This is documentation text")))
160 (insert " of a ")
161 (describe-text-widget widget)
162 (insert ".\n\n"))
163 ;; Buttons
164 (when (and button (not (widgetp wid-button)))
165 (newline)
166 (insert "Here is a `" (format "%S" button-type)
167 "' button labeled `" button-label "'.\n\n"))
168 ;; Overlays
169 (when overlays
170 (newline)
171 (if (eq (length overlays) 1)
172 (insert "There is an overlay here:\n")
173 (insert "There are " (format "%d" (length overlays))
174 " overlays here:\n"))
175 (dolist (overlay overlays)
176 (insert " From " (format "%d" (overlay-start overlay))
177 " to " (format "%d" (overlay-end overlay)) "\n")
178 (describe-property-list (overlay-properties overlay)))
179 (insert "\n"))
180 ;; Text properties
181 (when properties
182 (newline)
183 (insert "There are text properties here:\n")
184 (describe-property-list properties)))))
186 (defcustom describe-char-unidata-list nil
187 "List of Unicode-based character property names shown by `describe-char'."
188 :group 'mule
189 :version "23.1"
190 :type '(set
191 (const :tag "Unicode Name" name)
192 (const :tag "Unicode general category " general-category)
193 (const :tag "Unicode canonical combining class"
194 canonical-combining-class)
195 (const :tag "Unicode bidi class" bidi-class)
196 (const :tag "Unicode decomposition mapping" decomposition)
197 (const :tag "Unicode decimal digit value" decimal-digit-value)
198 (const :tag "Unicode digit value" digit-value)
199 (const :tag "Unicode numeric value" numeric-value)
200 (const :tag "Unicode mirrored" mirrored)
201 (const :tag "Unicode old name" old-name)
202 (const :tag "Unicode ISO 10646 comment" iso-10646-comment)
203 (const :tag "Unicode simple uppercase mapping" uppercase)
204 (const :tag "Unicode simple lowercase mapping" lowercase)
205 (const :tag "Unicode simple titlecase mapping" titlecase)))
207 (defcustom describe-char-unicodedata-file nil
208 "Location of Unicode data file.
209 This is the UnicodeData.txt file from the Unicode Consortium, used for
210 diagnostics. If it is non-nil `describe-char' will print data
211 looked up from it. This facility is mostly of use to people doing
212 multilingual development.
214 This is a fairly large file, not typically present on GNU systems.
215 At the time of writing it is at the URL
216 `http://www.unicode.org/Public/UNIDATA/UnicodeData.txt'."
217 :group 'mule
218 :version "22.1"
219 :type '(choice (const :tag "None" nil)
220 file))
222 ;; We could convert the unidata file into a Lispy form once-for-all
223 ;; and distribute it for loading on demand. It might be made more
224 ;; space-efficient by splitting strings word-wise and replacing them
225 ;; with lists of symbols interned in a private obarray, e.g.
226 ;; "LATIN SMALL LETTER A" => '(LATIN SMALL LETTER A).
228 ;; Fixme: Check whether this needs updating for Unicode 4.
229 (defun describe-char-unicode-data (char)
230 "Return a list of Unicode data for unicode CHAR.
231 Each element is a list of a property description and the property value.
232 The list is null if CHAR isn't found in `describe-char-unicodedata-file'.
233 This function is semi-obsolete. Use `get-char-code-property'."
234 (when describe-char-unicodedata-file
235 (unless (file-exists-p describe-char-unicodedata-file)
236 (error "`unicodedata-file' %s not found" describe-char-unicodedata-file))
237 (with-current-buffer (get-buffer-create " *Unicode Data*")
238 (when (zerop (buffer-size))
239 ;; Don't use -literally in case of DOS line endings.
240 (insert-file-contents describe-char-unicodedata-file))
241 (goto-char (point-min))
242 (let ((hex (format "%04X" char))
243 found first last)
244 (if (re-search-forward (concat "^" hex) nil t)
245 (setq found t)
246 ;; It's not listed explicitly. Look for ranges, e.g. CJK
247 ;; ideographs, and check whether it's in one of them.
248 (while (and (re-search-forward "^\\([^;]+\\);[^;]+First>;" nil t)
249 (>= char (setq first
250 (string-to-number (match-string 1) 16)))
251 (progn
252 (forward-line 1)
253 (looking-at "^\\([^;]+\\);[^;]+Last>;")
254 (> char
255 (setq last
256 (string-to-number (match-string 1) 16))))))
257 (if (and (>= char first)
258 (<= char last))
259 (setq found t)))
260 (if found
261 (let ((fields (mapcar (lambda (elt)
262 (if (> (length elt) 0)
263 elt))
264 (cdr (split-string
265 (buffer-substring
266 (line-beginning-position)
267 (line-end-position))
268 ";")))))
269 ;; The length depends on whether the last field was empty.
270 (unless (or (= 13 (length fields))
271 (= 14 (length fields)))
272 (error "Invalid contents in %s" describe-char-unicodedata-file))
273 ;; The field names and values lists are slightly
274 ;; modified from Mule-UCS unidata.el.
275 (list
276 (list "Name" (let ((name (nth 0 fields)))
277 ;; Check for <..., First>, <..., Last>
278 (if (string-match "\\`\\(<[^,]+\\)," name)
279 (concat (match-string 1 name) ">")
280 name)))
281 (list "Category"
282 (let ((val (nth 1 fields)))
283 (or (char-code-property-description
284 'general-category (intern val))
285 val)))
286 (list "Combining class"
287 (let ((val (nth 1 fields)))
288 (or (char-code-property-description
289 'canonical-combining-class (intern val))
290 val)))
291 (list "Bidi category"
292 (let ((val (nth 1 fields)))
293 (or (char-code-property-description
294 'bidi-class (intern val))
295 val)))
296 (list
297 "Decomposition"
298 (if (nth 4 fields)
299 (let* ((parts (split-string (nth 4 fields)))
300 (info (car parts)))
301 (if (string-match "\\`<\\(.+\\)>\\'" info)
302 (setq info (match-string 1 info))
303 (setq info nil))
304 (if info (setq parts (cdr parts)))
305 (setq parts (mapconcat
306 (lambda (arg)
307 (string (string-to-number arg 16)))
308 parts " "))
309 (concat info parts))))
310 (list "Decimal digit value"
311 (nth 5 fields))
312 (list "Digit value"
313 (nth 6 fields))
314 (list "Numeric value"
315 (nth 7 fields))
316 (list "Mirrored"
317 (if (equal "Y" (nth 8 fields))
318 "yes"))
319 (list "Old name" (nth 9 fields))
320 (list "ISO 10646 comment" (nth 10 fields))
321 (list "Uppercase" (and (nth 11 fields)
322 (string (string-to-number
323 (nth 11 fields) 16))))
324 (list "Lowercase" (and (nth 12 fields)
325 (string (string-to-number
326 (nth 12 fields) 16))))
327 (list "Titlecase" (and (nth 13 fields)
328 (string (string-to-number
329 (nth 13 fields) 16)))))))))))
331 ;; Return information about how CHAR is displayed at the buffer
332 ;; position POS. If the selected frame is on a graphic display,
333 ;; return a cons (FONTNAME . GLYPH-CODE) where GLYPH-CODE is a
334 ;; hexadigit string representing the glyph-ID. Otherwise, return a
335 ;; string describing the terminal codes for the character.
336 (defun describe-char-display (pos char)
337 (if (display-graphic-p (selected-frame))
338 (let ((char-font-info (internal-char-font pos char)))
339 (if char-font-info
340 (if (integerp (cdr char-font-info))
341 (setcdr char-font-info (format "%02X" (cdr char-font-info)))
342 (setcdr char-font-info
343 (format "%04X%04X"
344 (cadr char-font-info) (cddr char-font-info)))))
345 char-font-info)
346 (let* ((coding (terminal-coding-system))
347 (encoded (encode-coding-char char coding)))
348 (if encoded
349 (encoded-string-description encoded coding)))))
352 ;;;###autoload
353 (defun describe-char (pos)
354 "Describe the character after POS (interactively, the character after point).
355 The information includes character code, charset and code points in it,
356 syntax, category, how the character is encoded in a file,
357 character composition information (if relevant),
358 as well as widgets, buttons, overlays, and text properties."
359 (interactive "d")
360 (if (>= pos (point-max))
361 (error "No character follows specified position"))
362 (let* ((char (char-after pos))
363 (charset (char-charset char))
364 (composition (find-composition pos nil nil t))
365 (component-chars nil)
366 (display-table (or (window-display-table)
367 buffer-display-table
368 standard-display-table))
369 (disp-vector (and display-table (aref display-table char)))
370 (multibyte-p enable-multibyte-characters)
371 (overlays (mapcar #'(lambda (o) (overlay-properties o))
372 (overlays-at pos)))
373 (char-description (if (not multibyte-p)
374 (single-key-description char)
375 (if (< char 128)
376 (single-key-description char)
377 (string-to-multibyte
378 (char-to-string char)))))
379 (text-props-desc
380 (let ((tmp-buf (generate-new-buffer " *text-props*")))
381 (unwind-protect
382 (progn
383 (describe-text-properties pos tmp-buf)
384 (with-current-buffer tmp-buf (buffer-string)))
385 (kill-buffer tmp-buf))))
386 item-list max-width code)
388 (setq code (encode-char char charset))
389 (setq item-list
390 `(("character"
391 ,(format "%s (%d, #o%o, #x%x)"
392 (apply 'propertize char-description
393 (text-properties-at pos))
394 char char char))
395 ("preferred charset"
396 ,`(insert-text-button
397 ,(symbol-name charset)
398 'type 'help-character-set 'help-args '(,charset))
399 ,(format "(%s)" (charset-description charset)))
400 ("code point"
401 ,(let ((str (if (integerp code)
402 (format (if (< code 256) "0x%02X" "0x%04X") code)
403 (format "0x%04X%04X" (car code) (cdr code)))))
404 (if (<= (charset-dimension charset) 2)
405 `(insert-text-button
406 ,str
407 'action (lambda (&rest ignore)
408 (list-charset-chars ',charset)
409 (with-selected-window
410 (get-buffer-window "*Character List*" 0)
411 (goto-char (point-min))
412 (forward-line 2) ;Skip the header.
413 (let ((case-fold-search nil))
414 (if (search-forward ,(char-to-string char)
415 nil t)
416 (goto-char (match-beginning 0))))))
417 'help-echo
418 "mouse-2, RET: show this character in its character set")
419 str)))
420 ("syntax"
421 ,(let ((syntax (syntax-after pos)))
422 (with-temp-buffer
423 (internal-describe-syntax-value syntax)
424 (buffer-string))))
425 ("category"
426 ,@(let ((category-set (char-category-set char)))
427 (if (not category-set)
428 '("-- none --")
429 (mapcar #'(lambda (x) (format "%c:%s"
430 x (category-docstring x)))
431 (category-set-mnemonics category-set)))))
432 ("to input"
433 ,@(let ((key-list (and (eq input-method-function
434 'quail-input-method)
435 (quail-find-key char))))
436 (if (consp key-list)
437 (list "type"
438 (mapconcat #'(lambda (x) (concat "\"" x "\""))
439 key-list " or ")
440 "with"
441 `(insert-text-button
442 ,current-input-method
443 'type 'help-input-method
444 'help-args '(,current-input-method))))))
445 ("buffer code"
446 ,(encoded-string-description
447 (string-as-unibyte (char-to-string char)) nil))
448 ("file code"
449 ,@(let* ((coding buffer-file-coding-system)
450 (encoded (encode-coding-char char coding)))
451 (if encoded
452 (list (encoded-string-description encoded coding)
453 (format "(encoded by coding system %S)" coding))
454 (list "not encodable by coding system"
455 (symbol-name coding)))))
456 ("display"
457 ,(cond
458 (disp-vector
459 (setq disp-vector (copy-sequence disp-vector))
460 (dotimes (i (length disp-vector))
461 (setq char (aref disp-vector i))
462 (aset disp-vector i
463 (cons char (describe-char-display
464 pos (glyph-char char)))))
465 (format "by display table entry [%s] (see below)"
466 (mapconcat
467 #'(lambda (x)
468 (format "?%c" (glyph-char (car x))))
469 disp-vector " ")))
470 (composition
471 (let ((from (car composition))
472 (to (nth 1 composition))
473 (next (1+ pos))
474 (components (nth 2 composition))
476 (setcar composition
477 (and (< from pos) (buffer-substring from pos)))
478 (setcar (cdr composition)
479 (and (< next to) (buffer-substring next to)))
480 (dotimes (i (length components))
481 (if (integerp (setq ch (aref components i)))
482 (push (cons ch (describe-char-display pos ch))
483 component-chars)))
484 (setq component-chars (nreverse component-chars))
485 (format "composed to form \"%s\" (see below)"
486 (buffer-substring from to))))
488 (let ((display (describe-char-display pos char)))
489 (if (display-graphic-p (selected-frame))
490 (if display
491 (concat
492 "by this font (glyph code)\n"
493 (format " %s (#x%s)"
494 (car display) (cdr display)))
495 "no font available")
496 (if display
497 (format "terminal code %s" display)
498 "not encodable for terminal"))))))
499 ,@(let ((face
500 (if (not (or disp-vector composition))
501 (cond
502 ((and show-trailing-whitespace
503 (save-excursion (goto-char pos)
504 (looking-at "[ \t]+$")))
505 'trailing-whitespace)
506 ((and nobreak-char-display char (eq char '#xa0))
507 'nobreak-space)
508 ((and nobreak-char-display char (eq char '#xad))
509 'escape-glyph)
510 ((and (< char 32) (not (memq char '(9 10))))
511 'escape-glyph)))))
512 (if face (list (list "hardcoded face"
513 `(insert-text-button
514 ,(symbol-name face)
515 'type 'help-face 'help-args '(,face))))))
516 ,@(let ((unicodedata (describe-char-unicode-data char)))
517 (if unicodedata
518 (cons (list "Unicode data" " ") unicodedata)))))
519 (setq max-width (apply #'max (mapcar #'(lambda (x)
520 (if (cadr x) (length (car x)) 0))
521 item-list)))
522 (help-setup-xref nil (interactive-p))
523 (with-help-window (help-buffer)
524 (with-current-buffer standard-output
525 (set-buffer-multibyte multibyte-p)
526 (let ((formatter (format "%%%ds:" max-width)))
527 (dolist (elt item-list)
528 (when (cadr elt)
529 (insert (format formatter (car elt)))
530 (dolist (clm (cdr elt))
531 (if (eq (car-safe clm) 'insert-text-button)
532 (progn (insert " ") (eval clm))
533 (when (>= (+ (current-column)
534 (or (string-match "\n" clm)
535 (string-width clm))
537 (window-width))
538 (insert "\n")
539 (indent-to (1+ max-width)))
540 (insert " " clm)))
541 (insert "\n"))))
543 (when overlays
544 (save-excursion
545 (goto-char (point-min))
546 (re-search-forward "character:[ \t\n]+")
547 (let* ((end (+ (point) (length char-description))))
548 (mapc #'(lambda (props)
549 (let ((o (make-overlay (point) end)))
550 (while props
551 (overlay-put o (car props) (nth 1 props))
552 (setq props (cddr props)))))
553 overlays))))
555 (when disp-vector
556 (insert
557 "\nThe display table entry is displayed by ")
558 (if (display-graphic-p (selected-frame))
559 (progn
560 (insert "these fonts (glyph codes):\n")
561 (dotimes (i (length disp-vector))
562 (insert (glyph-char (car (aref disp-vector i))) ?:
563 (propertize " " 'display '(space :align-to 5))
564 (if (cdr (aref disp-vector i))
565 (format "%s (#x%s)" (cadr (aref disp-vector i))
566 (cddr (aref disp-vector i)))
567 "-- no font --")
568 "\n")
569 (let ((face (glyph-face (car (aref disp-vector i)))))
570 (when face
571 (insert (propertize " " 'display '(space :align-to 5))
572 "face: ")
573 (insert (concat "`" (symbol-name face) "'"))
574 (insert "\n")))))
575 (insert "these terminal codes:\n")
576 (dotimes (i (length disp-vector))
577 (insert (car (aref disp-vector i))
578 (propertize " " 'display '(space :align-to 5))
579 (or (cdr (aref disp-vector i)) "-- not encodable --")
580 "\n"))))
582 (when composition
583 (insert "\nComposed")
584 (if (car composition)
585 (if (cadr composition)
586 (insert " with the surrounding characters \""
587 (car composition) "\" and \""
588 (cadr composition) "\"")
589 (insert " with the preceding character(s) \""
590 (car composition) "\""))
591 (if (cadr composition)
592 (insert " with the following character(s) \""
593 (cadr composition) "\"")))
594 (if (and (vectorp (nth 2 composition))
595 (vectorp (aref (nth 2 composition) 0)))
596 (progn
597 (insert " using this font:\n "
598 (aref (query-font (aref (aref (nth 2 composition) 0) 0))
600 "\nby these glyphs:\n")
601 (mapc (lambda (x) (insert (format " %S\n" x)))
602 (nth 2 composition)))
603 (insert " by the rule:\n\t("
604 (mapconcat (lambda (x)
605 (if (consp x) (format "%S" x)
606 (if (= x ?\t)
607 (single-key-description x)
608 (string ?? x))))
609 (nth 2 composition)
610 " ")
611 ")")
612 (insert "\nThe component character(s) are displayed by ")
613 (if (display-graphic-p (selected-frame))
614 (progn
615 (insert "these fonts (glyph codes):")
616 (dolist (elt component-chars)
617 (if (/= (car elt) ?\t)
618 (insert "\n " (car elt) ?:
619 (propertize " " 'display '(space :align-to 5))
620 (if (cdr elt)
621 (format "%s (#x%s)" (cadr elt) (cddr elt))
622 "-- no font --")))))
623 (insert "these terminal codes:")
624 (dolist (elt component-chars)
625 (insert "\n " (car elt) ":"
626 (propertize " " 'display '(space :align-to 4))
627 (or (cdr elt) "-- not encodable --"))))
628 (insert "\nSee the variable `reference-point-alist' for "
629 "the meaning of the rule.\n")))
631 (if (not describe-char-unidata-list)
632 (insert "\nCharacter code properties are not shown: ")
633 (insert "\nCharacter code properties: "))
634 (insert-text-button
635 "customize what to show"
636 'action (lambda (&rest ignore)
637 (customize-variable
638 'describe-char-unidata-list)))
639 (insert "\n")
640 (dolist (elt describe-char-unidata-list)
641 (let ((val (get-char-code-property char elt))
642 description)
643 (when val
644 (setq description (char-code-property-description elt val))
645 (if description
646 (insert (format " %s: %s (%s)\n" elt val description))
647 (insert (format " %s: %s\n" elt val))))))
649 (if text-props-desc (insert text-props-desc))
650 (setq help-xref-stack-item (list 'help-insert-string (buffer-string)))
651 (toggle-read-only 1)))))
653 (defalias 'describe-char-after 'describe-char)
654 (make-obsolete 'describe-char-after 'describe-char "22.1")
656 (provide 'descr-text)
658 ;; arch-tag: fc55a498-f3e9-4312-b5bd-98cc02480af1
659 ;;; descr-text.el ends here