aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRamprasad B2006-10-31 09:54:01 +0000
committerRamprasad B2006-10-31 09:54:01 +0000
commitc76cf5f8a41a43538d40235daf03e9d2fe81b40c (patch)
treec02211b33ee0f8574945c3f37703f9cad5b98ccf
parente35fc9628ced2eafed2073622bbab1eec010d82a (diff)
downloademacs-c76cf5f8a41a43538d40235daf03e9d2fe81b40c.tar.gz
emacs-c76cf5f8a41a43538d40235daf03e9d2fe81b40c.zip
Installed describe-face sample text
-rw-r--r--lisp/faces.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/lisp/faces.el b/lisp/faces.el
index 55eca37d963..f0f3b1a8ce0 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -32,6 +32,9 @@
32 ;; Warning suppression -- can't require x-win in batch: 32 ;; Warning suppression -- can't require x-win in batch:
33 (autoload 'xw-defined-colors "x-win")) 33 (autoload 'xw-defined-colors "x-win"))
34 34
35(defvar faces-sample-overlay nil
36 "Overlay for showing an example of a face.")
37
35(defvar help-xref-stack-item) 38(defvar help-xref-stack-item)
36 39
37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -1252,6 +1255,16 @@ arg, prompt for a regular expression."
1252 (copy-face (car faces) (car faces) frame disp-frame) 1255 (copy-face (car faces) (car faces) frame disp-frame)
1253 (setq faces (cdr faces))))))) 1256 (setq faces (cdr faces)))))))
1254 1257
1258(defun faces-sample-overlay (face)
1259 "Insert sample text with FACE.
1260
1261If FACE is not a face or nil, use the default face."
1262 (let ((f (if (facep face) face 'default))
1263 (start (+ (point) 2))) ;; skip face and paren
1264 (insert " (sample)")
1265 (setq faces-sample-overlay (make-overlay start (1- (point))))
1266 (overlay-put faces-sample-overlay 'face f)))
1267
1255 1268
1256(defun describe-face (face &optional frame) 1269(defun describe-face (face &optional frame)
1257 "Display the properties of face FACE on FRAME. 1270 "Display the properties of face FACE on FRAME.
@@ -1293,6 +1306,7 @@ If FRAME is omitted or nil, use the selected frame."
1293 (insert " undefined face.\n") 1306 (insert " undefined face.\n")
1294 (let ((customize-label "customize this face") 1307 (let ((customize-label "customize this face")
1295 file-name) 1308 file-name)
1309 (faces-sample-overlay f)
1296 (princ (concat " (" customize-label ")\n")) 1310 (princ (concat " (" customize-label ")\n"))
1297 (insert "Documentation: " 1311 (insert "Documentation: "
1298 (or (face-documentation f) 1312 (or (face-documentation f)