1
0
Fork 0

feat: add lists->alist function to emacs config

Signed-off-by: Lucas Sta Maria <lucas@priime.dev>
This commit is contained in:
Lucas Sta Maria 2023-08-06 00:45:31 -07:00
parent dfd4587e67
commit 57932ff37f
No known key found for this signature in database
GPG key ID: F07FB16A826E3B47
3 changed files with 24 additions and 0 deletions

22
.emacs.d/include/utils.el Normal file
View file

@ -0,0 +1,22 @@
;;; utils.el --- Utility functions.
;;; Commentary:
;; Provides utility functions.
;;; Code:
(defun lists->alist (l1 l2)
"Transform lists L1 (keys) and L2 (values) into a single alist."
(cond ((and (null l1)
(null l2))
'())
((or (null l1)
(null l2))
(error "Lists L1 and L2 have to be of equal length"))
((and (consp l1)
(consp l2))
(cons `(,(car l1) . ,(car l2))
(lists->alist (cdr l1)
(cdr l2))))))
(provide 'utils)
;;; utils.el ends here

View file

@ -71,6 +71,7 @@
(load-library "general")
(load-library "misc")
(load-library "utils")
(load-library "orgconfig")
(load-library "mu4econfig")
(load-library "racket")