Fix bootstrap issues to decrease startup time
Emacs is loading normally with a collection of minor issues resolved. The biggest issue was a queuing of a lot of packages that only started loading once Emacs was finished with the boostrap. Removing this queue is saving a significant amount of start time.
This commit is contained in:
parent
22f44e8b9f
commit
f82229fdd0
9 changed files with 69 additions and 43 deletions
|
|
@ -126,6 +126,12 @@ Manipulate file paths with the [[https://github.com/rejeep/f.el][f.el]] project:
|
||||||
(use-package f)
|
(use-package f)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
The [[https://github.com/noctuid/general.el][general.el]] project supplies the =:general= keyword that many of my =use-package= declarations use, so the /library/ has to be loaded before any other file is *read*. See [[file:ha-general.org][ha-general]] for the complete definition before I convert to =ha-leader.org= for a more general solution:
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package general :demand t)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
The [[help:shell-command][shell-command]] function is useful, but having it split the output into a list is a helpful abstraction:
|
The [[help:shell-command][shell-command]] function is useful, but having it split the output into a list is a helpful abstraction:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(defun shell-command-to-list (command)
|
(defun shell-command-to-list (command)
|
||||||
|
|
@ -191,13 +197,13 @@ The following /defines/ the rest of my org-mode literate files, that I load late
|
||||||
(defvar ha-hamacs-files (flatten-list
|
(defvar ha-hamacs-files (flatten-list
|
||||||
`("ha-private.org"
|
`("ha-private.org"
|
||||||
,(when (display-graphic-p)
|
,(when (display-graphic-p)
|
||||||
"ha-theme.org"
|
|
||||||
"ha-display.org")
|
"ha-display.org")
|
||||||
"ha-config.org"
|
"ha-evil.org"
|
||||||
;; We need to replace ha-general (loaded in config) with:
|
;; We need to replace ha-general (loaded in config) with:
|
||||||
;; "ha-leader.org"
|
;; "ha-leader.org"
|
||||||
"ha-evil.org"
|
"ha-general.org"
|
||||||
;; "ha-meow.org"
|
;; "ha-meow.org"
|
||||||
|
"ha-config.org"
|
||||||
"ha-applications.org"
|
"ha-applications.org"
|
||||||
"ha-org.org"
|
"ha-org.org"
|
||||||
,(when (display-graphic-p)
|
,(when (display-graphic-p)
|
||||||
|
|
@ -252,7 +258,7 @@ With this function, we can test/debug/reload any individual file, via:
|
||||||
(ha-hamacs-files :all))))
|
(ha-hamacs-files :all))))
|
||||||
(let ((full-file (expand-file-name file hamacs-source-dir)))
|
(let ((full-file (expand-file-name file hamacs-source-dir)))
|
||||||
(when (file-exists-p full-file)
|
(when (file-exists-p full-file)
|
||||||
(message ">>> %s" full-file)
|
;; (message ">>> %s" full-file)
|
||||||
(if (called-interactively-p)
|
(if (called-interactively-p)
|
||||||
(org-babel-load-file full-file)
|
(org-babel-load-file full-file)
|
||||||
(ignore-errors (org-babel-load-file full-file))))))
|
(ignore-errors (org-babel-load-file full-file))))))
|
||||||
|
|
|
||||||
|
|
@ -524,7 +524,6 @@ Make sure this works:
|
||||||
:host "api.github.com"
|
:host "api.github.com"
|
||||||
:username "howardabrams"
|
:username "howardabrams"
|
||||||
:auth 'forge)
|
:auth 'forge)
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Magit Github
|
** Magit Github
|
||||||
|
|
@ -1055,7 +1054,7 @@ The [[Evil Collection][evil-collection]] package adds the following keybindings:
|
||||||
- ~o~ :: Table of contents (if available)
|
- ~o~ :: Table of contents (if available)
|
||||||
|
|
||||||
I’d like write notes in org files that link to the PDFs (and maybe visa versa), using the [[https://github.com/weirdNox/org-noter][org-noter]] package:
|
I’d like write notes in org files that link to the PDFs (and maybe visa versa), using the [[https://github.com/weirdNox/org-noter][org-noter]] package:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp :tangle no
|
||||||
(use-package org-noter
|
(use-package org-noter
|
||||||
:config
|
:config
|
||||||
(major-mode-hydra-define org-noter-doc-mode-map nil
|
(major-mode-hydra-define org-noter-doc-mode-map nil
|
||||||
|
|
|
||||||
|
|
@ -272,7 +272,7 @@ Once inside a source file, we can jump to one of these /relative locations/:
|
||||||
|
|
||||||
To verify that this works:
|
To verify that this works:
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp :tangle no
|
||||||
(seq-let (file heading offset) (ha-code-notes-location)
|
(seq-let (file heading offset) (ha-code-notes-location)
|
||||||
(ha-code-notes-location-goto file heading offset))
|
(ha-code-notes-location-goto file heading offset))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
|
||||||
|
|
@ -438,12 +438,6 @@ The [[https://gitlab.com/ideasman42/emacs-undo-fu][undo-fu]] isn’t much to the
|
||||||
While I generally use ~C-/~ for [[help:undo][undo]] (and ~C-?~ for [[help:undo-redo][redo]]), when I’m on the Mac, I need to cover my bases.
|
While I generally use ~C-/~ for [[help:undo][undo]] (and ~C-?~ for [[help:undo-redo][redo]]), when I’m on the Mac, I need to cover my bases.
|
||||||
|
|
||||||
** Leader Sequences
|
** Leader Sequences
|
||||||
Pressing the ~SPACE~ can activate a /leader key sequence/ I define in my [[file:ha-leader.org][ha-leader]] file.
|
|
||||||
#+begin_src emacs-lisp
|
|
||||||
(ha-hamacs-load "ha-general.org")
|
|
||||||
#+end_src
|
|
||||||
This extends the =use-package= to include a =:general= keybinding section.
|
|
||||||
|
|
||||||
Since I seldom remember keybindings, or even function names, for major-modes, I pull them all together into a nice table using Jerry Peng’s [[https://github.com/jerrypnz/major-mode-hydrajjj0.el][Major Mode Hydra]] project:
|
Since I seldom remember keybindings, or even function names, for major-modes, I pull them all together into a nice table using Jerry Peng’s [[https://github.com/jerrypnz/major-mode-hydrajjj0.el][Major Mode Hydra]] project:
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@ I found that the prolific [[https://protesilaos.com/][Protesilaos Stavrou]] [[ht
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package pulsar
|
(use-package pulsar
|
||||||
:after winum ace-window
|
:after (winum ace-window)
|
||||||
:custom
|
:custom
|
||||||
(pulsar-face 'pulsar-generic)
|
(pulsar-face 'pulsar-generic)
|
||||||
(pulsar-delay 0.15)
|
(pulsar-delay 0.15)
|
||||||
|
|
|
||||||
14
ha-evil.org
14
ha-evil.org
|
|
@ -211,19 +211,22 @@ To remedy this, I’m using the [[https://www.emacswiki.org/emacs/KeyChord][KeyC
|
||||||
** Evil Text Object Line
|
** Evil Text Object Line
|
||||||
Delete a line, ~d d~ is in basic VI. Since some commands use text objects, and the basic text object doesn’t include lines, the [[https://github.com/emacsorphanage/evil-textobj-line][evil-textobj-line]] project adds that:
|
Delete a line, ~d d~ is in basic VI. Since some commands use text objects, and the basic text object doesn’t include lines, the [[https://github.com/emacsorphanage/evil-textobj-line][evil-textobj-line]] project adds that:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package evil-textobj-line)
|
(use-package evil-textobj-line
|
||||||
|
:after evil)
|
||||||
#+end_src
|
#+end_src
|
||||||
Now ~v i l~ selects the line without initial/trailing whitespace, and ~v a l~ selects the line with spaces, and ~S-v~ selects the line with the final carriage return. Is this much of an improvement? Well, wrapping a line in parenthesis, is just ~y s i l )~
|
Now ~v i l~ selects the line without initial/trailing whitespace, and ~v a l~ selects the line with spaces, and ~S-v~ selects the line with the final carriage return. Is this much of an improvement? Well, wrapping a line in parenthesis, is just ~y s i l )~
|
||||||
** Text Objects based on Indentation
|
** Text Objects based on Indentation
|
||||||
The [[https://github.com/TheBB/evil-indent-plus][evil-indent-plus]] project creates text objects based on the indentation level, similar to how the ~b~ works with “blocks” of code.
|
The [[https://github.com/TheBB/evil-indent-plus][evil-indent-plus]] project creates text objects based on the indentation level, similar to how the ~b~ works with “blocks” of code.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package evil-indent-plus)
|
(use-package evil-indent-plus
|
||||||
|
:after evil)
|
||||||
#+end_src
|
#+end_src
|
||||||
This can be handy for Python, YAML, and lists in org files. Note that ~i~ works for the current indent, but ~k~ includes one line above and ~j~ includes one line above and below.
|
This can be handy for Python, YAML, and lists in org files. Note that ~i~ works for the current indent, but ~k~ includes one line above and ~j~ includes one line above and below.
|
||||||
** Arguments as Text Objects
|
** Arguments as Text Objects
|
||||||
The [[https://github.com/wcsmith/evil-args][evil-args]] projects creates text objects for symbols, but with trailing ~,~ or other syntax.
|
The [[https://github.com/wcsmith/evil-args][evil-args]] projects creates text objects for symbols, but with trailing ~,~ or other syntax.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package evil-args
|
(use-package evil-args
|
||||||
|
:after evil
|
||||||
:config
|
:config
|
||||||
;; bind evil-args text objects
|
;; bind evil-args text objects
|
||||||
(define-key evil-inner-text-objects-map "a" 'evil-inner-arg)
|
(define-key evil-inner-text-objects-map "a" 'evil-inner-arg)
|
||||||
|
|
@ -369,6 +372,7 @@ I often use the Emacs commands, ~M-t~ and whatnot to exchange words and whatnot,
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package evil-exchange
|
(use-package evil-exchange
|
||||||
|
:after (evil general)
|
||||||
:init
|
:init
|
||||||
(setq evil-exchange-key (kbd "gx")
|
(setq evil-exchange-key (kbd "gx")
|
||||||
evil-exchange-cancel-key (kbd "gX"))
|
evil-exchange-cancel-key (kbd "gX"))
|
||||||
|
|
@ -406,7 +410,7 @@ The [[https://github.com/edkolev/evil-lion][evil-lion]] package is a wrapper aro
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package evil-lion
|
(use-package evil-lion
|
||||||
:after evil
|
:after (evil general)
|
||||||
:general
|
:general
|
||||||
(:states '(normal visual)
|
(:states '(normal visual)
|
||||||
"g a" '("lion ←" . evil-lion-left)
|
"g a" '("lion ←" . evil-lion-left)
|
||||||
|
|
@ -443,6 +447,7 @@ The [[https://github.com/linktohack/evil-commentary][evil-commentary]] is a VI-l
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package evil-commentary
|
(use-package evil-commentary
|
||||||
|
:after (evil general)
|
||||||
:config (evil-commentary-mode)
|
:config (evil-commentary-mode)
|
||||||
|
|
||||||
:general
|
:general
|
||||||
|
|
@ -470,7 +475,7 @@ Not sure what is in a register? Have it show you when you hit ~”~ or ~@~ with
|
||||||
(use-package posframe)
|
(use-package posframe)
|
||||||
|
|
||||||
(use-package evil-owl
|
(use-package evil-owl
|
||||||
:after posframe
|
:after evil posframe
|
||||||
:config
|
:config
|
||||||
(setq evil-owl-display-method 'posframe
|
(setq evil-owl-display-method 'posframe
|
||||||
evil-owl-extra-posframe-args
|
evil-owl-extra-posframe-args
|
||||||
|
|
@ -515,6 +520,7 @@ The [[https//github.com/gilbertw1/better-jumper][better-jumper project]] replace
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package better-jumper
|
(use-package better-jumper
|
||||||
|
:after evil
|
||||||
:config
|
:config
|
||||||
(better-jumper-mode +1)
|
(better-jumper-mode +1)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,8 @@ And hook this function to Org:
|
||||||
The list of things to try:
|
The list of things to try:
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq org-hide-leading-stars t) ; or t
|
(setq org-hide-leading-stars t)
|
||||||
|
(org-indent-mode -1)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Markup View
|
** Markup View
|
||||||
|
|
|
||||||
32
ha-org.org
32
ha-org.org
|
|
@ -3,7 +3,7 @@
|
||||||
#+date: 2020-09-18
|
#+date: 2020-09-18
|
||||||
#+tags: emacs org
|
#+tags: emacs org
|
||||||
#+startup: inlineimages
|
#+startup: inlineimages
|
||||||
#+lastmod: [2026-10-20 Tue]
|
#+lastmod: [2026-10-29 Thu]
|
||||||
|
|
||||||
A literate programming file for configuring org-mode and those files.
|
A literate programming file for configuring org-mode and those files.
|
||||||
|
|
||||||
|
|
@ -38,8 +38,13 @@ Org is a /large/ complex beast with a gazillion settings, so I discuss these lat
|
||||||
<<org-todo>>
|
<<org-todo>>
|
||||||
<<org-todo-clock>>
|
<<org-todo-clock>>
|
||||||
<<ob-configuration>>
|
<<ob-configuration>>
|
||||||
<<html-exporting>>
|
<<html-exporting>>)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
Finding a subtle bug in some versions of =use-package=, where the macro can’t have a =:init= /and/ =:config= in the same macro call.
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp :noweb yes
|
||||||
|
(use-package org
|
||||||
:config
|
:config
|
||||||
<<ha-org-leader>>
|
<<ha-org-leader>>
|
||||||
<<visual-hook>>
|
<<visual-hook>>
|
||||||
|
|
@ -52,14 +57,15 @@ Org is a /large/ complex beast with a gazillion settings, so I discuss these lat
|
||||||
<<org-return-key>>
|
<<org-return-key>>
|
||||||
<<global-keybindings>>
|
<<global-keybindings>>
|
||||||
<<org-keybindings>>)
|
<<org-keybindings>>)
|
||||||
#+end_src
|
#+END_SRC
|
||||||
|
|
||||||
* Initialization Section
|
* Initialization Section
|
||||||
Begin by initializing these org variables:
|
Begin by initializing these org variables:
|
||||||
#+name: variables
|
#+name: variables
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp :tangle no
|
||||||
(setq org-return-follows-link t
|
(setq org-return-follows-link t
|
||||||
org-adapt-indentation nil ; Don't physically change files
|
org-adapt-indentation nil ; Don't physically change files
|
||||||
org-startup-indented t ; Visually show paragraphs indented
|
org-startup-indented nil ; Visually show paragraphs indented
|
||||||
org-list-indent-offset 2
|
org-list-indent-offset 2
|
||||||
org-edit-src-content-indentation 2 ; Doom Emacs sets this to 0,
|
org-edit-src-content-indentation 2 ; Doom Emacs sets this to 0,
|
||||||
; but uses a trick to make it
|
; but uses a trick to make it
|
||||||
|
|
@ -491,11 +497,24 @@ Need to install and configure Emacs to work with [[https://plantuml.com/][PlantU
|
||||||
curl -o ~/bin/plantuml.jar https://github.com/plantuml/plantuml/releases/download/v1.2022.4/plantuml-1.2022.4.jar
|
curl -o ~/bin/plantuml.jar https://github.com/plantuml/plantuml/releases/download/v1.2022.4/plantuml-1.2022.4.jar
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
After installing the [[https://github.com/skuro/plantuml-mode][plantuml-mode]], we need to reference the location:
|
After installing the [[https://github.com/skuro/plantuml-mode][plantuml-mode]], we need to reference the location.
|
||||||
|
|
||||||
|
Note the =plantuml-default-exec-mode=. It defaults to ='server=, and entering
|
||||||
|
=plantuml-mode= calls =plantuml-init-once= to build its font-lock keywords by
|
||||||
|
/downloading/ them from =https://www.plantuml.com/plantuml/language=,
|
||||||
|
synchronously. Since =org-src-fontify-natively= puts a buffer into
|
||||||
|
=plantuml-mode= just to colourise a =plantuml= block, and =desktop-save-mode=
|
||||||
|
restores this very file at startup, that download lands squarely in the
|
||||||
|
startup path. Asking the local executable for the same list avoids the
|
||||||
|
round trip, and still works on a plane:
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package plantuml-mode
|
(use-package plantuml-mode
|
||||||
|
:defer t
|
||||||
:init
|
:init
|
||||||
(setq org-plantuml-jar-path (expand-file-name "~/bin/plantuml.jar")))
|
(setq plantuml-default-exec-mode 'executable
|
||||||
|
plantuml-jar-path (expand-file-name "~/bin/plantuml.jar")
|
||||||
|
org-plantuml-jar-path (expand-file-name "~/bin/plantuml.jar")))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
With some [[file:snippets/org-mode/plantuml][YASnippets]], I have =<p= to start a general diagram, and afterwards (while still in the org-mode file), type one of the following to expand as an example:
|
With some [[file:snippets/org-mode/plantuml][YASnippets]], I have =<p= to start a general diagram, and afterwards (while still in the org-mode file), type one of the following to expand as an example:
|
||||||
|
|
@ -596,6 +615,7 @@ We can make Mermaid diagrams in Emacs Org files using [[https://github.com/arnm/
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package ob-mermaid
|
(use-package ob-mermaid
|
||||||
|
:after mermaid-mode
|
||||||
:config
|
:config
|
||||||
(setq ob-mermaid-cli-path mermaid-mmdc-location))
|
(setq ob-mermaid-cli-path mermaid-mmdc-location))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
|
||||||
26
ha-theme.org
26
ha-theme.org
|
|
@ -438,19 +438,19 @@ Let’s make a /theme/:
|
||||||
`(term-color-bright-yellow ((t (:foreground ,yellow))))
|
`(term-color-bright-yellow ((t (:foreground ,yellow))))
|
||||||
`(term-color-bright-cyan ((t (:foreground ,slate))))
|
`(term-color-bright-cyan ((t (:foreground ,slate))))
|
||||||
|
|
||||||
`(ansi-color-red ((t (:foreground ,red2-lt :background nil))))
|
`(ansi-color-red ((t (:foreground ,red2-lt :background unspecified))))
|
||||||
`(ansi-color-green ((t (:foreground ,green-lt :background nil))))
|
`(ansi-color-green ((t (:foreground ,green-lt :background unspecified))))
|
||||||
`(ansi-color-blue ((t (:foreground ,blue-lt :background nil))))
|
`(ansi-color-blue ((t (:foreground ,blue-lt :background unspecified))))
|
||||||
`(ansi-color-magenta ((t (:foreground ,purple-lt :background nil))))
|
`(ansi-color-magenta ((t (:foreground ,purple-lt :background unspecified))))
|
||||||
`(ansi-color-yellow ((t (:foreground ,yellow-lt :background nil))))
|
`(ansi-color-yellow ((t (:foreground ,yellow-lt :background unspecified))))
|
||||||
`(ansi-color-cyan ((t (:foreground ,slate :background nil))))
|
`(ansi-color-cyan ((t (:foreground ,slate :background unspecified))))
|
||||||
`(ansi-color-bright-red ((t (:foreground ,red2 :background nil))))
|
`(ansi-color-bright-red ((t (:foreground ,red2 :background unspecified))))
|
||||||
`(ansi-color-bright-green ((t (:foreground ,green :background nil))))
|
`(ansi-color-bright-green ((t (:foreground ,green :background unspecified))))
|
||||||
`(ansi-color-bright-blue ((t (:foreground ,blue :background nil))))
|
`(ansi-color-bright-blue ((t (:foreground ,blue :background unspecified))))
|
||||||
`(ansi-color-bright-magenta ((t (:foreground ,purple :background nil))))
|
`(ansi-color-bright-magenta ((t (:foreground ,purple :background unspecified))))
|
||||||
`(ansi-color-bright-yellow ((t (:foreground ,yellow :background nil))))
|
`(ansi-color-bright-yellow ((t (:foreground ,yellow :background unspecified))))
|
||||||
`(ansi-color-bright-cyan ((t (:foreground ,slate :background nil))))
|
`(ansi-color-bright-cyan ((t (:foreground ,slate :background unspecified))))
|
||||||
`(ansi-color-bright-black ((t (:foreground ,gray-50 :background nil))))
|
`(ansi-color-bright-black ((t (:foreground ,gray-50 :background unspecified))))
|
||||||
|
|
||||||
`(sh-heredoc ((t (:foreground ,almond))))
|
`(sh-heredoc ((t (:foreground ,almond))))
|
||||||
`(sh-quoted-exec ((t (:foreground ,orange2-lt))))
|
`(sh-quoted-exec ((t (:foreground ,orange2-lt))))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue