3 This document is for Riece developers or those who are interested in
10 If you find a bug, please file it at
11 https://savannah.nongnu.org/bugs/?group=riece
13 ** Getting the development source code
15 We currently use Git. Follow the instructions below to build the
20 git clone git://git.sv.gnu.org/riece.git
22 (2) generate configure script
26 (3) run the configure script
39 Riece consists of many elisp modules listed below, ordered by the
40 number of dependencies they have.
43 This module defines global variables.
46 This module defines user options.
49 This module defines the version of Riece.
52 This module provides functions which support character code conversions.
55 This module provides functions which support tab completion feature
59 This module manages add-ons.
62 This module manages modes of riece-channel/riece-user objects.
65 This module defines the riece-identity object type which represents
66 global names of riece-channel/riece-user objects.
69 This module defines the riece-channel object type.
72 This module defines the riece-user object type.
75 This module provides miscellaneous functions.
78 This module defines the riece-signal object type used to manage
82 This module manages window layouts.
85 This module manages display events.
88 This module manages connections to IRC servers.
91 This module is a so called the Mediator design pattern. It knows
92 relationships of riece-channel/riece-user objects.
95 This module defines the riece-message object type.
98 This module only provides the process filter function.
101 This module provides handler functions for IRC messages. These
102 functions are called from riece-filter.
105 This module provides handler functions for numeric replies whose
106 response codes are in 000 to 100 range. These handlers are called
110 This module provides handler functions for numeric replies whose
111 response codes are in 200 to 300 range. These handlers are called
115 This module provides handler functions for numeric replies whose
116 response codes are in 300 to 400 range. These handlers are called
120 This module provides handler functions for numeric replies whose
121 response codes are in 400 to 500 range. These handlers are called
125 This module provides handler functions for numeric replies whose
126 response codes are in 500 to 600 range. These handlers are called
130 This module provides user commands.
133 This module provides the binding for the IRC protocol.
136 This module is the entry point of M-x riece.
138 ** Namespace management
140 Riece is capable to connect to several IRC servers.
142 Riece has separate namespace (obarray) for each connection. These
143 namespaces can be accessed as buffer local variables of process
146 *** Obtaining server buffer
148 To access to the buffer local variables of process buffer, it is
149 needed to distinguish process object of each connection by its name.
153 (1) checking the value of riece-overriding-server-name,
155 (2) checking the value of riece-server-name,
156 (If the variable riece-server-name is local to the current buffer,
157 you are already in the process buffer.)
159 (3) or parsing riece-identity objects
161 Once you get the name of the IRC server, you can get the process
162 object by passing the name to the function riece-server-process.
164 *** riece-identity objects
166 A riece-identity object represents a name of a channel/user. It is
167 used to distinguish a channel/user among several servers.
169 A riece-identity object is actually a vector, which consists of two
170 elements listed below.
173 A channel/user name local to an IRC server.
176 The name of the IRC server.
178 Methods to manipulate riece-identity object are listed below.
180 - riece-make-identity prefix &optional server
181 Create a new riece-identity object. If the server argument is
182 omitted, it sets the server part to the value returned by the
183 riece-find-server-name function.
185 - riece-identity-prefix identity
186 Return the prefix element from the given riece-identity object.
188 - riece-identity-server identity
189 Return the server element from the given riece-identity object.
191 - riece-identity-equal ident1 ident2
192 Return t, if two riece-identity objects are equal.
194 - riece-identity-equal-no-server ident1 ident2
195 Return t, if two riece-identity objects are equal. This function
196 only consider a prefix part of a riece-identity object.
198 - riece-identity-member elt list
199 Return non-nil if a riece-identity object is an element of a list.
201 *** Channels and users
203 A riece-channel object provides an abstraction of a channel.
204 Likewise, a riece-user object provides an abstraction of a user.
206 **** riece-channel objects
208 A riece-channel object has many information about a channel. A
209 riece-channel object is actually a vector whose seven elements are listed
213 A list of nicknames which are of users in this channel.
216 A list of nicknames which are of channel operators in this channel.
219 A list of nicknames which are of users who have the right to speak
223 An alist which represents modes of this channel.
226 A list of patterns set by MODE +b.
229 A list of patterns set by MODE +I.
232 A list of patterns set by MODE +e.
234 **** riece-user objects
236 A riece-user object has many information about a user. A riece-user
237 object is actually a vector whose four elements are listed below.
240 A list of channel names this user is participating.
243 Connection information of this user, set in "<user>@<host>" format.
246 An alist which represents modes of this user.
249 A flag represent whether this user is AWAY.
251 **** The Mediator pattern
253 The riece-naming module is used to manage relationships between
254 channels and users. It utilizes the Mediator design pattern.
256 Using the riece-naming module allows to safely access to the namespace
257 rather than directly connects riece-channel/riece-user objects.
259 The riece-naming module provides the following functions.
261 - riece-naming-assert-join user-name channel-name
262 Assert that a user is a member of a channel.
264 - riece-naming-assert-part user-name channel-name
265 Assert that a user is no longer a member of a channel.
267 - riece-naming-assert-rename old-name new-name
268 Assert that a user changed his nickname.
272 There is a mechanism to connect events and display objects (windows,
273 buffers, and modeline indicators). This is done by signals.
275 When it is needed to redraw, a signal is emitted. The concept of
276 signals is corresponding to signals in generic window system toolkit
279 To emit a signal, use riece-emit-signal.
281 - riece-emit-signal signal-name &rest args
282 Emit a signal named signal-name with args.
284 To define a function called when a signal is emitted, use
285 riece-connect-signal.
287 - riece-connect-signal signal-name slot-function &optional
288 filter-function handback
290 Give a signal a slot-function. The slot-function gets two
291 arguments: the signal object itself and a handback object given as
292 the fourth argument of riece-connect-signal.
294 If the third argument filter-function is specified, the
295 slot-function is called conditionally. The filter-function gets the
296 signal object and returns nil or t. If the return value is nil, the
297 slot-function is not called.
299 To access to a signal object, use the following functions.
301 - riece-signal-name signal
302 Return the name of a signal.
305 Return the data of a signal.
307 Below is a list of signal names reserved.
309 - channel-list-changed
310 Need update the channel list.
313 Need update the user list.
314 (This signal gets a riece-identity object as an argument which
315 represents the channel.)
318 A user selected another channel.
320 - user-joined-channel
321 A user joined a channel.
322 (This signal gets two riece-identity objects as arguments
323 corresponding to the user and the channel respectively.)
326 A user left a channel.
327 (This signal gets two riece-identity objects as arguments
328 corresponding to the user and the channel respectively.)
331 A user changed his nickname.
332 (This signal gets two riece-identity objects as arguments
333 corresponding to the old and the new nickname respectively.)
336 A user changed his AWAY status.
337 (This signal gets a riece-identity object as an argument which
338 represents the user.)
340 - user-operator-changed
341 A user changed his IRC operator status.
342 (This signal gets a riece-identity object as an argument which
343 represents the user.)
345 - channel-topic-changed
346 A topic of a channel changed.
347 (This signal gets a riece-identity object as an argument which
348 represents the channel.)
350 - channel-modes-changed
351 Modes of a channel changed.
352 (This signal gets a riece-identity object as an argument which
353 represents the channel.)
355 - channel-operators-changed
356 A list of operators in a channel changed.
357 (This signal gets a riece-identity object as an argument which
358 represents the channel.)
360 - channel-speakers-changed
361 A list of users who have the right to speak in a channel changed.
362 (This signal gets a riece-identity object as an argument which
363 represents the channel.)
365 - buffer-freeze-changed
366 A buffer is frozen or unfrozen.
367 (This signal gets a buffer as an argument.)
371 Elisp modules that satisfy add-on spec should provide the following
374 - <module-name>-requires (optional)
375 Return a list of names of other add-ons this add-on depends.
377 - <module-name>-insinuate
378 Called on initialization of this module.
380 - <module-name>-uninstall (optional)
381 Called on uninstallation of this module.
383 - <module-name>-enable (optional)
384 Called when this add-on is enabled.
386 - <module-name>-disable (optional)
387 Called when this add-on is disabled.
389 It is recommended to set short explanation of the add-on to
390 <module-name>-description variable which is displayed on add-on
391 listing shown up by C-c ^ (M-x riece-command-list-addons).
393 To see the add-on's enabled/disabled status, check riece-addon-enabled
394 property set on <module-name> symbol.
396 Riece does the following procedure on add-ons when startup.
398 (1) Load add-ons listed in the riece-addons variable.
400 (2) Call <module-name>-requires on each add-on (if exists) and build a
403 (3) Sort the dependency graph.
405 (4) Call <module-name>-insinuate on each add-on in order of the
408 (5) Call <module-name>-enable on each add-on, iff it supports
409 enabling/disabling and is not disabled explicitly.
411 Add-ons are loaded from directories listed in load-path, or from
416 There are hooks called "handler hooks " which have special meaning in
417 Riece. Handler hooks are called before/after processing IRC messages.
419 - riece-<message>-hook
420 Called before processing an IRC message.
422 - riece-after-<message>-hook
423 Called after processing an IRC message.
425 Where <message> is a type of IRC message and consists only lowercase
428 If riece-<message>-hook returns non-nil, <message> is not processed.
429 In this case riece-after-<message>-hook is not called.
431 Handler hooks gets two arguments corresponding to prefix and
432 parameters in RFC2812.