catppuccin / emacs

🍄 Soothing pastel theme for Emacs
MIT License
279 stars 44 forks source link

Debugger entered--Lisp error: (wrong-type-argument arrayp nil) #86

Closed tsdh closed 1 year ago

tsdh commented 1 year ago

I've just tried to give catppuccin-theme a try but it errors on startup for me using the current Emacs master version (GNU Emacs 30.0.50 (build 11, x86_64-pc-linux-gnu, GTK+ Version 3.24.37, cairo version 1.17.8) of 2023-04-17).

That's the recipe in my .emacs:

(use-package catppuccin-theme
  :ensure t
  :custom (catppuccin-flavor 'catppuccin-latte)
  :init
  (load-theme 'catppuccin t)
  (catppuccin-reload))

With emacs --debug-init I get this error:

Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
  substring(nil 1 3)
  (string-to-number (substring color i (+ i 2)) 16)
  (closure ((color)) (i) (string-to-number (substring color i (+ i 2)) 16))(1)
  mapcar((closure ((color)) (i) (string-to-number (substring color i (+ i 2)) 16)) (1 3 5))
  (closure (t) (color) (mapcar #'(lambda (i) (string-to-number (substring color i (+ i 2)) 16)) '(1 3 5)))(nil)
  funcall((closure (t) (color) (mapcar #'(lambda (i) (string-to-number (substring color i (+ i 2)) 16)) '(1 3 5))) nil)
  (mapcar #'(lambda (v) (funcall rnd (min 255 (+ (* (- 255 v) factor) v)))) (funcall hex-to-rgb color))
  (apply rgb-to-hex (mapcar #'(lambda (v) (funcall rnd (min 255 (+ (* ... factor) v)))) (funcall hex-to-rgb color)))
  (let* ((factor (/ value 100.0))) (apply rgb-to-hex (mapcar #'(lambda (v) (funcall rnd (min 255 (+ ... v)))) (funcall hex-to-rgb color))))
  catppuccin-lighten(nil 5)
  (if (eq catppuccin-flavor 'latte) (catppuccin-darken (catppuccin-get-color 'base) 5) (catppuccin-lighten (catppuccin-get-color 'base) 5))
  (let ((ctp-current (if (eq catppuccin-flavor 'latte) (catppuccin-darken (catppuccin-get-color 'base) 5) (catppuccin-lighten (catppuccin-get-color 'base) 5))) (ctp-crust (catppuccin-get-color 'crust)) (ctp-mantle (catppuccin-get-color 'mantle)) (ctp-base (catppuccin-get-color 'base)) (ctp-surface0 (catppuccin-get-color 'surface0)) (ctp-surface1 (catppuccin-get-color 'surface1)) (ctp-surface2 (catppuccin-get-color 'surface2)) (ctp-overlay0 (catppuccin-get-color 'overlay0)) (ctp-overlay1 (catppuccin-get-color 'overlay1)) (ctp-overlay2 (catppuccin-get-color 'overlay2)) (ctp-subtext0 (catppuccin-get-color 'subtext0)) (ctp-subtext1 (catppuccin-get-color 'subtext1)) (ctp-text (catppuccin-get-color 'text)) (ctp-lavender (catppuccin-get-color 'lavender)) (ctp-blue (catppuccin-get-color 'blue)) (ctp-sapphire (catppuccin-get-color 'sapphire)) (ctp-sky (catppuccin-get-color 'sky)) (ctp-teal (catppuccin-get-color 'teal)) (ctp-green (catppuccin-get-color 'green)) (ctp-yellow (catppuccin-get-color 'yellow)) (ctp-peach (catppuccin-get-color 'peach)) (ctp-maroon (catppuccin-get-color 'maroon)) (ctp-red (catppuccin-get-color 'red)) (ctp-mauve (catppuccin-get-color 'mauve)) (ctp-pink (catppuccin-get-color 'pink)) (ctp-flamingo (catppuccin-get-color 'flamingo)) (ctp-rosewater (catppuccin-get-color 'rosewater)) (undef "#ff00ff")) (backquote (:background ,ctp-rosewater)))
  eval((let ((ctp-current (if (eq catppuccin-flavor 'latte) (catppuccin-darken (catppuccin-get-color 'base) 5) (catppuccin-lighten (catppuccin-get-color 'base) 5))) (ctp-crust (catppuccin-get-color 'crust)) (ctp-mantle (catppuccin-get-color 'mantle)) (ctp-base (catppuccin-get-color 'base)) (ctp-surface0 (catppuccin-get-color 'surface0)) (ctp-surface1 (catppuccin-get-color 'surface1)) (ctp-surface2 (catppuccin-get-color 'surface2)) (ctp-overlay0 (catppuccin-get-color 'overlay0)) (ctp-overlay1 (catppuccin-get-color 'overlay1)) (ctp-overlay2 (catppuccin-get-color 'overlay2)) (ctp-subtext0 (catppuccin-get-color 'subtext0)) (ctp-subtext1 (catppuccin-get-color 'subtext1)) (ctp-text (catppuccin-get-color 'text)) (ctp-lavender (catppuccin-get-color 'lavender)) (ctp-blue (catppuccin-get-color 'blue)) (ctp-sapphire (catppuccin-get-color 'sapphire)) (ctp-sky (catppuccin-get-color 'sky)) (ctp-teal (catppuccin-get-color 'teal)) (ctp-green (catppuccin-get-color 'green)) (ctp-yellow (catppuccin-get-color 'yellow)) (ctp-peach (catppuccin-get-color 'peach)) (ctp-maroon (catppuccin-get-color 'maroon)) (ctp-red (catppuccin-get-color 'red)) (ctp-mauve (catppuccin-get-color 'mauve)) (ctp-pink (catppuccin-get-color 'pink)) (ctp-flamingo (catppuccin-get-color 'flamingo)) (ctp-rosewater (catppuccin-get-color 'rosewater)) (undef "#ff00ff")) (backquote (:background ,ctp-rosewater))))
  (let (reduced-color-list) (let ((tail colors)) (while tail (let ((col (car tail))) (setq reduced-color-list (cons (list (car col) (funcall func col)) reduced-color-list)) (setq tail (cdr tail)))) reduced-color-list) (eval (list 'let reduced-color-list (list 'backquote spec))))
  (closure ((colors (undef "#ff00ff" "#ff00ff") (ctp-rosewater (catppuccin-get-color ...) (catppuccin-quantize-color ...)) (ctp-flamingo (catppuccin-get-color ...) (catppuccin-quantize-color ...)) (ctp-pink (catppuccin-get-color ...) (catppuccin-quantize-color ...)) (ctp-mauve (catppuccin-get-color ...) (catppuccin-quantize-color ...)) (ctp-red (catppuccin-get-color ...) (catppuccin-quantize-color ...)) (ctp-maroon (catppuccin-get-color ...) (catppuccin-quantize-color ...)) (ctp-peach (catppuccin-get-color ...) (catppuccin-quantize-color ...)) (ctp-yellow (catppuccin-get-color ...) (catppuccin-quantize-color ...)) (ctp-green (catppuccin-get-color ...) (catppuccin-quantize-color ...)) (ctp-teal (catppuccin-get-color ...) (catppuccin-quantize-color ...)) (ctp-sky (catppuccin-get-color ...) (catppuccin-quantize-color ...)) (ctp-sapphire (catppuccin-get-color ...) (catppuccin-quantize-color ...)) (ctp-blue (catppuccin-get-color ...) (catppuccin-quantize-color ...)) (ctp-lavender (catppuccin-get-color ...) (catppuccin-quantize-color ...)) (ctp-text (catppuccin-get-color ...) (catppuccin-quantize-color ...)) (ctp-subtext1 (catppuccin-get-color ...) (catppuccin-quantize-color ...)) (ctp-subtext0 (catppuccin-get-color ...) (catppuccin-quantize-color ...)) (ctp-overlay2 (catppuccin-get-color ...) (catppuccin-quantize-color ...)) (ctp-overlay1 (catppuccin-get-color ...) (catppuccin-quantize-color ...)) (ctp-overlay0 (catppuccin-get-color ...) (catppuccin-quantize-color ...)) (ctp-surface2 (catppuccin-get-color ...) (catppuccin-quantize-color ...)) (ctp-surface1 (catppuccin-get-color ...) (catppuccin-quantize-color ...)) (ctp-surface0 (catppuccin-get-color ...) (catppuccin-quantize-color ...)) (ctp-base (catppuccin-get-color ...) (catppuccin-quantize-color ...)) (ctp-mantle (catppuccin-get-color ...) (catppuccin-quantize-color ...)) (ctp-crust (catppuccin-get-color ...) (catppuccin-quantize-color ...)) (ctp-current (if ... ... ...) (catppuccin-quantize-color ...)))) (func spec) (let (reduced-color-list) (let ((tail colors)) (while tail (let ... ... ...)) reduced-color-list) (eval (list 'let reduced-color-list (list ... spec)))))(cadr (:background ,ctp-rosewater))
  funcall((closure ((colors (undef "#ff00ff" "#ff00ff") (ctp-rosewater (catppuccin-get-color 'rosewater) (catppuccin-quantize-color (catppuccin-get-color 'rosewater))) (ctp-flamingo (catppuccin-get-color 'flamingo) (catppuccin-quantize-color (catppuccin-get-color 'flamingo))) (ctp-pink (catppuccin-get-color 'pink) (catppuccin-quantize-color (catppuccin-get-color 'pink))) (ctp-mauve (catppuccin-get-color 'mauve) (catppuccin-quantize-color (catppuccin-get-color 'mauve))) (ctp-red (catppuccin-get-color 'red) (catppuccin-quantize-color (catppuccin-get-color 'red))) (ctp-maroon (catppuccin-get-color 'maroon) (catppuccin-quantize-color (catppuccin-get-color 'maroon))) (ctp-peach (catppuccin-get-color 'peach) (catppuccin-quantize-color (catppuccin-get-color 'peach))) (ctp-yellow (catppuccin-get-color 'yellow) (catppuccin-quantize-color (catppuccin-get-color 'yellow))) (ctp-green (catppuccin-get-color 'green) (catppuccin-quantize-color (catppuccin-get-color 'green))) (ctp-teal (catppuccin-get-color 'teal) (catppuccin-quantize-color (catppuccin-get-color 'teal))) (ctp-sky (catppuccin-get-color 'sky) (catppuccin-quantize-color (catppuccin-get-color 'sky))) (ctp-sapphire (catppuccin-get-color 'sapphire) (catppuccin-quantize-color (catppuccin-get-color 'sapphire))) (ctp-blue (catppuccin-get-color 'blue) (catppuccin-quantize-color (catppuccin-get-color 'blue))) (ctp-lavender (catppuccin-get-color 'lavender) (catppuccin-quantize-color (catppuccin-get-color 'lavender))) (ctp-text (catppuccin-get-color 'text) (catppuccin-quantize-color (catppuccin-get-color 'text))) (ctp-subtext1 (catppuccin-get-color 'subtext1) (catppuccin-quantize-color (catppuccin-get-color 'subtext1))) (ctp-subtext0 (catppuccin-get-color 'subtext0) (catppuccin-quantize-color (catppuccin-get-color 'subtext0))) (ctp-overlay2 (catppuccin-get-color 'overlay2) (catppuccin-quantize-color (catppuccin-get-color 'overlay2))) (ctp-overlay1 (catppuccin-get-color 'overlay1) (catppuccin-quantize-color (catppuccin-get-color 'overlay1))) (ctp-overlay0 (catppuccin-get-color 'overlay0) (catppuccin-quantize-color (catppuccin-get-color 'overlay0))) (ctp-surface2 (catppuccin-get-color 'surface2) (catppuccin-quantize-color (catppuccin-get-color 'surface2))) (ctp-surface1 (catppuccin-get-color 'surface1) (catppuccin-quantize-color (catppuccin-get-color 'surface1))) (ctp-surface0 (catppuccin-get-color 'surface0) (catppuccin-quantize-color (catppuccin-get-color 'surface0))) (ctp-base (catppuccin-get-color 'base) (catppuccin-quantize-color (catppuccin-get-color 'base))) (ctp-mantle (catppuccin-get-color 'mantle) (catppuccin-quantize-color (catppuccin-get-color 'mantle))) (ctp-crust (catppuccin-get-color 'crust) (catppuccin-quantize-color (catppuccin-get-color 'crust))) (ctp-current (if (eq catppuccin-flavor 'latte) (catppuccin-darken (catppuccin-get-color ...) 5) (catppuccin-lighten (catppuccin-get-color ...) 5)) (catppuccin-quantize-color (if (eq catppuccin-flavor ...) (catppuccin-darken ... 5) (catppuccin-lighten ... 5)))))) (func spec) (let (reduced-color-list) (let ((tail colors)) (while tail (let ((col ...)) (setq reduced-color-list (cons ... reduced-color-list)) (setq tail (cdr tail)))) reduced-color-list) (eval (list 'let reduced-color-list (list 'backquote spec))))) cadr (:background ,ctp-rosewater))
  (list '((min-colors 16777216)) (funcall expand-with-func 'cadr spec))
  (list (list '((min-colors 16777216)) (funcall expand-with-func 'cadr spec)) (list t (funcall expand-with-func '(lambda (v) (cadr (cdr v))) spec)))
  (list face (list (list '((min-colors 16777216)) (funcall expand-with-func 'cadr spec)) (list t (funcall expand-with-func '(lambda (v) (cadr (cdr v))) spec))))
  (cons (list face (list (list '((min-colors 16777216)) (funcall expand-with-func 'cadr spec)) (list t (funcall expand-with-func '(lambda (v) (cadr ...)) spec)))) whole-theme)
  (setq whole-theme (cons (list face (list (list '((min-colors 16777216)) (funcall expand-with-func 'cadr spec)) (list t (funcall expand-with-func '(lambda ... ...) spec)))) whole-theme))
  (let ((face x4) (spec x5)) (setq whole-theme (cons (list face (list (list '(...) (funcall expand-with-func 'cadr spec)) (list t (funcall expand-with-func '... spec)))) whole-theme)))
  (let* ((x4 (car-safe x3)) (x5 (cdr-safe x3))) (let ((face x4) (spec x5)) (setq whole-theme (cons (list face (list (list '... (funcall expand-with-func ... spec)) (list t (funcall expand-with-func ... spec)))) whole-theme))))
  (progn (ignore (consp x3)) (let* ((x4 (car-safe x3)) (x5 (cdr-safe x3))) (let ((face x4) (spec x5)) (setq whole-theme (cons (list face (list (list ... ...) (list t ...))) whole-theme)))))
  (let ((x3 (car tail))) (progn (ignore (consp x3)) (let* ((x4 (car-safe x3)) (x5 (cdr-safe x3))) (let ((face x4) (spec x5)) (setq whole-theme (cons (list face (list ... ...)) whole-theme))))) (setq tail (cdr tail)))
  (while tail (let ((x3 (car tail))) (progn (ignore (consp x3)) (let* ((x4 (car-safe x3)) (x5 (cdr-safe x3))) (let ((face x4) (spec x5)) (setq whole-theme (cons (list face ...) whole-theme))))) (setq tail (cdr tail))))
  (let ((tail faces)) (while tail (let ((x3 (car tail))) (progn (ignore (consp x3)) (let* ((x4 (car-safe x3)) (x5 (cdr-safe x3))) (let ((face x4) (spec x5)) (setq whole-theme (cons ... whole-theme))))) (setq tail (cdr tail)))))
  (let* ((expand-with-func #'(lambda (func spec) (let (reduced-color-list) (let (...) (while tail ...) reduced-color-list) (eval (list ... reduced-color-list ...))))) whole-theme) (let ((tail faces)) (while tail (let ((x3 (car tail))) (progn (ignore (consp x3)) (let* ((x4 ...) (x5 ...)) (let (... ...) (setq whole-theme ...)))) (setq tail (cdr tail))))) whole-theme)
  (apply #'custom-theme-set-faces 'catppuccin (let* ((expand-with-func #'(lambda (func spec) (let (reduced-color-list) (let ... ... reduced-color-list) (eval ...)))) whole-theme) (let ((tail faces)) (while tail (let ((x3 (car tail))) (progn (ignore (consp x3)) (let* (... ...) (let ... ...))) (setq tail (cdr tail))))) whole-theme))
  (let ((colors '((undef "#ff00ff" "#ff00ff") (ctp-rosewater ... ...) (ctp-flamingo ... ...) (ctp-pink ... ...) (ctp-mauve ... ...) (ctp-red ... ...) (ctp-maroon ... ...) (ctp-peach ... ...) (ctp-yellow ... ...) (ctp-green ... ...) (ctp-teal ... ...) (ctp-sky ... ...) (ctp-sapphire ... ...) (ctp-blue ... ...) (ctp-lavender ... ...) (ctp-text ... ...) (ctp-subtext1 ... ...) (ctp-subtext0 ... ...) (ctp-overlay2 ... ...) (ctp-overlay1 ... ...) (ctp-overlay0 ... ...) (ctp-surface2 ... ...) (ctp-surface1 ... ...) (ctp-surface0 ... ...) (ctp-base ... ...) (ctp-mantle ... ...) (ctp-crust ... ...) (ctp-current ... ...))) (faces '((cursor :background ...) (default :background ... :foreground ...) (default-italic :slant italic) (hl-todo :foreground ...) (error :foreground ...) (ffap :foreground ...) (fringe :background ... :foreground ...) (header-line :inherit ...) (highlight :foreground ... :background ...) (hl-line :background ... :extend t) (info-quoted-name :foreground ...) (info-string :foreground ...) (lazy-highlight :foreground ... :background ...) (link :foreground ... :underline t) (link-unvisited :foreground ... :underline t) (linum :foreground ... :background ...) (line-number :foreground ... :background ...) (line-number-current-line :inherit line-number :foreground ...) (match :background ... :foreground ...) (menu :background ... :inverse-video nil :foreground ...) (minibuffer-prompt :weight normal :foreground ...) (mode-line :background ... nil :foreground ...) (mode-line-inactive :background ... :inverse-video nil :foreground ...) (read-multiple-choice-face :inherit completions-first-difference) (region :background ... :extend t) (shadow :foreground ...) (success :foreground ...) (warning :foreground ...) (tooltip :foreground ... :background ...) (trailing-whitespace :inherit warning) (window-divider :foreground ...) (vertical-border :foreground ...) (tty-menu-enabled-face :foreground ... :inverse-video nil :background ...) (tty-menu-disabled-face :background ... :inverse-video nil :foreground ...) (tty-menu-selected-face :foreground ... :background ...) (solaire-default-face :background ... :foreground ...) (solaire-fringe-face :background ... :foreground ...) (solaire-line-number-face :foreground ... :background ...) ...))) (apply #'custom-theme-set-faces 'catppuccin (let* ((expand-with-func #'...) whole-theme) (let ((tail faces)) (while tail (let ... ... ...))) whole-theme)) (apply #'custom-theme-set-variables 'catppuccin (let ((get-func (let* ... ...))) (list (list 'ansi-color-names-vector (vector ... ... ... ... ... ... ... ...))) (list (list 'rustic-ansi-faces (list ... ... ... ... ... ... ... ... ...))))))
  eval-buffer(#<buffer  *load*-15213> nil "/home/hta/.emacs.d/elpa/catppuccin-theme-20230417...." nil t)  ; Reading at buffer position 66614
  load-with-code-conversion("/home/hta/.emacs.d/elpa/catppuccin-theme-20230417...." "/home/hta/.emacs.d/elpa/catppuccin-theme-20230417...." nil t)
  load("/home/hta/.emacs.d/elpa/catppuccin-theme-20230417...." nil t nil t)
  load-theme(catppuccin t)
  (progn (setq th/theme 'catppuccin) (load-theme 'catppuccin t) (catppuccin-reload))
  (condition-case err (progn (setq th/theme 'catppuccin) (load-theme 'catppuccin t) (catppuccin-reload)) ((debug error) (funcall use-package--warning0 :init err)))
  (progn (let ((custom--inhibit-theme-enable nil)) (if (memq 'use-package custom-known-themes) nil (custom-declare-theme 'use-package 'use-package-theme nil (list)) (enable-theme 'use-package) (setq custom-enabled-themes (remq 'use-package custom-enabled-themes))) (custom-theme-set-variables 'use-package '(catppuccin-flavor 'catppuccin-latte nil nil "Customized with use-package catppuccin-theme"))) (condition-case err (progn (setq th/theme 'catppuccin) (load-theme 'catppuccin t) (catppuccin-reload)) ((debug error) (funcall use-package--warning0 :init err))) (if (not (require 'catppuccin-theme nil t)) (display-warning 'use-package (format "Cannot load %s" 'catppuccin-theme) :error)))
  (condition-case err (progn (let ((custom--inhibit-theme-enable nil)) (if (memq 'use-package custom-known-themes) nil (custom-declare-theme 'use-package 'use-package-theme nil (list)) (enable-theme 'use-package) (setq custom-enabled-themes (remq 'use-package custom-enabled-themes))) (custom-theme-set-variables 'use-package '(catppuccin-flavor 'catppuccin-latte nil nil "Customized with use-package catppuccin-theme"))) (condition-case err (progn (setq th/theme 'catppuccin) (load-theme 'catppuccin t) (catppuccin-reload)) ((debug error) (funcall use-package--warning0 :init err))) (if (not (require 'catppuccin-theme nil t)) (display-warning 'use-package (format "Cannot load %s" 'catppuccin-theme) :error))) ((debug error) (funcall use-package--warning0 :catch err)))
  eval-buffer(#<buffer  *load*> nil "/home/hta/.emacs.d/init.el" nil t)  ; Reading at buffer position 4527
  load-with-code-conversion("/home/hta/.emacs.d/init.el" "/home/hta/.emacs.d/init.el" t t)
  load("/home/hta/.emacs.d/init" noerror nomessage)
  startup--load-user-init-file(#f(compiled-function () #<bytecode -0x14c30244cfea4f0f>) #f(compiled-function () #<bytecode -0x1f3c61addc0ba1b5>) t)
  command-line()
  normal-top-level()
tsdh commented 1 year ago

Nevermind, I found the error in my config: catppuccin-flavor should be latte and not catppuccin-latte.