Suggestions for compatibility of modus-themes-completions
After updating modus-themes from MELPA to the following version, an error occurred when loading the theme.
Debugger entered--Lisp error: (wrong-type-argument listp moderate)
alist-get(matches moderate)
modus-themes--completion(matches "#251232" "#f78fe7" "#49366e" "#ff62d4")
byte-code("\305\306!\203\34\0\10\203\34\0\307\10!\310\311\11\"\232\203\34\0\306\312\313\"\204 \0\314\312!\210\315\316\317\320#\210\321\322\316!\323\324\2\"\323\325\3\"..." [load-file-name data-directory modus-themes-diffs modus-themes-mixed-fonts modus-themes-org-blocks fboundp require-theme file-name-directory expand-file-name "themes/" modus-themes t require custom-declare-theme modus-vivendi modus-vivendi-theme "Accessible and customizable dark theme (WCAG AAA s..." ((class color) (min-colors 89)) modus-themes--palette alist-get bg-main fg-main bg-dim fg-dim bg-alt fg-alt bg-active fg-active bg-inactive fg-inactive bg-active-accent bg-special-cold bg-special-faint-cold fg-special-cold bg-special-mild bg-special-faint-mild fg-special-mild bg-special-warm bg-special-faint-warm fg-special-warm bg-special-calm bg-special-faint-calm fg-special-calm red red-alt red-alt-other red-faint red-alt-faint red-alt-other-faint green ...] 2860)
load-theme(modus-vivendi t)
modus-themes-load-vivendi()
(progn (modus-themes-load-vivendi))
elisp--eval-last-sexp(nil)
eval-last-sexp(nil)
funcall-interactively(eval-last-sexp nil)
command-execute(eval-last-sexp)
Although described as "IGNORED" in f3ff0bc0, it actually crashes and confuses the user.
All old values, such as 'opinionated' and 'moderate' ARE IGNORED.
Proposal
You can display a warning to the user and ignore the setting by replacing it as follows.
@@ -3813,7 +3813,12 @@ KEY is the key of a cons cell. BG and FG are the main colors.
BGINTENSE works with the main foreground. FGINTENSE works on its
own. BGACCENT and BGACCENTINTENSE are colorful variants of the
other backgrounds."
- (let* ((var modus-themes-completions)
+ (let* ((var (if (listp modus-themes-completions)
+ modus-themes-completions
+ (prog1 nil
+ (warn "modus-themes-completions: %s is deprecated.\nThis setting will be ignored until it is replaced from symbol to alist.\nPlease see %s"
+ modus-themes-completions
+ "https://gitlab.com/protesilaos/modus-themes/-/commit/f3ff0bc0089051cea85e39700ec148c1a40aeba4"))))
(properties (or (alist-get key var) (alist-get t var)))
(popup (eq key 'popup))
(selection (eq key 'selection))
This change was submitted in an issue rather than a Merge Request as I can't do good documentation. I do not claim copyright for this patch, so feel free to replace it.
Finally, I love modus-themes very much. Thank you!