diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2023-03-26 20:06:11 +0100 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2023-03-26 20:19:02 +0100 |
commit | ceeebf1e0ca15978894801d0d0229fa5db2059de (patch) | |
tree | a717e101db9110f2c6a5d18e2e23b52e365a7ccc | |
parent | 166d1581430833516f0490965a272ccecc078960 (diff) | |
download | dotfiles-ceeebf1e0ca15978894801d0d0229fa5db2059de.tar.gz dotfiles-ceeebf1e0ca15978894801d0d0229fa5db2059de.tar.bz2 dotfiles-ceeebf1e0ca15978894801d0d0229fa5db2059de.zip |
(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.
-rw-r--r-- | Emacs/.config/emacs/config.org | 19 |
1 files changed, 8 insertions, 11 deletions
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 |