emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

list-faces-display


From: Juanma Barranquero
Subject: list-faces-display
Date: Mon, 30 May 2005 15:39:28 +0200

The new regexp argument for list-faces-display is not documented on
NEWS. Should it? And if yes, in what section? "Changes in Specialized
Modes and Packages in Emacs 22.1" and "Lisp Changes in Emacs 22.1"
both seem in order.

Somewhat related: on 1999-07-21 Gerd committed lots and lots of
changes (possibly he was synchronizing from a branch). faces.el got an
almost complete rewrite, and in particular list-faces-display lost the
following ability:

1999-01-11  Richard Stallman  <address@hidden>

        * faces.el (list-faces-display): Improve the formatting
        by computing the maximum length required for any face-name.

(I'm attaching a patch that shows the changes done to
list-faces-display; line numbers are wrong because I've cut out just
the code for the function)

Question is, should this change be reverted? And, it is that a bugfix
or a new feature?

                    /L/e/k/t/u


--- faces-1.138 Mon May 30 13:35:15 2005
+++ faces-1.139 Mon May 30 13:35:29 2005
@@ -1,2 +1 @@
-
  (defvar list-faces-sample-text
@@ -5,4 +4,6 @@
 
-;; The name list-faces would be more consistent, but let's avoid a conflict
-;; with Lucid, which uses that name differently.
+
+;; The name list-faces would be more consistent, but let's avoid a
+;; conflict with Lucid, which uses that name differently.
+
  (defun list-faces-display ()
@@ -10,16 +11,8 @@
 The sample text is a string that comes from the variable
-`list-faces-sample-text'.
-
-It is possible to give a particular face name different appearances in
-different frames.  This command shows the appearance in the
-selected frame."
+`list-faces-sample-text'."
   (interactive)
-  (let ((faces (sort (face-list) (function string-lessp)))
+  (let ((faces (sort (face-list) #'string-lessp))
        (face nil)
        (frame (selected-frame))
-       disp-frame window
-        (face-name-max-length
-         (car (sort (mapcar (function string-width)
-                           (mapcar (function symbol-name) (face-list)))
-                    (function >)))))
+       disp-frame window)
     (with-output-to-temp-buffer "*Faces*"
@@ -31,6 +24,3 @@
          (setq faces (cdr faces))
-         (insert (format 
-                   (format "%%-%ds "
-                           face-name-max-length)
-                   (symbol-name face)))
+         (insert (format "%25s " (face-name face)))
          (let ((beg (point)))
@@ -43,3 +33,3 @@
            (while (not (eobp))
-             (insert-char ?  (1+ face-name-max-length))
+             (insert "                          ")
              (forward-line 1))))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]