further theme back fix

master
parent 9d5b5f6193
commit 3381cfb6ee
Signed by: yogsototh
GPG Key ID: 7B19A4C650D59646

@ -35,6 +35,7 @@
(require 'doom-themes)
(require 'hl-sentence)
(defvar doom-theme)
(defvar custom-enabled-themes)
;;;###autoload
(when (and (boundp 'custom-theme-load-path) load-file-name )
@ -67,16 +68,14 @@
nil
;; body
(if zen-writer-mode
(progn
;; save theme before enabling ZenWriter
(setq zen-writer--pre-zen-doom-theme doom-theme)
(zen-writer-on))
(zen-writer-on)
(zen-writer-off)))
(defun zen-writer-select-user-theme ()
"Change the theme back to the theme prior to the Zen Writer theme."
(setq doom-theme zen-writer--pre-zen-doom-theme)
(load-theme doom-theme t))
(when zen-writer--pre-zen-doom-theme
(setq doom-theme zen-writer--pre-zen-doom-theme)
(load-theme doom-theme t)))
(defun zen-writer-current-hour ()
"Retrieve current local hour."
@ -98,12 +97,19 @@
(defun zen-writer-on ()
"Activate Zen Writer."
(when (not zen-writer--pre-zen-doom-theme)
;; save theme before enabling ZenWriter
(setq zen-writer--pre-zen-doom-theme
(or (when (and custom-enabled-themes (listp custom-enabled-themes))
(car custom-enabled-themes))
doom-theme)))
(zen-writer-select-theme)
(hl-sentence-mode +1))
(defun zen-writer-off ()
"Deactivate Zen Writer."
(zen-writer-select-user-theme)
(setq zen-writer--pre-zen-doom-theme nil)
(hl-sentence-mode -1))
;; Full Zen Writer

Loading…
Cancel
Save