diff options
| author | Richard M. Stallman | 1994-12-15 13:49:51 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-12-15 13:49:51 +0000 |
| commit | e17dbede1b58b4c78cdf9d2406a063823cf3ea1b (patch) | |
| tree | 6bf1a1ac6f7aed0dac7b6001ccd5f6eb59a2ccdc | |
| parent | 1d517019a95a8b73f320bd1bbfd122fc8b78ced9 (diff) | |
| download | emacs-e17dbede1b58b4c78cdf9d2406a063823cf3ea1b.tar.gz emacs-e17dbede1b58b4c78cdf9d2406a063823cf3ea1b.zip | |
(face-initialize): Test for framep not t or nil.
(set-face-font): Pass `default' as face to x-resolve-font-name.
(x-resolve-font-name): Better error message when FACE doesn't specify the font.
| -rw-r--r-- | lisp/faces.el | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/faces.el b/lisp/faces.el index 520ddce2b10..289e63267eb 100644 --- a/lisp/faces.el +++ b/lisp/faces.el | |||
| @@ -109,7 +109,7 @@ If FRAME is omitted or nil, use the selected frame." | |||
| 109 | If the optional FRAME argument is provided, change only | 109 | If the optional FRAME argument is provided, change only |
| 110 | in that frame; otherwise change each frame." | 110 | in that frame; otherwise change each frame." |
| 111 | (interactive (internal-face-interactive "font")) | 111 | (interactive (internal-face-interactive "font")) |
| 112 | (if (stringp font) (setq font (x-resolve-font-name font face frame))) | 112 | (if (stringp font) (setq font (x-resolve-font-name font 'default frame))) |
| 113 | (internal-set-face-1 face 'font font 3 frame)) | 113 | (internal-set-face-1 face 'font font 3 frame)) |
| 114 | 114 | ||
| 115 | (defun set-face-foreground (face color &optional frame) | 115 | (defun set-face-foreground (face color &optional frame) |
| @@ -520,8 +520,8 @@ set its foreground and background to the default background and foreground." | |||
| 520 | All wildcards in PATTERN become substantiated. | 520 | All wildcards in PATTERN become substantiated. |
| 521 | If PATTERN is nil, return the name of the frame's base font, which never | 521 | If PATTERN is nil, return the name of the frame's base font, which never |
| 522 | contains wildcards. | 522 | contains wildcards. |
| 523 | Given optional arguments FACE and FRAME, try to return a font which is | 523 | Given optional arguments FACE and FRAME, return a font which is |
| 524 | also the same size as FACE on FRAME." | 524 | also the same size as FACE on FRAME, or fail." |
| 525 | (or (symbolp face) | 525 | (or (symbolp face) |
| 526 | (setq face (face-name face))) | 526 | (setq face (face-name face))) |
| 527 | (and (eq frame t) | 527 | (and (eq frame t) |
| @@ -532,7 +532,9 @@ also the same size as FACE on FRAME." | |||
| 532 | (or fonts | 532 | (or fonts |
| 533 | (if face | 533 | (if face |
| 534 | (error "No fonts matching pattern are the same size as `%s'" | 534 | (error "No fonts matching pattern are the same size as `%s'" |
| 535 | face) | 535 | (if (null (face-font face)) |
| 536 | (cdr (assq 'font (frame-parameters frame))) | ||
| 537 | face)) | ||
| 536 | (error "No fonts match `%s'" pattern))) | 538 | (error "No fonts match `%s'" pattern))) |
| 537 | (car fonts)) | 539 | (car fonts)) |
| 538 | (cdr (assq 'font (frame-parameters (selected-frame)))))) | 540 | (cdr (assq 'font (frame-parameters (selected-frame)))))) |
| @@ -867,7 +869,7 @@ selected frame." | |||
| 867 | 869 | ||
| 868 | (let ((frames (frame-list))) | 870 | (let ((frames (frame-list))) |
| 869 | (while frames | 871 | (while frames |
| 870 | (if (framep (car frames)) | 872 | (if (not (memq (framep (car frames)) '(t nil))) |
| 871 | (let ((frame (car frames)) | 873 | (let ((frame (car frames)) |
| 872 | (rest global-face-data)) | 874 | (rest global-face-data)) |
| 873 | (while rest | 875 | (while rest |