diff --git a/.emacs.d/include/misc.el b/.emacs.d/include/misc.el index bb3987f..52ca981 100644 --- a/.emacs.d/include/misc.el +++ b/.emacs.d/include/misc.el @@ -9,11 +9,40 @@ (require 'elfeed) (require 'neotree) -(defun config-recompile () - "Recompile the current Emacs configuration." +(defun config-compile () + "(Re)compile the current Emacs configuration." (interactive) (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 (global-git-gutter-mode +1)