1

Refactor init file-specific function names

This commit is contained in:
Jessie Hildebrandt 2019-10-01 02:25:36 -04:00
parent c9fc29a574
commit 82be9da21f

18
init.el
View File

@ -263,34 +263,34 @@
;; Init File ;; Init File
;;==================== ;;====================
(defun init-file/download-latest () (defun init-file/download-latest-init-file ()
"Download the latest init file from jessieh.net." "Download the latest init file from jessieh.net."
(interactive) (interactive)
(when (yes-or-no-p "Download latest init file from jessieh.net? ") (when (yes-or-no-p "Download latest init file from jessieh.net? ")
(message "Updating init file...") (message "Updating init file...")
(url-copy-file "https://jessieh.net/emacs" (concat user-emacs-directory "init.el") t) (url-copy-file "https://jessieh.net/emacs" (concat user-emacs-directory "init.el") t)
(init-file/byte-compile))) (init-file/byte-compile-init-file)))
(defun init-file/byte-compile () (defun init-file/byte-compile-init-file ()
"Byte compile the init file." "Byte compile the init file."
(interactive) (interactive)
(save-restriction (save-restriction
(message "Byte-compiling init file...") (message "Byte-compiling init file...")
(byte-compile-file (concat user-emacs-directory "init.el")))) (byte-compile-file (concat user-emacs-directory "init.el"))))
(defun init-file/redownload-packages () (defun init-file/refresh-packages ()
"Redownload all packages that have been configured in the init file." "Refresh all packages that have been configured for use in the init file."
(interactive) (interactive)
(when (yes-or-no-p "Redownload and reconfigure packages? ") (when (yes-or-no-p "Redownload and refresh packages? ")
(message "Redownloading packages...") (message "Refreshing packages...")
(delete-directory package-user-dir t) (delete-directory package-user-dir t)
(init-file/byte-compile))) (init-file/byte-compile-init-file)))
;; Make sure that this init file is byte-compiled whenever it changes. ;; Make sure that this init file is byte-compiled whenever it changes.
(if (file-newer-than-file-p (if (file-newer-than-file-p
(concat user-emacs-directory "init.el") (concat user-emacs-directory "init.el")
(concat user-emacs-directory "init.elc")) (concat user-emacs-directory "init.elc"))
(add-hook 'emacs-startup-hook 'init-file/byte-compile)) (add-hook 'emacs-startup-hook 'init-file/byte-compile-init-file))
;;======================================== ;;========================================