]> code.delx.au - gnu-emacs/blobdiff - lisp/faces.el
Changed version to 1.2.1.
[gnu-emacs] / lisp / faces.el
index e3e521bd713b2c8ac5e2e953b9ca91345524d824..4c938f2e1ba0eda91b9b70ac9954aa9bc43eff9b 100644 (file)
@@ -149,8 +149,7 @@ If the optional FRAME argument is provided, change only
 in that frame; otherwise change each frame."
   (interactive (internal-face-interactive "font"))
   (if (stringp font)
-      (setq font (or (and (not (eq window-system 'w32))
-                         (resolve-fontset-name font))
+      (setq font (or (resolve-fontset-name font)
                     (x-resolve-font-name font 'default frame))))
   (internal-set-face-1 face 'font font 3 frame)
   ;; Record that this face's font was set explicitly, not automatically,
@@ -165,8 +164,7 @@ If the optional FRAME argument is provided, change only
 in that frame; otherwise change each frame."
   (interactive (internal-face-interactive "font"))
   (if (stringp font)
-      (setq font (or (and (not (eq window-system 'w32))
-                         (resolve-fontset-name font))
+      (setq font (or (resolve-fontset-name font)
                     (x-resolve-font-name font 'default frame))))
   (internal-set-face-1 face 'font font 3 frame))
 
@@ -1126,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)
@@ -1134,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")
@@ -1143,7 +1148,7 @@ selected frame."
            (goto-char beg)
            (forward-line 1)
            (while (not (eobp))
-             (insert "                          ")
+             (insert-char ?  (1+ face-name-max-length))
              (forward-line 1))))
        (goto-char (point-min)))
       (print-help-return-message))