From: Richard M. Stallman Date: Mon, 11 Jan 1999 13:32:11 +0000 (+0000) Subject: (list-faces-display): Improve the formatting X-Git-Tag: emacs-20.4~904 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6fe3eb772f9e665f25ca7d45abe02edec97139c1;p=emacs.git (list-faces-display): Improve the formatting by computing the maximum length required for any face-name. --- 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")