jwiegley / use-package

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

custom-face, custom-file, and org-babel-load-file #934

Closed Boruch-Baum closed 1 year ago

Boruch-Baum commented 3 years ago

I guess that because predicate custom-face calls function customize-set-faces, the configured values are stored by emacs in the file defined by variable custom-file, so the user ends up with the customization present at two separate points in the Emacs init process. This can get confusing because making a change in the future at one point will not in all cases be sufficient, and a user would need to know / remember about the existence of both custom-file and the specific use-package invocaion.

In my personal config, I've replaced all uses of predicate custom-face with calls to face-spec-set within the config predicate, and removed the parallel entries in my config-file.

Maybe use-package should call face-spec-set instead of customize-set-faces?

c-alpha commented 2 years ago

[...] Maybe use-package should call face-spec-set instead of customize-set-faces?

I fully support @Boruch-Baum's suggestion to switch to face-spec-set.

I have made the experience that custom-set-faces does not always have the desired effect, especially when setting the default, fixed-pitch, and variable-pitch faces early in the init process. This may be because custom-set-faces is part of the themes framework, but I am not using themes.

face-spec-set on the other hand works in all situations I have been using it. Also, the first two parameters (FACE SPEC) are the same for both, so face-spec-set is a drop-in replacement.