1143 |
;; conflict with Lucid, which uses that name differently. |
;; conflict with Lucid, which uses that name differently. |
1144 |
|
|
1145 |
(defvar help-xref-stack) |
(defvar help-xref-stack) |
1146 |
(defun list-faces-display () |
(defun list-faces-display (&optional regexp) |
1147 |
"List all faces, using the same sample text in each. |
"List all faces, using the same sample text in each. |
1148 |
The sample text is a string that comes from the variable |
The sample text is a string that comes from the variable |
1149 |
`list-faces-sample-text'." |
`list-faces-sample-text'. |
1150 |
(interactive) |
|
1151 |
|
If REGEXP is non-nil, list only those faces with names matching |
1152 |
|
this regular expression. When called interactively with a prefix |
1153 |
|
arg, prompt for a regular expression." |
1154 |
|
(interactive (list (and current-prefix-arg |
1155 |
|
(read-string "List faces matching regexp: ")))) |
1156 |
(let ((faces (sort (face-list) #'string-lessp)) |
(let ((faces (sort (face-list) #'string-lessp)) |
|
(face nil) |
|
1157 |
(frame (selected-frame)) |
(frame (selected-frame)) |
1158 |
disp-frame window face-name) |
disp-frame window face-name) |
1159 |
|
(when (> (length regexp) 0) |
1160 |
|
(setq faces |
1161 |
|
(delq nil |
1162 |
|
(mapcar (lambda (f) |
1163 |
|
(when (string-match regexp (symbol-name f)) |
1164 |
|
f)) |
1165 |
|
faces)))) |
1166 |
(with-output-to-temp-buffer "*Faces*" |
(with-output-to-temp-buffer "*Faces*" |
1167 |
(save-excursion |
(save-excursion |
1168 |
(set-buffer standard-output) |
(set-buffer standard-output) |
1175 |
"\\[help-follow] on a face name to customize it\n" |
"\\[help-follow] on a face name to customize it\n" |
1176 |
"or on its sample text for a description of the face.\n\n"))) |
"or on its sample text for a description of the face.\n\n"))) |
1177 |
(setq help-xref-stack nil) |
(setq help-xref-stack nil) |
1178 |
(while faces |
(dolist (face faces) |
|
(setq face (car faces)) |
|
|
(setq faces (cdr faces)) |
|
1179 |
(setq face-name (symbol-name face)) |
(setq face-name (symbol-name face)) |
1180 |
(insert (format "%25s " face-name)) |
(insert (format "%25s " face-name)) |
1181 |
;; Hyperlink to a customization buffer for the face. Using |
;; Hyperlink to a customization buffer for the face. Using |
1217 |
(copy-face (car faces) (car faces) frame disp-frame) |
(copy-face (car faces) (car faces) frame disp-frame) |
1218 |
(setq faces (cdr faces))))))) |
(setq faces (cdr faces))))))) |
1219 |
|
|
1220 |
|
|
1221 |
(defun describe-face (face &optional frame) |
(defun describe-face (face &optional frame) |
1222 |
"Display the properties of face FACE on FRAME. |
"Display the properties of face FACE on FRAME. |
1223 |
Interactively, FACE defaults to the faces of the character after point |
Interactively, FACE defaults to the faces of the character after point |