From ceeebf1e0ca15978894801d0d0229fa5db2059de Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Sun, 26 Mar 2023 20:06:11 +0100 Subject: (Emacs)~made sys-name-cond nicer to read I used an iterative style for it before, but now its more functional as there is a 1-1 mapping between pairs given and cond forms. --- Emacs/.config/emacs/config.org | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'Emacs/.config/emacs/config.org') diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org index d4cec01..a0f6731 100644 --- a/Emacs/.config/emacs/config.org +++ b/Emacs/.config/emacs/config.org @@ -137,17 +137,14 @@ solution than this, this seems simple enough. Each pair in PAIRS is typed as: (string . (forms...)) where the string represents the system name to test, and forms being the consequence if true." - (let ((current-lisp)) - (while pairs - (let ((pair (car pairs))) - (let ((name (car pair)) - (body (cdr pair))) - (add-to-list - 'current-lisp - `((string= ,name (system-name)) ,@body)) - (setq pairs (cdr pairs))))) - `(cond - ,@current-lisp))) + `(cond + ,@(mapcar #'(lambda (pair) + ;; (str . forms..) -> ((string= str (system-name)) + ;; forms...) + (let ((name (car pair)) + (body (cdr pair))) + `((string= ,name (system-name)) ,@body))) + pairs))) #+end_src In [[file:early-init.el][early-init.el]] I set the number of native-workers to 4, which isn't -- cgit v1.2.3-13-gbd6f