Emacs: Only write minimal theme if colors are set.

This commit is contained in:
tastytea 2020-05-03 03:31:25 +02:00
parent db1ca14850
commit 2f51b17cce
1 changed files with 13 additions and 12 deletions

View File

@ -1,6 +1,6 @@
;;; appearance.el --- Configure appearance. -*- lexical-binding: t; -*-
;; Time-stamp: <2020-04-25T18:27:20+0200>
;; Time-stamp: <2020-05-03T03:17:10+0200>
;;; Commentary:
@ -70,17 +70,18 @@
"Deactivated.")
;; Write a minimal theme to file, to load it in early-init.el.
(let ((minimal-theme))
(setq minimal-theme (concat "(set-face-background 'default \""
(face-background 'default) "\")\n"
"(set-face-foreground 'default \""
(face-foreground 'default) "\")\n"
"(menu-bar-mode -1)\n"
"(when (display-graphic-p)\n"
" (tool-bar-mode -1))\n"))
(with-temp-file (expand-file-name "early-theme.el"
user-emacs-directory)
(insert minimal-theme)))))
(unless (string= (face-background 'default) "unspecified-bg")
(let ((minimal-theme))
(setq minimal-theme (concat "(set-face-background 'default \""
(face-background 'default) "\")\n"
"(set-face-foreground 'default \""
(face-foreground 'default) "\")\n"
"(menu-bar-mode -1)\n"
"(when (display-graphic-p)\n"
" (tool-bar-mode -1))\n"))
(with-temp-file (expand-file-name "early-theme.el"
user-emacs-directory)
(insert minimal-theme))))))
) ; unless slow-computer.
;; Neat modeline.