branch: externals/nano-theme commit b06eff4381e35494d1358b677c28a1e33424561b Author: Nicolas P. Rougier <nicolas.roug...@inria.fr> Commit: Nicolas P. Rougier <nicolas.roug...@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