Extract make clean/clean-cache into elisp; new doom-etc-dir for non-volatile temp files

This commit is contained in:
Henrik Lissner 2017-03-16 23:38:22 -04:00
parent 4ae0513020
commit 923d4585fa
7 changed files with 43 additions and 16 deletions

View file

@ -115,7 +115,7 @@ to speed up startup."
package-activated-list nil)
;; Ensure core folders exist
(dolist (dir (list doom-local-dir doom-cache-dir package-user-dir))
(dolist (dir (list doom-local-dir doom-etc-dir doom-cache-dir package-user-dir))
(unless (file-directory-p dir)
(make-directory dir t)))
@ -458,6 +458,22 @@ This may take a while."
(message "\n%s" (mapconcat (lambda (file) (concat "+ ERROR: " (car file)))
(nreverse errors) "\n"))))))
(defun doom/clear-cache ()
"Clear local cache (`doom-cache-dir'). You may need to restart Emacs for some
components to feel its effects."
(delete-directory doom-cache-dir t)
(make-directory doom-cache-dir t))
(defun doom/clear-compiled ()
"Delete all compiled elc files in DOOM emacs, excluding compiled ELPA/QUELPA
package files."
(interactive)
(when-let (elc-files (cl-remove-if (lambda (file) (file-in-directory-p file doom-local-dir))
(directory-files-recursively doom-emacs-dir "\\.elc$")))
(dolist (file elc-files)
(delete-file file)
(message "Deleting %s" (abbreviate-file-name file)))))
;;
;; Package.el modifications