From c8969b68fa97a35ff04f30871018ae079e549a83 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Wed, 18 Oct 2023 09:37:44 +0200 Subject: [PATCH] Extract face definitions to custom 'esy' theme --- .emacs.d/init.el | 43 ++++--------------------------------- .emacs.d/theme/esy-theme.el | 32 +++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 39 deletions(-) create mode 100644 .emacs.d/theme/esy-theme.el diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 05b76d3..52a4322 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -463,46 +463,11 @@ (setq-default indent-tabs-mode nil) -;;; Set up the Iosevka font family +;;; Load my custom theme -(when (eq system-type 'darwin) - (set-face-attribute 'default nil :height 130)) -(unless (eq system-type 'android) - (set-face-attribute 'default nil :family "Iosevka") - (set-face-attribute 'fixed-pitch nil :family "Iosevka") - (set-face-attribute 'variable-pitch nil :family "Iosevka Etoile")) -(set-face-attribute 'mode-line nil - :box 'unspecified - :background 'unspecified - :overline 'unspecified) -(set-face-attribute 'mode-line-active nil - :overline "black" - :background "lavender" - :underline 'unspecified) -(set-face-attribute 'mode-line-inactive nil - :box 'unspecified - :background 'unspecified - :underline "black") -(set-face-attribute 'fringe nil :background 'unspecified) -(set-face-attribute 'line-number-current-line nil - :background "yellow" - :inherit 'unspecified) -(set-face-attribute 'fill-column-indicator nil - :background 'unspecified - :foreground "orange" - :weight 'light) -(set-face-attribute 'vertical-border nil - :foreground "grey") -(set-face-attribute 'minibuffer-prompt nil - :weight 'bold :slant 'italic - :foreground "red") -(set-face-attribute 'cursor nil - :background "salmon") -(set-face-attribute 'font-lock-doc-face nil - :slant 'italic) -(set-face-attribute 'elisp-shorthand-font-lock-face nil - :foreground 'unspecified - :slant 'italic) +(add-to-list 'custom-theme-load-path + (expand-file-name "theme/" user-emacs-directory)) +(load-theme 'esy t) ;;; Add custom code directory to `load-path' diff --git a/.emacs.d/theme/esy-theme.el b/.emacs.d/theme/esy-theme.el new file mode 100644 index 0000000..82218c7 --- /dev/null +++ b/.emacs.d/theme/esy-theme.el @@ -0,0 +1,32 @@ +;;; esy-theme.el --- My custom theme -*- lexical-binding:t -*- + +;; Copyright (C) 2023 Eshel Yaron + +;; This file is NOT part of GNU Emacs. + +;;; Commentary: + +;;; Code: + +(deftheme esy "My custom theme.") + +(custom-theme-set-faces + 'esy + `(default ((t . ,(append (when (eq system-type 'darwin) '(:height 130)) + (unless (eq system-type 'android) '(:family "Iosevka")))))) + `(fixed-pitch ((t . ,(unless (eq system-type 'android) '(:family "Iosevka"))))) + `(variable-pitch ((t . ,(unless (eq system-type 'android) '(:family "Iosevka Etoile"))))) + '(mode-line ((t))) + '(mode-line-active ((t :overline "black" :background "lavender"))) + '(mode-line-inactive ((t :underline "black"))) + '(fringe ((t))) + '(line-number-current-line ((t :background "yellow"))) + '(fill-column-indicator ((t :foreground "orange" :weight light))) + '(vertical-border ((t :foreground "grey"))) + '(minibuffer-prompt ((t :weight bold :slant italic :foreground "red"))) + '(cursor ((t :background "salmon"))) + '(font-lock-doc-face ((t :inherit font-lock-string-face :slant italic))) + '(elisp-shorthand-font-lock-face ((t :inherit font-lock-keyword-face :slant italic)))) + +(provide-theme 'esy) +;;; esy-theme.el ends here -- 2.39.2