aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman1997-04-11 05:59:37 +0000
committerRichard M. Stallman1997-04-11 05:59:37 +0000
commit17b3a11bfc66faa92ba2a8c4bfc46177a9b3b3c4 (patch)
treeb008703ad48a6df41425cbc4432a7a94d02d51af /lisp
parent056a21c458b19e289f3858d5c23bee3ce82fdf23 (diff)
downloademacs-17b3a11bfc66faa92ba2a8c4bfc46177a9b3b3c4.tar.gz
emacs-17b3a11bfc66faa92ba2a8c4bfc46177a9b3b3c4.zip
(make-face): New arg no-resources.
(make-empty-face): New function.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/faces.el21
1 files changed, 16 insertions, 5 deletions
diff --git a/lisp/faces.el b/lisp/faces.el
index 438f80adb07..bb36630f87c 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -390,9 +390,12 @@ If NAME is already a face, it is simply returned."
390 new-stipple-string))) 390 new-stipple-string)))
391 (list face (if (equal stipple "") nil stipple)))) 391 (list face (if (equal stipple "") nil stipple))))
392 392
393(defun make-face (name) 393(defun make-face (name &optional no-resources)
394 "Define a new FACE on all frames. 394 "Define a new FACE on all frames.
395You can modify the font, color, etc of this face with the set-face- functions. 395You can modify the font, color, etc of this face with the set-face- functions.
396If NO-RESOURCES is non-nil, then we ignore X resources
397and always make a face whose attributes are all nil.
398
396If the face already exists, it is unmodified." 399If the face already exists, it is unmodified."
397 (interactive "SMake face: ") 400 (interactive "SMake face: ")
398 (or (internal-find-face name) 401 (or (internal-find-face name)
@@ -410,15 +413,23 @@ If the face already exists, it is unmodified."
410 (frame-face-alist (car frames)))) 413 (frame-face-alist (car frames))))
411 (setq frames (cdr frames))) 414 (setq frames (cdr frames)))
412 (setq global-face-data (cons (cons name face) global-face-data))) 415 (setq global-face-data (cons (cons name face) global-face-data)))
413 ;; when making a face after frames already exist 416 ;; When making a face after frames already exist
414 (if (memq window-system '(x w32)) 417 (or no-resources
415 (make-face-x-resource-internal face)) 418 (if (memq window-system '(x w32))
416 ;; add to menu 419 (make-face-x-resource-internal face)))
420 ;; Add to menu of faces.
417 (if (fboundp 'facemenu-add-new-face) 421 (if (fboundp 'facemenu-add-new-face)
418 (facemenu-add-new-face name)) 422 (facemenu-add-new-face name))
419 face)) 423 face))
420 name) 424 name)
421 425
426(defun make-empty-face (face)
427 "Define a new FACE on all frames, which initially reflects the defaults.
428You can modify the font, color, etc of this face with the set-face- functions.
429If the face already exists, it is unmodified."
430 (interactive "SMake empty face: ")
431 (make-face face t))
432
422;; Fill in a face by default based on X resources, for all existing frames. 433;; Fill in a face by default based on X resources, for all existing frames.
423;; This has to be done when a new face is made. 434;; This has to be done when a new face is made.
424(defun make-face-x-resource-internal (face &optional frame set-anyway) 435(defun make-face-x-resource-internal (face &optional frame set-anyway)