From 6fe3eb772f9e665f25ca7d45abe02edec97139c1 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 11 Jan 1999 13:32:11 +0000 Subject: [PATCH] (list-faces-display): Improve the formatting by computing the maximum length required for any face-name. --- lisp/faces.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lisp/faces.el b/lisp/faces.el index 24abd40a06c..5e713c25cf7 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -1124,7 +1124,11 @@ selected frame." (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 @@ selected frame." (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") -- 2.39.2