[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: list-faces-display
From: |
Juanma Barranquero |
Subject: |
Re: list-faces-display |
Date: |
Tue, 31 May 2005 13:15:21 +0200 |
Anyway, this is the patch I propose, if deemed a fix and not a feature.
--
/L/e/k/t/u
Index: faces.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/faces.el,v
retrieving revision 1.310
diff -u -2 -r1.310 faces.el
--- faces.el 31 May 2005 11:10:43 -0000 1.310
+++ faces.el 31 May 2005 11:07:42 -0000
@@ -1155,16 +1155,21 @@
(interactive (list (and current-prefix-arg
(read-string "List faces matching regexp: "))))
- (let ((faces (sort (face-list) #'string-lessp))
+ (let ((all-faces (zerop (length regexp)))
(frame (selected-frame))
+ (max-length 0)
+ face line-format
disp-frame window face-name)
- (when (> (length regexp) 0)
- (setq faces
- (delq nil
- (mapcar (lambda (f)
- (when (string-match regexp (symbol-name f))
- f))
- faces)))
- (unless faces
- (error "No faces matching \"%s\"" regexp)))
+ (setq faces
+ (delq nil
+ (mapcar (lambda (f)
+ (let ((s (symbol-name f)))
+ (when (or all-faces (string-match regexp s))
+ (setq max-length (max (length s) max-length))
+ f)))
+ (sort (face-list) #'string-lessp))))
+ (unless faces
+ (error "No faces matching \"%s\"" regexp))
+ (setq max-length (1+ max-length)
+ line-format (format "%%-%ds" max-length))
(with-output-to-temp-buffer "*Faces*"
(save-excursion
@@ -1181,5 +1186,5 @@
(dolist (face faces)
(setq face-name (symbol-name face))
- (insert (format "%25s " face-name))
+ (insert (format line-format face-name))
;; Hyperlink to a customization buffer for the face. Using
;; the help xref mechanism may not be the best way.
@@ -1206,5 +1211,5 @@
(forward-line 1)
(while (not (eobp))
- (insert " ")
+ (insert-char ?\s max-length)
(forward-line 1))))
(goto-char (point-min)))
- list-faces-display, Juanma Barranquero, 2005/05/30
- Re: list-faces-display,
Juanma Barranquero <=