Skip to content

Commit

Permalink
Merge pull request rougier#132 from balakrishnanc/main
Browse files Browse the repository at this point in the history
Fix minor bug in theme loading
  • Loading branch information
rougier committed Dec 20, 2022
2 parents 3aab6d3 + e486c30 commit 41baa7b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 18 deletions.
2 changes: 0 additions & 2 deletions nano-theme-dark.el
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,4 @@
(setq nano-theme-var "dark")
)

(nano-theme-set-dark)

(provide 'nano-theme-dark)
1 change: 0 additions & 1 deletion nano-theme-light.el
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,5 @@
;; to allow for toggling of the themes.
(setq nano-theme-var "light")
)
(nano-theme-set-light)

(provide 'nano-theme-light)
11 changes: 4 additions & 7 deletions nano-theme.el
Original file line number Diff line number Diff line change
Expand Up @@ -796,13 +796,10 @@ Calls \(nano-faces\) and \(nano-theme\) sequentially."
Requires both to be loaded in order to work."
(interactive)
(cond ((string= nano-theme-var "light")
(progn (nano-theme-set-dark)
(nano-refresh-theme)
(setq nano-theme-var "dark")))
(nano-theme-set-dark))
((string= nano-theme-var "dark")
(progn (nano-theme-set-light)
(nano-refresh-theme)
(setq nano-theme-var "light")))
(t nil)))
(nano-theme-set-light))
(t nil))
(nano-refresh-theme))

(provide 'nano-theme)
16 changes: 8 additions & 8 deletions nano.el
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@
(add-to-list 'command-switch-alist '("-compact" . (lambda (args))))


(cond
((member "-default" command-line-args) t)
((member "-dark" command-line-args) (require 'nano-theme-dark))
(t (require 'nano-theme-light)))

;; Customize support for 'emacs -q' (Optional)
;; You can enable customizations by creating the nano-custom.el file
;; with e.g. `touch nano-custom.el` in the folder containing this file.
Expand All @@ -54,10 +49,15 @@

;; Theme
(require 'nano-faces)
(nano-faces)

(require 'nano-theme)
(nano-theme)
(require 'nano-theme-dark)
(require 'nano-theme-light)

(cond
((member "-default" command-line-args) t)
((member "-dark" command-line-args) (nano-theme-set-dark))
(t (nano-theme-set-light)))
(call-interactively 'nano-refresh-theme)

;; Nano default settings (optional)
(require 'nano-defaults)
Expand Down

0 comments on commit 41baa7b

Please sign in to comment.