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 ;; path where settings files are kept
(add-to-list 'load-path (concat config-dir "settings")) (add-to-list 'load-path (concat config-dir "settings"))
;; personal elisp lib dir, for manually installed packages ;; 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"))) (let ((default-directory (concat config-dir "lisp")))
(normal-top-level-add-subdirs-to-load-path)) (normal-top-level-add-subdirs-to-load-path))

View File

@@ -16,20 +16,16 @@
;;; Code: ;;; Code:
(use-package pdf-tools (use-package pdf-tools
:load-path (lambda() (concat config-dir "lisp/pdf-tools"))
:defer t) ;; used by org-ref :defer t) ;; used by org-ref
(use-package biblio (use-package biblio
:load-path (lambda() (concat config-dir "lisp/biblio"))
:defer t) ;; used by org-ref :defer t) ;; used by org-ref
(use-package citeproc (use-package citeproc
:load-path (lambda() (concat config-dir "lisp/citeproc"))
:defer t) ;; used by org-ref :defer t) ;; used by org-ref
;; !in a org document run org-ref to test the installation ;; !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 (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) :after (org)
:defer 1 :defer 1
:init :init

View File

@@ -51,7 +51,6 @@
(setq srecode-map-save-file (concat user-cache-directory "cedet/srecode-map.el"))) (setq srecode-map-save-file (concat user-cache-directory "cedet/srecode-map.el")))
(use-package srefactor ;; https://melpa.org/#/srefactor (use-package srefactor ;; https://melpa.org/#/srefactor
:load-path (lambda() (concat config-dir "lisp/srefactor"))
:defer 2) ;; Loads after 2 seconds of idle time. :defer 2) ;; Loads after 2 seconds of idle time.
(use-package srefactor-lisp (use-package srefactor-lisp

View File

@@ -33,7 +33,6 @@
;; in an ivy action minibuffer use M-o `ivy-dispatching-done' to see ;; in an ivy action minibuffer use M-o `ivy-dispatching-done' to see
;; valid actions. ;; valid actions.
(use-package ivy (use-package ivy
:load-path (lambda() (concat config-dir "lisp/ivy"))
:delight (ivy-mode "Ivy") ;; \u24BE i :delight (ivy-mode "Ivy") ;; \u24BE i
:defer 0.1 :defer 0.1
;; Ivy-based interface to standard commands ;; 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 ;;(setq tab-always-indent 'complete) ;; use 'complete when auto-complete is disabled
(use-package company (use-package company
:load-path (lambda() (concat config-dir "lisp/company"))
:delight (company-mode "Co") ;; \u24B8 c :delight (company-mode "Co") ;; \u24B8 c
;;:bind (("C-M-i" . company-complete)) ;;:bind (("C-M-i" . company-complete))
:bind (([remap completion-at-point] . 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))) '(yas-popup-isearch-prompt yas-maybe-ido-prompt yas-completing-prompt yas-no-prompt)))
(use-package yasnippet-snippets (use-package yasnippet-snippets
:load-path (lambda() (concat config-dir "lisp/yasnippet-snippets"))
:after (yasnippet) :after (yasnippet)
:defer 1) :defer 1)

View File

@@ -6,7 +6,6 @@
;;; Code: ;;; Code:
(use-package eaf (use-package eaf
:load-path (lambda() (concat config-dir "lisp/emacs-application-framework"))
;;:after (org) ;; eaf requires eaf-interleave requires org ;;:after (org) ;; eaf requires eaf-interleave requires org
;;:defer 2 ;;:defer 2
:commands (eaf-create-minmap :commands (eaf-create-minmap

View File

@@ -18,7 +18,6 @@
;;; Code: ;;; Code:
(use-package ess-site ;; all ESS features (use-package ess-site ;; all ESS features
:load-path (lambda() (concat config-dir "lisp/ess"))
:commands ess-r-mode) ;; only R related features :commands ess-r-mode) ;; only R related features
(use-package ess-R-data-view (use-package ess-R-data-view

View File

@@ -15,11 +15,9 @@
:mode "\\.md\\'") :mode "\\.md\\'")
(use-package sql-indent (use-package sql-indent
:load-path (lambda() (concat config-dir "lisp/sql-indent"))
:commands sqlind-minor-mode) :commands sqlind-minor-mode)
(use-package systemd (use-package systemd
:load-path (lambda() (concat config-dir "lisp/systemd"))
:commands systemd-mode :commands systemd-mode
:mode (("\\.service\\'" . systemd-mode) ("\\.mount\\'" . 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")) (setq bookmark-default-file (concat user-cache-directory "bookmarks"))
(use-package transient (use-package transient
:load-path (lambda() (concat config-dir "lisp/transient"))
:defer t :defer t
:config :config
(setq transient-levels-file (concat user-cache-directory "transient/levels.el")) (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) :defer t)
(use-package all-the-icons (use-package all-the-icons
:load-path (lambda() (concat config-dir "lisp/all-the-icons"))
:defer t :defer t
:config :config
(when (and (not (my-font-installed-p "all-the-icons")) (when (and (not (my-font-installed-p "all-the-icons"))
@@ -190,7 +189,6 @@ DISPLAY-START: `integer', e.g. 3820"
)) ))
(use-package dashboard (use-package dashboard
:load-path (lambda() (concat config-dir "lisp/dashboard"))
:delight (dashboard-mode "Db") ;; "\u01F153 :delight (dashboard-mode "Db") ;; "\u01F153
:config :config
(require 'linum) ;; TODO: (delete after dashboard fixed it) bc/ dashboard.el sets (linum-mode -1) in `dashboard-mode' (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: ;;; Code:
(use-package ledger-mode (use-package ledger-mode
:load-path (lambda() (concat config-dir "lisp/ledger-mode"))
:delight :delight
(ledger-mode "Le") ; "Le " "\u01F15B\uFF44" (ledger-mode "Le") ; "Le " "\u01F15B\uFF44"
(ledger-report-mode "Ler") ; "LeR \u01F156\u24AD" "\01F15B (ledger-report-mode "Ler") ; "LeR \u01F156\u24AD" "\01F15B

View File

@@ -7,7 +7,6 @@
;;; Code: ;;; Code:
(use-package multiple-cursors (use-package multiple-cursors
:load-path (lambda() (concat config-dir "lisp/multiple-cursors"))
:bind (;; see kbd prefix description in which-key-settings :bind (;; see kbd prefix description in which-key-settings
("M-m s m a" . mc/mark-all-dwim) ("M-m s m a" . mc/mark-all-dwim)
("M-m s m b" . mc/mark-all-like-this) ("M-m s m b" . mc/mark-all-like-this)

View File

@@ -2,14 +2,12 @@
;;; Commentary: ;;; Commentary:
;;; Code: ;;; Code:
(use-package my (use-package my
:load-path (lambda() (concat config-dir "lisp/my"))
:config :config
(with-eval-after-load 'org (with-eval-after-load 'org
(add-hook 'org-mode-hook 'my-org-link-color-hook) (add-hook 'org-mode-hook 'my-org-link-color-hook)
(add-hook 'org-ctrl-c-ctrl-c-hook 'my-org-table-cell-color-attr))) (add-hook 'org-ctrl-c-ctrl-c-hook 'my-org-table-cell-color-attr)))
(use-package my-org-article (use-package my-org-article
:load-path (lambda() (concat config-dir "lisp/my"))
:after (org) :after (org)
:config :config
;; HTML ;; HTML
@@ -92,7 +90,6 @@ gnuplot buffer. See also async init file
) )
(use-package my-org-letter (use-package my-org-letter
:load-path (lambda() (concat config-dir "lisp/my"))
:after (org)) :after (org))
(provide 'my-settings) (provide 'my-settings)

View File

@@ -246,7 +246,6 @@ Example defines
;; be loaded before, otherwise both versions will be loaded and will ;; be loaded before, otherwise both versions will be loaded and will
;; conflict. ;; conflict.
(use-package org (use-package org
:load-path (lambda () (list (concat config-dir "lisp/org")))
:delight (org-mode "Org") ;; "Org " "\u01F15E" :delight (org-mode "Org") ;; "Org " "\u01F15E"
:defer t :defer t
:after (ob-csharp) :after (ob-csharp)
@@ -321,8 +320,7 @@ Example defines
(setq org-src-preserve-indentation t)) (setq org-src-preserve-indentation t))
(use-package org-contrib (use-package org-contrib
:after (org) :after (org))
:load-path (lambda () (list (concat config-dir "lisp/org-contrib"))))
;;; org-contrib libs ;;; org-contrib libs
@@ -424,7 +422,6 @@ Suggest the URL title as a description for resource."
(use-package org-cliplink (use-package org-cliplink
:after (org) :after (org)
:load-path (lambda() (concat config-dir "lisp/org-cliplink"))
:config :config
(defun my-org-link-description-update () (defun my-org-link-description-update ()
"." "."

View File

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

View File

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

View File

@@ -98,7 +98,6 @@ process."
;; needs system package python-jedi ;; needs system package python-jedi
(use-package anaconda-mode ;; works with company-mode via company-anaconda (use-package anaconda-mode ;; works with company-mode via company-anaconda
:load-path (lambda() (concat config-dir "lisp/anaconda-mode"))
:after python :after python
:delight (anaconda-mode "A") ;; \u24B6 a :delight (anaconda-mode "A") ;; \u24B6 a
:bind (([remap anaconda-mode-show-doc] . my-anaconda-mode-show-doc)) ;; M-? :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/"))) (setq eshell-directory-name (concat user-cache-directory "eshell/")))
(use-package vterm (use-package vterm
:load-path (lambda () (list (concat config-dir "lisp/vterm")))
:commands (vterm)) :commands (vterm))
(provide 'shell-settings) (provide 'shell-settings)

View File

@@ -12,7 +12,6 @@
;;; Code: ;;; Code:
(use-package flyspell-correct (use-package flyspell-correct
:load-path (lambda() (concat config-dir "lisp/flyspell-correct"))
:after flyspell :after flyspell
:bind (:map flyspell-mode-map ("C-;" . flyspell-correct-wrapper))) :bind (:map flyspell-mode-map ("C-;" . flyspell-correct-wrapper)))

View File

@@ -20,7 +20,6 @@
;; for a short while. Therefore better defer loading. ;; for a short while. Therefore better defer loading.
;;(require 'flycheck (concat config-dir "lisp/flycheck/flycheck.el")) ;;(require 'flycheck (concat config-dir "lisp/flycheck/flycheck.el"))
(use-package flycheck (use-package flycheck
:load-path (lambda() (concat config-dir "lisp/flycheck"))
:defer 2 :defer 2
:init :init
(setq flycheck-mode-line-prefix "F") ;; \u24BB \u01D4D5 \u2708 f ;; other flycheck settings see syntax-checking-settings.el (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: ;;; Code:
(use-package spacemacs-common (use-package spacemacs-common
:after (cl-lib) ;; spacemacs-common misses to load cl-lib :after (cl-lib) ;; spacemacs-common misses to load cl-lib
:load-path (lambda() (concat config-dir "lisp/spacemacs-theme"))
:config :config
(load-theme 'spacemacs-dark t)) (load-theme 'spacemacs-dark t))
@@ -55,7 +54,6 @@
(use-package emojify (use-package emojify
:if window-system :if window-system
:commands emojify-mode :commands emojify-mode
:load-path (lambda() (concat config-dir "lisp/emojify"))
:hook (after-init . global-emojify-mode) :hook (after-init . global-emojify-mode)
:init :init
(setq emojify-emojis-dir (concat user-emacs-directory ".cache/emojify"))) (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 ;; hydra.el https://elpa.gnu.org/packages/hydra.html
;; treemacs-magit ;; http://melpa.org/#/treemacs-magit ;; treemacs-magit ;; http://melpa.org/#/treemacs-magit
(use-package treemacs (use-package treemacs
:load-path (lambda() (concat config-dir "lisp/treemacs"))
:commands treemacs :commands treemacs
:init :init
;; get rid of the message: ;; get rid of the message:

View File

@@ -23,11 +23,9 @@
;; required by magit ;; required by magit
(use-package git-commit (use-package git-commit
:load-path (lambda() (concat config-dir "lisp/git-commit"))
:defer t) :defer t)
(use-package magit (use-package magit
:load-path (lambda() (concat config-dir "lisp/magit"))
:bind (("C-c M-g" . magit-file-dispatch)) :bind (("C-c M-g" . magit-file-dispatch))
:config :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 ;; (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)) (define-key magit-mode-map [left-fringe mouse-1] 'my-magit-fringe-click))
(use-package magit-section (use-package magit-section
:load-path (lambda() (concat config-dir "lisp/magit-section"))
:defer t) :defer t)
;; On Windows, we must use Git GUI to enter username and password ;; On Windows, we must use Git GUI to enter username and password
@@ -61,7 +58,6 @@
;; show diffs in fringes ;; show diffs in fringes
(use-package diff-hl (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) :hook (((prog-mode vc-dir-mode org-mode) . turn-on-diff-hl-mode)
(magit-pre-refresh . diff-hl-magit-pre-refresh) (magit-pre-refresh . diff-hl-magit-pre-refresh)
(magit-post-refresh . diff-hl-magit-post-refresh)) (magit-post-refresh . diff-hl-magit-post-refresh))

View File

@@ -18,23 +18,19 @@
(setq css-indent-offset 2)) (setq css-indent-offset 2))
(use-package js2-mode (use-package js2-mode
:load-path (lambda() (concat config-dir "lisp/js2-mode"))
:commands js2-mode) :commands js2-mode)
(use-package php-mode (use-package php-mode
:load-path (lambda() (concat config-dir "lisp/php-mode"))
:commands php-mode) :commands php-mode)
(use-package web-mode (use-package web-mode
:commands (web-mode)) :commands (web-mode))
(use-package web-completion-data (use-package web-completion-data
:load-path (lambda() (concat config-dir "lisp/web-completion-data"))
:defer t) :defer t)
(use-package company-web-html (use-package company-web-html
:after (web-mode company) :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> :bind (([remap complete-symbol] . company-complete)) ;; M-C-i and <M-tab>
:config :config
;;(add-to-list 'company-backends 'company-web-html) ;;(add-to-list 'company-backends 'company-web-html)