This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/core/core-compilation.el
2021-01-25 04:03:14 +02:00

47 lines
1.4 KiB
EmacsLisp

;;; core-compilation.el --- Spacemacs Core File
;;
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
;;
;; Author: Eugene "JAremko" Yaremenko <w3techplayground@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(defconst spacemacs-compiled-files
'(;; Built-in libs that we changed
"core/libs/forks/load-env-vars.el"
;; Rest of built-in libs.
"core/libs/packed.el"
"core/libs/auto-compile.el"
"core/libs/dash.el"
"core/libs/ht.el"
"core/libs/ido-vertical-mode.el"
"core/libs/package-build-badges.el"
"core/libs/package-build.el"
"core/libs/package-recipe-mode.el"
"core/libs/page-break-lines.el"
"core/libs/quelpa.el"
"core/libs/spinner.el")
"List of Spacemacs files that should be compiled.
File paths are relative to the `spacemacs-start-directory'.")
(defun spacemacs//ensure-byte-compilation (files)
"Make sure that elisp FILES are byte-compiled."
(dolist (file files)
(let ((fbp (file-name-sans-extension (file-truename file))))
(unless (file-exists-p (concat fbp ".elc"))
(byte-compile-file (concat fbp ".el"))))))
(defun spacemacs//remove-byte-compiled-files (files)
"Remove .elc files corresponding to the source FILES."
(dolist (file files)
(thread-last file
(file-truename)
(file-name-sans-extension)
(format "%s.elc")
(delete-file))))
(provide 'core-compilation)