Commit 6a1e7d67 authored by Gerd Moellmann's avatar Gerd Moellmann
Browse files

(normal-top-level): Don't operate on the initial

frame if we failed to create one.
parent 30a7ac22
...@@ -470,31 +470,35 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'." ...@@ -470,31 +470,35 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
(run-hooks 'emacs-startup-hook) (run-hooks 'emacs-startup-hook)
(and term-setup-hook (and term-setup-hook
(run-hooks 'term-setup-hook)) (run-hooks 'term-setup-hook))
;; Modify the initial frame based on what .emacs puts into
;; ...-frame-alist. ;; Don't do this if we failed to create the initial frame,
(if (fboundp 'frame-notice-user-settings) ;; for instance due to a dense colormap.
(frame-notice-user-settings)) (when frame-initial-frame
(if (fboundp 'frame-set-background-mode) ;; Modify the initial frame based on what .emacs puts into
;; Set the faces for the initial background mode even if ;; ...-frame-alist.
;; frame-notice-user-settings didn't (such as on a tty). (if (fboundp 'frame-notice-user-settings)
;; frame-set-background-mode is idempotent, so it won't (frame-notice-user-settings))
;; cause any harm if it's already been done. (if (fboundp 'frame-set-background-mode)
(let ((frame-background-mode frame-background-mode) ;; Set the faces for the initial background mode even if
(frame (selected-frame)) ;; frame-notice-user-settings didn't (such as on a tty).
term) ;; frame-set-background-mode is idempotent, so it won't
(when (and (null window-system) ;; cause any harm if it's already been done.
;; Don't override a possibly customized value. (let ((frame-background-mode frame-background-mode)
(null frame-background-mode) (frame (selected-frame))
;; Don't override user specifications. term)
(null (frame-parameter frame 'reverse)) (when (and (null window-system)
(let ((bg (frame-parameter frame 'background-color))) ;; Don't override a possibly customized value.
(or (null bg) (null frame-background-mode)
(member bg '(unspecified "unspecified-bg"))))) ;; Don't override user specifications.
(setq term (getenv "TERM")) (null (frame-parameter frame 'reverse))
(if (string-match "^\\(xterm\\|rxvt\\|dtterm\\|eterm\\)" (let ((bg (frame-parameter frame 'background-color)))
term) (or (null bg)
(setq frame-background-mode 'light))) (member bg '(unspecified "unspecified-bg")))))
(frame-set-background-mode (selected-frame)))) (setq term (getenv "TERM"))
(if (string-match "^\\(xterm\\|rxvt\\|dtterm\\|eterm\\)"
term)
(setq frame-background-mode 'light)))
(frame-set-background-mode (selected-frame)))))
;; Now we know the user's default font, so add it to the menu. ;; Now we know the user's default font, so add it to the menu.
(if (fboundp 'font-menu-add-default) (if (fboundp 'font-menu-add-default)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment