From 5009bf681efb3eac5ac048ef34814aa09c04c04b Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Thu, 21 Nov 2024 01:29:08 +0000 Subject: [PATCH] chore(core/compile): add disabled setup for compile-angel Once kinks have been worked out, we can re-enable it again. --- core/siren-core-compile.el | 44 ++++++++++++++++++++++++++++++++++++++ core/siren-core-init.el | 1 + 2 files changed, 45 insertions(+) create mode 100644 core/siren-core-compile.el diff --git a/core/siren-core-compile.el b/core/siren-core-compile.el new file mode 100644 index 0000000..6ed7ca6 --- /dev/null +++ b/core/siren-core-compile.el @@ -0,0 +1,44 @@ +;;; siren-core-compile.el --- jimeh's Emacs Siren: Compilation. + +;;; Commentary: + +;; Elisp byte compilation and native compilation. + +;;; Code: + +;; TODO: Investigate why vertico--exhibit triggers require calls that +;; compile-angel intercepts and slows down upto 2 seconds per keystroke when +;; filtering M-x commands. + +;; Use compile-angel to automatically recompile Emacs Lisp files when +;; they are saved. +;; (use-package compile-angel +;; :demand t +;; ;; Do not enable compile-angel-on-save-local-mode by default, as it +;; ;; byte-compiles all *.el files, which causes them to be native compiled too. +;; ;; :hook +;; ;; (emacs-lisp-mode . compile-angel-on-save-local-mode) + +;; :custom +;; (compile-angel-enable-byte-compile t) +;; (compile-angel-enable-native-compile t) +;; (compile-angel-excluded-files-regexps '("/\\.dir-config\\.el$")) +;; (compile-angel-predicate-function 'siren-compile-angel-predicate-function) +;; (compile-angel-verbose nil) + +;; :preface +;; (defun siren-compile-angel-predicate-function (el-file) +;; "Determine if compile-angel should compile EL-FILE." +;; (let ((file-name (file-name-nondirectory el-file)) +;; (abs-emacs-dir (expand-file-name user-emacs-directory))) +;; ;; TODO: Investigate loading errors when *.el files from my config are +;; ;; native compiled. +;; (and (not (string-equal "init.el" file-name)) +;; (not (string-match-p "\\`siren-.*\\.el\\'" file-name)) +;; (not (string-equal (file-name-directory el-file) abs-emacs-dir))))) + +;; :config +;; (compile-angel-on-load-mode)) + +(provide 'siren-core-compile) +;;; siren-core-compile.el ends here diff --git a/core/siren-core-init.el b/core/siren-core-init.el index 7bcaf67..0c3fb12 100644 --- a/core/siren-core-init.el +++ b/core/siren-core-init.el @@ -51,6 +51,7 @@ (require 'siren-core-packages) (require 'siren-core-package-overrides) (require 'siren-core-performance) +(require 'siren-core-compile) (require 'siren-core-keybinds) (require 'siren-core-env) (require 'siren-core-ui)