Closed tefkah closed 1 year ago
Thanks. What is the use-case of refresh-theme exactly?
Refresh theme can be useful when changing the font(-size) for instance, avoids having to manually call (nano-faces) and (nano-theme). Not strictly necessary of course, but when testing things out I found myself calling these quite often, and I thought other people might find it useful.
I think the nano-theme might make theme switch much easier now and the plan os to remove the theme files from this repository. I still need to add a settings to enforce fonts or not.
Is there anything blocking this PR? I have reproduced the changes here on nano-emacs
master
and that seems to work fine.
I would really love to be able to load these two themes just like other themes with load-theme
because then they could be cycled with other themes from ELPA/MELPA in a single command. For instance, this is what I was using before trying nano-emacs
for the first time today:
;; Cycle between some themes
(defun toggle-theme ()
(interactive)
(cond ((eq (car custom-enabled-themes) 'doom-palenight)
(mapc #'disable-theme custom-enabled-themes)
(load-theme 'doom-nord-light))
((eq (car custom-enabled-themes) 'doom-nord-light)
(mapc #'disable-theme custom-enabled-themes)
(load-theme 'doom-Iosvkem))
((eq (car custom-enabled-themes) 'doom-Iosvkem)
(mapc #'disable-theme custom-enabled-themes)
(load-theme 'doom-palenight))))
(global-set-key (kbd "C-c t") 'toggle-theme)
Unfortunately I wouldn't know how to make nano-theme-dark
and nano-theme-light
compatible with that workflow.
Sorry for late reply and many thanks for the PR.
Fixes #26.
Adds two new functions:
(nano-refresh-theme)
and(nano-toggle-theme)
, and one new variablenano-theme-var
.Calling
nano-toggle-theme
will switch the theme from light to dark, and vice versa. This does require you to also require both themes separately, otherwise the function fails. I put this in the docstring, but is probably a better way to do this, maybe adding the themes back intonano-theme
?