aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2004-12-16 13:09:48 +0000
committerJuri Linkov2004-12-16 13:09:48 +0000
commit8b18fb8fff58f0063ae8500a62eafb09434676c3 (patch)
treebd1dfda975d257c65cbe61e944f4e194be0dd8fd
parentf507d6a15348caaba4eac96182f6ca74a089659b (diff)
downloademacs-8b18fb8fff58f0063ae8500a62eafb09434676c3.tar.gz
emacs-8b18fb8fff58f0063ae8500a62eafb09434676c3.zip
(describe-property-list): Don't treat syntax-table
specially. Use describe-text-sexp which inserts [show] button for large objects and handles printing errors. Sort properties by names in alphabetical order instead of by value sizes. Add `mouse-face' to list of properties for `describe-face' widget. (describe-char): Mask out face-id from 19 bits of character. Print face-id separately.
-rw-r--r--lisp/descr-text.el46
1 files changed, 16 insertions, 30 deletions
diff --git a/lisp/descr-text.el b/lisp/descr-text.el
index 49b9b12154a..726d3e6e5d8 100644
--- a/lisp/descr-text.el
+++ b/lisp/descr-text.el
@@ -104,24 +104,11 @@ The `category', `face' and `font-lock-face' properties are made
104into widget buttons that call `describe-text-category' or 104into widget buttons that call `describe-text-category' or
105`describe-face' when pushed." 105`describe-face' when pushed."
106 ;; Sort the properties by the size of their value. 106 ;; Sort the properties by the size of their value.
107 (dolist (elt (sort (let ((ret nil) 107 (dolist (elt (sort (let (ret)
108 (key nil)
109 (val nil)
110 (len nil))
111 (while properties 108 (while properties
112 (setq key (pop properties) 109 (push (list (pop properties) (pop properties)) ret))
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) 110 ret)
122 (lambda (a b) 111 (lambda (a b) (string< (nth 0 a) (nth 0 b)))))
123 (< (nth 2 a)
124 (nth 2 b)))))
125 (let ((key (nth 0 elt)) 112 (let ((key (nth 0 elt))
126 (value (nth 1 elt))) 113 (value (nth 1 elt)))
127 (widget-insert (propertize (format " %-20s " key) 114 (widget-insert (propertize (format " %-20s " key)
@@ -131,23 +118,15 @@ into widget buttons that call `describe-text-category' or
131 :notify `(lambda (&rest ignore) 118 :notify `(lambda (&rest ignore)
132 (describe-text-category ',value)) 119 (describe-text-category ',value))
133 (format "%S" value))) 120 (format "%S" value)))
134 ((memq key '(face font-lock-face)) 121 ((memq key '(face font-lock-face mouse-face))
135 (widget-create 'link 122 (widget-create 'link
136 :notify `(lambda (&rest ignore) 123 :notify `(lambda (&rest ignore)
137 (describe-face ',value)) 124 (describe-face ',value))
138 (format "%S" value))) 125 (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) 126 ((widgetp value)
148 (describe-text-widget value)) 127 (describe-text-widget value))
149 (t 128 (t
150 (widget-insert value)))) 129 (describe-text-sexp value))))
151 (widget-insert "\n"))) 130 (widget-insert "\n")))
152 131
153;;; Describe-Text Commands. 132;;; Describe-Text Commands.
@@ -552,10 +531,17 @@ as well as widgets, buttons, overlays, and text properties."
552 (dotimes (i (length disp-vector)) 531 (dotimes (i (length disp-vector))
553 (setq char (aref disp-vector i)) 532 (setq char (aref disp-vector i))
554 (aset disp-vector i 533 (aset disp-vector i
555 (cons char (describe-char-display pos char)))) 534 (cons char (describe-char-display
535 pos (logand char #x7ffff)))))
556 (format "by display table entry [%s] (see below)" 536 (format "by display table entry [%s] (see below)"
557 (mapconcat #'(lambda (x) (format "?%c" (car x))) 537 (mapconcat
558 disp-vector " "))) 538 #'(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 " ")))
559 (composition 545 (composition
560 (let ((from (car composition)) 546 (let ((from (car composition))
561 (to (nth 1 composition)) 547 (to (nth 1 composition))
@@ -627,7 +613,7 @@ as well as widgets, buttons, overlays, and text properties."
627 (progn 613 (progn
628 (insert "these fonts (glyph codes):\n") 614 (insert "these fonts (glyph codes):\n")
629 (dotimes (i (length disp-vector)) 615 (dotimes (i (length disp-vector))
630 (insert (car (aref disp-vector i)) ?: 616 (insert (logand (car (aref disp-vector i)) #x7ffff) ?:
631 (propertize " " 'display '(space :align-to 5)) 617 (propertize " " 'display '(space :align-to 5))
632 (if (cdr (aref disp-vector i)) 618 (if (cdr (aref disp-vector i))
633 (format "%s (0x%02X)" (cadr (aref disp-vector i)) 619 (format "%s (0x%02X)" (cadr (aref disp-vector i))