Mercurial > emacs
changeset 45436:0d9c23804094
(describe-char-after): Order display of text properties by the size of
their value, for clarity.
author | Colin Walters <walters@gnu.org> |
---|---|
date | Tue, 21 May 2002 06:05:39 +0000 |
parents | 5fd8d851473e |
children | c48cc0f16c0e |
files | lisp/international/mule-diag.el |
diffstat | 1 files changed, 15 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/international/mule-diag.el Tue May 21 06:05:12 2002 +0000 +++ b/lisp/international/mule-diag.el Tue May 21 06:05:39 2002 +0000 @@ -659,11 +659,21 @@ ").\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)))) ))))