104 |
into widget buttons that call `describe-text-category' or |
into widget buttons that call `describe-text-category' or |
105 |
`describe-face' when pushed." |
`describe-face' when pushed." |
106 |
;; Sort the properties by the size of their value. |
;; Sort the properties by the size of their value. |
107 |
(dolist (elt (sort (let ((ret nil) |
(dolist (elt (sort (let (ret) |
|
(key nil) |
|
|
(val nil) |
|
|
(len nil)) |
|
108 |
(while properties |
(while properties |
109 |
(setq key (pop properties) |
(push (list (pop properties) (pop properties)) ret)) |
|
val (pop properties) |
|
|
len 0) |
|
|
(unless (or (memq key '(category face font-lock-face |
|
|
syntax-table)) |
|
|
(widgetp val)) |
|
|
(setq val (pp-to-string val) |
|
|
len (length val))) |
|
|
(push (list key val len) ret)) |
|
110 |
ret) |
ret) |
111 |
(lambda (a b) |
(lambda (a b) (string< (nth 0 a) (nth 0 b))))) |
|
(< (nth 2 a) |
|
|
(nth 2 b))))) |
|
112 |
(let ((key (nth 0 elt)) |
(let ((key (nth 0 elt)) |
113 |
(value (nth 1 elt))) |
(value (nth 1 elt))) |
114 |
(widget-insert (propertize (format " %-20s " key) |
(widget-insert (propertize (format " %-20s " key) |
118 |
:notify `(lambda (&rest ignore) |
:notify `(lambda (&rest ignore) |
119 |
(describe-text-category ',value)) |
(describe-text-category ',value)) |
120 |
(format "%S" value))) |
(format "%S" value))) |
121 |
((memq key '(face font-lock-face)) |
((memq key '(face font-lock-face mouse-face)) |
122 |
(widget-create 'link |
(widget-create 'link |
123 |
:notify `(lambda (&rest ignore) |
:notify `(lambda (&rest ignore) |
124 |
(describe-face ',value)) |
(describe-face ',value)) |
125 |
(format "%S" value))) |
(format "%S" value))) |
|
((eq key 'syntax-table) |
|
|
(widget-create 'push-button |
|
|
:tag "show" |
|
|
:action (lambda (widget &optional event) |
|
|
(with-output-to-temp-buffer |
|
|
"*Pp Eval Output*" |
|
|
(pp (widget-get widget :value)))) |
|
|
value)) |
|
126 |
((widgetp value) |
((widgetp value) |
127 |
(describe-text-widget value)) |
(describe-text-widget value)) |
128 |
(t |
(t |
129 |
(widget-insert value)))) |
(describe-text-sexp value)))) |
130 |
(widget-insert "\n"))) |
(widget-insert "\n"))) |
131 |
|
|
132 |
;;; Describe-Text Commands. |
;;; Describe-Text Commands. |
531 |
(dotimes (i (length disp-vector)) |
(dotimes (i (length disp-vector)) |
532 |
(setq char (aref disp-vector i)) |
(setq char (aref disp-vector i)) |
533 |
(aset disp-vector i |
(aset disp-vector i |
534 |
(cons char (describe-char-display pos char)))) |
(cons char (describe-char-display |
535 |
|
pos (logand char #x7ffff))))) |
536 |
(format "by display table entry [%s] (see below)" |
(format "by display table entry [%s] (see below)" |
537 |
(mapconcat #'(lambda (x) (format "?%c" (car x))) |
(mapconcat |
538 |
disp-vector " "))) |
#'(lambda (x) |
539 |
|
(if (> (car x) #x7ffff) |
540 |
|
(format "?%c<face-id=%s>" |
541 |
|
(logand (car x) #x7ffff) |
542 |
|
(lsh (car x) -19)) |
543 |
|
(format "?%c" (car x)))) |
544 |
|
disp-vector " "))) |
545 |
(composition |
(composition |
546 |
(let ((from (car composition)) |
(let ((from (car composition)) |
547 |
(to (nth 1 composition)) |
(to (nth 1 composition)) |
613 |
(progn |
(progn |
614 |
(insert "these fonts (glyph codes):\n") |
(insert "these fonts (glyph codes):\n") |
615 |
(dotimes (i (length disp-vector)) |
(dotimes (i (length disp-vector)) |
616 |
(insert (car (aref disp-vector i)) ?: |
(insert (logand (car (aref disp-vector i)) #x7ffff) ?: |
617 |
(propertize " " 'display '(space :align-to 5)) |
(propertize " " 'display '(space :align-to 5)) |
618 |
(if (cdr (aref disp-vector i)) |
(if (cdr (aref disp-vector i)) |
619 |
(format "%s (0x%02X)" (cadr (aref disp-vector i)) |
(format "%s (0x%02X)" (cadr (aref disp-vector i)) |