From aab5bfd074e57d06a79e39d7c7c4760e1f385a06 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 17 Oct 2022 21:41:28 -0500 Subject: Bankruptcy 9 --- early-init.el | 129 +++++++++++++--------------------------------------------- 1 file changed, 28 insertions(+), 101 deletions(-) (limited to 'early-init.el') diff --git a/early-init.el b/early-init.el index 615b417..173625f 100644 --- a/early-init.el +++ b/early-init.el @@ -1,25 +1,6 @@ -;;; early-init.el -*- lexical-binding: t; coding: utf-8-unix -*- - -;; Author: Case Duckworth -;; Created: Sometime during Covid-19, 2020 -;; Keywords: configuration -;; URL: https://tildegit.org/acdw/emacs - -;;; License: - -;; Everyone is permitted to do whatever they like with this software -;; without limitation. This software comes without any warranty -;; whatsoever, but with two pieces of advice: -;; - Be kind to yourself. -;; - Make good choices. - -;;; Commentary: - -;; Starting with Emacs 27.1, early-init.el is sourced before -;; package.el and any graphical frames. In this file, I set up frame -;; parameters and packaging infrastructure. - -;;; Code: +;;; emacs early init -*- lexical-binding: t; -*- +;; by C. Duckworth +(provide 'early-init) ;;; Speed up init @@ -60,19 +41,6 @@ restore that." (unless (eq debug-on-error 'startup) (+set-during-startup 'debug-on-error 'init)) -;;; Set up extra load paths and functionality - -(push (locate-user-emacs-file "lisp") load-path) -(require 'acdw) -(require '+compat) - -(+define-dir .etc (locate-user-emacs-file ".etc") - "Directory for all of Emacs's various files. -See `no-littering' for examples.") - -(+define-dir sync/ (expand-file-name "~/Sync") - "My Syncthing directory.") - ;;; Default frame settings (setq default-frame-alist '((tool-bar-lines . 0) @@ -89,76 +57,35 @@ See `no-littering' for examples.") ;; (bottom . right)) ) -;;; No littering! -;; We install `no-littering' package below, but we can set the variables now. +;;; Set up extra load paths and functionality -(setq no-littering-etc-directory .etc - no-littering-var-directory .etc - straight-base-dir .etc) +(push (locate-user-emacs-file "lisp") load-path) +(require 'acdw) -;; https://github.com/emacscollective/no-littering/wiki/Setting-gccemacs'-eln-cache +(+define-dir .etc (locate-user-emacs-file ".etc") + "Directory for all of Emacs's various files. +See `no-littering' for examples.") -(when (boundp 'comp-eln-load-path) - (setcar comp-eln-load-path (expand-file-name (.etc "eln-cache" t)))) +(+define-dir sync/ (expand-file-name "~/Sync") + "My Syncthing directory.") ;;; Packages (setq package-enable-at-startup nil - package-quickstart nil - straight-host-usernames '((github . "duckwork") - (gitlab . "acdw")) - straight-check-for-modifications '(check-on-save - find-when-checking)) - -;; Bootstrap straight.el -;; https://github.com/raxod502/straight.el - -(+with-message "Bootstrapping straight" - (defvar bootstrap-version) - (let ((bootstrap-file - (expand-file-name - "straight/repos/straight.el/bootstrap.el" - straight-base-dir)) - (bootstrap-version 5)) - (unless (file-exists-p bootstrap-file) - (with-current-buffer - (url-retrieve-synchronously - (concat "https://raw.githubusercontent.com/" - "raxod502/straight.el/develop/install.el") - 'silent 'inhibit-cookies) - (goto-char (point-max)) - (eval-print-last-sexp))) - (load bootstrap-file nil 'nomessage))) - -;; Early-loaded packages -- those that, for some reason or another, -;; need to be ensured to be loaded first. - -(require 'straight-x) - -(dolist (pkg '(el-patch - no-littering - setup - straight ; already installed, but what the hell - )) - (straight-use-package pkg) - (require pkg) - (require (intern (format "+%s" pkg)) nil :noerror)) - -;; Setup `setup' - -(add-to-list 'setup-modifier-list '+setup-wrap-to-demote-errors) -(unless (memq debug-on-error '(nil init)) - (define-advice setup (:around (fn head &rest args) +setup-report) - (+with-progress ((format "[Setup] %S..." head)) - (apply fn head args)))) - -;;; Appendix - -;; Get rid of a dumb alias. straight-ಠ_ಠ-mode really slows down all -;; minibuffer completion functions. Since it's a (rarely-used, even) -;; alias anyway, I just define it back to nil. By the way, the alias -;; is `straight-package-neutering-mode'. -(defalias 'straight-ಠ_ಠ-mode nil) - -(provide 'early-init) -;;; early-init.el ends here + package-quickstart nil) + +(require 'yoke) + +(yoke compat "https://git.sr.ht/~pkal/compat") + +(yoke no-littering "https://github.com/emacscollective/no-littering" + (require 'no-littering) + (setq no-littering-etc-directory .etc + no-littering-var-directory .etc + custom-file (.etc "custom.el")) + (when (boundp 'comp-eln-load-path) + (setcar comp-eln-load-path (expand-file-name (.etc "eln-cache" t)))) + (when (fboundp 'startup-redirect-eln-cache) + (startup-redirect-eln-cache + (convert-standard-filename + (.etc "eln-cache/"))))) -- cgit 1.4.1-21-gabe81