feat: add lists->alist
function to emacs config
Signed-off-by: Lucas Sta Maria <lucas@priime.dev>
This commit is contained in:
parent
dfd4587e67
commit
57932ff37f
3 changed files with 24 additions and 0 deletions
22
.emacs.d/include/utils.el
Normal file
22
.emacs.d/include/utils.el
Normal 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
|
|
@ -71,6 +71,7 @@
|
|||
|
||||
(load-library "general")
|
||||
(load-library "misc")
|
||||
(load-library "utils")
|
||||
(load-library "orgconfig")
|
||||
(load-library "mu4econfig")
|
||||
(load-library "racket")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue