When an event happens (currently including presence changes, incoming messages, and completed queries) you will usually want to be notified. Since tastes in this area vary wildly, these alerts are implemented as hooks, so you can choose which ones you want, or write your own if none fit.
Actually, if you don't want to write your own, stop reading this section and just read Standard alerts.
Many kinds of alerts consist in displaying a text message through a
certain mechanism. This text message is provided by a function which
you can rewrite or replace. If this function returns nil
, no
message is displayed, and non-textual alerts refrain from action.
The hooks take different arguments depending on category. However, they all have in common that the last argument is the result of the message function. The message function for each category takes the same arguments as the corresponding hooks, except for that last argument.
Alert hook contributions are very welcome. Either submit them to the Sourceforge patch tracker, or contact us directly.
Alert hooks are meant for optional UI things, that are subject to
varying user tastes, and that can be toggled by simply adding or
removing the function from/to the hook. For other things, there are
corresponding general hooks, that are defvars instead of defcustoms,
and that are to be managed by Lisp code. They have the same name as
the alert hooks minus the -alert
part.