feat: add convenient config-download
function
Signed-off-by: Lucas Sta Maria <lucas@priime.dev>
This commit is contained in:
parent
57932ff37f
commit
23641ca5c2
1 changed files with 31 additions and 2 deletions
|
@ -9,11 +9,40 @@
|
||||||
(require 'elfeed)
|
(require 'elfeed)
|
||||||
(require 'neotree)
|
(require 'neotree)
|
||||||
|
|
||||||
(defun config-recompile ()
|
(defun config-compile ()
|
||||||
"Recompile the current Emacs configuration."
|
"(Re)compile the current Emacs configuration."
|
||||||
(interactive)
|
(interactive)
|
||||||
(byte-recompile-directory "~/.emacs.d/"))
|
(byte-recompile-directory "~/.emacs.d/"))
|
||||||
|
|
||||||
|
(defun config-download (&optional confirm)
|
||||||
|
"Download the latest Emacs configuration files from the GitHub repository."
|
||||||
|
(interactive)
|
||||||
|
(let* ((confirm (or confirm
|
||||||
|
(read-string "Type `YES' to confirm download: "))))
|
||||||
|
(if (not (string= confirm "YES"))
|
||||||
|
(print "Cancelling config download/update...")
|
||||||
|
(let* ((gh-url "https://raw.githubusercontent.com/priime0/dotfiles/master/.emacs.d/")
|
||||||
|
(target-dir "~/temp/.emacs.d/")
|
||||||
|
(filenames
|
||||||
|
'("init.el"
|
||||||
|
"include/general.el"
|
||||||
|
"include/misc.el"
|
||||||
|
"include/racket.el"
|
||||||
|
"include/pdfconfig.el"
|
||||||
|
"include/cppconfig.el"
|
||||||
|
"include/latexconfig.el"
|
||||||
|
"include/mu4econfig.el"
|
||||||
|
"include/orgconfig.el"))
|
||||||
|
(file-paths (mapcar (lambda (s) (concat target-dir s))
|
||||||
|
filenames))
|
||||||
|
(file-urls (mapcar (lambda (s) (concat gh-url s))
|
||||||
|
filenames))
|
||||||
|
(file-path-urls (lists->alist file-paths file-urls)))
|
||||||
|
(mkdir (concat target-dir "include") t)
|
||||||
|
(mapc (lambda (f)
|
||||||
|
(url-copy-file (cdr f) (car f) t))
|
||||||
|
file-path-urls)))))
|
||||||
|
|
||||||
;; Git Gutter
|
;; Git Gutter
|
||||||
(global-git-gutter-mode +1)
|
(global-git-gutter-mode +1)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue