jwiegley / use-package

A use-package declaration for simplifying your .emacs
https://jwiegley.github.io/use-package
GNU General Public License v3.0
4.37k stars 260 forks source link

custom-face produce a lot of warnings after update #1028

Closed Crandel closed 1 year ago

Crandel commented 1 year ago

After use-package update custom-faces produce tons of warnings in *Messages* buffer like this:

Warning: setting attribute ‘:background’ of face ‘diff-removed’: nil value is invalid, use ‘unspecified’ instead.
Warning: setting attribute ‘:background’ of face ‘diff-added’: nil value is invalid, use ‘unspecified’ instead.
Warning: setting attribute ‘:background’ of face ‘diff-changed’: nil value is invalid, use ‘unspecified’ instead.
Warning: setting attribute ‘:background’ of face ‘diff-refine-removed’: nil value is invalid, use ‘unspecified’ instead.
Warning: setting attribute ‘:background’ of face ‘diff-refine-added’: nil value is invalid, use ‘unspecified’ instead.
Warning: setting attribute ‘:background’ of face ‘rainbow-delimiters-unmatched-face’: nil value is invalid, use ‘unspecified’ instead.
Wrote /home/crandel/.cache/emacs/.my-recentf
Warning: setting attribute ‘:background’ of face ‘rainbow-delimiters-unmatched-face’: nil value is invalid, use ‘unspecified’ instead.
Warning: setting attribute ‘:background’ of face ‘diff-refine-added’: nil value is invalid, use ‘unspecified’ instead.
Warning: setting attribute ‘:background’ of face ‘diff-refine-removed’: nil value is invalid, use ‘unspecified’ instead.
Warning: setting attribute ‘:background’ of face ‘diff-changed’: nil value is invalid, use ‘unspecified’ instead.
Warning: setting attribute ‘:background’ of face ‘diff-added’: nil value is invalid, use ‘unspecified’ instead.
Warning: setting attribute ‘:background’ of face ‘diff-removed’: nil value is invalid, use ‘unspecified’ instead.
Warning: setting attribute ‘:foreground’ of face ‘sml/modes’: nil value is invalid, use ‘unspecified’ instead.
Warning: setting attribute ‘:background’ of face ‘blamer-face’: nil value is invalid, use ‘unspecified’ instead.
Warning: setting attribute ‘:background’ of face ‘whitespace-empty’: nil value is invalid, use ‘unspecified’ instead.
Warning: setting attribute ‘:foreground’ of face ‘whitespace-empty’: nil value is invalid, use ‘unspecified’ instead.
Warning: setting attribute ‘:background’ of face ‘whitespace-empty’: nil value is invalid, use ‘unspecified’ instead.
Warning: setting attribute ‘:foreground’ of face ‘whitespace-empty’: nil value is invalid, use ‘unspecified’ instead.
Warning: setting attribute ‘:background’ of face ‘blamer-face’: nil value is invalid, use ‘unspecified’ instead.
Warning: setting attribute ‘:background’ of face ‘rainbow-delimiters-unmatched-face’: nil value is invalid, use ‘unspecified’ instead.
Warning: setting attribute ‘:background’ of face ‘diff-refine-added’: nil value is invalid, use ‘unspecified’ instead.
Warning: setting attribute ‘:background’ of face ‘diff-refine-removed’: nil value is invalid, use ‘unspecified’ instead.
Warning: setting attribute ‘:background’ of face ‘diff-changed’: nil value is invalid, use ‘unspecified’ instead.
Warning: setting attribute ‘:background’ of face ‘diff-added’: nil value is invalid, use ‘unspecified’ instead.
Warning: setting attribute ‘:background’ of face ‘diff-removed’: nil value is invalid, use ‘unspecified’ instead.
Warning: setting attribute ‘:foreground’ of face ‘sml/modes’: nil value is invalid, use ‘unspecified’ instead.
Warning: setting attribute ‘:background’ of face ‘blamer-face’: nil value is invalid, use ‘unspecified’ instead.
Warning: setting attribute ‘:background’ of face ‘whitespace-empty’: nil value is invalid, use ‘unspecified’ instead.
Warning: setting attribute ‘:foreground’ of face ‘whitespace-empty’: nil value is invalid, use ‘unspecified’ instead.

Some examples from my config

(use-package whitespace
 :demand t
 :init
 (global-whitespace-mode t)
 :custom-face
 (whitespace-empty ((t (:foreground "sienna" :background unspecified))))
 (whitespace-hspace ((t (:background "grey24" :foreground "MistyRose4"))))
 (whitespace-indentation ((t (:foreground "DarkOrchid4"))))
 (whitespace-newline ((t (:foreground "dark green" :weight normal))))
 (whitespace-space ((t (:foreground "DarkOrchid4"))))
 (whitespace-space-after-tab ((t (:foreground "firebrick"))))
 (whitespace-space-before-tab ((t (:foreground "firebrick"))))
 (whitespace-tab ((t (:foreground "magenta"))))
 (whitespace-trailing ((t (:foreground "yellow" :weight bold))))
 :custom
 (whitespace-style '(face trailing spaces lines-char empty indentation::tab
                     indentation::space tabs newline space-mark tab-mark newline-mark))
 (whitespace-global-modes '(not magit-diff-mode))
 (whitespace-line-column 130)
)

Any way to fix it?

skangas commented 1 year ago

Thanks.

Crandel commented 1 year ago

Hi @skangas, I use emacs 29, build from master.

I tried with emacs -Q and use-package works without warnings. Looks like it conflicts with my theme.

Can you help me solve these conflicts? I'm not so advanced in elisp

skangas commented 1 year ago

When are you getting these warning messages? On startup? Byte-compilation?

Also, what do you get if you type M-x describe-face RET whitespace-empty RET?

skangas commented 1 year ago

It seems like this is related to commit d0a66f3e0e668d8c12c54436740c62f8e238a664 on the Emacs master branch. I don't know why that change was made.

Could you please report this as a bug against Emacs using M-x report-emacs-bug or with an email to the bug-gnu-emacs mailing list instead?

Crandel commented 1 year ago

I replace all nil in my theme file with unspecified and now I have no warnings.