rougier / nano-emacs

GNU Emacs / N Λ N O - Emacs made simple
GNU General Public License v3.0
2.52k stars 195 forks source link

nano-faces: new module, extracted from nano-theme, that just defines nano faces #12

Closed mrzor closed 3 years ago

mrzor commented 3 years ago

What this is

This is the refactor in line with changes discussed in #9. It was a scary rebase after all the new faces, but I think I got it right.

How to use modular faces / theme

Here is the snippet I use to selectively load nano-emacs header line into my own configuration. It feels much better than copying and editing most of the related source code, so that's a win!

(add-to-list 'load-path "/home/zor/taf/my-nano-emacs")

(defvar nano-color-foreground "#ECEFF4") ;; Snow Storm 3  / nord  6
(defvar nano-color-background "#2E3440") ;; Polar Night 0 / nord  0
(defvar nano-color-highlight  "#3B4252") ;; Polar Night 1 / nord  1
(defvar nano-color-critical   "#EBCB8B") ;; Aurora        / nord 11
(defvar nano-color-salient    "#81A1C1") ;; Frost         / nord  9
(defvar nano-color-strong     "#ECEFF4") ;; Snow Storm 3  / nord  6
(defvar nano-color-popout     "#D08770") ;; Aurora        / nord 12
(defvar nano-color-subtle     "#434C5E") ;; Polar Night 2 / nord  2
(defvar nano-color-faded      "#616E87") ;;

(require 'nano-faces)
(nano-faces)

(require 'nano-theme)
(nano-theme--mode-line)

(require 'nano-modeline)

:warning: Sneaky changes in layout.el

Some things sneaked in. I can rewrite this commit to be cleaner and force push if you deem them too disturbing or irrelevant.

Next steps ?

It's still not perfect. Copying the color theme is not great. As things stand, a nano-theme-xx can't be required because it will in turn require and set everything else.

Also: existing faces are not customizable, and the colors are really not customizable. This is because they are mostly proceduraly set. I think making colors and faces independently customizable (with customize-group nano) is a big enough change to warrant its own PR. I've started hacking around that idea, it seems there is plenty enough potention in defcustom to support this. More info in a new issue after this merges.

rougier commented 3 years ago

Thanks, much cleaner now.