summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2001-07-10 12:55:44 +0000
committerGerd Moellmann <gerd@gnu.org>2001-07-10 12:55:44 +0000
commit6a1e7d6714703f8600ffdb33e1df2316cf4a3831 (patch)
treeb1827a72633d6d9c11826a7356eb08a12e18f3bb
parent30a7ac224fe64611fbccb665606aea44eefc48b9 (diff)
downloademacs-6a1e7d6714703f8600ffdb33e1df2316cf4a3831.tar.gz
(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'."
(run-hooks 'emacs-startup-hook)
(and term-setup-hook
(run-hooks 'term-setup-hook))
- ;; Modify the initial frame based on what .emacs puts into
- ;; ...-frame-alist.
- (if (fboundp 'frame-notice-user-settings)
- (frame-notice-user-settings))
- (if (fboundp 'frame-set-background-mode)
- ;; Set the faces for the initial background mode even if
- ;; frame-notice-user-settings didn't (such as on a tty).
- ;; frame-set-background-mode is idempotent, so it won't
- ;; cause any harm if it's already been done.
- (let ((frame-background-mode frame-background-mode)
- (frame (selected-frame))
- term)
- (when (and (null window-system)
- ;; Don't override a possibly customized value.
- (null frame-background-mode)
- ;; Don't override user specifications.
- (null (frame-parameter frame 'reverse))
- (let ((bg (frame-parameter frame 'background-color)))
- (or (null bg)
- (member bg '(unspecified "unspecified-bg")))))
- (setq term (getenv "TERM"))
- (if (string-match "^\\(xterm\\|rxvt\\|dtterm\\|eterm\\)"
- term)
- (setq frame-background-mode 'light)))
- (frame-set-background-mode (selected-frame))))
+
+ ;; Don't do this if we failed to create the initial frame,
+ ;; for instance due to a dense colormap.
+ (when frame-initial-frame
+ ;; Modify the initial frame based on what .emacs puts into
+ ;; ...-frame-alist.
+ (if (fboundp 'frame-notice-user-settings)
+ (frame-notice-user-settings))
+ (if (fboundp 'frame-set-background-mode)
+ ;; Set the faces for the initial background mode even if
+ ;; frame-notice-user-settings didn't (such as on a tty).
+ ;; frame-set-background-mode is idempotent, so it won't
+ ;; cause any harm if it's already been done.
+ (let ((frame-background-mode frame-background-mode)
+ (frame (selected-frame))
+ term)
+ (when (and (null window-system)
+ ;; Don't override a possibly customized value.
+ (null frame-background-mode)
+ ;; Don't override user specifications.
+ (null (frame-parameter frame 'reverse))
+ (let ((bg (frame-parameter frame 'background-color)))
+ (or (null bg)
+ (member bg '(unspecified "unspecified-bg")))))
+ (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.
(if (fboundp 'font-menu-add-default)