(Emacs/config)~Write better code using system-name-cond

This commit is contained in:
2024-07-05 16:28:03 +01:00
parent f1020a94de
commit 68ef739be9

View File

@@ -128,7 +128,7 @@ simple enough.
Note the check for the symbol ~otherwise~ which acts as the default Note the check for the symbol ~otherwise~ which acts as the default
case. case.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defmacro +oreo/sys-name-cond (&rest pairs) (defmacro system-name-cond (&rest pairs)
"Switch case on result of function `system-name'. "Switch case on result of function `system-name'.
Each pair in PAIRS is typed as: (string . (forms...)) where the Each pair in PAIRS is typed as: (string . (forms...)) where the
@@ -156,11 +156,11 @@ use:
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package comp (use-package comp
:init :init
(+oreo/sys-name-cond (setq native-comp-async-jobs-number
("newboy" (system-name-cond
(setq native-comp-async-jobs-number 3)) ("newboy" 3)
("oldboy" ("oldboy" 6)
(setq native-comp-async-jobs-number 6)))) (otherwise 3))))
#+end_src #+end_src
** Clean buffer list ** Clean buffer list
Clean all buffers except for those in ~+oreo/keep-buffers~. Clean all buffers except for those in ~+oreo/keep-buffers~.
@@ -285,9 +285,10 @@ Make font size bigger on my laptop and smaller on my desktop.
(use-package faces (use-package faces
:defer t :defer t
:config :config
(+oreo/sys-name-cond (set-face-attribute 'default nil :height
("newboy" (set-face-attribute 'default nil :height 145)) (system-name-cond
("oldboy" (set-face-attribute 'default nil :height 135)))) ("newboy" 145)
("oldboy" 135))))
#+end_src #+end_src
** Startup screen ** Startup screen
The default startup screen is quite bad in all honesty. While for a The default startup screen is quite bad in all honesty. While for a