From 7b477d19fa8e61ac5cce38c8feebbd6dcdde17b4 Mon Sep 17 00:00:00 2001 From: Daniel Weschke Date: Sun, 18 Dec 2022 19:32:54 +0100 Subject: [PATCH] optimize package loading --- early-init.el | 3 ++- settings/bibliography-settings.el | 4 ---- settings/cedet-settings.el | 1 - settings/completion-settings.el | 3 --- settings/eaf-settings.el | 1 - settings/ess-settings.el | 1 - settings/filetype-settings.el | 2 -- settings/general-settings.el | 1 - settings/gui-settings.el | 2 -- settings/ledger-settings.el | 1 - settings/multiple-cursors-settings.el | 1 - settings/my-settings.el | 3 --- settings/org-settings.el | 5 +---- settings/plot-settings.el | 1 - settings/polymode-settings.el | 1 - settings/python-settings.el | 1 - settings/shell-settings.el | 1 - settings/spell-settings.el | 1 - settings/syntax-checking-settings.el | 1 - settings/theme-settings.el | 2 -- settings/treemacs-settings.el | 1 - settings/version-control-settings.el | 4 ---- settings/web-settings.el | 4 ---- 23 files changed, 3 insertions(+), 42 deletions(-) diff --git a/early-init.el b/early-init.el index 5ee1f131..dd30ecf3 100644 --- a/early-init.el +++ b/early-init.el @@ -26,7 +26,8 @@ ;; path where settings files are kept (add-to-list 'load-path (concat config-dir "settings")) ;; personal elisp lib dir, for manually installed packages -;; add all directories from config-dir into load-path +(add-to-list 'load-path (concat config-dir "lisp")) +;; add all directories from config-dir/lisp into load-path (let ((default-directory (concat config-dir "lisp"))) (normal-top-level-add-subdirs-to-load-path)) diff --git a/settings/bibliography-settings.el b/settings/bibliography-settings.el index 36dcc54b..a6ecef86 100644 --- a/settings/bibliography-settings.el +++ b/settings/bibliography-settings.el @@ -16,20 +16,16 @@ ;;; Code: (use-package pdf-tools - :load-path (lambda() (concat config-dir "lisp/pdf-tools")) :defer t) ;; used by org-ref (use-package biblio - :load-path (lambda() (concat config-dir "lisp/biblio")) :defer t) ;; used by org-ref (use-package citeproc - :load-path (lambda() (concat config-dir "lisp/citeproc")) :defer t) ;; used by org-ref ;; !in a org document run org-ref to test the installation (use-package org-ref ;; used with some preamble defs and \printbibliography (biblatex/biber, no html export), see also ox-bibtex - :load-path (lambda() (concat config-dir "lisp/org-ref")) :after (org) :defer 1 :init diff --git a/settings/cedet-settings.el b/settings/cedet-settings.el index 2422e908..45d4a633 100644 --- a/settings/cedet-settings.el +++ b/settings/cedet-settings.el @@ -51,7 +51,6 @@ (setq srecode-map-save-file (concat user-cache-directory "cedet/srecode-map.el"))) (use-package srefactor ;; https://melpa.org/#/srefactor - :load-path (lambda() (concat config-dir "lisp/srefactor")) :defer 2) ;; Loads after 2 seconds of idle time. (use-package srefactor-lisp diff --git a/settings/completion-settings.el b/settings/completion-settings.el index 885419c9..c2861ada 100644 --- a/settings/completion-settings.el +++ b/settings/completion-settings.el @@ -33,7 +33,6 @@ ;; in an ivy action minibuffer use M-o `ivy-dispatching-done' to see ;; valid actions. (use-package ivy - :load-path (lambda() (concat config-dir "lisp/ivy")) :delight (ivy-mode "Ivy") ;; \u24BE i :defer 0.1 ;; Ivy-based interface to standard commands @@ -125,7 +124,6 @@ of `menu-bar-final-items'." ;;(setq tab-always-indent 'complete) ;; use 'complete when auto-complete is disabled (use-package company - :load-path (lambda() (concat config-dir "lisp/company")) :delight (company-mode "Co") ;; \u24B8 c ;;:bind (("C-M-i" . company-complete)) :bind (([remap completion-at-point] . company-complete) @@ -234,7 +232,6 @@ Possible PACKAGE values are `company'." '(yas-popup-isearch-prompt yas-maybe-ido-prompt yas-completing-prompt yas-no-prompt))) (use-package yasnippet-snippets - :load-path (lambda() (concat config-dir "lisp/yasnippet-snippets")) :after (yasnippet) :defer 1) diff --git a/settings/eaf-settings.el b/settings/eaf-settings.el index 62026714..98053656 100644 --- a/settings/eaf-settings.el +++ b/settings/eaf-settings.el @@ -6,7 +6,6 @@ ;;; Code: (use-package eaf - :load-path (lambda() (concat config-dir "lisp/emacs-application-framework")) ;;:after (org) ;; eaf requires eaf-interleave requires org ;;:defer 2 :commands (eaf-create-minmap diff --git a/settings/ess-settings.el b/settings/ess-settings.el index c7721ed5..95f80e69 100644 --- a/settings/ess-settings.el +++ b/settings/ess-settings.el @@ -18,7 +18,6 @@ ;;; Code: (use-package ess-site ;; all ESS features - :load-path (lambda() (concat config-dir "lisp/ess")) :commands ess-r-mode) ;; only R related features (use-package ess-R-data-view diff --git a/settings/filetype-settings.el b/settings/filetype-settings.el index 1887608b..78bb37ef 100644 --- a/settings/filetype-settings.el +++ b/settings/filetype-settings.el @@ -15,11 +15,9 @@ :mode "\\.md\\'") (use-package sql-indent - :load-path (lambda() (concat config-dir "lisp/sql-indent")) :commands sqlind-minor-mode) (use-package systemd - :load-path (lambda() (concat config-dir "lisp/systemd")) :commands systemd-mode :mode (("\\.service\\'" . systemd-mode) ("\\.mount\\'" . systemd-mode))) diff --git a/settings/general-settings.el b/settings/general-settings.el index d8b27ca3..3bcfc2fb 100644 --- a/settings/general-settings.el +++ b/settings/general-settings.el @@ -296,7 +296,6 @@ Version 2016-07-13" (setq bookmark-default-file (concat user-cache-directory "bookmarks")) (use-package transient - :load-path (lambda() (concat config-dir "lisp/transient")) :defer t :config (setq transient-levels-file (concat user-cache-directory "transient/levels.el")) diff --git a/settings/gui-settings.el b/settings/gui-settings.el index c1b464f7..97cd1291 100644 --- a/settings/gui-settings.el +++ b/settings/gui-settings.el @@ -180,7 +180,6 @@ DISPLAY-START: `integer', e.g. 3820" :defer t) (use-package all-the-icons - :load-path (lambda() (concat config-dir "lisp/all-the-icons")) :defer t :config (when (and (not (my-font-installed-p "all-the-icons")) @@ -190,7 +189,6 @@ DISPLAY-START: `integer', e.g. 3820" )) (use-package dashboard - :load-path (lambda() (concat config-dir "lisp/dashboard")) :delight (dashboard-mode "Db") ;; "\u01F153 :config (require 'linum) ;; TODO: (delete after dashboard fixed it) bc/ dashboard.el sets (linum-mode -1) in `dashboard-mode' diff --git a/settings/ledger-settings.el b/settings/ledger-settings.el index 093a94ae..ce339d9c 100644 --- a/settings/ledger-settings.el +++ b/settings/ledger-settings.el @@ -14,7 +14,6 @@ ;;; Code: (use-package ledger-mode - :load-path (lambda() (concat config-dir "lisp/ledger-mode")) :delight (ledger-mode "Le") ; "Le " "\u01F15B\uFF44" (ledger-report-mode "Ler") ; "LeR \u01F156\u24AD" "\01F15B diff --git a/settings/multiple-cursors-settings.el b/settings/multiple-cursors-settings.el index c1efce58..dd56bc86 100644 --- a/settings/multiple-cursors-settings.el +++ b/settings/multiple-cursors-settings.el @@ -7,7 +7,6 @@ ;;; Code: (use-package multiple-cursors - :load-path (lambda() (concat config-dir "lisp/multiple-cursors")) :bind (;; see kbd prefix description in which-key-settings ("M-m s m a" . mc/mark-all-dwim) ("M-m s m b" . mc/mark-all-like-this) diff --git a/settings/my-settings.el b/settings/my-settings.el index e0700ee8..eaf23852 100644 --- a/settings/my-settings.el +++ b/settings/my-settings.el @@ -2,14 +2,12 @@ ;;; Commentary: ;;; Code: (use-package my - :load-path (lambda() (concat config-dir "lisp/my")) :config (with-eval-after-load 'org (add-hook 'org-mode-hook 'my-org-link-color-hook) (add-hook 'org-ctrl-c-ctrl-c-hook 'my-org-table-cell-color-attr))) (use-package my-org-article - :load-path (lambda() (concat config-dir "lisp/my")) :after (org) :config ;; HTML @@ -92,7 +90,6 @@ gnuplot buffer. See also async init file ) (use-package my-org-letter - :load-path (lambda() (concat config-dir "lisp/my")) :after (org)) (provide 'my-settings) diff --git a/settings/org-settings.el b/settings/org-settings.el index ef7161e7..2c353edb 100644 --- a/settings/org-settings.el +++ b/settings/org-settings.el @@ -246,7 +246,6 @@ Example defines ;; be loaded before, otherwise both versions will be loaded and will ;; conflict. (use-package org - :load-path (lambda () (list (concat config-dir "lisp/org"))) :delight (org-mode "Org") ;; "Org " "\u01F15E" :defer t :after (ob-csharp) @@ -321,8 +320,7 @@ Example defines (setq org-src-preserve-indentation t)) (use-package org-contrib - :after (org) - :load-path (lambda () (list (concat config-dir "lisp/org-contrib")))) + :after (org)) ;;; org-contrib libs @@ -424,7 +422,6 @@ Suggest the URL title as a description for resource." (use-package org-cliplink :after (org) - :load-path (lambda() (concat config-dir "lisp/org-cliplink")) :config (defun my-org-link-description-update () "." diff --git a/settings/plot-settings.el b/settings/plot-settings.el index ac81d153..4babb06e 100644 --- a/settings/plot-settings.el +++ b/settings/plot-settings.el @@ -10,7 +10,6 @@ ;;; Code: (use-package gnuplot - :load-path (lambda() (concat config-dir "lisp/gnuplot")) :commands gnuplot-mode :mode "\\.gp\\'") diff --git a/settings/polymode-settings.el b/settings/polymode-settings.el index 83afd43a..ff8a12f5 100644 --- a/settings/polymode-settings.el +++ b/settings/polymode-settings.el @@ -2,7 +2,6 @@ ;;; Commentary: ;;; Code: (use-package polymode - :load-path (lambda() (concat config-dir "lisp/polymode")) :commands poly-python-web-mode :config diff --git a/settings/python-settings.el b/settings/python-settings.el index e3364bf8..dfe88953 100644 --- a/settings/python-settings.el +++ b/settings/python-settings.el @@ -98,7 +98,6 @@ process." ;; needs system package python-jedi (use-package anaconda-mode ;; works with company-mode via company-anaconda - :load-path (lambda() (concat config-dir "lisp/anaconda-mode")) :after python :delight (anaconda-mode "A") ;; \u24B6 a :bind (([remap anaconda-mode-show-doc] . my-anaconda-mode-show-doc)) ;; M-? diff --git a/settings/shell-settings.el b/settings/shell-settings.el index b43e2e49..2489ae8d 100644 --- a/settings/shell-settings.el +++ b/settings/shell-settings.el @@ -20,7 +20,6 @@ (setq eshell-directory-name (concat user-cache-directory "eshell/"))) (use-package vterm - :load-path (lambda () (list (concat config-dir "lisp/vterm"))) :commands (vterm)) (provide 'shell-settings) diff --git a/settings/spell-settings.el b/settings/spell-settings.el index 872adb97..2ca2153c 100644 --- a/settings/spell-settings.el +++ b/settings/spell-settings.el @@ -12,7 +12,6 @@ ;;; Code: (use-package flyspell-correct - :load-path (lambda() (concat config-dir "lisp/flyspell-correct")) :after flyspell :bind (:map flyspell-mode-map ("C-;" . flyspell-correct-wrapper))) diff --git a/settings/syntax-checking-settings.el b/settings/syntax-checking-settings.el index fd91fcef..ef451a9d 100644 --- a/settings/syntax-checking-settings.el +++ b/settings/syntax-checking-settings.el @@ -20,7 +20,6 @@ ;; for a short while. Therefore better defer loading. ;;(require 'flycheck (concat config-dir "lisp/flycheck/flycheck.el")) (use-package flycheck - :load-path (lambda() (concat config-dir "lisp/flycheck")) :defer 2 :init (setq flycheck-mode-line-prefix "F") ;; \u24BB \u01D4D5 \u2708 f ;; other flycheck settings see syntax-checking-settings.el diff --git a/settings/theme-settings.el b/settings/theme-settings.el index c4fc89de..4239964d 100644 --- a/settings/theme-settings.el +++ b/settings/theme-settings.el @@ -12,7 +12,6 @@ ;;; Code: (use-package spacemacs-common :after (cl-lib) ;; spacemacs-common misses to load cl-lib - :load-path (lambda() (concat config-dir "lisp/spacemacs-theme")) :config (load-theme 'spacemacs-dark t)) @@ -55,7 +54,6 @@ (use-package emojify :if window-system :commands emojify-mode - :load-path (lambda() (concat config-dir "lisp/emojify")) :hook (after-init . global-emojify-mode) :init (setq emojify-emojis-dir (concat user-emacs-directory ".cache/emojify"))) diff --git a/settings/treemacs-settings.el b/settings/treemacs-settings.el index 6b0141d3..2522ac60 100644 --- a/settings/treemacs-settings.el +++ b/settings/treemacs-settings.el @@ -11,7 +11,6 @@ ;; hydra.el https://elpa.gnu.org/packages/hydra.html ;; treemacs-magit ;; http://melpa.org/#/treemacs-magit (use-package treemacs - :load-path (lambda() (concat config-dir "lisp/treemacs")) :commands treemacs :init ;; get rid of the message: diff --git a/settings/version-control-settings.el b/settings/version-control-settings.el index 804b9607..1a3d2b85 100644 --- a/settings/version-control-settings.el +++ b/settings/version-control-settings.el @@ -23,11 +23,9 @@ ;; required by magit (use-package git-commit - :load-path (lambda() (concat config-dir "lisp/git-commit")) :defer t) (use-package magit - :load-path (lambda() (concat config-dir "lisp/magit")) :bind (("C-c M-g" . magit-file-dispatch)) :config ;; (setq magit-completing-read-function 'magit-builtin-completing-read) ;; if ivy-mode is on then it uses it otherwise set to 'ivy-completing-read @@ -41,7 +39,6 @@ (define-key magit-mode-map [left-fringe mouse-1] 'my-magit-fringe-click)) (use-package magit-section - :load-path (lambda() (concat config-dir "lisp/magit-section")) :defer t) ;; On Windows, we must use Git GUI to enter username and password @@ -61,7 +58,6 @@ ;; show diffs in fringes (use-package diff-hl - :load-path (lambda() (concat config-dir "lisp/diff-hl")) :hook (((prog-mode vc-dir-mode org-mode) . turn-on-diff-hl-mode) (magit-pre-refresh . diff-hl-magit-pre-refresh) (magit-post-refresh . diff-hl-magit-post-refresh)) diff --git a/settings/web-settings.el b/settings/web-settings.el index 95778127..322454d8 100644 --- a/settings/web-settings.el +++ b/settings/web-settings.el @@ -18,23 +18,19 @@ (setq css-indent-offset 2)) (use-package js2-mode - :load-path (lambda() (concat config-dir "lisp/js2-mode")) :commands js2-mode) (use-package php-mode - :load-path (lambda() (concat config-dir "lisp/php-mode")) :commands php-mode) (use-package web-mode :commands (web-mode)) (use-package web-completion-data - :load-path (lambda() (concat config-dir "lisp/web-completion-data")) :defer t) (use-package company-web-html :after (web-mode company) - :load-path (lambda() (concat config-dir "lisp/company-web")) :bind (([remap complete-symbol] . company-complete)) ;; M-C-i and :config ;;(add-to-list 'company-backends 'company-web-html)