*** faces.el 15 Sep 2004 11:48:16 +0100 1.290 --- faces.el 06 Oct 2004 09:22:57 +0100 *************** *** 1136,1150 **** ;; conflict with Lucid, which uses that name differently. (defvar help-xref-stack) ! (defun list-faces-display () "List all faces, using the same sample text in each. The sample text is a string that comes from the variable ! `list-faces-sample-text'." ! (interactive) (let ((faces (sort (face-list) #'string-lessp)) - (face nil) (frame (selected-frame)) disp-frame window face-name) (with-output-to-temp-buffer "*Faces*" (save-excursion (set-buffer standard-output) --- 1136,1157 ---- ;; conflict with Lucid, which uses that name differently. (defvar help-xref-stack) ! (defun list-faces-display (&optional regexp) "List all faces, using the same sample text in each. The sample text is a string that comes from the variable ! `list-faces-sample-text'. With a prefix arg, limit faces to those ! matching REGEXP." ! (interactive (list (and current-prefix-arg ! (read-string "Filter by regexp: ")))) (let ((faces (sort (face-list) #'string-lessp)) (frame (selected-frame)) disp-frame window face-name) + ;; Perhaps filter by regexp + (when regexp + (setq faces (delq nil (mapcar (lambda (f) + (when (string-match regexp + (symbol-name f)) f)) + faces)))) (with-output-to-temp-buffer "*Faces*" (save-excursion (set-buffer standard-output) *************** *** 1157,1165 **** "\\[help-follow] on a face name to customize it\n" "or on its sample text for a description of the face.\n\n"))) (setq help-xref-stack nil) ! (while faces ! (setq face (car faces)) ! (setq faces (cdr faces)) (setq face-name (symbol-name face)) (insert (format "%25s " face-name)) ;; Hyperlink to a customization buffer for the face. Using --- 1164,1170 ---- "\\[help-follow] on a face name to customize it\n" "or on its sample text for a description of the face.\n\n"))) (setq help-xref-stack nil) ! (mapcar (lambda (face) (setq face-name (symbol-name face)) (insert (format "%25s " face-name)) ;; Hyperlink to a customization buffer for the face. Using *************** *** 1187,1192 **** --- 1192,1198 ---- (while (not (eobp)) (insert " ") (forward-line 1)))) + faces) (goto-char (point-min))) (print-help-return-message)) ;; If the *Faces* buffer appears in a different frame, *************** *** 1196,1205 **** (setq disp-frame (if window (window-frame window) (car (frame-list)))) (or (eq frame disp-frame) ! (let ((faces (face-list))) ! (while faces ! (copy-face (car faces) (car faces) frame disp-frame) ! (setq faces (cdr faces))))))) (defun describe-face (face &optional frame) "Display the properties of face FACE on FRAME. --- 1202,1210 ---- (setq disp-frame (if window (window-frame window) (car (frame-list)))) (or (eq frame disp-frame) ! (while faces ! (copy-face (car faces) (car faces) frame disp-frame) ! (setq faces (cdr faces)))))) (defun describe-face (face &optional frame) "Display the properties of face FACE on FRAME.