From f7bbb7c66cc807397b974b62e20bf61f66eb2361 Mon Sep 17 00:00:00 2001 From: MitchMarq42 Date: Fri, 9 Dec 2022 10:31:08 -0900 Subject: [PATCH] update elpaca-bootstrap file according to new readme, for things to come --- lisp/elpaca-bootstrap.el | 46 ++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/lisp/elpaca-bootstrap.el b/lisp/elpaca-bootstrap.el index 2f19d9a..3597e63 100644 --- a/lisp/elpaca-bootstrap.el +++ b/lisp/elpaca-bootstrap.el @@ -4,33 +4,37 @@ ;; Taken from https://github.com/progfolio/elpaca ;;; Code: -(declare-function elpaca-generate-autoloads "elpaca") (defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory)) (defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory)) -(when-let ((elpaca-repo (expand-file-name "repos/elpaca/" elpaca-directory)) - (elpaca-build (expand-file-name "elpaca/" elpaca-builds-directory)) - (elpaca-target (if (file-exists-p elpaca-build) elpaca-build elpaca-repo)) - (elpaca-url "https://www.github.com/progfolio/elpaca.git") - ((add-to-list 'load-path elpaca-target)) - ((not (file-exists-p elpaca-repo))) +(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git" + :ref nil + :build (:not elpaca--activate-package))) +(when-let ((repo (expand-file-name "repos/elpaca/" elpaca-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*"))) (condition-case-unless-debug err - (progn - (unless (zerop (call-process "git" nil buffer t "clone" elpaca-url elpaca-repo)) - (error "%s" (list (with-current-buffer buffer (buffer-string))))) - (byte-recompile-directory elpaca-repo 0 'force) - (require 'elpaca) - (elpaca-generate-autoloads "elpaca" elpaca-repo) - (kill-buffer buffer)) + (if-let (((pop-to-buffer buffer '((display-buffer-reuse-window + display-buffer-same-window)))) + ((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)) + (error "%s" (with-current-buffer buffer (buffer-string)))) ((error) - (delete-directory elpaca-directory 'recursive) - (with-current-buffer buffer - (goto-char (point-max)) - (insert (format "\n%S" err)) - (display-buffer buffer))))) + (warn "%s" err) + (delete-directory repo 'recursive)))) (require 'elpaca-autoloads) (add-hook 'after-init-hook #'elpaca-process-queues) -(elpaca (elpaca :host github :repo "progfolio/elpaca")) - +(elpaca `(,@elpaca-order)) (provide 'elpaca-bootstrap) ;;; elpaca-bootstrap.el ends here