Compare commits

..

No commits in common. "main" and "use-package-vc" have entirely different histories.

11 changed files with 70 additions and 87 deletions

View file

@ -126,12 +126,6 @@ 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)
@ -197,13 +191,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-evil.org" "ha-config.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-general.org" "ha-evil.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)
@ -258,7 +252,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))))))

View file

@ -62,7 +62,7 @@ This also requires installing some command line support utilities, as well as [[
*** Notifications *** Notifications
When my /artificial intern/ completes a task, I have long since nipped out to the kitchen, put the kettle on ... buttering scones... and getting crumbs and bits of food out of those round brown straw mats that the teapot goes on. When my /artificial intern/ completes a task, I have long since nipped out to the kitchen, put the kettle on ... buttering scones... and getting crumbs and bits of food out of those round brown straw mats that the teapot goes on.
I would like the /intern/ to notify me when it needs attention, so I noticed the [[https://github.com/xenodium/agent-shell-knockknock][agent-shell-knockknock]] project can connect the =agent-shell= project with the [[https://github.com/konrad1977/knockknock/][knock-knock]] project (which is similar to my [[https://howardism.org/Technical/Emacs/beep-for-emacs.html][beep project]]). I would like the /intern/ to notify me when it needs attention, so I noticed the [[https://github.com/zackattackz/agent-shell-notifications/][agent-shell-notifications]] project can connect the =agent-shell= project with the [[https://github.com/konrad1977/knockknock/][knock-knock]] project (which is similar to my [[https://howardism.org/Technical/Emacs/beep-for-emacs.html][beep project]]).
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package knockknock (use-package knockknock
@ -83,13 +83,28 @@ Testing it out:
:icon "nf-md-robot_confused") :icon "nf-md-robot_confused")
#+END_SRC #+END_SRC
The configuration for [[https://github.com/xenodium/agent-shell-knockknock][agent-shell-knockknock]] and hook it in: The configuration for [[https://github.com/zackattackz/agent-shell-notifications/][agent-shell-notifications]] and hook it to the =agent-shell-notifications-provider=:
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package agent-shell-knockknock (use-package agent-shell-notifications
:vc (:url "https://github.com/xenodium/agent-shell-knockknock" :rev :newest) :vc (:url "https://github.com/zackattackz/agent-shell-notifications" :rev :newest)
:after (agent-shell knockknock) :after knockknock
:hook (agent-shell-mode . agent-shell-knockknock-mode)) :hook
;; Enable notifications in each agent-shell buffer
(agent-shell-mode . agent-shell-notifications-mode)
:config
;; Notification display timeout in seconds (0 = never expire (the default), -1 = backend default)
;; (setq agent-shell-notifications-timeout 5)
;; Seconds to wait before notifying when the shell is already visible (default: 10)
;; (setq agent-shell-notifications-idle-timeout 30)
;; Use the knockknock backend instead of the default libnotify
(setq agent-shell-notifications-provider 'agent-shell-notifications-knockknock)
;; While that code is _supposed_ to do this, I seem to need to do this manually:
(require 'agent-shell-notifications-knockknock))
#+END_SRC #+END_SRC
I might switch to [[https://github.com/cxa/agent-shell-macext#start-of-content][agent-shell-macext]] if I can’t get KnockKnock to work well on my Linux system. I might switch to [[https://github.com/cxa/agent-shell-macext#start-of-content][agent-shell-macext]] if I can’t get KnockKnock to work well on my Linux system.
@ -523,6 +538,7 @@ 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
@ -1053,7 +1069,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 :tangle no #+begin_src emacs-lisp
(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

View file

@ -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 :tangle no #+BEGIN_SRC emacs-lisp
(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

View file

@ -438,6 +438,12 @@ 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

View file

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

View file

@ -211,22 +211,19 @@ 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)
@ -372,7 +369,6 @@ 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"))
@ -410,7 +406,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 general) :after evil
:general :general
(:states '(normal visual) (:states '(normal visual)
"g a" '("lion ←" . evil-lion-left) "g a" '("lion ←" . evil-lion-left)
@ -447,7 +443,6 @@ 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
@ -475,7 +470,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 evil posframe :after 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
@ -520,7 +515,6 @@ 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)

View file

@ -101,8 +101,7 @@ 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) (setq org-hide-leading-stars t) ; or t
(org-indent-mode -1)
#+END_SRC #+END_SRC
** Markup View ** Markup View

View file

@ -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-29 Thu] #+lastmod: [2026-10-20 Tue]
A literate programming file for configuring org-mode and those files. A literate programming file for configuring org-mode and those files.
@ -38,13 +38,8 @@ 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>>
@ -57,15 +52,14 @@ Finding a subtle bug in some versions of =use-package=, where the macro can’t
<<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 nil ; Visually show paragraphs indented org-startup-indented t ; 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
@ -497,24 +491,11 @@ 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 plantuml-default-exec-mode 'executable (setq org-plantuml-jar-path (expand-file-name "~/bin/plantuml.jar")))
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:
@ -615,7 +596,6 @@ 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

View file

@ -450,7 +450,6 @@ Note that Emacs already has the ability to download and install grammars, so fol
;; (julia "https://github.com/tree-sitter/tree-sitter-julia" "master" "src") ;; (julia "https://github.com/tree-sitter/tree-sitter-julia" "master" "src")
;; (lua "https://github.com/MunifTanjim/tree-sitter-lua" "main" "src") ;; (lua "https://github.com/MunifTanjim/tree-sitter-lua" "main" "src")
(make "https://github.com/alemuller/tree-sitter-make") (make "https://github.com/alemuller/tree-sitter-make")
(mermaid "https://github.com/monaqa/tree-sitter-mermaid")
;; (markdown "https://github.com/ikatyang/tree-sitter-markdown") ;; (markdown "https://github.com/ikatyang/tree-sitter-markdown")
;; (meson "https://github.com/Decodetalkers/tree-sitter-meson" "master" "src") ;; (meson "https://github.com/Decodetalkers/tree-sitter-meson" "master" "src")
;; (python "https://github.com/tree-sitter/tree-sitter-python") ;; (python "https://github.com/tree-sitter/tree-sitter-python")
@ -461,17 +460,11 @@ Note that Emacs already has the ability to download and install grammars, so fol
;; (typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src") ;; (typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src")
(yaml "https://github.com/tree-sitter-grammars/tree-sitter-yaml"))) (yaml "https://github.com/tree-sitter-grammars/tree-sitter-yaml")))
(defun mp-setup-install-grammars (&optional force) (defun mp-setup-install-grammars ()
"Install Tree-sitter grammars if they are absent. "Install Tree-sitter grammars if they are absent."
Each grammar in `treesit-language-source-alist' is only cloned and (interactive)
compiled when `treesit-language-available-p' says it is missing, as (sit-for 30)
installing one takes a second or two. With a prefix argument, FORCE (mapc #'treesit-install-language-grammar (mapcar #'car treesit-language-source-alist)))
reinstalls every grammar, which is how we pick up upstream changes."
(interactive "P")
(dolist (lang (mapcar #'car treesit-language-source-alist))
(when (or force (not (treesit-language-available-p lang)))
(message "Installing Tree-sitter grammar for `%s' ..." lang)
(treesit-install-language-grammar lang))))
;; Optional, but Mickey recommends. Tree-sitter enabled major ;; Optional, but Mickey recommends. Tree-sitter enabled major
;; modes are distinct from their ordinary counterparts, however, ;; modes are distinct from their ordinary counterparts, however,

View file

@ -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 unspecified)))) `(ansi-color-red ((t (:foreground ,red2-lt :background nil))))
`(ansi-color-green ((t (:foreground ,green-lt :background unspecified)))) `(ansi-color-green ((t (:foreground ,green-lt :background nil))))
`(ansi-color-blue ((t (:foreground ,blue-lt :background unspecified)))) `(ansi-color-blue ((t (:foreground ,blue-lt :background nil))))
`(ansi-color-magenta ((t (:foreground ,purple-lt :background unspecified)))) `(ansi-color-magenta ((t (:foreground ,purple-lt :background nil))))
`(ansi-color-yellow ((t (:foreground ,yellow-lt :background unspecified)))) `(ansi-color-yellow ((t (:foreground ,yellow-lt :background nil))))
`(ansi-color-cyan ((t (:foreground ,slate :background unspecified)))) `(ansi-color-cyan ((t (:foreground ,slate :background nil))))
`(ansi-color-bright-red ((t (:foreground ,red2 :background unspecified)))) `(ansi-color-bright-red ((t (:foreground ,red2 :background nil))))
`(ansi-color-bright-green ((t (:foreground ,green :background unspecified)))) `(ansi-color-bright-green ((t (:foreground ,green :background nil))))
`(ansi-color-bright-blue ((t (:foreground ,blue :background unspecified)))) `(ansi-color-bright-blue ((t (:foreground ,blue :background nil))))
`(ansi-color-bright-magenta ((t (:foreground ,purple :background unspecified)))) `(ansi-color-bright-magenta ((t (:foreground ,purple :background nil))))
`(ansi-color-bright-yellow ((t (:foreground ,yellow :background unspecified)))) `(ansi-color-bright-yellow ((t (:foreground ,yellow :background nil))))
`(ansi-color-bright-cyan ((t (:foreground ,slate :background unspecified)))) `(ansi-color-bright-cyan ((t (:foreground ,slate :background nil))))
`(ansi-color-bright-black ((t (:foreground ,gray-50 :background unspecified)))) `(ansi-color-bright-black ((t (:foreground ,gray-50 :background nil))))
`(sh-heredoc ((t (:foreground ,almond)))) `(sh-heredoc ((t (:foreground ,almond))))
`(sh-quoted-exec ((t (:foreground ,orange2-lt)))) `(sh-quoted-exec ((t (:foreground ,orange2-lt))))

View file

@ -114,6 +114,7 @@ cat > "$HAMACS_DEST/init.el" <<EOF
(add-to-list 'package-archives (add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/")) '("melpa" . "https://melpa.org/packages/"))
(setq package-enable-at-startup nil)
(package-initialize) (package-initialize)
;; Install any missing package by default, so we don't need :ensure t. ;; Install any missing package by default, so we don't need :ensure t.