;;; -*- lexical-binding: t -*- ;; Disable package.el from start-up, because using elpaca (setq package-enable-at-startup nil) ;; Bootstrap elpaca (defvar elpaca-installer-version 0.7) (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 :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) (load "./elpaca-autoloads"))) (add-hook 'after-init-hook #'elpaca-process-queues) (elpaca `(,@elpaca-order)) (require 'package) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) (package-refresh-contents nil) ;; refresh package repositories, synchronously ;; Install use-package support (elpaca elpaca-use-package ;; Enable use-package :ensure support for Elpaca. (elpaca-use-package-mode)) ;; Block until current queue processed. (elpaca-wait);;; Ensure packages are always new and always loaded ;;; Emacs 29.1 added a the ability for Emacs' built-in package.el to upgrade ;;; some packages that are shipped with Emacs, such as flymake. Hopefully, ;;; straight.el picks this option up and upgrades these too. (when (and (= emacs-major-version 29) (= emacs-major-version 1)) (setq-default package-install-upgrade-built-in 't)) ;; Add highlighting for TODO/NOTE/FIXME strings in most buffers. ;; By default, it highlights TODO, FIXME, and NOTE. ;; You can also choose what words should be recognized and what color they should ;; be highlighted with my modifying the hl-todo-keyword-faces variable. (use-package hl-todo :ensure (:depth nil) :bind (("C-c C-t p" . #'hl-todo-previous) ("C-c C-t n" . #'hl-todo-next)) :config (global-hl-todo-mode)) ;; Load in Magit options ;; Use more up-to-date packages for magit (use-package seq :ensure t) ;; To make magit work, we need the compat package too (use-package compat :ensure t :defer t) (use-package transient :ensure t :defer nil) (use-package magit :ensure t :defer t :requires compat :bind (;; Open Magit Status (git status) for git handling ("C-x g" . #'magit-status) ;; Bring up a small menu to choose to do magit things ("C-x M-g" . #'magit-dispatch) ;; With `git blame`, we can find out the commits that changed certain lines and/or regions ("C-c b" . #'magit-blame)) :custom (magit-no-confirm '(stage-all-changes unstage-all-changes)) (magit-clone-default-directory "~/Repos/") (magit-auto-revert-mode t)) ;; Display TODO/FIXME/other tagged items in the repository in the magit-status ;; buffer. (use-package magit-todos :ensure t :demand t ; Use :demand, because we still autoload magit ;; :after magit :custom (magit-todos-keywords-list (list "TODO" "FIXME" "XXXX*")) (magit-todos-auto-group-items 50) (magit-todos-exclude-globs '(".git/")) :config (magit-todos-mode)) (elpaca-wait) ;;; init.el ends here