From: Colin Walters Date: Tue, 21 May 2002 06:05:39 +0000 (+0000) Subject: (describe-char-after): Order display of text properties by the size of X-Git-Tag: ttn-vms-21-2-B4~14940 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2306a6c74f00d98c8a7d1b2f08dde637ecc24d48;p=emacs.git (describe-char-after): Order display of text properties by the size of their value, for clarity. --- diff --git a/lisp/international/mule-diag.el b/lisp/international/mule-diag.el index 3ed7a501030..055da29a83e 100644 --- a/lisp/international/mule-diag.el +++ b/lisp/international/mule-diag.el @@ -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)))) ))))