emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/nano-theme b06eff4: Added nano-theme-toggle


From: ELPA Syncer
Subject: [elpa] externals/nano-theme b06eff4: Added nano-theme-toggle
Date: Tue, 5 Oct 2021 17:57:16 -0400 (EDT)

branch: externals/nano-theme
commit b06eff4381e35494d1358b677c28a1e33424561b
Author: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>
Commit: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>

    Added nano-theme-toggle
---
 nano-theme.el | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/nano-theme.el b/nano-theme.el
index f7ac089..d5079e8 100644
--- a/nano-theme.el
+++ b/nano-theme.el
@@ -472,6 +472,17 @@ background color that is barely perceptible."
   (set-background-color nano-light-background)
   (load-theme 'nano-light t))
 
+(defvar nano-theme--current 'light
+  "Current nano theme")
+
+(defun nano-theme-toggle ()
+  "Toggle theme on current frame."
+
+  (interactive)
+  (if (eq nano-theme--current 'light)
+      (nano-dark)
+    (nano-light)))
+
 
 (defun nano-theme (mode)
   "Apply the nano theme according to MODE which can be 'dark or 'light."
@@ -484,6 +495,7 @@ background color that is barely perceptible."
 
     (set-frame-parameter nil 'background-mode mode)
     (setq frame-background-mode mode)
+    (setq nano-theme--current mode)
     (frame-set-background-mode (selected-frame))
     
     (when nano-fonts-use



reply via email to

[Prev in Thread] Current Thread [Next in Thread]