aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2001-07-10 12:55:44 +0000
committerGerd Moellmann2001-07-10 12:55:44 +0000
commit6a1e7d6714703f8600ffdb33e1df2316cf4a3831 (patch)
treeb1827a72633d6d9c11826a7356eb08a12e18f3bb
parent30a7ac224fe64611fbccb665606aea44eefc48b9 (diff)
downloademacs-6a1e7d6714703f8600ffdb33e1df2316cf4a3831.tar.gz
emacs-6a1e7d6714703f8600ffdb33e1df2316cf4a3831.zip
(normal-top-level): Don't operate on the initial
frame if we failed to create one.
-rw-r--r--lisp/startup.el54
1 files changed, 29 insertions, 25 deletions
diff --git a/lisp/startup.el b/lisp/startup.el
index e99c0bacdbe..da0e718c716 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -470,31 +470,35 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
470 (run-hooks 'emacs-startup-hook) 470 (run-hooks 'emacs-startup-hook)
471 (and term-setup-hook 471 (and term-setup-hook
472 (run-hooks 'term-setup-hook)) 472 (run-hooks 'term-setup-hook))
473 ;; Modify the initial frame based on what .emacs puts into 473
474 ;; ...-frame-alist. 474 ;; Don't do this if we failed to create the initial frame,
475 (if (fboundp 'frame-notice-user-settings) 475 ;; for instance due to a dense colormap.
476 (frame-notice-user-settings)) 476 (when frame-initial-frame
477 (if (fboundp 'frame-set-background-mode) 477 ;; Modify the initial frame based on what .emacs puts into
478 ;; Set the faces for the initial background mode even if 478 ;; ...-frame-alist.
479 ;; frame-notice-user-settings didn't (such as on a tty). 479 (if (fboundp 'frame-notice-user-settings)
480 ;; frame-set-background-mode is idempotent, so it won't 480 (frame-notice-user-settings))
481 ;; cause any harm if it's already been done. 481 (if (fboundp 'frame-set-background-mode)
482 (let ((frame-background-mode frame-background-mode) 482 ;; Set the faces for the initial background mode even if
483 (frame (selected-frame)) 483 ;; frame-notice-user-settings didn't (such as on a tty).
484 term) 484 ;; frame-set-background-mode is idempotent, so it won't
485 (when (and (null window-system) 485 ;; cause any harm if it's already been done.
486 ;; Don't override a possibly customized value. 486 (let ((frame-background-mode frame-background-mode)
487 (null frame-background-mode) 487 (frame (selected-frame))
488 ;; Don't override user specifications. 488 term)
489 (null (frame-parameter frame 'reverse)) 489 (when (and (null window-system)
490 (let ((bg (frame-parameter frame 'background-color))) 490 ;; Don't override a possibly customized value.
491 (or (null bg) 491 (null frame-background-mode)
492 (member bg '(unspecified "unspecified-bg"))))) 492 ;; Don't override user specifications.
493 (setq term (getenv "TERM")) 493 (null (frame-parameter frame 'reverse))
494 (if (string-match "^\\(xterm\\|rxvt\\|dtterm\\|eterm\\)" 494 (let ((bg (frame-parameter frame 'background-color)))
495 term) 495 (or (null bg)
496 (setq frame-background-mode 'light))) 496 (member bg '(unspecified "unspecified-bg")))))
497 (frame-set-background-mode (selected-frame)))) 497 (setq term (getenv "TERM"))
498 (if (string-match "^\\(xterm\\|rxvt\\|dtterm\\|eterm\\)"
499 term)
500 (setq frame-background-mode 'light)))
501 (frame-set-background-mode (selected-frame)))))
498 502
499 ;; Now we know the user's default font, so add it to the menu. 503 ;; Now we know the user's default font, so add it to the menu.
500 (if (fboundp 'font-menu-add-default) 504 (if (fboundp 'font-menu-add-default)