From 812a6e258038732746ddb70edfbbb8f767fe1707 Mon Sep 17 00:00:00 2001 From: MitchMarq42 Date: Thu, 23 Feb 2023 11:34:17 -0900 Subject: [PATCH] Update elpaca bootstrap --- lisp/elpaca-bootstrap.el | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/lisp/elpaca-bootstrap.el b/lisp/elpaca-bootstrap.el index 3597e63..77b6f62 100644 --- a/lisp/elpaca-bootstrap.el +++ b/lisp/elpaca-bootstrap.el @@ -4,37 +4,35 @@ ;; Taken from https://github.com/progfolio/elpaca ;;; Code: +(defvar elpaca-installer-version 0.2) (defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory)) (defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory)) +(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory)) (defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git" :ref nil + :files (:defaults (:exclude "extensions")) :build (:not elpaca--activate-package))) -(when-let ((repo (expand-file-name "repos/elpaca/" elpaca-directory)) +(when-let ((repo (expand-file-name "elpaca/" elpaca-repos-directory)) (build (expand-file-name "elpaca/" elpaca-builds-directory)) (order (cdr elpaca-order)) ((add-to-list 'load-path (if (file-exists-p build) build repo))) - ((not (file-exists-p repo))) - (buffer (get-buffer-create "*elpaca-bootstrap*"))) + ((not (file-exists-p repo)))) (condition-case-unless-debug err - (if-let (((pop-to-buffer buffer '((display-buffer-reuse-window - display-buffer-same-window)))) + (if-let ((buffer (pop-to-buffer-same-window "*elpaca-installer*")) ((zerop (call-process "git" nil buffer t "clone" (plist-get order :repo) repo))) (default-directory repo) ((zerop (call-process "git" nil buffer t "checkout" - (or (plist-get order :ref) "--"))))) - (progn - (byte-recompile-directory repo 0 'force) - (require 'elpaca) - (and (fboundp 'elpaca-generate-autoloads) - (elpaca-generate-autoloads "elpaca" repo)) - (kill-buffer buffer)) + (or (plist-get order :ref) "--")))) + (emacs (concat invocation-directory invocation-name)) + ((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch" + "--eval" "(byte-recompile-directory \".\" 0 'force)")))) + (progn (require 'elpaca) + (elpaca-generate-autoloads "elpaca" repo) + (kill-buffer buffer)) (error "%s" (with-current-buffer buffer (buffer-string)))) - ((error) - (warn "%s" err) - (delete-directory repo 'recursive)))) + ((error) (warn "%s" err) (delete-directory repo 'recursive)))) (require 'elpaca-autoloads) (add-hook 'after-init-hook #'elpaca-process-queues) (elpaca `(,@elpaca-order)) -(provide 'elpaca-bootstrap) ;;; elpaca-bootstrap.el ends here