Examples of Using the Message Facility

In the Overview we discussed several likely ways this facility might be used. The ways to accomplish such goals are discussed in the following sections. To sum up, here are some motivations for customizing messages, with an indication of which procedures should be used:

  1. Add a few new types of messages to the ones supplied; for example, a new exception type. (Define user:generate_message_hook/3)
  2. Change the text of a few existing messages. (Define user:generate_message_hook/3)
  3. Customize default ways of printing existing message text, e.g. changing the default prefixes; (use message_hook/3 to override the defaults given by print_message_lines/3).
  4. "you_name_it" as in Figure ref-sem-typ-rpr.

    You can specify an action to replace or augment the default action by defining clauses for user:message_hook/3. Examples:

  5. Control how the system asks for and interprets responses from users. (query_hook/6)
  6. Translate all the existing messages, with or without customizations, to another language. This includes queries and user responses. (redefine generate_message/3; see ref-msg-ime)