Commit330e1ce0Recorded25 Apr 2026Repositorysigil-hooks

Extract sigil-hooks from sigil monorepo

Message

Standalone repo for the (sigil hooks) Emacs-style hook system. Pure-library Scheme — no consumers in the monorepo at extraction time.

Scaffolding added: - README.md: usage examples, modules table, build/test commands. - .gitignore: build/ + .sigil/. - manifest.scm: minimal Guix dev environment. - dev-redirects.sgl: codeberg:sigil/sigil -> ../sigil for sigil-stdlib.

package.sgl changes: - Add version: "0.13.1". - Update url: -> codeberg.org/sigil/sigil-hooks. - Swap (from-workspace name: "sigil-stdlib") to from-git monorepo-resident pin at ^0.13.1.

Build clean; tests 10/10 passed.

See [[procedures/sigil-package-extraction]].

Changed
 .gitignore        |  2 ++
 README.md         | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 dev-redirects.sgl |  6 ++++++
 manifest.scm      |  7 +++++++
 package.sgl       |  5 +++--
 sigil.lock        |  8 ++++++++
 6 files changed, 77 insertions(+), 2 deletions(-)
Diff
.gitignoreadded
@@ -0,0 +1,2 @@
+1
build/
+2
.sigil/
README.mdadded
@@ -0,0 +1,51 @@
+1
# sigil-hooks
+2
+3
Emacs-style hook system for Sigil — register named callbacks and run them on event.
+4
+5
A hook is a list of functions called when a specific event occurs. Multiple
+6
handlers can be registered for each hook and are invoked in registration order.
+7
+8
## Usage
+9
+10
```scheme
+11
(import (sigil hooks))
+12
+13
(define on-save (make-hook))
+14
+15
(add-hook! on-save (lambda () (display "Saved!\n")))
+16
(add-hook! on-save (lambda () (display "Logged.\n")))
+17
+18
(run-hook on-save)
+19
;; prints: Saved!
+20
;; Logged.
+21
```
+22
+23
Hooks can also receive arguments via `run-hook-with-args`:
+24
+25
```scheme
+26
(define on-file-save (make-hook))
+27
+28
(add-hook! on-file-save
+29
(lambda (filename)
+30
(display "Saved: ") (display filename) (newline)))
+31
+32
(run-hook-with-args on-file-save "document.txt")
+33
```
+34
+35
## Modules
+36
+37
| Module | Purpose |
+38
|-----------------|----------------------------------------------------------------|
+39
| `(sigil hooks)` | Core hook API: `make-hook`, `add-hook!`, `remove-hook!`, `clear-hook!`, `run-hook`, `run-hook-with-args`, `hook?`, `hook-empty?`. |
+40
+41
## Build & Test
+42
+43
```bash
+44
sigil deps install
+45
sigil build
+46
sigil test
+47
```
+48
+49
## License
+50
+51
BSD-3-Clause. See [LICENSE](LICENSE) for details.
dev-redirects.sgladded
@@ -0,0 +1,6 @@
+1
;; Development redirects — point dependencies at local Sigil checkout
+2
(redirects
+3
repos: (list
+4
(for-repo
+5
url: "codeberg:sigil/sigil"
+6
use: (from-path dir: "../sigil"))))
manifest.scmadded
@@ -0,0 +1,7 @@
+1
;; sigil-hooks Development Environment
+2
;; Use with: guix shell -m manifest.scm
+3
+4
(specifications->manifest
+5
'("gcc-toolchain"
+6
"make"
+7
"pkg-config"))
package.sglmodified
@@ -4,10 +4,11 @@
4
5
(package
6
name: "sigil-hooks"
+7
version: "0.13.1"
8
description: "Emacs-style hook system for Sigil"
8
url: "https://codeberg.org/sigil/sigil"
+9
url: "https://codeberg.org/sigil/sigil-hooks"
10
license: "BSD-3-Clause"
11
authors: (list "David Wilson <[email protected]>")
12
13
dependencies: (list
13
(from-workspace name: "sigil-stdlib")))
+14
(from-git url: "codeberg:sigil/sigil" package: "sigil-stdlib" version: "^0.13.1")))
sigil.lockadded
@@ -0,0 +1,8 @@
+1
;; Auto-generated by sigil deps install. Do not edit.
+2
(lock
+3
(package name: "sigil-stdlib"
+4
url: "codeberg:sigil/sigil"
+5
ref: "^0.13.1"
+6
sha: "1aea1cecd3487bf07d071da2c1e7eb3cf4bbdb21"
+7
package-selector: "sigil-stdlib")
+8
)