1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-07 15:21:46 +00:00

* faces.el (make-face-bold, make-face-italic,

make-face-bold-italic, make-face-unbold, make-face-unitalic):
	Always pass the frame parameter to internal-try-face-font; we only
	want to set the face for this frame.

	* faces.el (make-face-bold, make-face-italic,
	make-face-bold-italic, make-face-unbold, make-face-unitalic):
	Fix error messages.
This commit is contained in:
Jim Blandy 1993-06-17 22:59:49 +00:00
parent f0b9055ffa
commit 586388410a

View File

@ -503,12 +503,12 @@ If NOERROR is non-nil, return nil on failure."
(face-font 'default frame) (face-font 'default frame)
(cdr (assq 'font (frame-parameters frame))))) (cdr (assq 'font (frame-parameters frame)))))
(or (and (setq f2 (x-make-font-bold font)) (or (and (setq f2 (x-make-font-bold font))
(internal-try-face-font face f2)) (internal-try-face-font face f2 frame))
(and (setq f2 (x-make-font-demibold font)) (and (setq f2 (x-make-font-demibold font))
(internal-try-face-font face f2)))) (internal-try-face-font face f2 frame))))
(or (not (equal ofont (face-font face))) (or (not (equal ofont (face-font face)))
(and (not noerror) (and (not noerror)
(error "No %s version of %S" face ofont))))) (error "No bold version of %S" font)))))
(defun make-face-italic (face &optional frame noerror) (defun make-face-italic (face &optional frame noerror)
"Make the font of the given face be italic, if possible. "Make the font of the given face be italic, if possible.
@ -527,12 +527,12 @@ If NOERROR is non-nil, return nil on failure."
(face-font 'default frame) (face-font 'default frame)
(cdr (assq 'font (frame-parameters frame))))) (cdr (assq 'font (frame-parameters frame)))))
(or (and (setq f2 (x-make-font-italic font)) (or (and (setq f2 (x-make-font-italic font))
(internal-try-face-font face f2)) (internal-try-face-font face f2 frame))
(and (setq f2 (x-make-font-oblique font)) (and (setq f2 (x-make-font-oblique font))
(internal-try-face-font face f2)))) (internal-try-face-font face f2 frame))))
(or (not (equal ofont (face-font face))) (or (not (equal ofont (face-font face)))
(and (not noerror) (and (not noerror)
(error "No %s version of %S" face ofont))))) (error "No italic version of %S" font)))))
(defun make-face-bold-italic (face &optional frame noerror) (defun make-face-bold-italic (face &optional frame noerror)
"Make the font of the given face be bold and italic, if possible. "Make the font of the given face be bold and italic, if possible.
@ -554,25 +554,25 @@ If NOERROR is non-nil, return nil on failure."
(not (equal font f2)) (not (equal font f2))
(setq f3 (x-make-font-bold f2)) (setq f3 (x-make-font-bold f2))
(not (equal f2 f3)) (not (equal f2 f3))
(internal-try-face-font face f3)) (internal-try-face-font face f3 frame))
(and (setq f2 (x-make-font-oblique font)) (and (setq f2 (x-make-font-oblique font))
(not (equal font f2)) (not (equal font f2))
(setq f3 (x-make-font-bold f2)) (setq f3 (x-make-font-bold f2))
(not (equal f2 f3)) (not (equal f2 f3))
(internal-try-face-font face f3)) (internal-try-face-font face f3 frame))
(and (setq f2 (x-make-font-italic font)) (and (setq f2 (x-make-font-italic font))
(not (equal font f2)) (not (equal font f2))
(setq f3 (x-make-font-demibold f2)) (setq f3 (x-make-font-demibold f2))
(not (equal f2 f3)) (not (equal f2 f3))
(internal-try-face-font face f3)) (internal-try-face-font face f3 frame))
(and (setq f2 (x-make-font-oblique font)) (and (setq f2 (x-make-font-oblique font))
(not (equal font f2)) (not (equal font f2))
(setq f3 (x-make-font-demibold f2)) (setq f3 (x-make-font-demibold f2))
(not (equal f2 f3)) (not (equal f2 f3))
(internal-try-face-font face f3)))) (internal-try-face-font face f3 frame))))
(or (not (equal ofont (face-font face))) (or (not (equal ofont (face-font face)))
(and (not noerror) (and (not noerror)
(error "No %s version of %S" face ofont))))) (error "No bold italic version of %S" font)))))
(defun make-face-unbold (face &optional frame noerror) (defun make-face-unbold (face &optional frame noerror)
"Make the font of the given face be non-bold, if possible. "Make the font of the given face be non-bold, if possible.
@ -591,10 +591,10 @@ If NOERROR is non-nil, return nil on failure."
(face-font 'default frame) (face-font 'default frame)
(cdr (assq 'font (frame-parameters frame))))) (cdr (assq 'font (frame-parameters frame)))))
(setq font (x-make-font-unbold font1)) (setq font (x-make-font-unbold font1))
(if font (internal-try-face-font face font))) (if font (internal-try-face-font face font frame)))
(or (not (equal ofont (face-font face))) (or (not (equal ofont (face-font face)))
(and (not noerror) (and (not noerror)
(error "No %s version of %S" face ofont))))) (error "No unbold version of %S" font1)))))
(defun make-face-unitalic (face &optional frame noerror) (defun make-face-unitalic (face &optional frame noerror)
"Make the font of the given face be non-italic, if possible. "Make the font of the given face be non-italic, if possible.
@ -613,10 +613,10 @@ If NOERROR is non-nil, return nil on failure."
(face-font 'default frame) (face-font 'default frame)
(cdr (assq 'font (frame-parameters frame))))) (cdr (assq 'font (frame-parameters frame)))))
(setq font (x-make-font-unitalic font1)) (setq font (x-make-font-unitalic font1))
(if font (internal-try-face-font face font))) (if font (internal-try-face-font face font frame)))
(or (not (equal ofont (face-font face))) (or (not (equal ofont (face-font face)))
(and (not noerror) (and (not noerror)
(error "No %s version of %S" face ofont))))) (error "No unitalic version of %S" font1)))))
;;; Make the builtin faces; the C code knows these as faces 0, 1, and 2, ;;; Make the builtin faces; the C code knows these as faces 0, 1, and 2,
;;; respectively, so they must be the first three faces made. ;;; respectively, so they must be the first three faces made.