1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 04:10:54 -08:00

(list-faces-display): Improve the formatting

by computing the maximum length required for any face-name.
This commit is contained in:
Richard M. Stallman 1999-01-11 13:32:11 +00:00
parent 69791a3cd4
commit 6fe3eb772f

View file

@ -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")