Skip to content

Hook Variables

Hyperbole supplies a number of hook variables that allow you to adjust its basic operations to meet your own needs, without requiring you to change the code for those operations.

We find it best to always set the value of hook variables either to ‘nil’ or to a list of function names of no arguments, each of which will be called in sequence when the hook is triggered. If you use the add-hook function to adjust the value of hooks, it will do this automatically for you.

Given the name of a function, a Hyperbole hook variable triggered within that function has the same name as the function with a ‘-hook’ appended. Hyperbole includes the following hook variables:

hyperbole-init-hook

For customization at Hyperbole initialization time. Use this to load any personal Hyperbole type definitions or key bindings you might have. It is run after Hyperbole support code is loaded but before Hyperbole is initialized, i.e. prior to keyboard and mouse bindings.

action-key-depress-hook

assist-key-depress-hook

Run after an Action or Assist Mouse Key depress is detected.

action-key-release-hook

assist-key-release-hook

Run after an Action or Assist Mouse Key release is detected, before any associated action is executed.

action-act-hook

Run before each Hyperbole button activation. The variable hbut:current contains the button to be activated when this is run.

ebut-create-hook

Adds to the Hyperbole explicit button creation process.

ebut-delete-hook

Adds to the Hyperbole explicit button deletion process.

ebut-modify-hook

Executed when an explicit button’s attributes are modified.

hibtypes-begin-load-hook

Executed prior to loading of standard Hyperbole implicit button types. Used to load site-specific low priority implicit button types since lowest priority ibtypes are loaded first.

hibtypes-end-load-hook

Executed after loading of standard Hyperbole implicit button types. Used to load site-specific high priority implicit button types since highest priority ibtypes are loaded last.

htype-create-hook

Executed whenever a Hyperbole type (e.g. action type or implicit button type) is added to the environment.

htype-delete-hook

Executed whenever a type is deleted from the environment.

kotl-mode-hook

Executed whenever a koutline is created or read in or when kotl-mode is invoked.

hyrolo-add-hook

Executed after the addition of a new rolo entry.

hyrolo-display-hook

Executed when rolo matches are displayed.

hyrolo-edit-hook

Executed after point is successfully moved to an entry to be edited.

hyrolo-mode-hook

Executed when a rolo match buffer is created and put into hyrolo-mode.

hyrolo-yank-reformat-function

A variable whose value may be set to a function of two arguments, START and END, which give the region of the rolo entry yanked into the current buffer by the hyrolo-yank command. The function may reformat this region to meet user-specific needs.

Hyperbole also makes use of a number of standard Emacs hook variables.

find-file-hook

This is called whenever a file is read into a buffer. Hyperbole uses it to highlight any buttons within files.

write-file-hooks

This is called whenever a buffer is written to a file. Hyperbole uses it to save modified button attributes associated with any file from the same directory as the current file.

Hyperbole mail and news facilities also utilize a number of Emacs hook variables. These hide button data and highlight buttons if possible. See the Hyperbole files with ‘mail’ and ‘gnus’ in their names for specific usage of such hooks.