From c2b61e4c66c1ed41b95175f0cfe28906fc49c61e Mon Sep 17 00:00:00 2001 From: MitchMarq42 Date: Tue, 30 Aug 2022 05:40:34 -0800 Subject: [PATCH] Don't use elpaca. Just stick with use-package and straight. --- init.el | 5 +- lisp/mitch-packages.el | 149 +++++++++++++++++++---------------------- 2 files changed, 72 insertions(+), 82 deletions(-) diff --git a/init.el b/init.el index 82982fd..a18ab97 100644 --- a/init.el +++ b/init.el @@ -70,8 +70,8 @@ (defvar bootstrap-version) (let ((bootstrap-file (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) (bootstrap-version 5)) (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) ;; actually, use elpaca instead - (require 'elpaca-bootstrap) (elpaca 'use-package (require 'use-package)) - + ;; (require 'elpaca-bootstrap) (elpaca 'use-package (require 'use-package)) + ;; actually, don't because it's broken on Windows (require 'mitch-packages) @@ -79,7 +79,6 @@ ;; (global-display-line-numbers-mode) ;; (defvar display-line-numbers-width-start t) - ;; scroll step stuff (setq scroll-margin 2 scroll-conservatively 100 diff --git a/lisp/mitch-packages.el b/lisp/mitch-packages.el index 08c7cee..1cde06e 100644 --- a/lisp/mitch-packages.el +++ b/lisp/mitch-packages.el @@ -6,18 +6,9 @@ ;; ----------------------------------------------------------------------------- ;;; Code: -;; (elpaca-use-package elpaca -;; :init (require 'elpaca-bootstrap)) -(defmacro use-feature (name &rest args) - "Like `use-package' but accounting for asynchronous installation. -NAME and ARGS are in `use-package'." - (declare (indent defun)) - `(elpaca nil (use-package ,name - :ensure nil - ,@args))) ;; diminish -(elpaca-use-package diminish) -(use-feature eldoc +(use-package diminish) +(use-package eldoc :straight (:type built-in) :diminish :defer 1 @@ -29,11 +20,11 @@ NAME and ARGS are in `use-package'." (get-char-code-property (string-to-char (thing-at-point 'char)) 'name))) (add-hook 'eldoc-documentation-functions #'eldoc-jhk)) -(use-feature savehist +(use-package savehist :straight (:type built-in) :init (savehist-mode)) ;; Visualize whitespace. In a very chill and invisible way. -(use-feature whitespace +(use-package whitespace :straight (:type built-in) :defer 1 :diminish whitespace-mode @@ -43,29 +34,29 @@ NAME and ARGS are in `use-package'." :hook (prog-mode . whitespace-mode) ;; :config (global-whitespace-mode t) ) -(use-feature ibuffer +(use-package ibuffer :straight (:type built-in) :commands ibuffer :custom (ibuffer-use-other-window t)) -(use-feature image-mode +(use-package image-mode :straight (:type built-in) :config (turn-off-line-numbers) (blink-cursor-mode -1)) ;; ...and finally, sync files with disk changes -(use-feature autorevert +(use-package autorevert :straight (:type built-in) :diminish auto-revert-mode :config (global-auto-revert-mode)) ;; Keybinding manager -(use-feature general +(use-package general :straight t :config (mitch/general-config)) ;; load evil -(use-feature evil +(use-package evil :straight t :general (general-define-key @@ -93,22 +84,22 @@ NAME and ARGS are in `use-package'." (quote undo-fu))) :init (evil-mode t)) -(use-feature evil-collection +(use-package evil-collection :straight t :after evil :diminish evil-collection-unimpaired-mode :config (evil-collection-init)) -(use-feature evil-commentary +(use-package evil-commentary :straight t :diminish 'evil-commentary-mode :config (evil-commentary-mode) :hook (prog-mode . evil-commentary-mode)) -(use-feature evil-surround +(use-package evil-surround :straight t :diminish 'global-evil-surround-mode :hook (prog-mode . evil-surround-mode) :config (global-evil-surround-mode 1)) -(use-feature evil-terminal-cursor-changer +(use-package evil-terminal-cursor-changer :straight t :after evil :diminish @@ -116,13 +107,13 @@ NAME and ARGS are in `use-package'." :config (evil-terminal-cursor-changer-activate) (xterm-mouse-mode)) -(use-feature undo-fu +(use-package undo-fu :after evil :if (< (string-to-number emacs-version) 28) :diminish) ;; eshell. Pretty good actually. -(use-feature eshell +(use-package eshell :straight (:type built-in) :commands (eshell/emacs eshell/man) :custom (eshell-scroll-to-bottom-on-input t) @@ -144,21 +135,21 @@ This is taken from a website that I can't remember at the moment." :states 'normal :keymaps 'eshell-mode-map "I" 'eshell-evil-insert-line)) -(elpaca-use-package eshell-vterm +(use-package eshell-vterm :after eshell :custom (eshell-destroy-buffer-when-process-dies t) :hook (eshell-mode . eshell-vterm-mode)) -(elpaca-use-package eshell-syntax-highlighting +(use-package eshell-syntax-highlighting :hook (eshell-mode . eshell-syntax-highlighting-mode)) -(elpaca-use-package eshell-prompt-extras +(use-package eshell-prompt-extras :after eshell :custom (eshell-highlight-prompt nil) (eshell-prompt-function 'epe-theme-multiline-with-status) (epe-path-style 'full)) -(use-feature all-the-icons) -(elpaca-use-package dirvish +(use-package all-the-icons) +(use-package dirvish :straight (:files (:defaults "extensions/*.el")) :defer 0.5 :commands dirvish @@ -185,7 +176,7 @@ This is taken from a website that I can't remember at the moment." "t" 'dirvish-side)) ;; Completion framework... -(elpaca-use-package vertico +(use-package vertico :straight (:files (:defaults "extensions/vertico-mouse.el")) :custom (vertico-resize t) :init (vertico-mode t) @@ -205,18 +196,18 @@ Otherwise, kill back 1 letter." (general-define-key :prefix-map 'minibuffer-mode-map "DEL" 'backspace-in-minibuffer)) -(use-feature vertico-mouse +(use-package vertico-mouse :straight vertico :after vertico :config (vertico-mouse-mode)) -(use-feature consult +(use-package consult :after vertico) ;; Minibuffer generic stuff -(use-feature marginalia +(use-package marginalia ;; :custom (marginalia-separator " ") :init (marginalia-mode)) -(use-feature orderless +(use-package orderless :custom (completion-styles '(orderless partial-completion basic)) (completion-category-defaults nil) @@ -224,7 +215,7 @@ Otherwise, kill back 1 letter." (completion-category-overrides nil)) ;; weird multi-path thing -(use-feature embark +(use-package embark :general (general-define-key :keymap minibuffer-mode-map @@ -264,11 +255,11 @@ targets." :config (setq enable-recursive-minibuffers t)) ;; Consult users will also want the embark-consult package. -(use-feature embark-consult +(use-package embark-consult :after (embark consult)) ;; SORTA WORKING: Relative line numbers with stuff -(use-feature linum-relative +(use-package linum-relative :diminish :init (require 'cl-lib) @@ -321,7 +312,7 @@ targets." ;; (setq display-line-numbers-mode 'relative) ;; broken terminal that doesn't compile but at least it's fast when it does -(use-feature vterm +(use-package vterm :custom (vterm-always-compile-module t) (vterm-module-cmake-args "-DUSE_SYSTEM_LIBVTERM=no") @@ -359,7 +350,7 @@ targets." :hook (vterm-mode . mitch/terminal-setup) (vterm-exit-functions . save-buffers-kill-terminal)) -(use-feature multi-vterm +(use-package multi-vterm :commands (multi-vterm multi-vterm-other-window) :config (defun multi-vterm-other-window () @@ -379,7 +370,7 @@ targets." "v" 'multi-vterm-other-window)) ;; Better modeline? Better modeline. -(use-feature nyan-mode +(use-package nyan-mode :after airline :custom (nyan-cat-face [[""]]) @@ -387,13 +378,13 @@ targets." :init (nyan-mode)) ;; (add-to-list 'mode-line-format (nyan-create) t) ;; (string-to-char "") -(use-feature powerline +(use-package powerline :custom (powerline-display-buffer-size nil) (powerline-default-separator 'utf-8) (powerline-utf-8-separator-left (string-to-char "")) (powerline-utf-8-separator-right (string-to-char ""))) -(use-feature airline-themes +(use-package airline-themes :custom (airline-cursor-colors nil) (airline-display-directory t) @@ -439,7 +430,7 @@ targets." ;; Custom Theme. ;; Not to be confused with a color theme, or a color scheme, or a custom scheme. -(use-feature autothemer +(use-package autothemer :custom (window-divider-default-places t) (right-divider-width 5) @@ -461,7 +452,7 @@ targets." ;; :config (global-yascroll-bar-mode 1)) ;; parentheses settingses -(use-feature paredit +(use-package paredit :defer 0.1 :general (general-define-key :states 'normal @@ -477,7 +468,7 @@ targets." (show-paren-style 'parenthesis)) ;; org mode and messy things -(use-feature org +(use-package org :straight (:type built-in) :mode (("\\.org$" . org-mode)) :diminish org-indent-mode @@ -489,7 +480,7 @@ targets." #'(lambda () (if (equal major-mode 'org-mode) (org-babel-tangle)))) :hook (org-mode . turn-off-line-numbers)) -(use-feature org-tempo +(use-package org-tempo :straight (:type built-in) :after org :config @@ -497,13 +488,13 @@ targets." (add-to-list 'org-structure-template-alist '("el" . "src elisp")) (add-to-list 'org-structure-template-alist '("ps1" . "src powershell")) (add-to-list 'org-structure-template-alist '("html" . "src html"))) -(use-feature org-variable-pitch +(use-package org-variable-pitch :if (display-graphic-p) :diminish (buffer-face-mode org-variable-pitch-minor-mode) :config (set-face-attribute 'org-meta-line nil :inherit '(font-lock-comment-delimiter-face fixed-pitch)) :hook (org-mode . org-variable-pitch-minor-mode)) -(use-feature org-contrib +(use-package org-contrib :after org :config (org-babel-do-load-languages @@ -516,39 +507,39 @@ targets." ;; :after org ;; :custom ;; (org-appear-autolinks t)) -(use-feature ob-powershell +(use-package ob-powershell :after org :custom (ob-powershell-powershell-command "pwsh")) -(use-feature ox-hugo +(use-package ox-hugo :after ox) ;; cheaty key popups -(use-feature which-key +(use-package which-key :diminish :defer 5 :init (which-key-mode t)) ;; parentheses are boring -(use-feature rainbow-delimiters +(use-package rainbow-delimiters :diminish :defer 1 :hook (prog-mode . rainbow-delimiters-mode)) ;; Hex colors -(use-feature rainbow-mode +(use-package rainbow-mode :diminish :defer 10 :hook (prog-mode . rainbow-mode)) ;; Nobody loves a good language -(use-feature powershell +(use-package powershell :mode ("\\.ps1\\'" . powershell-mode)) -(use-feature cider +(use-package cider :defer 1) ;; or a bad language -(use-feature haskell-mode +(use-package haskell-mode :mode "\\.hs\\'" ;; :init ;; (add-hook 'haskell-mode-hook 'haskell-decl-scan-mode) @@ -564,7 +555,7 @@ targets." ;; c sharp; taken from https://www.reddit.com/r/emacs/comments/k8tnzg/help_setting_up_c_lsp_omnisharproslyn/ ;; '(there is nothing here because I'm not using c sharp...) -(use-feature lsp-mode +(use-package lsp-mode :hook ((powershell-mode . lsp) (lsp-mode . lsp-enable-which-key-integration) (lsp-mode . lsp-ui-mode)) @@ -573,17 +564,17 @@ targets." (lsp-completion-provider :none)) ;; optionally -(use-feature lsp-ui +(use-package lsp-ui :after lsp :commands lsp-ui-mode) ;; broken snippets I don't care about... -(use-feature yasnippet +(use-package yasnippet :diminish yas-minor-mode :hook (prog-mode . yas-minor-mode)) ;; Better help-pages. Genuinely pretty great. -(use-feature helpful +(use-package helpful :general (general-define-key [remap describe-key] 'helpful-key [remap describe-variable] 'helpful-variable @@ -599,25 +590,25 @@ targets." :custom (elisp-refs-verbose nil)) ;; Better lisp highlighting? -(use-feature highlight-defined +(use-package highlight-defined :hook (emacs-lisp-mode . highlight-defined-mode)) ;; Shell linting? -(use-feature flycheck +(use-package flycheck :diminish :hook (prog-mode . flycheck-mode) ;; :config (global-flycheck-mode t) ) ;; Emacs startup profiling -(use-feature esup +(use-package esup :commands esup) ;; Blingy file tree view ;; '(I'm using dirvish instead, so no treemacs config here anymore.) ;; Blingy laggy minimap on the right -(use-feature minimap +(use-package minimap :general (general-define-key :states 'normal :prefix-command 'mini-map-prefix @@ -654,7 +645,7 @@ targets." ;; (company-fuzzy-history-backends '(company-yasnippet)) ;; (company-fuzzy-trigger-symbols '("." "->" "<" "\"" "'" "@")) ;; (company-fuzzy-passthrough-backends '(company-capf))) -(use-feature corfu +(use-package corfu :custom (completion-cycle-threshold 3) (tab-always-indent 'complete) @@ -695,12 +686,12 @@ targets." ) ) -(use-feature popon +(use-package popon :straight (:type git :repo "https://codeberg.org/akib/emacs-popon") :if (not (display-graphic-p))) -(use-feature corfu-terminal +(use-package corfu-terminal :straight (:type git :repo "https://codeberg.org/akib/emacs-corfu-terminal") @@ -738,7 +729,7 @@ targets." -(use-feature xwidget ;-webkit +(use-package xwidget ;-webkit :straight (:type built-in) :if (featurep 'xwidget-internal) :commands xwidget-webkit-browse-url @@ -749,24 +740,24 @@ targets." (scroll-bar-mode -1) ))) -(use-feature magit +(use-package magit :commands magit :hook (magit-mode . turn-off-line-numbers)) -(use-feature hyperbole +(use-package hyperbole :diminish ;; :init (hyperbole-mode) :general (general-define-key :states 'normal "RET" 'hkey-either)) -(use-feature dconf-mode +(use-package dconf-mode :straight (:type git :repo "https://git.mitchmarq42.xyz/mitch/dconf-mode.el")) -(use-feature info-variable-pitch +(use-package info-variable-pitch :straight (:type git :host github :repo "kisaragi-hiu/info-variable-pitch") @@ -783,11 +774,11 @@ targets." ;; ;; (require 'exwm-config) ;; ;; (exwm-config-example) ;; ) -(use-feature ani-el +(use-package ani-el :straight (:type git :repo "https://git.mitchmarq42.xyz/mitch/ani-el" :files ("ani-el.el" "lib"))) -(use-feature slime +(use-package slime :if (file-exists-p (expand-file-name "~/quicklisp/slime-helper.el")) :custom (inferior-lisp-program "sbcl") :init (load (expand-file-name "~/quicklisp/slime-helper.el"))) @@ -796,7 +787,7 @@ targets." ;; :config (add-hook 'pdf-view-mode-hook 'turn-off-line-numbers)) ;; built in spell checker, for losers -(use-feature flyspell +(use-package flyspell :straight (:type built-in) :custom (flyspell-auto-correct-word t) @@ -804,15 +795,15 @@ targets." (org-mode . flyspell-mode)) ;; Java never looked so useful... -(use-feature clojure-mode) -(use-feature inf-clojure) +(use-package clojure-mode) +(use-package inf-clojure) ;; Let's pretend we're nevoim for a moment -(use-feature tree-sitter +(use-package tree-sitter :config (global-tree-sitter-mode) (add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode)) -(use-feature tree-sitter-langs) +(use-package tree-sitter-langs) (provide 'mitch-packages) ;;; mitch-packages.el ends here