This is the cl-hooks Reference Manual, version 0.2.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 03:18:52 2024 GMT+0.
cl-hooks/cl-hooks.asd
cl-hooks/src/early/package.lisp
cl-hooks/src/early/conditions.lisp
cl-hooks/src/early/protocol.lisp
cl-hooks/src/early/util.lisp
cl-hooks/src/early/hook.lisp
cl-hooks/src/early/state.lisp
cl-hooks/src/early/mixins.lisp
cl-hooks/src/early/symbol.lisp
cl-hooks/src/early/object-internal.lisp
cl-hooks/src/early/object-external.lisp
cl-hooks/src/early/macros.lisp
The main system appears first, followed by any subsystem dependency.
cl-hooks
This system provides the hooks extension point mechanism (as known, e.g., from GNU Emacs).
Jan Moringen <jmoringe@techfak.uni-bielefeld.de>
Jan Moringen <jmoringe@techfak.uni-bielefeld.de>
LLGPLv3
0.2.1
alexandria
(system).
let-plus
(system).
closer-mop
(system).
trivial-garbage
(system).
src/early
(module).
Modules are listed depth-first from the system components tree.
cl-hooks/src/early
cl-hooks
(system).
package.lisp
(file).
conditions.lisp
(file).
protocol.lisp
(file).
util.lisp
(file).
hook.lisp
(file).
state.lisp
(file).
mixins.lisp
(file).
symbol.lisp
(file).
object-internal.lisp
(file).
object-external.lisp
(file).
macros.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
cl-hooks/cl-hooks.asd
cl-hooks/src/early/package.lisp
cl-hooks/src/early/conditions.lisp
cl-hooks/src/early/protocol.lisp
cl-hooks/src/early/util.lisp
cl-hooks/src/early/hook.lisp
cl-hooks/src/early/state.lisp
cl-hooks/src/early/mixins.lisp
cl-hooks/src/early/symbol.lisp
cl-hooks/src/early/object-internal.lisp
cl-hooks/src/early/object-external.lisp
cl-hooks/src/early/macros.lisp
cl-hooks/src/early/conditions.lisp
package.lisp
(file).
src/early
(module).
duplicate-handler
(condition).
hook-error-handler
(reader method).
hook-error-hook
(reader method).
hook-error-mixin
(condition).
malformed-handler-binding
(condition).
malformed-handler-binding-binding
(reader method).
no-such-hook
(condition).
cl-hooks/src/early/protocol.lisp
conditions.lisp
(file).
src/early
(module).
add-to-hook
(generic function).
clear-hook
(generic function).
combine-results
(generic function).
hook-combination
(generic function).
(setf hook-combination)
(generic function).
hook-handlers
(generic function).
(setf hook-handlers)
(generic function).
hook-name
(generic function).
remove-from-hook
(generic function).
run-hook
(generic function).
cl-hooks/src/early/util.lisp
protocol.lisp
(file).
src/early
(module).
read-value
(function).
run-handler-without-restarts
(function).
signal-with-hook-and-handler-restarts
(function).
cl-hooks/src/early/hook.lisp
util.lisp
(file).
src/early
(module).
add-to-hook
(method).
clear-hook
(method).
combine-results
(method).
combine-results
(method).
hook-combination
(method).
remove-from-hook
(method).
run-hook
(method).
run-hook-fast
(function).
cl-hooks/src/early/state.lisp
hook.lisp
(file).
src/early
(module).
(setf hook-handlers)
(method).
on-become-active
(generic function).
on-become-inactive
(generic function).
cl-hooks/src/early/mixins.lisp
state.lisp
(file).
src/early
(module).
(setf documentation)
(method).
documentation
(method).
hook-combination
(reader method).
(setf hook-combination)
(writer method).
hook-handlers
(reader method).
(setf hook-handlers)
(writer method).
on-become-active
(method).
on-become-inactive
(method).
print-object
(method).
activatable-mixin
(class).
internal-combination-mixin
(class).
internal-documentation-mixin
(class).
internal-handlers-mixin
(class).
simple-printing-mixin
(class).
cl-hooks/src/early/symbol.lisp
mixins.lisp
(file).
src/early
(module).
hook-combination
(method).
(setf hook-combination)
(method).
hook-handlers
(method).
(setf hook-handlers)
(method).
hook-name
(method).
cl-hooks/src/early/object-internal.lisp
symbol.lisp
(file).
src/early
(module).
(setf documentation)
(method).
documentation
(method).
hook-handlers
(method).
(setf hook-handlers)
(method).
hook-name
(reader method).
hook-object
(reader method).
object-hook
(generic function).
object-hook
(class).
cl-hooks/src/early/object-external.lisp
object-internal.lisp
(file).
src/early
(module).
external-hook
(generic function).
external-hook
(class).
hook-name
(reader method).
cl-hooks/src/early/macros.lisp
object-external.lisp
(file).
src/early
(module).
defhook
(macro).
define-external-hook-activation
(macro).
define-hook-activation
(macro).
define-hook-activation-method
(macro).
define-internal-hook-activation
(macro).
with-handlers
(macro).
Packages are listed by definition order.
hooks
This package contains functions and classes which implement the
"hook" extension point mechanism as known, for example, from GNU
Emacs.
Hooks are first-class objects which can be inspected and modified via
accessors:
+ ‘hook-name’
+ ‘hook-handlers’
+ ‘hook-combination’
+ ‘run-hook’
+ ‘add-to-hook’
+ ‘remove-from-hook’
+ ‘clear-hook’
The builtin kinds of hooks are the following
+ list of handlers as value of a symbol
+ list of handlers in an object slot
+ hook object is associated to arbitrary Lisp object
alexandria
.
common-lisp
.
let-plus
.
add-to-hook
(generic function).
clear-hook
(generic function).
combine-results
(generic function).
defhook
(macro).
define-external-hook-activation
(macro).
define-hook-activation
(macro).
define-hook-activation-method
(macro).
define-internal-hook-activation
(macro).
duplicate-handler
(condition).
external-hook
(generic function).
external-hook
(class).
hook-combination
(generic function).
(setf hook-combination)
(generic function).
hook-error-handler
(generic reader).
hook-error-hook
(generic reader).
hook-error-mixin
(condition).
hook-handlers
(generic function).
(setf hook-handlers)
(generic function).
hook-name
(generic function).
hook-object
(generic reader).
malformed-handler-binding
(condition).
malformed-handler-binding-binding
(generic reader).
no-such-hook
(condition).
object-hook
(generic function).
object-hook
(class).
on-become-active
(generic function).
on-become-inactive
(generic function).
remove-from-hook
(generic function).
run-hook
(generic function).
run-hook-fast
(function).
with-handlers
(macro).
activatable-mixin
(class).
internal-combination-mixin
(class).
internal-documentation-mixin
(class).
internal-handlers-mixin
(class).
read-value
(function).
run-handler-without-restarts
(function).
signal-with-hook-and-handler-restarts
(function).
simple-printing-mixin
(class).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Instantiate HOOK and set COMBINATION and DOCUMENTATION.
Execute BODY when the external hook named NAME becomes active. The keyword arguments object and hook can be used to name variables will be bound to the object and the hook object respectively during the execution of BODY.
Execute [DE]ACTIVATE when HOOK becomes [in]active respectively.
HOOK is a form that designates or retrieves a hook. Examples include a
symbol designating a hook stored in that symbol or a form
like (object-hook OBJECT HOOK-SYMBOL).
Within the forms ACTIVATE and DEACTIVATE, the variable VAR (when
specified) can be used to refer to the hook object (not HOOK, which is
a form to retrieve the hook object).
When HOOK becomes active, execute BODY which has to return a method object. When HOOK becomes inactive, the method is removed. The keyword argument VAR can be used to specify the name of a variable to which the hook object will be bound during the execution of BODY.
Execute ACTIVATE when internal HOOK of an instance of CLASS becomes active and execute DEACTIVATE when such a hook becomes inactive. The keyword arguments INSTANCE and HOOK can be used to name variables that will be bound to the instance and the hook object respectively during the execution of ACTIVATE and DEACTIVATE.
Run BODY with handlers as specified in HOOKS-AND-HANDLERS.
HOOKS-AND-HANDLERS is a list of items of the form (HOOK HANDLER) where
HOOK is a hook and HANDLER is coercable to a function.
Example:
((with-handlers (((object-external object ’hook)
(lambda (args)
(format t "~S~%" args))))
(do-something))
Run HOOK with ARGS like ‘run-hook’, with the following differences:
+ do not run any methods installed on ‘run-hook’
+ do not install any restarts
+ do not collect or combine any values returned by handlers.
Add HANDLER to HOOK.
Remove all handlers from HOOK.
Combine RESULTS of running HOOK’s handlers according to COMBINATION.
Return a representation of the slot residing outside of OBJECT under the name HOOK.
symbol
)) ¶Return the hook combination used by HOOK.
symbol
)) ¶internal-combination-mixin
)) ¶The hook combination used by this hook.
Install NEW-VALUE as the hook combination used by HOOK.
symbol
)) ¶internal-combination-mixin
)) ¶The hook combination used by this hook.
duplicate-handler
)) ¶hook-error-mixin
)) ¶hook
.
Return a list of handlers attached to HOOK.
object-hook
)) ¶symbol
)) ¶internal-handlers-mixin
)) ¶The list of handlers associated with this hook.
Replace list of handlers attached to HOOK with NEW-VALUE.
object-hook
)) ¶symbol
)) ¶internal-handlers-mixin
)) ¶The list of handlers associated with this hook.
Check whether HOOK becomes active or inactive.
Return the name of HOOK (a symbol).
external-hook
)) ¶The name of this hook.
name
.
object-hook
)) ¶The slot in which the hook resides.
slot
.
symbol
)) ¶object-hook
)) ¶The object in which the hook resides.
malformed-handler-binding
)) ¶Return a representation of the slot residing in OBJECT under the name HOOK.
standard-object
) (hook symbol
)) ¶Called when HOOK becomes active.
activatable-mixin
)) ¶If HOOK has a handler for becoming active installed, call that handler.
Default behavior is to do nothing.
Called when HOOK becomes inactive.
activatable-mixin
)) ¶If HOOK has a handler for becoming inactive installed, call that handler.
Default behavior is to do nothing.
Remove HANDLER from HOOK.
Run HOOK passing extra args ARGS to all handlers.
object-hook
) type) ¶object-hook
) type) ¶internal-documentation-mixin
) type) ¶internal-documentation-mixin
) type) ¶simple-printing-mixin
) stream) ¶This condition is signaled if a handler is added to a hook to which it has been added before and the policy does not permit handlers to be added to a hook multiple times.
Initarg | Value |
---|---|
:handler | (required-argument handler) |
The handler which was added to the hook twice.
:handler
This slot is read-only.
This condition servers as a superclass for condition classes that are related to hooks.
error
.
Initarg | Value |
---|---|
:hook | (required-argument hook) |
The hook object from which the error originated.
:hook
This slot is read-only.
This condition is signaled if an invalid hook-handler binding is detected during the expansion of an ‘with-handlers’ macro.
error
.
Initarg | Value |
---|---|
:binding | (required-argument binding) |
The invalid hook-handler binding.
:binding
This slot is read-only.
This condition is signaled when a designated hook cannot be found.
Instances of this class represent hooks that reside outside of objects.
Initarg | Value |
---|---|
:name | (required-argument name) |
Instances of this class represent hooks that reside in object.
Initarg | Value |
---|---|
:object | (required-argument object) |
:slot | (required-argument slot) |
The object in which the hook resides.
standard-object
:object
This slot is read-only.
Run HANDLER with ARGS.
Signal CONDITION with appropriate restarts installed.
The installed restarts for HANDLER are:
+ ‘retry’
+ ‘continue’
+ ‘use-value’
The installed restarts for HOOK are:
+ ‘retry’
+ ‘use-value’
This mixin adds slot to functions which run when the hook becomes active or inactive.
If a function is stored in this slot, the function is called when the hook becomes active.
(or null function)
hooks:on-become-active
If a function is stored in this slot, the function is called when the hook becomes inactive.
(or null function)
hooks:on-become-inactive
This mixin adds a slot which stores the hook combination of the hook.
The hook combination used by this hook.
(quote progn)
:combination
This mixin adds a slot which stores the documentation of the hook.
Documentation string of the hook.
common-lisp
.
(or null string)
:documentation
This mixin adds a slot which stores the list of handlers of the hook.
The list of handlers associated with this hook.
list
(quote nil)
:handlers
This mixin adds simple printing behavior for hooks.
Jump to: | (
A C D E F G H M O P R S W |
---|
Jump to: | (
A C D E F G H M O P R S W |
---|
Jump to: | B C D H N O S |
---|
Jump to: | B C D H N O S |
---|
Jump to: | A C D E F H I M N O P S U |
---|
Jump to: | A C D E F H I M N O P S U |
---|