From 72d321f478c2a67a4d37e41f8a85853f41f7f044 Mon Sep 17 00:00:00 2001
From: Swarsel
-This file has 40971 words spanning 10908 lines and was last revised on 2024-07-19 00:29:02 +0200.
+This file has 41033 words spanning 10909 lines and was last revised on 2024-07-19 00:52:31 +0200.
@@ -437,7 +437,7 @@ Table of Contents
1
-My emacs is built using the emacs-overlay nix flake, which builds a bleeding edge emacs on wayland (pgtk) with utilities like treesitter support. By executing the below source block, the current build setting can be updated at any time, and you can see my most up-to-date build options (last updated: 2024-07-19 00:29:02 +0200) +My emacs is built using the emacs-overlay nix flake, which builds a bleeding edge emacs on wayland (pgtk) with utilities like treesitter support. By executing the below source block, the current build setting can be updated at any time, and you can see my most up-to-date build options (last updated: 2024-07-19 00:52:31 +0200)
@@ -6335,6 +6335,11 @@
-This section automatically tangles all configuration blocks in this file to the defined Emacs org-file. It also exports the configuration file as html.
+This section handles everything that shoudld happen when I save SwarselSystems.org
. It:
.nix
files in accordance to the Alejandra
-style.+We set a hook that runs everytime we save the file. It would be a bit more efficient to only export and format when we enter a magit window for instance (since especially the html export takes times), however, since I cannot be sure to only ever commit from magit (I do indeed sometimes use git from the command line), I prefer this approach. +
-(defun swarsel/org-babel-tangle-config () - (when (string-equal (buffer-file-name) - swarsel-swarsel-org-filepath) - ;; Dynamic scoping to the rescue - (let ((org-confirm-babel-evaluate nil)) - (org-html-export-to-html) - (org-babel-tangle))) - (when (string-equal (buffer-file-name) - swarsel-emacs-org-filepath) - ;; Dynamic scoping to the rescue - (let ((org-confirm-babel-evaluate nil)) - (org-html-export-to-html) - (org-babel-tangle))) - (when (string-equal (buffer-file-name) - swarsel-nix-org-filepath) - ;; Dynamic scoping to the rescue - (let ((org-confirm-babel-evaluate nil)) - (org-babel-tangle)))) - -(setq org-html-htmlize-output-type nil) +(defun run-alejandra () + (interactive) + (let ((default-directory (expand-file-name "~/.dotfiles"))) + (shell-command "alejandra . -q"))) -(add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'swarsel/org-babel-tangle-config))) + (defun swarsel/org-babel-tangle-config () + (when (string-equal (buffer-file-name) + swarsel-swarsel-org-filepath) + ;; Dynamic scoping to the rescue + (let ((org-confirm-babel-evaluate nil)) + (org-html-export-to-html) + (org-babel-tangle) + (run-alejandra)))) + (setq org-html-htmlize-output-type nil) + (add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'swarsel/org-babel-tangle-config)))
This function searches for common delimiters in region and removes them, summarizing all captured lines by it. @@ -12907,7 +12912,7 @@