Version0.16.1Verifiednot yet verifiedLicenseBSD-3-Clause

sigil-hooks

Emacs-style hook system for Sigil

Report a bug or suggest a feature
Readme

sigil-hooks

Emacs-style hook system for Sigil — register named callbacks and run them on event.

A hook is a list of functions called when a specific event occurs. Multiple handlers can be registered for each hook and are invoked in registration order.

Usage

(import (sigil hooks))

(define on-save (make-hook))

(add-hook! on-save (lambda () (display "Saved!\n")))
(add-hook! on-save (lambda () (display "Logged.\n")))

(run-hook on-save)
;; prints: Saved!
;;         Logged.

Hooks can also receive arguments via run-hook-with-args:

(define on-file-save (make-hook))

(add-hook! on-file-save
  (lambda (filename)
    (display "Saved: ") (display filename) (newline)))

(run-hook-with-args on-file-save "document.txt")

Modules

ModulePurpose
(sigil hooks)Core hook API: make-hook, add-hook!, remove-hook!, clear-hook!, run-hook, run-hook-with-args, hook?, hook-empty?.

Build & Test

sigil deps install
sigil build
sigil test

License

BSD-3-Clause. See LICENSE for details.

Clone

$ git clone https://codeberg.org/sigil/sigil-hooks

Releases

v0.16.1 — latest by version, released 28 Jun 2026

All releases — 4 tags in this repository.

Source

Browse the latest source

One page per file, and every line has a permalink.

Recent commitsAtom

The last 20 commits keep a page here. Everything older lives in the clone.