diff options
| author | Chong Yidong | 2008-07-10 03:32:53 +0000 |
|---|---|---|
| committer | Chong Yidong | 2008-07-10 03:32:53 +0000 |
| commit | 41e6403e7f7ff84fcc43beb438190b46083498a8 (patch) | |
| tree | c16975c19c1d9564c2c0d8b04e85869c4ce31e66 | |
| parent | 86d616f0a907d369ad0894e05d7f8abd8a35edf7 (diff) | |
| download | emacs-41e6403e7f7ff84fcc43beb438190b46083498a8.tar.gz emacs-41e6403e7f7ff84fcc43beb438190b46083498a8.zip | |
(x-create-frame-with-faces): Don't pass parameters that
are set later to x-create-frame.
(face-set-after-frame-default): Apply X resources for non-default
faces.
| -rw-r--r-- | lisp/faces.el | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/lisp/faces.el b/lisp/faces.el index 1524de4dab9..5d80b9319d0 100644 --- a/lisp/faces.el +++ b/lisp/faces.el | |||
| @@ -1985,9 +1985,16 @@ or `default-frame-alist' contains a `reverse' parameter, or | |||
| 1985 | the X resource ``reverseVideo'' is present, handle that. | 1985 | the X resource ``reverseVideo'' is present, handle that. |
| 1986 | Value is the new frame created." | 1986 | Value is the new frame created." |
| 1987 | (setq parameters (x-handle-named-frame-geometry parameters)) | 1987 | (setq parameters (x-handle-named-frame-geometry parameters)) |
| 1988 | (let ((visibility-spec (assq 'visibility parameters)) | 1988 | (let* ((params (copy-tree parameters)) |
| 1989 | (frame (x-create-frame `((visibility . nil) . ,parameters))) | 1989 | (visibility-spec (assq 'visibility parameters)) |
| 1990 | success) | 1990 | (delayed-params '(foreground-color background-color font |
| 1991 | border-color cursor-color mouse-color | ||
| 1992 | visibility scroll-bar-foreground | ||
| 1993 | scroll-bar-background)) | ||
| 1994 | frame success) | ||
| 1995 | (dolist (param delayed-params) | ||
| 1996 | (setq params (assq-delete-all param params))) | ||
| 1997 | (setq frame (x-create-frame `((visibility . nil) . ,params))) | ||
| 1991 | (unwind-protect | 1998 | (unwind-protect |
| 1992 | (progn | 1999 | (progn |
| 1993 | (x-setup-function-keys frame) | 2000 | (x-setup-function-keys frame) |
| @@ -2009,19 +2016,19 @@ Value is the new frame created." | |||
| 2009 | (defun face-set-after-frame-default (frame &optional parameters) | 2016 | (defun face-set-after-frame-default (frame &optional parameters) |
| 2010 | "Initialize the frame-local faces of FRAME. | 2017 | "Initialize the frame-local faces of FRAME. |
| 2011 | Calculate the face definitions using the face specs, custom theme | 2018 | Calculate the face definitions using the face specs, custom theme |
| 2012 | settings, and `face-new-frame-defaults' (in that order). | 2019 | settings, X resources, and `face-new-frame-defaults'. |
| 2013 | Finally, apply any relevant face attributes found amongst the | 2020 | Finally, apply any relevant face attributes found amongst the |
| 2014 | frame parameters in PARAMETERS and `default-frame-alist'." | 2021 | frame parameters in PARAMETERS and `default-frame-alist'." |
| 2015 | (dolist (face (nreverse (face-list))) | 2022 | (dolist (face (nreverse (face-list))) |
| 2016 | (condition-case () | 2023 | (condition-case () |
| 2017 | ;; We used to apply X resources within this loop, because X | ||
| 2018 | ;; resources could be frame-specific. We don't do that any | ||
| 2019 | ;; more, because this interacts poorly with specifying faces | ||
| 2020 | ;; via frame parameters and Lisp faces. (X resouces for Emacs | ||
| 2021 | ;; as a whole are applied during x-create-frame.) | ||
| 2022 | (progn | 2024 | (progn |
| 2023 | ;; Initialize faces from face spec and custom theme. | 2025 | ;; Initialize faces from face spec and custom theme. |
| 2024 | (face-spec-recalc face frame) | 2026 | (face-spec-recalc face frame) |
| 2027 | ;; X resouces for the default face are applied during | ||
| 2028 | ;; x-create-frame. | ||
| 2029 | (and (not (eq face 'default)) | ||
| 2030 | (memq (window-system frame) '(x w32 mac)) | ||
| 2031 | (make-face-x-resource-internal face frame)) | ||
| 2025 | ;; Apply attributes specified by face-new-frame-defaults | 2032 | ;; Apply attributes specified by face-new-frame-defaults |
| 2026 | (internal-merge-in-global-face face frame)) | 2033 | (internal-merge-in-global-face face frame)) |
| 2027 | ;; Don't let invalid specs prevent frame creation. | 2034 | ;; Don't let invalid specs prevent frame creation. |