summaryrefslogtreecommitdiff
path: root/.config/emacs
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-09-08 13:45:57 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-09-08 13:45:57 +0200
commit43c3ffb9fd412e768a324f49dde61a697bc019f3 (patch)
treef308ec4f45c1b2ea11a599f09e383c61ebac1144 /.config/emacs
parentb2e1ba52ecd4f08d1bd62c85f73ea97ecc892706 (diff)
emacs: Fixup font config for emacs-server and -client
Diffstat (limited to '.config/emacs')
-rw-r--r--.config/emacs/init.el51
1 files changed, 30 insertions, 21 deletions
diff --git a/.config/emacs/init.el b/.config/emacs/init.el
index 3884d4e..5ab5317 100644
--- a/.config/emacs/init.el
+++ b/.config/emacs/init.el
@@ -594,7 +594,7 @@ of 0 is fully transparent while a value of 100 is fully opaque.")
(add-to-list
'default-frame-alist (cons 'alpha-background x-alpha-background))
-(defvar x-monospace-font '("Iosevka Smooth" :weight regular :height 160)
+(defvar x-monospace-font '("Iosevka Smooth" :weight regular :height 162)
"The default monospace font to use. This is a list containing a
font name, font weight, and font height in that order.")
@@ -602,26 +602,35 @@ font name, font weight, and font height in that order.")
"The default proportional font to use. This is a list containing a
font name, font weight, and font height in that order.")
-(let* ((mono-family (car x-monospace-font))
- (mono-props (cdr x-monospace-font))
- (prop-family (car x-proportional-font))
- (prop-props (cdr x-proportional-font))
- (mono-weight (plist-get mono-props :weight))
- (mono-height (plist-get mono-props :height))
- (prop-weight (plist-get prop-props :weight))
- (prop-height (plist-get prop-props :height)))
- (set-face-attribute 'default nil
- :font mono-family
- :weight mono-weight
- :height mono-height)
- (set-face-attribute 'fixed-pitch nil
- :font mono-family
- :weight mono-weight
- :height mono-height)
- (set-face-attribute 'variable-pitch nil
- :font prop-family
- :weight prop-weight
- :height prop-height))
+(defun x-set-fonts ()
+ "Set the fonts specified by ‘x-monospace-font’ and
+‘x-proportional-font’."
+ (interactive)
+ (let* ((mono-family (car x-monospace-font))
+ (mono-props (cdr x-monospace-font))
+ (prop-family (car x-proportional-font))
+ (prop-props (cdr x-proportional-font))
+ (mono-weight (plist-get mono-props :weight))
+ (mono-height (plist-get mono-props :height))
+ (prop-weight (plist-get prop-props :weight))
+ (prop-height (plist-get prop-props :height)))
+ (set-face-attribute 'default nil
+ :font mono-family
+ :weight mono-weight
+ :height mono-height)
+ (set-face-attribute 'fixed-pitch nil
+ :font mono-family
+ :weight mono-weight
+ :height mono-height)
+ (set-face-attribute 'variable-pitch nil
+ :font prop-family
+ :weight prop-weight
+ :height prop-height)))
+
+(when (daemonp)
+ (add-hook 'after-make-frame-functions (lambda (_) (x-set-fonts))))
+(x-set-fonts)
+
;;; C-Style
(defun x-c-defun-open-safe (_syntax _position)