From 2306a6c74f00d98c8a7d1b2f08dde637ecc24d48 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 21 May 2002 06:05:39 +0000 Subject: [PATCH] (describe-char-after): Order display of text properties by the size of their value, for clarity. --- lisp/international/mule-diag.el | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) 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)))) )))) -- 2.39.5