protesilaos / modus-themes

Highly accessible themes for GNU Emacs, conforming with the highest standard for colour contrast between background and foreground values (WCAG AAA).
https://protesilaos.com/emacs/modus-themes
GNU General Public License v3.0
553 stars 30 forks source link

error on theme loading #20

Closed japhir closed 2 years ago

japhir commented 2 years ago

Hi Prot!

When I load the theme I get a warning: Wrong type argument: listp, subtle

the directory name is modus-themes-20220131.164. If I launch into emacs -q and go View -> customize and set the theme, it does load (but this is probably loading the emacs built-in version?)

I'm on

emacs --version
GNU Emacs 28.0.90
Copyright (C) 2021 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

here's the full stacktrace:

Debugger entered--Lisp error: (wrong-type-argument listp subtle)
  modus-themes--prompt("#6ae4b9" "#00bcff" "#a8a8a8" "#041529" "#242679" "#ffffff" "#191a1b" "#323232")
  (cons class (modus-themes--prompt cyan-alt-other blue-alt-other fg-alt cyan-nuanced-bg blue-refine-bg fg-main bg-alt bg-active))
  (list (cons class (modus-themes--prompt cyan-alt-other blue-alt-other fg-alt cyan-nuanced-bg blue-refine-bg fg-main bg-alt bg-active)))
  (list 'modus-themes-prompt (list (cons class (modus-themes--prompt cyan-alt-other blue-alt-other fg-alt cyan-nuanced-bg blue-refine-bg fg-main bg-alt bg-active))))
  (custom-theme-set-faces 'modus-vivendi (list 'modus-themes-subtle-red (list (list class ':background red-subtle-bg ':foreground fg-dim))) (list 'modus-themes-subtle-green (list (list class ':background green-subtle-bg ':foreground fg-dim))) (list 'modus-themes-subtle-yellow (list (list class ':background yellow-subtle-bg ':foreground fg-dim))) (list 'modus-themes-subtle-blue (list (list class ':background blue-subtle-bg ':foreground fg-dim))) (list 'modus-themes-subtle-magenta (list (list class ':background magenta-subtle-bg ':foreground fg-dim))) (list 'modus-themes-subtle-cyan (list (list class ':background cyan-subtle-bg ':foreground fg-dim))) (list 'modus-themes-subtle-neutral (list (list class ':background bg-inactive ':foreground fg-inactive))) (list 'modus-themes-intense-red (list (list class ':background red-intense-bg ':foreground fg-main))) (list 'modus-themes-intense-green (list (list class ':background green-intense-bg ':foreground fg-main))) (list 'modus-themes-intense-yellow (list (list class ':background yellow-intense-bg ':foreground fg-main))) (list 'modus-themes-intense-blue (list (list class ':background blue-intense-bg ':foreground fg-main))) (list 'modus-themes-intense-magenta (list (list class ':background magenta-intense-bg ':foreground fg-main))) (list 'modus-themes-intense-cyan (list (list class ':background cyan-intense-bg ':foreground fg-main))) (list 'modus-themes-intense-neutral (list (list class ':background bg-active ':foreground fg-main))) (list 'modus-themes-refine-red (list (list class ':background red-refine-bg ':foreground red-refine-fg))) (list 'modus-themes-refine-green (list (list class ':background green-refine-bg ':foreground green-refine-fg))) (list 'modus-themes-refine-yellow (list (list class ':background yellow-refine-bg ':foreground yellow-refine-fg))) (list 'modus-themes-refine-blue (list (list class ':background blue-refine-bg ':foreground blue-refine-fg))) (list 'modus-themes-refine-magenta (list (list class ':background magenta-refine-bg ':foreground magenta-refine-fg))) (list 'modus-themes-refine-cyan (list (list class ':background cyan-refine-bg ':foreground cyan-refine-fg))) (list 'modus-themes-active-red (list (list class ':background red-active ':foreground bg-active))) (list 'modus-themes-active-green (list (list class ':background green-active ':foreground bg-active))) (list 'modus-themes-active-yellow (list (list class ':background yellow-active ':foreground bg-active))) (list 'modus-themes-active-blue (list (list class ':background blue-active ':foreground bg-active))) (list 'modus-themes-active-magenta (list (list class ':background magenta-active ':foreground bg-active))) (list 'modus-themes-active-cyan (list (list class ':background cyan-active ':foreground bg-active))) (list 'modus-themes-nuanced-red (list (cons class (cons ':background (cons red-nuanced-bg '...))))) (list 'modus-themes-nuanced-green (list (cons class (cons ':background (cons green-nuanced-bg '...))))) (list 'modus-themes-nuanced-yellow (list (cons class (cons ':background (cons yellow-nuanced-bg '...))))) (list 'modus-themes-nuanced-blue (list (cons class (cons ':background (cons blue-nuanced-bg '...))))) (list 'modus-themes-nuanced-magenta (list (cons class (cons ':background (cons magenta-nuanced-bg '...))))) (list 'modus-themes-nuanced-cyan (list (cons class (cons ':background (cons cyan-nuanced-bg '...))))) (list 'modus-themes-fringe-red (list (list class ':background red-fringe-bg ':foreground fg-main))) (list 'modus-themes-fringe-green (list (list class ':background green-fringe-bg ':foreground fg-main))) (list 'modus-themes-fringe-yellow (list (list class ':background yellow-fringe-bg ':foreground fg-main))) (list 'modus-themes-fringe-blue (list (list class ':background blue-fringe-bg ':foreground fg-main))) (list 'modus-themes-fringe-magenta (list (list class ':background magenta-fringe-bg ':foreground fg-main))) (list 'modus-themes-fringe-cyan (list (list class ':background cyan-fringe-bg ':foreground fg-main))) (list 'modus-themes-special-cold (list (list class ':background bg-special-cold ':foreground fg-special-cold))) (list 'modus-themes-special-mild (list (list class ':background bg-special-mild ':foreground fg-special-mild))) (list 'modus-themes-special-warm (list (list class ':background bg-special-warm ':foreground fg-special-warm))) (list 'modus-themes-special-calm (list (list class ':background bg-special-calm ':foreground fg-special-calm))) ...)
  (let* ((class '...) (g80 (modus-themes--palette ...)) (bg-main (alist-get ... g80)) (fg-main (alist-get ... g80)) (bg-dim (alist-get ... g80)) (fg-dim (alist-get ... g80)) (bg-alt (alist-get ... g80)) (fg-alt (alist-get ... g80)) (bg-active (alist-get ... g80)) (fg-active (alist-get ... g80)) (bg-inactive (alist-get ... g80)) (fg-inactive (alist-get ... g80)) (bg-active-accent (alist-get ... g80)) (bg-special-cold (alist-get ... g80)) (fg-special-cold (alist-get ... g80)) (bg-special-mild (alist-get ... g80)) (fg-special-mild (alist-get ... g80)) (bg-special-warm (alist-get ... g80)) (fg-special-warm (alist-get ... g80)) (bg-special-calm (alist-get ... g80)) (fg-special-calm (alist-get ... g80)) (red (alist-get ... g80)) (red-alt (alist-get ... g80)) (red-alt-other (alist-get ... g80)) (red-faint (alist-get ... g80)) (red-alt-faint (alist-get ... g80)) ...) (custom-theme-set-faces 'modus-vivendi (list 'modus-themes-subtle-red (list ...)) (list 'modus-themes-subtle-green (list ...)) (list 'modus-themes-subtle-yellow (list ...)) (list 'modus-themes-subtle-blue (list ...)) (list 'modus-themes-subtle-magenta (list ...)) (list 'modus-themes-subtle-cyan (list ...)) (list 'modus-themes-subtle-neutral (list ...)) (list 'modus-themes-intense-red (list ...)) (list 'modus-themes-intense-green (list ...)) (list 'modus-themes-intense-yellow (list ...)) (list 'modus-themes-intense-blue (list ...)) (list 'modus-themes-intense-magenta (list ...)) (list 'modus-themes-intense-cyan (list ...)) (list 'modus-themes-intense-neutral (list ...)) (list 'modus-themes-refine-red (list ...)) (list 'modus-themes-refine-green (list ...)) (list 'modus-themes-refine-yellow (list ...)) (list 'modus-themes-refine-blue (list ...)) (list 'modus-themes-refine-magenta (list ...)) (list 'modus-themes-refine-cyan (list ...)) (list 'modus-themes-active-red (list ...)) (list 'modus-themes-active-green (list ...)) (list 'modus-themes-active-yellow (list ...)) (list 'modus-themes-active-blue (list ...)) ...) (custom-theme-set-variables 'modus-vivendi '(ansi-color-faces-vector ...) (list 'ansi-color-names-vector (apply ... ...)) (list 'awesome-tray-mode-line-active-color blue) (list 'awesome-tray-mode-line-inactive-color bg-active) (list 'exwm-floating-border-color fg-window-divider-inner) '(flymake-error-bitmap ...) '(flymake-warning-bitmap ...) '(flymake-note-bitmap ...) '(ibuffer-deletion-face ...) '(ibuffer-filter-group-name-face ...) '(ibuffer-marked-face ...) '(ibuffer-title-face ...) (list 'hl-todo-keyword-faces (list ... ...)) (list 'pdf-view-midnight-colors (list ... ...)) '(vc-annotate-background nil) '(vc-annotate-background-mode nil) (list 'vc-annotate-color-map (list ... ...)) '(vc-annotate-very-old-color nil) (list 'xterm-color-names (apply ... ...)) (list 'xterm-color-names-bright (apply ... ...)) (if (or ... ...) '... '...)))
  load-theme(modus-vivendi)
  (progn (load-theme 'modus-vivendi))
  elisp--eval-last-sexp(nil)
  eval-last-sexp(nil)
  funcall-interactively(eval-last-sexp nil)
  command-execute(eval-last-sexp)

EDIT: here is my modus-themes config, it has nothing special I think...

protesilaos commented 2 years ago

Hello @japhir and sorry for the inconvenience!

You need to update this to the new style of setting values (we now use a list of properties instead of a symbol):

modus-themes-prompts 'subtle

The equivalent is this:

modus-themes-prompts '(background)

The upside of using a list of properties instead of a symbol is that it scales well because you can add more properties to it to get their combined effect.

For example:

;; Use a bold weight, add background, and gray colours (the order does not matter)
(setq modus-themes-prompts '(background bold gray))

Before we had to have a symbol for each possible combination, like:

And so on. It did not scale well.


By the way, those two are now part of the modus-themes-headings:

Evaluate this form to see a sample snippet with all up-to-date options:

(info "(modus-themes) Customization Options")
japhir commented 2 years ago

Thanks for the elaborate reply. I guess that's the risk of early adoption ;-).

I'm working now and just need it to work, so for now I've just implemented all of the example configs in the (info "(modus-themes) Customization Options") section :)

protesilaos commented 2 years ago

Thanks for the elaborate reply.

You are welcome!

I guess that's the risk of early adoption ;-).

Indeed. I tried to keep the compatibility layer for as long as possible, but it had to be removed because it could lead to subtle bugs.

I'm working now and just need it to work, so for now I've just implemented all of the example configs in the (info "(modus-themes) Customization Options") section :)

If you need any further help, please let me know.

-- Protesilaos Stavrou https://protesilaos.com

japhir commented 2 years ago

I also didn't realize that all the necessary information was in the changelog. I should remember to check that first next time :).

protesilaos commented 2 years ago

I also didn't realize that all the necessary information was in the changelog. I should remember to check that first next time :).

No worries! Depending on when you last updated the package, there may have been be lots of changes in the meantime, so it is okay to raise an issue.

-- Protesilaos Stavrou https://protesilaos.com