From 0d0f292d28b68c9e806d7f2f25c7e1f203a4ac2b Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Thu, 13 Jul 2023 15:36:56 +0100 Subject: (Emacs)~let/while -> mapcar for :pretty use-package Same idiomatic change for use-package handling. Should've realised this earlier. --- Emacs/.config/emacs/config.org | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'Emacs/.config/emacs/config.org') diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org index 82d36fe..b7b956e 100644 --- a/Emacs/.config/emacs/config.org +++ b/Emacs/.config/emacs/config.org @@ -904,24 +904,20 @@ for an example. (defun use-package-handler/:pretty (name _keyword args rest state) (use-package-concat (use-package-process-keywords name rest state) - (let ((arg args) - (forms nil)) - (while arg - (let ((mode (caar arg)) - (rest (cdr (car arg)))) - (add-to-list - 'forms + (mapcar + #'(lambda (arg) + (let ((mode (car arg)) + (rest (cdr arg))) `(add-hook ',mode - (lambda nil - (setq prettify-symbols-alist ',rest) - (prettify-symbols-mode))))) - (setq arg (cdr arg))) - forms))))) + #'(lambda nil + (setq prettify-symbols-alist ',rest) + (prettify-symbols-mode))))) + args))))) #+end_src -Here's a collection of keywords and their associated symbols, for a -pseudo language. +Here's a collection of keywords and possible associated symbols for +any prog language of choice. Mostly for reference and copying. #+begin_example ("null" . "Ø") ("list" . "ℓ") -- cgit v1.2.3-13-gbd6f