larstvei / Focus

Dim the font color of text in surrounding paragraphs
485 stars 16 forks source link

incorrect usage of color-rgb-to-hex in focus-average-colors #5

Closed fommil closed 8 years ago

fommil commented 8 years ago

color-rgb-to-hex takes 3 arguments. This causes focus to blow up when I load it.

Debugger entered--Lisp error: (wrong-number-of-arguments (3 . 3) 0)
 color-rgb-to-hex()
 apply(color-rgb-to-hex nil)
 focus-average-colors(unspecified unspecified)
 apply(focus-average-colors (unspecified unspecified))
 focus-make-dim-color()
 focus-init()
 focus-mode()
 (closure (t) nil (setq show-trailing-whitespace t) (whitespace-mode-with-local-variables) (focus-mode) (rainbow-mode) (prettify-symbols-mode) (eldoc-mode) (flycheck-mode) (yas-minor-mode) (company-mode) (smartparens-strict-mode) 
fommil commented 8 years ago

btw, looks like avg is an empty list here.

fommil commented 8 years ago

the debugging stack trace seems to imply that focus-make-dim-color is calling focus-average-colors with nil parameters.

You might want to know that I'm running this in my CI (yes, I run my .emacs.d in CI... yes, I know...) so this might be a headless emacs thing.

larstvei commented 8 years ago

Ok, I get the same error if I run Emacs completely without a theme. This can only be achieved by running Emacs in the terminal (which I normally don't).

Do you have an idea for a fix?

fommil commented 8 years ago

maybe do some nil checking?