From 46b86fc5a9e022ca8d4586032567222dd83f7ed2 Mon Sep 17 00:00:00 2001 From: Maciej Szlosarczyk Date: Mon, 6 Jan 2025 11:36:39 +0200 Subject: [PATCH] Make diminish non-blocking Further lowers the startup time --- lisp/icejam-blocking.el | 1 - lisp/icejam-diminish.el | 41 ++++++++++++++++++--------------- lisp/icejam-fonts.el | 8 +++---- lisp/langs/icejam-lang-elisp.el | 4 ++++ 4 files changed, 31 insertions(+), 23 deletions(-) diff --git a/lisp/icejam-blocking.el b/lisp/icejam-blocking.el index 524f452..428235a 100644 --- a/lisp/icejam-blocking.el +++ b/lisp/icejam-blocking.el @@ -9,7 +9,6 @@ ;;; Code: (use-package transient :ensure t) -(use-package diminish :ensure t) (use-package company :ensure t) ;; Finally, wait for installation of these four packages. diff --git a/lisp/icejam-diminish.el b/lisp/icejam-diminish.el index 1332de0..9e2d0ed 100644 --- a/lisp/icejam-diminish.el +++ b/lisp/icejam-diminish.el @@ -6,27 +6,32 @@ ;;; Commentary: -;; diminish minor modes +;; diminish minor modes to remove modeline litter. ;;; Code: -(require 'icejam-blocking) -;; (use-package diminish :ensure t) +(use-package diminish :ensure t :defer t :commands (diminish)) -(with-eval-after-load 'diminish - (with-eval-after-load 'flyspell (diminish 'flyspell-mode)) - (with-eval-after-load 'flycheck (diminish 'flycheck-mode)) - (with-eval-after-load 'rainbow-mode (diminish 'rainbow-mode)) - (with-eval-after-load 'undo-tree (diminish 'undo-tree-mode)) - (with-eval-after-load 'company (diminish 'company-mode)) - (with-eval-after-load 'which-key (diminish 'which-key-mode)) - (with-eval-after-load 'eldoc (diminish 'eldoc-mode)) - (with-eval-after-load 'yasnippet (diminish 'yas-minor-mode)) - (with-eval-after-load 'whitespace (diminish 'whitespace-mode)) - (with-eval-after-load 'autorevert (diminish 'auto-revert-mode)) - (with-eval-after-load 'ivy (diminish 'ivy-mode)) - (with-eval-after-load 'company-box (diminish 'company-box-mode)) - (with-eval-after-load 'smerge-mode (diminish 'smerge-mode)) - (with-eval-after-load 'gcmh (diminish 'gcmh-mode))) +(defun icejam-diminish-modes () + "Diminish selected modes." + (dolist (package-and-mode '((flyspell flyspell-mode) + (flycheck flycheck-mode) + (rainbow-mode rainbow-mode) + (undo-tree undo-tree-mode) + (company company-mode) + (which-key which-key-mode) + (eldoc eldoc-mode) + (yasnippet yas-minor-mode) + (whitespace whitespace-mode) + (autorevert auto-revert-mode) + (ivy ivy-mode) + (company-box company-box-mode) + (smerge-mode smerge-mode) + (gcmh gcmh-mode))) + (let ((package (car package-and-mode)) + (mode (car (last package-and-mode)))) + (with-eval-after-load package (diminish mode))))) + +(add-hook 'elpaca-after-init-hook 'icejam-diminish-modes) (provide 'icejam-diminish) ;;; icejam-diminish.el ends here diff --git a/lisp/icejam-fonts.el b/lisp/icejam-fonts.el index 811675e..ec3bdf4 100644 --- a/lisp/icejam-fonts.el +++ b/lisp/icejam-fonts.el @@ -3,14 +3,11 @@ ;; Author: Maciej Szlosarczyk ;; Maintainer: Maciej Szlosarczyk ;; Version: 0.1-snapshot - ;;; Commentary: ;; Set font stuff ;;; Code: -(use-package dash :ensure t :defer t) - ;; (defconst icejam-font "Monoid" ;; (defconst icejam-font "Fira Mono" ;; (defconst icejam-font "Fira Code" @@ -26,11 +23,14 @@ ;; (defconst icejam-font "Berkeley Mono Trial" ;; (defconst icejam-font "Inconsolata" ;; (defconst icejam-font "Victor Mono Medium" "Default font.") - ;; (defconst icejam-font "Iosevka Term" "Default font.") + (defconst icejam-font-family "Iosevka Comfy Motion" "Default font.") (defconst icejam-markdown-font-family "Iosevka Term" "Font used to render code blocks in markdown.") +;; Require dash functions to be included: +(declare-function -> "dash.el") + (defconst icejam-font-height 14 "Default height of then font. It is used to calculated the height in relation to the screen diff --git a/lisp/langs/icejam-lang-elisp.el b/lisp/langs/icejam-lang-elisp.el index 44484bd..9f7d5c5 100644 --- a/lisp/langs/icejam-lang-elisp.el +++ b/lisp/langs/icejam-lang-elisp.el @@ -5,6 +5,9 @@ (require 'icejam-prog-mode) (require 'icejam-transient) +;; Dash is a package that creates terse and more natural to me functions to +;; do basic things in Elisp. +(use-package dash :ensure t :defer t) (use-package lispy :ensure t :defer t) (use-package aggressive-indent :ensure t :defer t) @@ -32,6 +35,7 @@ (icejam-set-indent 2) ;; Default indentation of 2 characters (column-enforce-n 80) + (dash-fontify-mode t) ;; Fontify dash variables (lispy-mode t) ;; Pseudomodal editing for lisp code (aggressive-indent-mode) ;; Indent lisp automatically