From 13a412d81fee24f93acbec89e3c504e2fd4d6c22 Mon Sep 17 00:00:00 2001 From: Camden Dixie O'Brien Date: Sat, 29 Oct 2022 13:45:15 +0100 Subject: [PATCH] Set font height in a host-specific way --- config.org | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/config.org b/config.org index 0a89f71..638dc43 100644 --- a/config.org +++ b/config.org @@ -54,6 +54,19 @@ (setq use-package-always-ensure t) #+end_src +** Hostname + It's useful to have the short hostname available in case we want to + configure something differently on certain machines. The full + hostname can be retrieved with [[help:system-name][system-name]], but this has the local + domain on the end; we want to cut that off. + + #+begin_src emacs-lisp + (defun cut-at (delimeter string) + (substring string 0 (string-search delimeter string))) + + (defvar hostname (cut-at "." (system-name))) + #+end_src + * Emacs Server Start an Emacs server if one is not running already: @@ -98,13 +111,19 @@ #+end_src ** Font - I find serif fonts much nicer to read, so change the default face - to a serif font: + I find serif fonts much nicer to read, so definitely change the + default face to a serif font. Font size seems inconsistent across + different systems for some reason, so need to determine the font + height based off the hostname. #+begin_src emacs-lisp - (set-face-attribute 'default nil - :family "Courier 10 Pitch" - :height 100) + (let ((font-height + (pcase hostname + ("mandarax" 115) + (_ 110)))) + (set-face-attribute 'default nil + :family "Courier 10 Pitch" + :height font-height)) #+end_src I also like a little more line spacing than default, again makes