From 9446a8f411c64e36b9c52b975f2db9ec147d4f73 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 6 Feb 2021 04:49:28 -0500 Subject: [PATCH] Move byte-compile fix to core-packages So it targets more than just 28.x+ users. --- core/core-lib.el | 21 +-------------------- core/core-packages.el | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/core/core-lib.el b/core/core-lib.el index 6ea104a31..ed399b59e 100644 --- a/core/core-lib.el +++ b/core/core-lib.el @@ -749,26 +749,7 @@ made obsolete, for example a date or a release number. See the docstrings of `defalias' and `make-obsolete' for more details." (declare (doc-string 4)) `(progn (defalias ,obsolete-name ,current-name ,docstring) - (make-obsolete ,obsolete-name ,current-name ,when))) - - (defadvice! doom--byte-compile-in-same-session-a (recipe) - "Straight recompiles packages from an Emacs child process. This is sensible, -but many packages don't properly load their macro dependencies, causing errors, -which we can't possibly police, so I revert straight to its old strategy of -compiling in the same session." - :override #'straight--build-compile - (straight--with-plist recipe (package) - ;; These two `let' forms try very, very hard to make byte-compilation an - ;; invisible process. Lots of packages have byte-compile warnings; I - ;; don't need to know about them and neither do straight.el users. - (letf! (;; Prevent Emacs from asking the user to save all their - ;; files before compiling. - (#'save-some-buffers #'ignore)) - (quiet! - ;; Note that there is in fact no `byte-compile-directory' function. - (byte-recompile-directory - (straight--build-dir package) - 0 'force)))))) + (make-obsolete ,obsolete-name ,current-name ,when)))) (provide 'core-lib) ;;; core-lib.el ends here diff --git a/core/core-packages.el b/core/core-packages.el index 856f269a5..a5c3ae6ce 100644 --- a/core/core-packages.el +++ b/core/core-packages.el @@ -111,6 +111,25 @@ uses a straight or package.el command directly).") (append (apply orig-fn args) ; lockfiles still take priority (doom-package-pinned-list))) +(defadvice! doom--byte-compile-in-same-session-a (recipe) + "Straight recompiles packages from an Emacs child process. This is sensible, +but many packages don't properly load their macro dependencies, causing errors, +which we can't possibly police, so I revert straight to its old strategy of +compiling in the same session." + :override #'straight--build-compile + (straight--with-plist recipe (package) + ;; These two `let' forms try very, very hard to make byte-compilation an + ;; invisible process. Lots of packages have byte-compile warnings; I + ;; don't need to know about them and neither do straight.el users. + (letf! (;; Prevent Emacs from asking the user to save all their + ;; files before compiling. + (#'save-some-buffers #'ignore)) + (quiet! + ;; Note that there is in fact no `byte-compile-directory' function. + (byte-recompile-directory + (straight--build-dir package) + 0 'force))))) + ;; ;;; Bootstrappers