diff options
| author | Richard M. Stallman | 1999-01-11 13:32:11 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1999-01-11 13:32:11 +0000 |
| commit | 6fe3eb772f9e665f25ca7d45abe02edec97139c1 (patch) | |
| tree | 60b6fc4680744605e11fed414d4f661646a9bcdc /lisp | |
| parent | 69791a3cd492c29669ef2fa37613fabae3f499cc (diff) | |
| download | emacs-6fe3eb772f9e665f25ca7d45abe02edec97139c1.tar.gz emacs-6fe3eb772f9e665f25ca7d45abe02edec97139c1.zip | |
(list-faces-display): Improve the formatting
by computing the maximum length required for any face-name.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/faces.el | 11 |
1 files 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." | |||
| 1124 | (let ((faces (sort (face-list) (function string-lessp))) | 1124 | (let ((faces (sort (face-list) (function string-lessp))) |
| 1125 | (face nil) | 1125 | (face nil) |
| 1126 | (frame (selected-frame)) | 1126 | (frame (selected-frame)) |
| 1127 | disp-frame window) | 1127 | disp-frame window |
| 1128 | (face-name-max-length | ||
| 1129 | (car (sort (mapcar (function string-width) | ||
| 1130 | (mapcar (function symbol-name) (face-list))) | ||
| 1131 | (function >))))) | ||
| 1128 | (with-output-to-temp-buffer "*Faces*" | 1132 | (with-output-to-temp-buffer "*Faces*" |
| 1129 | (save-excursion | 1133 | (save-excursion |
| 1130 | (set-buffer standard-output) | 1134 | (set-buffer standard-output) |
| @@ -1132,7 +1136,10 @@ selected frame." | |||
| 1132 | (while faces | 1136 | (while faces |
| 1133 | (setq face (car faces)) | 1137 | (setq face (car faces)) |
| 1134 | (setq faces (cdr faces)) | 1138 | (setq faces (cdr faces)) |
| 1135 | (insert (format "%25s " (symbol-name face))) | 1139 | (insert (format |
| 1140 | (format "%%-%ds " | ||
| 1141 | face-name-max-length) | ||
| 1142 | (symbol-name face))) | ||
| 1136 | (let ((beg (point))) | 1143 | (let ((beg (point))) |
| 1137 | (insert list-faces-sample-text) | 1144 | (insert list-faces-sample-text) |
| 1138 | (insert "\n") | 1145 | (insert "\n") |