]> git.eshelyaron.com Git - emacs.git/commitdiff
(normal-top-level): If the value of $TERM indicates that
authorEli Zaretskii <eliz@gnu.org>
Sat, 28 Oct 2000 18:48:08 +0000 (18:48 +0000)
committerEli Zaretskii <eliz@gnu.org>
Sat, 28 Oct 2000 18:48:08 +0000 (18:48 +0000)
we are running from xterm or one of its work-alikes, default to a
light background mode.

lisp/ChangeLog
lisp/startup.el

index 3b63b2e246472d7067d6c5e02ec0c35a4fa08106..6d8da4be2234b58092736dfa9e3e1d4e763f42c8 100644 (file)
@@ -1,5 +1,9 @@
 2000-10-28  Eli Zaretskii  <eliz@is.elta.co.il>
 
+       * startup.el (normal-top-level): If the value of $TERM indicates
+       we are running from xterm or one of its work-alikes, default to a
+       light background mode.
+
        Support for -fg, -bg, and -rv command-line arguments for TTYs:
        * faces.el (tty-handle-reverse-video): New function.
        (tty-create-frame-with-faces): Call it.
index 51a6778f8346c8eb79ce5b77bc2e51dc16a2c635..0a0919958f3f6cb697a8350f8745a38ab5adde6a 100644 (file)
@@ -478,7 +478,22 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
            ;; 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.
-           (frame-set-background-mode (selected-frame)))
+           (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)