Skip to content

Problems deriving a theme from something other than modus #181

@jdtsmith

Description

@jdtsmith

modus-themes v20251122.1448, ef-themes v2.0.1, standard-themes v3.0.2

I'm attempting to port an old theme I use (and have modified) into the modus-landscape using the new capabilities for deriving themes via modus-theme-themes.

I'm trying this simple derivation using:

(modus-themes-theme
 'modus-alect-dark
 'modus-alect-themes
 "A dark theme in the modus family similar to alect-dark."
 'dark
 'standard-dark-palette
 'modus-alect-palette
 nil)

but am getting various errors.

No ability to require standard-dark-theme

Because I want to inherit from standard-dark-palette, I need to load it:

(require 'standard-dark-theme)

This throws:

Debugger entered--Lisp error: (error "Loading file .../.emacs.d/elpa/standard-themes-3.0.2/standard-dark-theme.elc failed to provide feature ‘standard-dark-theme’")
  require(standard-dark-theme)

I try require-theme: it does the same.

How are you supposed to derive from a theme which is not loaded? Do you need to load it first? All the examples in the manual show deriving from an already-loaded modus-theme (like modus-operandi). Maybe:

(load-theme 'standard-dark t t)

is the right approach? Would be good to have in the manual if so.

Bare symbol errors deriving themes

With that out of the way, other errors are encountered on evaluating the modus-themes-theme stanza above. modus appears to be unhappy with some "bare" symbols, e.g. bg-completion-match-0:

void-variable backtrace
Debugger entered--Lisp error: (void-variable bg-completion-match-0)
  (modus-themes--completion-match fg-completion-match-0 bg-completion-match-0)
  (cons c (modus-themes--completion-match fg-completion-match-0 bg-completion-match-0))
  (list (cons c (modus-themes--completion-match fg-completion-match-0 bg-completion-match-0)))
  (list 'modus-themes-completion-match-0 (list (cons c (modus-themes--completion-match fg-completion-match-0 bg-completion-match-0))))
  `(modus-themes-completion-match-0 ((,c ,@(modus-themes--completion-match fg-completion-match-0 bg-completion-match-0))))
  (custom-theme-set-faces 'modus-alect-dark `(modus-themes-heading-0 ((,c ,@(modus-themes--heading 0 fg-heading-0 bg-heading-0 overline-heading-0)))) `(modus-themes-heading-1 ((,c ,@(modus-themes--heading 1 fg-heading-1 bg-heading-1 overline-heading-1)))) `(modus-themes-heading-2 ((,c ,@(modus-themes--heading 2 fg-heading-2 bg-heading-2 overline-heading-2)))) `(modus-themes-heading-3 ((,c ,@(modus-themes--heading 3 fg-heading-3 bg-heading-3 overline-heading-3)))) `(modus-themes-heading-4 ((,c ,@(modus-themes--heading 4 fg-heading-4 bg-heading-4 overline-heading-4)))) `(modus-themes-heading-5 ((,c ,@(modus-themes--heading 5 fg-heading-5 bg-heading-5 overline-heading-5)))) `(modus-themes-heading-6 ((,c ,@(modus-themes--heading 6 fg-heading-6 bg-heading-6 overline-heading-6)))) `(modus-themes-heading-7 ((,c ,@(modus-themes--heading 7 fg-heading-7 bg-heading-7 overline-heading-7)))) `(modus-themes-heading-8 ((,c ,@(modus-themes--heading 8 fg-heading-8 bg-heading-8 overline-heading-8)))) `(modus-themes-completion-match-0 ((,c ,@(modus-themes--completion-match fg-completion-match-0 bg-completion-match-0)))) `(modus-themes-completion-match-1 ((,c ,@(modus-themes--completion-match fg-completion-match-1 bg-completion-match-1)))) `(modus-themes-completion-match-2 ((,c ,@(modus-themes--completion-match fg-completion-match-2 bg-completion-match-2)))) `(modus-themes-completion-match-3 ((,c ,@(modus-themes--completion-match fg-completion-match-3 bg-completion-match-3)))) `(modus-themes-completion-selected ((,c ,@(modus-themes--completion-line bg-completion)))) `(modus-themes-bold ((,c ,@(modus-themes--bold-weight)))) `(modus-themes-fixed-pitch ((,c ,@(modus-themes--fixed-pitch)))) `(modus-themes-slant ((,c ,@(modus-themes--slant)))) `(modus-themes-ui-variable-pitch ((,c ,@(modus-themes--variable-pitch-ui)))) `(modus-themes-button ((default :inherit variable-pitch :background ,bg-button-active :foreground ,fg-button-active) (((supports :box t)) :box (:line-width 1 :color ,border :style released-button)) (t :underline ,border))) `(modus-themes-prompt ((,c ,@(modus-themes--prompt fg-prompt bg-prompt)))) `(modus-themes-reset-soft ((,c :background ,bg-main :foreground ,fg-main :weight normal :slant normal :strike-through nil :box nil :underline nil :overline nil :extend nil))) `(default ((,c :background ,bg-main :foreground ,fg-main))) `(bold ((,c :weight bold))) `(bold-italic ((,c :inherit (bold italic)))) `(underline ((,c :underline ,fg-dim))) `(italic ((,c :slant italic))) `(cursor ((,c :background ,cursor))) `(fringe ((,c :background ,fringe :foreground ,fg-main))) `(menu ((,c :background ,bg-dim :foreground ,fg-main))) `(scroll-bar ((,c :background ,fringe :foreground ,border))) `(tool-bar ((,c :background ,bg-dim :foreground ,fg-main))) `(vertical-border ((,c :foreground ,border))) `(abbrev-table-name ((,c :inherit modus-themes-heading-1))) `(appt-notification ((,c :inherit modus-themes-bold :foreground ,modeline-err))) `(blink-matching-paren-offscreen ((,c :background ,bg-paren-match))) `(buffer-menu-buffer ((,c :foreground ,name))) `(child-frame-border ((,c :background ,border))) `(comint-highlight-input ((,c :inherit modus-themes-bold))) `(comint-highlight-prompt ((,c :inherit modus-themes-prompt))) `(confusingly-reordered ((,c :underline (:style wave :color ,underline-err)))) `(edmacro-label ((,c :inherit modus-themes-bold :foreground ,accent-0))) `(error ((,c :inherit modus-themes-bold :foreground ,err))) `(escape-glyph ((,c :inherit modus-themes-bold :foreground ,keybind))) `(file-name-shadow ((,c :foreground ,fg-dim))) `(header-line ((,c :inherit modus-themes-ui-variable-pitch :background ,bg-dim))) `(header-line-inactive ((,c :inherit modus-themes-ui-variable-pitch :background ,bg-dim :foreground ,fg-dim))) `(header-line-highlight ((,c :background ,bg-hover :foreground ,fg-main :box ,fg-main))) `(help-argument-name ((,c :inherit modus-themes-slant :foreground ,variable))) ...)
  (let* ((c '(... ...)) (palette (modus-themes--get-theme-palette-subr 'modus-alect-dark :with-overrides :with-user-palette)) (fringe (modus-themes--retrieve-palette-value 'fringe palette)) (border-mode-line-active (modus-themes--retrieve-palette-value 'border-mode-line-active palette)) (border-mode-line-inactive (modus-themes--retrieve-palette-value 'border-mode-line-inactive palette)) (blue (modus-themes--retrieve-palette-value 'blue palette)) (blue-faint (modus-themes--retrieve-palette-value 'blue-faint palette)) (green (modus-themes--retrieve-palette-value 'green palette)) (green-faint (modus-themes--retrieve-palette-value 'green-faint palette)) (red (modus-themes--retrieve-palette-value 'red palette)) (red-faint (modus-themes--retrieve-palette-value 'red-faint palette)) (yellow (modus-themes--retrieve-palette-value 'yellow palette)) (yellow-faint (modus-themes--retrieve-palette-value 'yellow-faint palette)) (magenta (modus-themes--retrieve-palette-value 'magenta palette)) (magenta-faint (modus-themes--retrieve-palette-value 'magenta-faint palette)) (cyan (modus-themes--retrieve-palette-value 'cyan palette)) (cyan-faint (modus-themes--retrieve-palette-value 'cyan-faint palette)) (rainbow-0 (modus-themes--retrieve-palette-value 'rainbow-0 palette)) (rainbow-1 (modus-themes--retrieve-palette-value 'rainbow-1 palette)) (rainbow-2 (modus-themes--retrieve-palette-value 'rainbow-2 palette)) (rainbow-3 (modus-themes--retrieve-palette-value 'rainbow-3 palette)) (rainbow-4 (modus-themes--retrieve-palette-value 'rainbow-4 palette)) (rainbow-5 (modus-themes--retrieve-palette-value 'rainbow-5 palette)) (rainbow-6 (modus-themes--retrieve-palette-value 'rainbow-6 palette)) (rainbow-7 (modus-themes--retrieve-palette-value 'rainbow-7 palette)) (rainbow-8 (modus-themes--retrieve-palette-value 'rainbow-8 palette)) (bg-main (modus-themes--retrieve-palette-value 'bg-main palette)) (fg-main (modus-themes--retrieve-palette-value 'fg-main palette)) (bg-dim (modus-themes--retrieve-palette-value 'bg-dim palette)) (fg-dim (modus-themes--retrieve-palette-value 'fg-dim palette)) (bg-alt (modus-themes--retrieve-palette-value 'bg-alt palette)) (fg-alt (modus-themes--retrieve-palette-value 'fg-alt palette)) ...) (custom-theme-set-faces 'modus-alect-dark `(modus-themes-heading-0 (...)) `(modus-themes-heading-1 (...)) `(modus-themes-heading-2 (...)) `(modus-themes-heading-3 (...)) `(modus-themes-heading-4 (...)) `(modus-themes-heading-5 (...)) `(modus-themes-heading-6 (...)) `(modus-themes-heading-7 (...)) `(modus-themes-heading-8 (...)) `(modus-themes-completion-match-0 (...)) `(modus-themes-completion-match-1 (...)) `(modus-themes-completion-match-2 (...)) `(modus-themes-completion-match-3 (...)) `(modus-themes-completion-selected (...)) `(modus-themes-bold (...)) `(modus-themes-fixed-pitch (...)) `(modus-themes-slant (...)) `(modus-themes-ui-variable-pitch (...)) `(modus-themes-button (... ... ...)) `(modus-themes-prompt (...)) `(modus-themes-reset-soft (...)) `(default (...)) `(bold (...)) `(bold-italic (...)) `(underline (...)) `(italic (...)) `(cursor (...)) `(fringe (...)) `(menu (...)) `(scroll-bar (...)) ...) (custom-theme-set-variables 'modus-alect-dark `(ansi-color-faces-vector [default bold shadow italic underline success warning error]) `(ansi-color-names-vector ["#595959" ... ... ... ... ... ... "#a6a6a6"]) `(chart-face-color-list '...) `(exwm-floating-border-color ,border) `(highlight-changes-colors nil) `(highlight-changes-face-list '...) `(ibuffer-filter-group-name-face 'bold) `(ibuffer-title-face 'default) `(hl-todo-keyword-faces '...) `(pdf-view-midnight-colors '...) `(rustic-ansi-faces [... ... ... ... ... ... ... ...]) `(viper-replace-overlay-cursor-color ,err) `(viper-insert-state-cursor-color ,info) `(viper-emacs-state-cursor-color ,fg-main) `(xterm-color-names [... ... ... ... ... ... ... ...]) `(xterm-color-names-bright [... ... ... ... ... ... ... ...]) '(frame-background-mode 'dark)))
  eval((let* ((c '(... ...)) (palette (modus-themes--get-theme-palette-subr 'modus-alect-dark :with-overrides :with-user-palette)) (fringe (modus-themes--retrieve-palette-value 'fringe palette)) (border-mode-line-active (modus-themes--retrieve-palette-value 'border-mode-line-active palette)) (border-mode-line-inactive (modus-themes--retrieve-palette-value 'border-mode-line-inactive palette)) (blue (modus-themes--retrieve-palette-value 'blue palette)) (blue-faint (modus-themes--retrieve-palette-value 'blue-faint palette)) (green (modus-themes--retrieve-palette-value 'green palette)) (green-faint (modus-themes--retrieve-palette-value 'green-faint palette)) (red (modus-themes--retrieve-palette-value 'red palette)) (red-faint (modus-themes--retrieve-palette-value 'red-faint palette)) (yellow (modus-themes--retrieve-palette-value 'yellow palette)) (yellow-faint (modus-themes--retrieve-palette-value 'yellow-faint palette)) (magenta (modus-themes--retrieve-palette-value 'magenta palette)) (magenta-faint (modus-themes--retrieve-palette-value 'magenta-faint palette)) (cyan (modus-themes--retrieve-palette-value 'cyan palette)) (cyan-faint (modus-themes--retrieve-palette-value 'cyan-faint palette)) (rainbow-0 (modus-themes--retrieve-palette-value 'rainbow-0 palette)) (rainbow-1 (modus-themes--retrieve-palette-value 'rainbow-1 palette)) (rainbow-2 (modus-themes--retrieve-palette-value 'rainbow-2 palette)) (rainbow-3 (modus-themes--retrieve-palette-value 'rainbow-3 palette)) (rainbow-4 (modus-themes--retrieve-palette-value 'rainbow-4 palette)) (rainbow-5 (modus-themes--retrieve-palette-value 'rainbow-5 palette)) (rainbow-6 (modus-themes--retrieve-palette-value 'rainbow-6 palette)) (rainbow-7 (modus-themes--retrieve-palette-value 'rainbow-7 palette)) (rainbow-8 (modus-themes--retrieve-palette-value 'rainbow-8 palette)) (bg-main (modus-themes--retrieve-palette-value 'bg-main palette)) (fg-main (modus-themes--retrieve-palette-value 'fg-main palette)) (bg-dim (modus-themes--retrieve-palette-value 'bg-dim palette)) (fg-dim (modus-themes--retrieve-palette-value 'fg-dim palette)) (bg-alt (modus-themes--retrieve-palette-value 'bg-alt palette)) (fg-alt (modus-themes--retrieve-palette-value 'fg-alt palette)) (bg-active (modus-themes--retrieve-palette-value 'bg-active palette)) (bg-inactive (modus-themes--retrieve-palette-value 'bg-inactive palette)) (border (modus-themes--retrieve-palette-value 'border palette)) (red (modus-themes--retrieve-palette-value 'red palette)) (red-warmer (modus-themes--retrieve-palette-value 'red-warmer palette)) (red-cooler (modus-themes--retrieve-palette-value 'red-cooler palette)) ...) (custom-theme-set-faces 'modus-alect-dark `(modus-themes-heading-0 (...)) `(modus-themes-heading-1 (...)) `(modus-themes-heading-2 (...)) `(modus-themes-heading-3 (...)) `(modus-themes-heading-4 (...)) `(modus-themes-heading-5 (...)) `(modus-themes-heading-6 (...)) `(modus-themes-heading-7 (...)) `(modus-themes-heading-8 (...)) `(modus-themes-completion-match-0 (...)) `(modus-themes-completion-match-1 (...)) `(modus-themes-completion-match-2 (...)) `(modus-themes-completion-match-3 (...)) `(modus-themes-completion-selected (...)) `(modus-themes-bold (...)) `(modus-themes-fixed-pitch (...)) `(modus-themes-slant (...)) `(modus-themes-ui-variable-pitch (...)) `(modus-themes-button (... ... ...)) `(modus-themes-prompt (...)) `(modus-themes-reset-soft (...)) `(default (...)) `(bold (...)) `(bold-italic (...)) `(underline (...)) `(italic (...)) `(cursor (...)) `(fringe (...)) `(menu (...)) `(scroll-bar (...)) `(tool-bar (...)) `(vertical-border (...)) `(abbrev-table-name (...)) `(appt-notification (...)) `(blink-matching-paren-offscreen (...)) `(buffer-menu-buffer (...)) ...) (custom-theme-set-variables 'modus-alect-dark `(ansi-color-faces-vector [default bold shadow italic underline success warning error]) `(ansi-color-names-vector ["#595959" ... ... ... ... ... ... "#a6a6a6"]) `(chart-face-color-list '...) `(exwm-floating-border-color ,border) `(highlight-changes-colors nil) `(highlight-changes-face-list '...) `(ibuffer-filter-group-name-face 'bold) `(ibuffer-title-face 'default) `(hl-todo-keyword-faces '...) `(pdf-view-midnight-colors '...) `(rustic-ansi-faces [... ... ... ... ... ... ... ...]) `(viper-replace-overlay-cursor-color ,err) `(viper-insert-state-cursor-color ,info) `(viper-emacs-state-cursor-color ,fg-main) `(xterm-color-names [... ... ... ... ... ... ... ...]) `(xterm-color-names-bright [... ... ... ... ... ... ... ...]) '(frame-background-mode 'dark))) :lexical)
  modus-themes-theme(modus-alect-dark modus-alect-themes "A dark theme in the modus family like alect-dark." dark ef-owl-palette modus-alect-palette nil)
...

It seems to me this call wants to be inside a let-wrapping environment like modus-with-colors, but of course that binds the colors of the currently active theme, not the theme we are creating.

If you change the name of the theme, sometimes these errors go away. And sometimes modus-themes-theme returns nil without error.

Summary

All in all it's quite a bit harder than I hoped to play around with deriving themes. The workflow I had imagined:

  1. Pick a basic modus/ef/standard theme you like as a base theme.
  2. Create a simple package defining your own custom palette.
  3. Use modus-themes-theme to create your theme, deriving from your desired base theme's palette.
  4. Load your newly created theme and test it.
  5. Add a few more color mappings to your custom palette.
  6. Maybe try updating the theme from which your new theme derives (say from modus-vivendi to ef-owl).
  7. Keep evaluating modus-themes-theme after every change to update the theme (maybe requiring you to load-theme the theme again, ideally not).

Is this the kind of workflow that's intended?

Thanks for all your work on modus.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions