diff --git a/bootstrap.org b/bootstrap.org index 6b3d491..455236a 100644 --- a/bootstrap.org +++ b/bootstrap.org @@ -126,6 +126,12 @@ Manipulate file paths with the [[https://github.com/rejeep/f.el][f.el]] project: (use-package f) #+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: #+begin_src emacs-lisp (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 `("ha-private.org" ,(when (display-graphic-p) - "ha-theme.org" "ha-display.org") - "ha-config.org" + "ha-evil.org" ;; We need to replace ha-general (loaded in config) with: ;; "ha-leader.org" - "ha-evil.org" + "ha-general.org" ;; "ha-meow.org" + "ha-config.org" "ha-applications.org" "ha-org.org" ,(when (display-graphic-p) @@ -252,7 +258,7 @@ With this function, we can test/debug/reload any individual file, via: (ha-hamacs-files :all)))) (let ((full-file (expand-file-name file hamacs-source-dir))) (when (file-exists-p full-file) - (message ">>> %s" full-file) + ;; (message ">>> %s" full-file) (if (called-interactively-p) (org-babel-load-file full-file) (ignore-errors (org-babel-load-file full-file)))))) diff --git a/ha-applications.org b/ha-applications.org index aeeea61..7628ff7 100644 --- a/ha-applications.org +++ b/ha-applications.org @@ -519,12 +519,11 @@ Every /so often/, pop over to the following URLs and generate a new token where Make sure this works: #+begin_src emacs-lisp :tangle no :results replace - (ghub-request "GET" "/user" nil - :forge 'github - :host "api.github.com" - :username "howardabrams" - :auth 'forge) - + (ghub-request "GET" "/user" nil + :forge 'github + :host "api.github.com" + :username "howardabrams" + :auth 'forge) #+end_src ** Magit Github @@ -1055,7 +1054,7 @@ The [[Evil Collection][evil-collection]] package adds the following keybindings: - ~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: -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle no (use-package org-noter :config (major-mode-hydra-define org-noter-doc-mode-map nil diff --git a/ha-code-notes.org b/ha-code-notes.org index 518e204..1d0724f 100644 --- a/ha-code-notes.org +++ b/ha-code-notes.org @@ -272,7 +272,7 @@ Once inside a source file, we can jump to one of these /relative locations/: To verify that this works: -#+BEGIN_SRC emacs-lisp +#+BEGIN_SRC emacs-lisp :tangle no (seq-let (file heading offset) (ha-code-notes-location) (ha-code-notes-location-goto file heading offset)) #+END_SRC diff --git a/ha-config.org b/ha-config.org index 3dfa399..34bce14 100644 --- a/ha-config.org +++ b/ha-config.org @@ -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. ** 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: #+begin_src emacs-lisp diff --git a/ha-display.org b/ha-display.org index fadaacf..7c23a35 100644 --- a/ha-display.org +++ b/ha-display.org @@ -122,7 +122,7 @@ I found that the prolific [[https://protesilaos.com/][Protesilaos Stavrou]] [[ht #+begin_src emacs-lisp (use-package pulsar - :after winum ace-window + :after (winum ace-window) :custom (pulsar-face 'pulsar-generic) (pulsar-delay 0.15) diff --git a/ha-evil.org b/ha-evil.org index 222676a..860771d 100644 --- a/ha-evil.org +++ b/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 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 - (use-package evil-textobj-line) + (use-package evil-textobj-line + :after evil) #+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 )~ ** 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. #+begin_src emacs-lisp - (use-package evil-indent-plus) + (use-package evil-indent-plus + :after evil) #+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. ** 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. #+begin_src emacs-lisp (use-package evil-args + :after evil :config ;; bind evil-args text objects (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 (use-package evil-exchange + :after (evil general) :init (setq evil-exchange-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 (use-package evil-lion - :after evil + :after (evil general) :general (:states '(normal visual) "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 (use-package evil-commentary + :after (evil general) :config (evil-commentary-mode) :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 evil-owl - :after posframe + :after evil posframe :config (setq evil-owl-display-method 'posframe evil-owl-extra-posframe-args @@ -515,6 +520,7 @@ The [[https//github.com/gilbertw1/better-jumper][better-jumper project]] replace #+begin_src emacs-lisp (use-package better-jumper + :after evil :config (better-jumper-mode +1) diff --git a/ha-org-word-processor.org b/ha-org-word-processor.org index 50d1ea7..ca59bdf 100644 --- a/ha-org-word-processor.org +++ b/ha-org-word-processor.org @@ -101,7 +101,8 @@ And hook this function to Org: The list of things to try: #+BEGIN_SRC emacs-lisp - (setq org-hide-leading-stars t) ; or t + (setq org-hide-leading-stars t) + (org-indent-mode -1) #+END_SRC ** Markup View diff --git a/ha-org.org b/ha-org.org index d2ea18f..5e4e69c 100644 --- a/ha-org.org +++ b/ha-org.org @@ -3,7 +3,7 @@ #+date: 2020-09-18 #+tags: emacs org #+startup: inlineimages -#+lastmod: [2026-10-20 Tue] +#+lastmod: [2026-10-29 Thu] 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 <> <> <> - <> + <>) +#+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 <> <> @@ -52,14 +57,15 @@ Org is a /large/ complex beast with a gazillion settings, so I discuss these lat <> <> <>) -#+end_src +#+END_SRC + * Initialization Section Begin by initializing these org variables: #+name: variables #+begin_src emacs-lisp :tangle no (setq org-return-follows-link t 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-edit-src-content-indentation 2 ; Doom Emacs sets this to 0, ; 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 #+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 (use-package plantuml-mode + :defer t :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 With some [[file:snippets/org-mode/plantuml][YASnippets]], I have =