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 #+CREATOR: Laurens Miers
#+LANGUAGE: en #+LANGUAGE: en
* Elpaca * General config
** Core
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(defvar elpaca-installer-version 0.11) (use-package emacs
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory)) :ensure nil
(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory)) :custom
(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory)) (inhibit-startup-message t)
(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git" :init
:ref nil :depth 1 :inherit ignore (with-current-buffer (get-buffer-create "*scratch*")
:files (:defaults "elpaca-test.el" (:exclude "extensions")) (insert (format ";;
: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)))) ;; Loading time : %s
((zerop (call-process "git" nil buffer t "checkout" ;; Packages : %s
(or (plist-get order :ref) "--")))) ;;
(emacs (concat invocation-directory invocation-name)) "
((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch" (emacs-init-time)
"--eval" "(byte-recompile-directory \".\" 0 'force)"))) (number-to-string (length package-activated-list)))))
((require 'elpaca))
((elpaca-generate-autoloads "elpaca" repo))) (message (emacs-init-time))
(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))
#+END_SRC #+END_SRC
** Use-package integration ** Package repos
#+begin_src emacs-lisp #+BEGIN_SRC emacs-lisp
;; Install use-package support (require 'package)
(elpaca elpaca-use-package (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
;; Enable use-package :ensure support for Elpaca. ;; Comment/uncomment this line to enable MELPA Stable if desired. See `package-archive-priorities`
(elpaca-use-package-mode) ;; 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 ** Use-package
(elpaca-wait)
#+end_src *** Always ensure
#+BEGIN_SRC emacs-lisp
(require 'use-package-ensure)
(setq use-package-always-ensure t)
#+END_SRC
* General config
** Bell ** Bell
The audible bell is annoying AF. 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) (put 'narrow-to-region 'disabled nil)
#+END_SRC #+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 ** Adaptive cursor width
Make cursor the width of the character it is under f.e. full width of a tab. 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 #+begin_src emacs-lisp
(use-package dashboard (use-package dashboard
:config :config
(add-hook 'elpaca-after-init-hook #'dashboard-insert-startupify-lists)
(add-hook 'elpaca-after-init-hook #'dashboard-initialize)
(dashboard-setup-startup-hook)) (dashboard-setup-startup-hook))
#+end_src #+end_src
* Hydra * Hydra
Install and wait for hydra to be available since we are using it in this init.el : https://github.com/abo-abo/hydra
#+begin_src emacs-lisp
#+BEGIN_SRC emacs-lisp
(use-package hydra (use-package hydra
:ensure (:wait t) :defer t
) :config
#+end_src ;; Zoom hydra
** Text zoom
#+begin_src emacs-lisp
(defhydra hydra-zoom (global-map "<f1>") (defhydra hydra-zoom (global-map "<f1>")
"zoom" "zoom"
("g" text-scale-increase "in") ("g" text-scale-increase "in")
("l" text-scale-decrease "out") ("l" text-scale-decrease "out")
) )
#+end_src
)
#+END_SRC
* Zygospore * Zygospore
@ -770,41 +754,15 @@ https://github.com/victorhge/iedit
** Magit ** 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 *** Core
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package magit (use-package magit
:ensure (:wait t) :defer t
) )
#+END_SRC #+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 ** Dumb-jump
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp

View file

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