aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Walters2002-06-08 22:12:14 +0000
committerColin Walters2002-06-08 22:12:14 +0000
commite2fa2f6e91def6fa16bfc7abe424eed650722d12 (patch)
tree051046b129939cd9a96fef4676ec9446582ed935
parentcc11e3eea91d31c530a982fcf1c5fa4fc97a3afa (diff)
downloademacs-e2fa2f6e91def6fa16bfc7abe424eed650722d12.tar.gz
emacs-e2fa2f6e91def6fa16bfc7abe424eed650722d12.zip
(describe-text-properties): Sort the output by the size of the values.
Put `font-lock-face' property on property names.
-rw-r--r--lisp/descr-text.el31
1 files changed, 24 insertions, 7 deletions
diff --git a/lisp/descr-text.el b/lisp/descr-text.el
index 72a3009ebd3..d9e5d6f4282 100644
--- a/lisp/descr-text.el
+++ b/lisp/descr-text.el
@@ -98,10 +98,28 @@ if that value is non-nil."
98PROPERTIES should be a list of overlay or text properties. 98PROPERTIES should be a list of overlay or text properties.
99The `category' property is made into a widget button that call 99The `category' property is made into a widget button that call
100`describe-text-category' when pushed." 100`describe-text-category' when pushed."
101 (while properties 101 ;; Sort the properties by the size of their value.
102 (widget-insert (format " %-20s " (car properties))) 102 (dolist (elt (sort (let ((ret nil)
103 (let ((key (nth 0 properties)) 103 (key nil)
104 (value (nth 1 properties))) 104 (val nil)
105 (len nil))
106 (while properties
107 (setq key (pop properties)
108 val (pop properties)
109 len 0)
110 (unless (or (eq key 'category)
111 (widgetp val))
112 (setq val (pp-to-string val)
113 len (length val)))
114 (push (list key val len) ret))
115 ret)
116 (lambda (a b)
117 (< (nth 2 a)
118 (nth 2 b)))))
119 (let ((key (nth 0 elt))
120 (value (nth 1 elt)))
121 (widget-insert (propertize (format " %-20s" key)
122 'font-lock-face 'italic))
105 (cond ((eq key 'category) 123 (cond ((eq key 'category)
106 (widget-create 'link 124 (widget-create 'link
107 :notify `(lambda (&rest ignore) 125 :notify `(lambda (&rest ignore)
@@ -110,9 +128,8 @@ The `category' property is made into a widget button that call
110 ((widgetp value) 128 ((widgetp value)
111 (describe-text-widget value)) 129 (describe-text-widget value))
112 (t 130 (t
113 (describe-text-sexp value)))) 131 (widget-insert value))))
114 (widget-insert "\n") 132 (widget-insert "\n")))
115 (setq properties (cdr (cdr properties)))))
116 133
117;;; Describe-Text Commands. 134;;; Describe-Text Commands.
118 135