]> git.eshelyaron.com Git - emacs.git/commitdiff
(describe-char-after): Order display of text properties by the size of
authorColin Walters <walters@gnu.org>
Tue, 21 May 2002 06:05:39 +0000 (06:05 +0000)
committerColin Walters <walters@gnu.org>
Tue, 21 May 2002 06:05:39 +0000 (06:05 +0000)
their value, for clarity.

lisp/international/mule-diag.el

index 3ed7a5010308da383cdd81137c43ab66af87dcb6..055da29a83e694d8cd11b89e97bf4316fb30f46e 100644 (file)
@@ -659,11 +659,21 @@ which font is being used for displaying the character."
                    ").\n"
                    "See the variable `reference-point-alist' for "
                    "the meaning of the rule.\n")))
-       (if props
-           (insert "\nText properties\n"))
-       (while props
-         (insert (format "  %s: %s" (car props) (cadr props)))
-         (setq props (cddr props)))
+       (when props
+         (insert "\nText properties\n"))
+       ;; List the text properties, sorted by the size of the printed
+       ;; representation of their value.  This makes it easier to
+       ;; read.
+       (dolist (elt (sort (let ((ret nil))
+                            (while props
+                              (push (cons (pop props)
+                                          (prin1-to-string (pop props)))
+                                    ret))
+                            ret)
+                          (lambda (a b)
+                            (< (length (cdr a))
+                               (length (cdr b))))))
+         (insert (format "  %s: %s\n" (car elt) (cdr elt))))
        ))))
 
 \f