optimize package loading

This commit is contained in:
2022-12-18 19:32:54 +01:00
parent cbc480386c
commit 7b477d19fa
23 changed files with 3 additions and 42 deletions

View File

@@ -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))

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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)))

View File

@@ -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"))

View File

@@ -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'

View File

@@ -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

View File

@@ -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)

View File

@@ -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)

View File

@@ -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 ()
"."

View File

@@ -10,7 +10,6 @@
;;; Code:
(use-package gnuplot
:load-path (lambda() (concat config-dir "lisp/gnuplot"))
:commands gnuplot-mode
:mode "\\.gp\\'")

View File

@@ -2,7 +2,6 @@
;;; Commentary:
;;; Code:
(use-package polymode
:load-path (lambda() (concat config-dir "lisp/polymode"))
:commands poly-python-web-mode
:config

View File

@@ -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-?

View File

@@ -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)

View File

@@ -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)))

View File

@@ -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

View File

@@ -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")))

View File

@@ -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:

View File

@@ -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))

View File

@@ -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 <M-tab>
:config
;;(add-to-list 'company-backends 'company-web-html)