reddit / emacs

use-package :custom-face for centaur-tabs?

domsch1988 · 2022-12-02 17:40
I'm a bit at a loss. I'm not that great with lisp and have been going through documentation for hours now. I saw that use-package supports directly customizing fonts through `:custom-face` which i would like to use to change some centaur tabs fonts. Before i did this "manually" with set-face-attribute. So far, i'm not getting errors, but my font also isn't getting applied. Additionally it seems things like :weight don't work here. So, could someone explain to me how this is done correctly? My current setup: (defvar PropFont) (setq PropFont "Inter") (use-package centaur-tabs :demand :straight t :init (centaur-tabs-mode t) :bind ("C-<prior>" . centaur-tabs-backward) ("C-<next>" . centaur-tabs-forward) :config (setq centaur-tabs-set-icons t) :custom (set-face-attribute 'centaur-tabs-selected-modified nil :family PropFont :weight 'bold :slant 'italic) (set-face-attribute 'centaur-tabs-unselected-modified nil :family PropFont :weight 'normal :slant 'italic) :custom-face (centaur-tabs-active-bar-face ((t (:family PropFont)))) (centaur-tabs-default ((t (:family PropFont)))) (centaur-tabs-selected ((t (:family PropFont)))) (centaur-tabs-unselected ((t (:family PropFont))))) If you need more context i can put my entire init on pastebin or such, but this is all that's centaur tabs related. Any hint on what i'm doing wrong would be awesome.
deaddyfreddy · 2022-12-02 17:45
> Any hint on what i'm doing wrong would be awesome. not understanding how misc use-package keywords work, try to macroexpand the expression and you'll see some issues (or just read README)
domsch1988 · 2022-12-02 18:11
>not understanding how misc use-package keywords work Probably. I try to read the use-package readme, but a lot of it is hard to understand if you don't already have a lot of background information. >macroexpand the expression First time i've heard this. I tried looking it up, but wrapping my use-package statement into a macroexpand block and evaluating it didn't do anything. Could you elaborate a bit what i should be doing here?
franburstall · 2022-12-02 18:43
Put the cursor at the end of the statement and do `M-x pp-macroexpand-last-sexp`.
deaddyfreddy · 2022-12-03 09:23
> but a lot of it is hard to understand if you don't already have a lot of background information. it has examples of how to use every keyword, you may want to check `:custom` one
domsch1988 · 2022-12-03 22:02
Even leaving the :custom keywords out complete doesn't change anything. macroexpanding this part isn't telling me anything i could understand. I'm getting a funcall use-package--warning, but i'm also getting that when just copy pasting the config from centaur-tabs readme, so not sure how usefull that is. Trying to search for that online also didn't bring anything up. I guess i'm just going back to configuring fonts outside of use-package and be done with it.
grimscythe_ · 2022-12-04 11:22
Just a hunch but (centaur-tabs-mode t) should be in :config, not in :init. Init is for stuff before the package loads, config is for after it loads. Usually everything should be in :config. Try to set your faces there too.