refactor(emacs): remove misc.el
Signed-off-by: Lucas Sta Maria <lucas@priime.dev>
This commit is contained in:
parent
e8bbfc318d
commit
9b862b7d2b
10 changed files with 219 additions and 301 deletions
30
.emacs.d/include/priime-utils.el
Normal file
30
.emacs.d/include/priime-utils.el
Normal file
|
@ -0,0 +1,30 @@
|
|||
;;; priime-utils.el --- Utility functions and commands
|
||||
;;; Commentary:
|
||||
;; Provides utility functions and commands.
|
||||
;;; 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))))))
|
||||
|
||||
(defun download-file (&optional url filepath)
|
||||
"Download the file from URL to FILEPATH."
|
||||
(interactive)
|
||||
(let* ((url (or url
|
||||
(read-string "url: ")))
|
||||
(filepath (or filepath (read-file-name "filename: "))))
|
||||
(url-copy-file url filepath 1)))
|
||||
|
||||
(provide 'priime-utils)
|
||||
|
||||
;;; priime-utils.el ends here
|
Loading…
Add table
Add a link
Reference in a new issue