changeset 24045:094765645c52

(list-faces-display): Improve the formatting by computing the maximum length required for any face-name.
author Richard M. Stallman <rms@gnu.org>
date Mon, 11 Jan 1999 13:32:11 +0000
parents 9a52ffb7bfb2
children f2140f1e8109
files lisp/faces.el
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/faces.el	Mon Jan 11 12:59:36 1999 +0000
+++ b/lisp/faces.el	Mon Jan 11 13:32:11 1999 +0000
@@ -1124,7 +1124,11 @@
   (let ((faces (sort (face-list) (function string-lessp)))
 	(face nil)
 	(frame (selected-frame))
-	disp-frame window)
+	disp-frame window
+        (face-name-max-length
+         (car (sort (mapcar (function string-width)
+			    (mapcar (function symbol-name) (face-list)))
+                    (function >)))))
     (with-output-to-temp-buffer "*Faces*"
       (save-excursion
 	(set-buffer standard-output)
@@ -1132,7 +1136,10 @@
 	(while faces
 	  (setq face (car faces))
 	  (setq faces (cdr faces))
-	  (insert (format "%25s " (symbol-name face)))
+	  (insert (format 
+                   (format "%%-%ds "
+                           face-name-max-length)
+                   (symbol-name face)))
 	  (let ((beg (point)))
 	    (insert list-faces-sample-text)
 	    (insert "\n")