mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
fix(themes/doom): correctly load theme when running in terminal
On macOS when running Emacs in a terminal, the ns-system-appearance variable is defined, but set to nil. We now cater for that, and simply default to loading the dark theme.
This commit is contained in:
@@ -29,12 +29,11 @@
|
||||
(nlinum-highlight-current-line t)
|
||||
|
||||
:config
|
||||
(if (boundp 'ns-system-appearance)
|
||||
(progn
|
||||
(siren-doom-themes-set-appearance ns-system-appearance)
|
||||
(add-hook 'ns-system-appearance-change-functions
|
||||
'siren-doom-themes-set-appearance))
|
||||
(siren-doom-themes-set-appearance 'dark))
|
||||
(if (not (siren-ns-system-appearance))
|
||||
(siren-doom-themes-set-appearance 'dark)
|
||||
(siren-doom-themes-set-appearance ns-system-appearance)
|
||||
(add-hook 'ns-system-appearance-change-functions
|
||||
'siren-doom-themes-set-appearance))
|
||||
|
||||
;; Enable flashing mode-line on errors
|
||||
(doom-themes-visual-bell-config)
|
||||
@@ -46,6 +45,16 @@
|
||||
(doom-themes-org-config)
|
||||
|
||||
:preface
|
||||
(defun siren-ns-system-appearance()
|
||||
"Return the system appearance, either `dark', `light', or `nil'.
|
||||
|
||||
A return value of `nil' means that the system appearance is could
|
||||
not be determined. This happens on non-macOS systems, or on macOS
|
||||
if running Emacs in a terminal."
|
||||
(if (boundp 'ns-system-appearance)
|
||||
ns-system-appearance
|
||||
nil))
|
||||
|
||||
(defgroup siren-doom-themes nil
|
||||
"siren-doom-themes customizations."
|
||||
:group 'doom-themes)
|
||||
|
||||
Reference in New Issue
Block a user