(when (and frame-notice-user-settings
(null frame-initial-frame))
- ;; This case happens when we don't have a window system.
+ ;; This case happens when we don't have a window system, and
+ ;; also for MS-DOS frames.
(let ((parms (frame-parameters frame-initial-frame)))
;; Don't change the frame names.
(setq parms (delq (assq 'name parms) parms))
;; Can't modify the minibuffer parameter, so don't try.
(setq parms (delq (assq 'minibuffer parms) parms))
(modify-frame-parameters nil
- (append initial-frame-alist
- default-frame-alist
- parms
- nil))))
+ (if (null window-system)
+ (append initial-frame-alist
+ default-frame-alist
+ parms
+ nil)
+ ;; initial-frame-alist and
+ ;; default-frame-alist were already
+ ;; applied in pc-win.el.
+ parms))
+ (if (null window-system) ;; MS-DOS does this differently in pc-win.el
+ (let ((newparms (frame-parameters))
+ (frame (selected-frame)))
+ (tty-handle-reverse-video frame newparms)
+ ;; If we changed the background color, we need to update
+ ;; the background-mode parameter, and maybe some faces,
+ ;; too.
+ (when (assq 'background-color newparms)
+ (unless (or (assq 'background-mode initial-frame-alist)
+ (assq 'background-mode default-frame-alist))
+ (frame-set-background-mode frame))
+ (face-set-after-frame-default frame))))))
;; If the initial frame is still around, apply initial-frame-alist
;; and default-frame-alist to it.
(when (assq 'background-color newparms)
(unless (assq 'background-mode newparms)
(frame-set-background-mode frame-initial-frame))
- (face-set-after-frame-default frame-initial-frame))
- (if (assq 'font newparms)
- (frame-update-faces frame-initial-frame)))))
+ (face-set-after-frame-default frame-initial-frame)))))
;; Restore the original buffer.
(set-buffer old-buffer)
"Functions to run after a frame is created.
The functions are run with one arg, the newly created frame.")
-(defvar after-setting-font-hooks nil
+(defvar after-setting-font-hook nil
"Functions to run after a frame's font has been changed.")
;; Alias, kept temporarily.
(x-list-fonts "*" nil (selected-frame)))))))
(modify-frame-parameters (selected-frame)
(list (cons 'font font-name)))
- ;; Update faces that want a bold or italic version of the default font.
- (frame-update-faces (selected-frame))
- (run-hooks 'after-setting-font-hooks))
+ (run-hooks 'after-setting-font-hook 'after-setting-font-hooks))
(defun set-background-color (color-name)
"Set the background color of the selected frame to COLOR-NAME.
To get the frame's current background color, use `frame-parameters'."
(interactive (list (facemenu-read-color)))
(modify-frame-parameters (selected-frame)
- (list (cons 'background-color color-name)))
- (frame-update-face-colors (selected-frame)))
+ (list (cons 'background-color color-name))))
(defun set-foreground-color (color-name)
"Set the foreground color of the selected frame to COLOR-NAME.
To get the frame's current foreground color, use `frame-parameters'."
(interactive (list (facemenu-read-color)))
(modify-frame-parameters (selected-frame)
- (list (cons 'foreground-color color-name)))
- (frame-update-face-colors (selected-frame)))
+ (list (cons 'foreground-color color-name))))
(defun set-cursor-color (color-name)
"Set the text cursor color of the selected frame to COLOR-NAME.
\f
(defcustom show-cursor-in-non-selected-windows t
"*Non-nil means show a hollow box cursor in non-selected-windows.
-If nil, don't show a cursor except in the selected window."
+If nil, don't show a cursor except in the selected window.
+Setting this variable directly has no effect; use custom instead."
:tag "Cursor in non-selected windows"
:type 'boolean
:group 'cursor
(provide 'frame)
;;; frame.el ends here
-(frame-notice-user-settings):