feat: Remove elpaca

I'm not actually using it and it's just bloat at this point.
This speeds up the startup significantly.

Remove what you don't need.
This commit is contained in:
Laurens Miers 2025-05-27 11:47:37 +02:00
parent a731bab651
commit 7f901b23ae
2 changed files with 64 additions and 106 deletions

View file

@ -3,65 +3,61 @@
#+CREATOR: Laurens Miers
#+LANGUAGE: en
* Elpaca
** Core
* General config
#+BEGIN_SRC emacs-lisp
(defvar elpaca-installer-version 0.11)
(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 :depth 1 :inherit ignore
:files (:defaults "elpaca-test.el" (: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 (apply #'call-process `("git" nil ,buffer t "clone"
,@(when-let* ((depth (plist-get order :depth)))
(list (format "--depth=%d" depth) "--no-single-branch"))
,(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)
(let ((load-source-file-function nil)) (load "./elpaca-autoloads"))))
(add-hook 'after-init-hook #'elpaca-process-queues)
(elpaca `(,@elpaca-order))
(use-package emacs
:ensure nil
:custom
(inhibit-startup-message t)
:init
(with-current-buffer (get-buffer-create "*scratch*")
(insert (format ";;
;; ██╗ ██╗███████╗██╗ ██╗ ██████╗
;; ██║ ██║██╔════╝██║ ██║ ██╔═══██╗
;; ███████║█████╗ ██║ ██║ ██║ ██║
;; ██╔══██║██╔══╝ ██║ ██║ ██║ ██║
;; ██║ ██║███████╗███████╗███████╗╚██████╔╝
;; ╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝ ╚═════╝
;;
;; ███████╗███╗ ███╗ █████╗ ██████╗███████╗
;; ██╔════╝████╗ ████║██╔══██╗██╔════╝██╔════╝
;; █████╗ ██╔████╔██║███████║██║ ███████╗
;; ██╔══╝ ██║╚██╔╝██║██╔══██║██║ ╚════██║
;; ███████╗██║ ╚═╝ ██║██║ ██║╚██████╗███████║
;; ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚══════╝
;;
;; Loading time : %s
;; Packages : %s
;;
"
(emacs-init-time)
(number-to-string (length package-activated-list)))))
(message (emacs-init-time))
)
#+END_SRC
** Use-package integration
** Package repos
#+begin_src emacs-lisp
;; Install use-package support
(elpaca elpaca-use-package
;; Enable use-package :ensure support for Elpaca.
(elpaca-use-package-mode)
)
#+BEGIN_SRC emacs-lisp
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
;; Comment/uncomment this line to enable MELPA Stable if desired. See `package-archive-priorities`
;; and `package-pinned-packages`. Most users will not need or want to do this.
;;(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t)
(package-initialize)
#+END_SRC
;; wait to get elpaca use-package integration
(elpaca-wait)
#+end_src
** Use-package
*** Always ensure
#+BEGIN_SRC emacs-lisp
(require 'use-package-ensure)
(setq use-package-always-ensure t)
#+END_SRC
* General config
** Bell
The audible bell is annoying AF.
@ -246,15 +242,6 @@ Narrow-region/page is a really handy feature, enable it:
(put 'narrow-to-region 'disabled nil)
#+END_SRC
** Use-package
*** Always ensure
#+BEGIN_SRC emacs-lisp
(require 'use-package-ensure)
(setq use-package-always-ensure t)
#+END_SRC
** Adaptive cursor width
Make cursor the width of the character it is under f.e. full width of a tab.
@ -650,29 +637,26 @@ For the keybindings, we have to defien them in both raw and line mode. From the
#+begin_src emacs-lisp
(use-package dashboard
:config
(add-hook 'elpaca-after-init-hook #'dashboard-insert-startupify-lists)
(add-hook 'elpaca-after-init-hook #'dashboard-initialize)
(dashboard-setup-startup-hook))
#+end_src
* Hydra
Install and wait for hydra to be available since we are using it in this init.el :
#+begin_src emacs-lisp
https://github.com/abo-abo/hydra
#+BEGIN_SRC emacs-lisp
(use-package hydra
:ensure (:wait t)
:defer t
:config
;; Zoom hydra
(defhydra hydra-zoom (global-map "<f1>")
"zoom"
("g" text-scale-increase "in")
("l" text-scale-decrease "out")
)
)
#+end_src
** Text zoom
#+begin_src emacs-lisp
(defhydra hydra-zoom (global-map "<f1>")
"zoom"
("g" text-scale-increase "in")
("l" text-scale-decrease "out")
)
#+end_src
#+END_SRC
* Zygospore
@ -770,41 +754,15 @@ https://github.com/victorhge/iedit
** Magit
*** Transient
Magit depends on this and it seems it's not installed as a dependency, so install it explicitly.
#+BEGIN_SRC emacs-lisp
(use-package transient
:ensure (:wait t)
)
#+END_SRC
*** Core
#+BEGIN_SRC emacs-lisp
(use-package magit
:ensure (:wait t)
)
:defer t
)
#+END_SRC
**** Extra commands
***** Update all submodules
#+BEGIN_SRC emacs-lisp
(transient-define-suffix magit-submodule-update-all ()
"Update all submodules"
:description "Update All git submodule update --init --recursive"
(interactive)
(magit-with-toplevel
(magit-run-git-async "submodule" "update" "--force")))
(transient-append-suffix 'magit-submodule "f"
'("U" magit-submodule-update-all))
#+END_SRC
** Dumb-jump
#+BEGIN_SRC emacs-lisp

View file

@ -10,7 +10,7 @@
;; Only care about errors in *Messages* buffer
(setq warning-minimum-level :error)
;; Recommended by elpaca
;; We control when packages are enabled
(setq package-enable-at-startup nil)
(provide 'early-init)