From 4e5a4e98008587fed5a8e48a8b77dca167adf32a Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Tue, 9 Nov 2021 17:18:52 -0800 Subject: [PATCH] Create `ha-hamacs-load` function to re-read files This function shows my Hamacs files, and allows me to update a reload it. Also, fixed a few bugs. --- bootstrap.org | 53 ++++++++++++++++++++++--------------- ha-config.org | 4 +-- initialize | 3 ++- support/final-initialize.el | 1 + 4 files changed, 37 insertions(+), 24 deletions(-) diff --git a/bootstrap.org b/bootstrap.org index 663cf21..8d96cef 100644 --- a/bootstrap.org +++ b/bootstrap.org @@ -107,29 +107,40 @@ the native-comp model, but I reserve the right to change this." * Load the Rest The following loads the rest of my org-mode literate files. I add them as they are /ready/, but eventually, I'll trim this up into a nicer pattern. #+BEGIN_SRC emacs-lisp - (dolist (file `("ha-config.org" - "ha-display.org" - "ha-org.org" - "ha-org-word-processor.org" - "ha-org-clipboard.org" - ;; "org-journaling.org" - ;; "org-publishing.org" - "ha-org-sprint.org" - "ha-capturing-notes.org" - "ha-programming.org" - ;; "ha-agendas.org" - ;; "ha-email.org" - ;; "ha-irc.org" - ;; "ha-passwords.org" - ;; "ha-remoting.org" - ;; "my-feeds.org" - ,(when (ha-emacs-for-work?) - "ha-work.org"))) + (defvar ha-hamacs-files `("ha-config.org" + "ha-display.org" + "ha-org.org" + "ha-org-word-processor.org" + "ha-org-clipboard.org" + ;; "org-journaling.org" + ;; "org-publishing.org" + "ha-org-sprint.org" + "ha-capturing-notes.org" + "ha-programming.org" + ;; "ha-agendas.org" + ;; "ha-email.org" + ;; "ha-irc.org" + ;; "ha-passwords.org" + ;; "ha-remoting.org" + "ha-feed-reader.org" + + ,(when (ha-emacs-for-work?) + "ha-work.org")) + "List of org files that complete the hamacs project.") +#+END_SRC + +We can test/debug/reload any individual file, via: +#+BEGIN_SRC emacs-lisp + (defun ha-hamacs-load (file) + "Load or reload an org-mode FILE containing literate Emacs configuration code." + (interactive (list (completing-read "Org file: " ha-hamacs-files))) (org-babel-load-file (f-join hamacs-source-dir file))) #+END_SRC -We can test/debug any individual file, via: -#+BEGIN_SRC emacs-lisp :tangle no - (org-babel-load-file (f-join hamacs-source-dir "ha-org-word-processor.org")) + +And we can now load everything: +#+BEGIN_SRC emacs-lisp + (dolist (file ha-hamacs-files) + (ha-hamacs-load file)) #+END_SRC * Technical Artifacts :noexport: Let's provide a name so that the file can be required: diff --git a/ha-config.org b/ha-config.org index d4c8b73..ac95a58 100644 --- a/ha-config.org +++ b/ha-config.org @@ -571,7 +571,7 @@ Ways to search for information goes under the ~s~ key. This primarily depends on (defun ha-rg-go-results-buffer () "Pop to the `*rg*' buffer that `rg' creates." (interactive) - (pop-to-buffer "*rg*"))) + (pop-to-buffer "*rg*")) (defun ha-rg-go-next-results () "Bring the next file results into view." @@ -604,7 +604,7 @@ While the ~C-h~ is easy enough, I am now in the habit of typing ~SPC h~ instead. "h v" '("variable" . describe-variable) "h k" '("key binding" . describe-key) "h B" '("embark" . embark-bindings) - "h i" '("info" . Info)) + "h i" '("info" . info)) #+END_SRC *** Consult Enhancements diff --git a/initialize b/initialize index 7043184..e66ff27 100755 --- a/initialize +++ b/initialize @@ -31,8 +31,9 @@ cat > $HAMACS_DEST/init.el <