]> code.delx.au - gnu-emacs/blobdiff - lisp/frame.el
*** empty log message ***
[gnu-emacs] / lisp / frame.el
index 9b404a75356d87c77821f7d00cda28ff3db3d0aa..06dfcbf8469662303326f6dbb518e2cac417f01e 100644 (file)
@@ -229,8 +229,13 @@ React to settings of `default-frame-alist', `initial-frame-alist' there."
              (cons (cons 'menu-bar-lines (if menu-bar-mode 1 0))
                    default-frame-alist)))))
   
-  ;; Make tool-bar-mode and default-frame-alist consistent.
-  (when (boundp 'tool-bar-mode)
+  ;; Make tool-bar-mode and default-frame-alist consistent.  Don't do
+  ;; it in batch mode since that would leave a tool-bar-lines
+  ;; parameter in default-frame-alist in a dumped Emacs, which is not
+  ;; what we want.  For some reason, menu-bar-mode is not bound
+  ;; in this case, but tool-bar-mode is.
+  (when (and (boundp 'tool-bar-mode)
+            (not noninteractive))
     (let ((default (assq 'tool-bar-lines default-frame-alist)))
       (if default
          (setq tool-bar-mode (not (eq (cdr default) 0)))
@@ -247,17 +252,35 @@ React to settings of `default-frame-alist', `initial-frame-alist' there."
 
     (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.
@@ -404,9 +427,7 @@ React to settings of `default-frame-alist', `initial-frame-alist' there."
            (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)
@@ -469,7 +490,7 @@ The optional second argument PARAMETERS specifies additional frame parameters."
   "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.
@@ -712,9 +733,7 @@ To get the frame's current default font, use `frame-parameters'."
                               (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.
@@ -722,8 +741,7 @@ When called interactively, prompt for the name of the color to use.
 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.
@@ -731,8 +749,7 @@ When called interactively, prompt for the name of the color to use.
 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.
@@ -1144,7 +1161,8 @@ itself as a pre-command hook."
 \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
@@ -1165,4 +1183,3 @@ If nil, don't show a cursor except in the selected window."
 (provide 'frame)
 
 ;;; frame.el ends here
-(frame-notice-user-settings):