Migrate Emacs package management to Elpaca
This commit is contained in:
parent
030712337c
commit
e8520cd29c
4 changed files with 53 additions and 21 deletions
1
.config/emacs/early-init.el
Normal file
1
.config/emacs/early-init.el
Normal file
|
|
@ -0,0 +1 @@
|
|||
(setq package-enable-at-startup nil)
|
||||
45
.config/emacs/init-elpaca.el
Normal file
45
.config/emacs/init-elpaca.el
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
(defvar elpaca-installer-version 0.5)
|
||||
(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)))
|
||||
(let* ((repo (expand-file-name "elpaca/" elpaca-repos-directory))
|
||||
(build (expand-file-name "elpaca/" elpaca-builds-directory))
|
||||
(order (cdr elpaca-order))
|
||||
(default-directory repo))
|
||||
(add-to-list 'load-path (if (file-exists-p build) build repo))
|
||||
(unless (file-exists-p repo)
|
||||
(make-directory repo t)
|
||||
(when (< emacs-major-version 28) (require 'subr-x))
|
||||
(condition-case-unless-debug err
|
||||
(if-let ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*"))
|
||||
((zerop (call-process "git" nil buffer t "clone"
|
||||
(plist-get order :repo) repo)))
|
||||
((zerop (call-process "git" nil buffer t "checkout"
|
||||
(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)")))
|
||||
((require 'elpaca))
|
||||
((elpaca-generate-autoloads "elpaca" repo)))
|
||||
(progn (message "%s" (buffer-string)) (kill-buffer buffer))
|
||||
(error "%s" (with-current-buffer buffer (buffer-string))))
|
||||
((error) (warn "%s" err) (delete-directory repo 'recursive))))
|
||||
(unless (require 'elpaca-autoloads nil t)
|
||||
(require 'elpaca)
|
||||
(elpaca-generate-autoloads "elpaca" repo)
|
||||
(load "./elpaca-autoloads")))
|
||||
(add-hook 'after-init-hook #'elpaca-process-queues)
|
||||
(elpaca `(,@elpaca-order))
|
||||
|
||||
;; Install use-package support
|
||||
(elpaca elpaca-use-package
|
||||
;; Enable :elpaca use-package keyword.
|
||||
(elpaca-use-package-mode)
|
||||
;; Assume :elpaca t unless otherwise specified.
|
||||
(setq elpaca-use-package-by-default t))
|
||||
|
||||
(elpaca-wait)
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
(defvar bootstrap-version)
|
||||
(let ((bootstrap-file
|
||||
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
|
||||
(bootstrap-version 6))
|
||||
(unless (file-exists-p bootstrap-file)
|
||||
(with-current-buffer
|
||||
(url-retrieve-synchronously
|
||||
"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
|
||||
'silent 'inhibit-cookies)
|
||||
(goto-char (point-max))
|
||||
(eval-print-last-sexp)))
|
||||
(load bootstrap-file nil 'nomessage))
|
||||
|
||||
(straight-use-package 'use-package)
|
||||
(setq straight-use-package-by-default t)
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
(load-file ".config/emacs/init-straight.el")
|
||||
(load-file ".config/emacs/init-elpaca.el")
|
||||
|
||||
(use-package emacs
|
||||
:straight (:type built-in)
|
||||
:elpaca nil
|
||||
:bind (("C-z" . nil)
|
||||
("C-z i" . (lambda () (interactive) (find-file user-init-file))))
|
||||
:config
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
(global-auto-revert-non-file-buffers t))
|
||||
|
||||
(use-package better-defaults
|
||||
:straight (:host nil :repo "https://git.sr.ht/~technomancy/better-defaults"))
|
||||
:elpaca (:repo "https://git.sr.ht/~technomancy/better-defaults"))
|
||||
|
||||
(use-package treemacs-icons-dired
|
||||
:hook (dired-mode . treemacs-icons-dired-mode))
|
||||
|
|
@ -54,7 +54,7 @@
|
|||
(load-theme 'material t))
|
||||
|
||||
(use-package windmove
|
||||
:straight (:type built-in)
|
||||
:elpaca nil
|
||||
:bind (("s-w" . windmove-up)
|
||||
("s-a" . windmove-left)
|
||||
("s-s" . windmove-down)
|
||||
|
|
@ -82,7 +82,7 @@
|
|||
(ivy-count-format "(%d/%d) "))
|
||||
|
||||
(use-package org
|
||||
:straight (:type built-in)
|
||||
:elpaca nil
|
||||
:bind (("C-c l" . org-store-link)
|
||||
("C-c c" . org-capture)
|
||||
("C-c a" . org-agenda)
|
||||
|
|
@ -116,7 +116,8 @@
|
|||
(use-package company
|
||||
:init (global-company-mode))
|
||||
|
||||
(use-package apt-mode)
|
||||
(use-package apt-mode
|
||||
:disabled t)
|
||||
|
||||
(use-package docker
|
||||
:bind ("C-c d" . docker))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue