diff options
author | Richard M. Stallman <rms@gnu.org> | 1997-04-11 05:59:37 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1997-04-11 05:59:37 +0000 |
commit | 74475f874f463125619495dd9e223d730d38ffac (patch) | |
tree | 93363e727adc397c919c534d705fc2d4d6e58d30 /lisp/faces.el | |
parent | b74ab9a629c1397addde3dfd634dc7dc2b847784 (diff) | |
download | emacs-74475f874f463125619495dd9e223d730d38ffac.tar.gz |
(make-face): New arg no-resources.
(make-empty-face): New function.
Diffstat (limited to 'lisp/faces.el')
-rw-r--r-- | lisp/faces.el | 21 |
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." new-stipple-string))) (list face (if (equal stipple "") nil stipple)))) -(defun make-face (name) +(defun make-face (name &optional no-resources) "Define a new FACE on all frames. You can modify the font, color, etc of this face with the set-face- functions. +If NO-RESOURCES is non-nil, then we ignore X resources +and always make a face whose attributes are all nil. + If the face already exists, it is unmodified." (interactive "SMake face: ") (or (internal-find-face name) @@ -410,15 +413,23 @@ If the face already exists, it is unmodified." (frame-face-alist (car frames)))) (setq frames (cdr frames))) (setq global-face-data (cons (cons name face) global-face-data))) - ;; when making a face after frames already exist - (if (memq window-system '(x w32)) - (make-face-x-resource-internal face)) - ;; add to menu + ;; When making a face after frames already exist + (or no-resources + (if (memq window-system '(x w32)) + (make-face-x-resource-internal face))) + ;; Add to menu of faces. (if (fboundp 'facemenu-add-new-face) (facemenu-add-new-face name)) face)) name) +(defun make-empty-face (face) + "Define a new FACE on all frames, which initially reflects the defaults. +You can modify the font, color, etc of this face with the set-face- functions. +If the face already exists, it is unmodified." + (interactive "SMake empty face: ") + (make-face face t)) + ;; Fill in a face by default based on X resources, for all existing frames. ;; This has to be done when a new face is made. (defun make-face-x-resource-internal (face &optional frame set-anyway) |