From cc1bffb22f4f835e901aa50f375280988d175113 Mon Sep 17 00:00:00 2001 From: eriedaberrie Date: Mon, 10 Feb 2025 17:01:10 +0000 Subject: [PATCH] Replace face-spec-set with set-face-attribute --- init.el | 68 ++++++++++++++++++++++++++------------------------------- 1 file changed, 31 insertions(+), 37 deletions(-) diff --git a/init.el b/init.el index cd3d98e..d1a416f 100644 --- a/init.el +++ b/init.el @@ -52,7 +52,7 @@ ;; Prevent weird colors in the ribbons on solaire buffers at the cost of ;; everything looking the same (worth it IMO) (with-eval-after-load 'solaire-mode - (face-spec-set 'mode-line `((t (:background ,(catppuccin-get-color 'crust))))) + (set-face-attribute 'mode-line nil :background (catppuccin-color 'crust)) ;; NOTE: Technically this line is unnnecessary because of the previous but ;; I'll keep it here in case it ever becomes relevant (dolist (face '(mode-line mode-line-active mode-line-inactive)) @@ -108,12 +108,12 @@ (with-eval-after-load 'catppuccin-theme (add-hook 'god-mode-enabled-hook (lambda () - (face-spec-set 'cursor `((t (:background ,(catppuccin-get-color 'rosewater))))) + (set-face-attribute 'cursor nil :background (catppuccin-color 'rosewater)) (unless (display-graphic-p) (send-string-to-terminal "\e[2 q")))) (add-hook 'god-mode-disabled-hook (lambda () - (face-spec-set 'cursor `((t (:background ,(catppuccin-get-color 'mauve))))) + (set-face-attribute 'cursor nil :background (catppuccin-color 'mauve)) (unless (display-graphic-p) ;; Escape codes for hbar cursor in insert mode (send-string-to-terminal "\e[4 q"))))) @@ -180,13 +180,12 @@ (aw-keys '(?a ?w ?d ?f ?g ?h ?k ?l)) :config (with-eval-after-load 'catppuccin-theme - (face-spec-set 'aw-leading-char-face `((t (:foreground - ,(catppuccin-get-color 'crust) - :background - ,(catppuccin-get-color 'red) - :weight bold)))) - (face-spec-set 'aw-background-face `((t (:foreground - ,(catppuccin-get-color 'overlay1))))))) + (set-face-attribute 'aw-leading-char-face nil + :foreground (catppuccin-color 'crust) + :background (catppuccin-color 'red) + :weight 'bold) + (set-face-attribute 'aw-background-face nil + :foreground (catppuccin-color 'overlay1)))) (use-package goggles :hook prog-mode @@ -194,11 +193,11 @@ :config (setq-default goggles-pulse t) (with-eval-after-load 'catppuccin-theme - (let ((new-spec `((t (:background ,(catppuccin-get-color 'surface1)))))) + (let ((goggles-bg (catppuccin-color 'surface1))) (dolist (f '(goggles-added goggles-removed goggles-changed)) - (face-spec-set f new-spec))))) + (set-face-attribute f nil :background goggles-bg))))) (defun my--set-tab-width-2 () (setq tab-width 2)) @@ -572,7 +571,7 @@ (advice-add #'org-latex-make-preamble :filter-args #'my--org-latex-make-preamble-change-class)) (with-eval-after-load 'catppuccin-theme - (face-spec-set 'org-block `((t (:foreground ,(catppuccin-get-color 'text))))))) + (set-face-attribute 'org-block nil :foreground (catppuccin-color 'text)))) (use-package ob-asymptote :config @@ -616,28 +615,23 @@ This function is called by `org-babel-execute-src-block'." (org-agenda-finalize . org-modern-agenda) :config (with-eval-after-load 'catppuccin-theme - (face-spec-set 'org-modern-done `((t (:foreground - ,(catppuccin-get-color 'text) - :background - ,(catppuccin-get-color 'surface0))))) - (face-spec-set 'org-modern-date-inactive `((t (:foreground - ,(catppuccin-get-color 'subtext0) - :background - ,(catppuccin-get-color 'surface0))))) - (face-spec-set 'org-modern-horizontal-rule `((t (:strike-through - ,(catppuccin-get-color 'overlay1))))) - (face-spec-set 'org-modern-tag `((t (:foreground - ,(catppuccin-get-color 'base) - :background - ,(catppuccin-get-color 'sapphire))))) - (face-spec-set 'org-modern-time-active `((t (:foreground - ,(catppuccin-get-color 'base) - :background - ,(catppuccin-get-color 'overlay2))))) - (face-spec-set 'org-modern-time-inactive `((t (:foreground - ,(catppuccin-get-color 'base) - :background - ,(catppuccin-get-color 'surface0))))))) + (set-face-attribute 'org-modern-done nil + :foreground (catppuccin-color 'text) + :background (catppuccin-color 'surface0)) + (set-face-attribute 'org-modern-date-inactive nil + :foreground (catppuccin-color 'subtext0) + :background (catppuccin-color 'surface0)) + (set-face-attribute 'org-modern-horizontal-rule nil + :strike-through (catppuccin-color 'overlay1)) + (set-face-attribute 'org-modern-tag nil + :foreground (catppuccin-color 'base) + :background (catppuccin-color 'sapphire)) + (set-face-attribute 'org-modern-time-active nil + :foreground (catppuccin-color 'base) + :background (catppuccin-color 'overlay2)) + (set-face-attribute 'org-modern-time-inactive nil + :foreground (catppuccin-color 'base) + :background (catppuccin-color 'surface0)))) (use-package org-modern-indent :ensure nil @@ -836,8 +830,8 @@ This function is called by `org-babel-execute-src-block'." (defun my-load-theme-with-solaire () (load-theme 'catppuccin t) (catppuccin-reload) - (face-spec-set 'font-lock-variable-name-face `((t (:foreground - ,(catppuccin-get-color 'flamingo))))) + (set-face-attribute 'font-lock-variable-name-face nil + :foreground (catppuccin-color 'flamingo)) (solaire-global-mode) (when (daemonp) (remove-hook 'server-after-make-frame-hook #'my-load-theme-with-solaire)))