Skip to reference content
简体中文

Standard Hooks

Hooks are the observation points the framework runs at defined moments. All are abnormal hooks: the value is a list of functions, and a buffer-local value, when set, replaces the global list for that buffer. Each row links to the entry that documents the arguments, timing and recovery.

Hook Runs when Called with Errors
ebox-unmount-functions A mount is being released by ebox-unmount-buffer, before the mount is detached and before the display settings are restored, so the buffer still answers ebox-buffer-mount. the buffer An error signals out of ebox-unmount-buffer, aborts the rest of the release and leaves the mount live.
ebox-focus-change-functions ebox-focus moved the mount's focus; it does not run when the focused node is unchanged, and it runs inside the focus operation, so the mount already reports the new focus. the previously focused node, or nil, and the newly focused node, or nil An error propagates from the focus operation that ran the hook.
ebox-after-flush-functions A flush actually published, after the observer and the background sync; the buffer shows the new output and geometry is settled. the buffer An error in one function does not prevent the others from running.
ebox-viewport-prepare-functions The viewport size updated in ebox-refit, before the relayout flushes so reactive layers can batch viewport-driven updates into the same flush. the buffer An error in one function does not stop the others.
ebox-viewport-change-functions The viewport size changed, whether by a window resize or ebox-mount-set-viewport, once the relayout for the new size has settled. the buffer An error in one function does not stop the others.
ebox-display-change-functions Buffer text scaling has settled and the retained tree has been remeasured, including fixed-size viewports. the buffer A callback error is reported by the viewport task; unstarted work remains queued after a quit.
ebox-display-window-change-functions A window change settled and the mount was refit, when the window became the buffer's display window or its body pixel size changed; fixed viewports are notified too, borrowed lines are not. the buffer and its display window An error stops the rest of that frame's batch and is reported by the viewport task.
etaf-runtime-mount-functions etaf-mount finished its initial publication and registered the Runtime. the Runtime An error in one function is isolated and does not affect other observers or the mount.
etaf-runtime-after-commit-functions A mounted Runtime committed an application change (excluding initial mount and presentation-only flushes). the Runtime An error in one function is isolated.
etaf-runtime-after-flush-functions A non-presentation Ebox flush finished on the Runtime's buffer (including :overflow scroll scrolls, refits and application commits). the Runtime An error in one function is isolated.
etaf-runtime-unmount-functions A mounted Runtime begins unmounting, before its segments and buffer bindings are released. the Runtime An error in one function is isolated.
etaf-runtime-meta-change-functions A mounted Runtime's resolved metadata snapshot changes through etaf-runtime-set-meta or a reactive metadata source. the Runtime and its detached metadata plist An error in one function is isolated.
etaf-runtime-focus-change-functions Logical Host focus changes inside a mounted Runtime. the Runtime, previous Host ID (or nil) and next Host ID (or nil) An error in one function is isolated.
etaf-activity-change-functions A cross-application live activity is published, updated or removed. EVENT (publish or remove), activity ID and detached activity plist (or nil) An error in one function is isolated.
etaf-notify-functions etaf-notify records a new or grouped notification. detached notification plist An error in one function is isolated.
  • ebox-unmount-functions is the explicit-release hook. Killing a buffer releases its mount through the buffer's kill hook and does not run it.
  • The hooks run in the mount's buffer. Register a function that belongs to one application buffer with a buffer-local entry, (add-hook 'HOOK FUNCTION nil t), and one that belongs to the process with the global list.
  • :on-focus-enter is built on ebox-focus-change-functions: ETAF computes the Hosts between the previous and the new node and dispatches the callback on each, nearest first.