* riece.el (riece): Connect to servers in riece-startup-server-list.
[riece] / lisp / riece-globals.el
1 ;;; riece-globals.el --- global variables and constants.
2 ;; Copyright (C) 1998-2003 Daiki Ueno
3
4 ;; Author: Daiki Ueno <ueno@unixuser.org>
5 ;; Created: 1998-09-28
6 ;; Keywords: IRC, riece
7
8 ;; This file is part of Riece.
9
10 ;; This program is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
13 ;; any later version.
14
15 ;; This program is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 ;; GNU General Public License for more details.
19
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
24
25 ;;; Code:
26
27 (require 'riece-compat)                 ;riece-make-interval-regexp
28
29 ;;; Constants:
30 (defconst riece-channel-regexp
31   (concat "\\([+&#]\\|!"
32           (riece-make-interval-regexp "[A-Z0-9]" 5)
33           "\\|!!\\)[^\0\7\r\n ,:]*\\(:[^\0\7\r\n ,:]*\\)?"))
34
35 (defconst riece-user-regexp
36   (concat "[][\\\\`_^{|}A-Za-z]"
37           (riece-make-interval-regexp "[][\\\\`_^{|}A-Za-z0-9-]" 0 8)))
38
39 ;;; Global variables:
40 (defvar riece-server-process-alist nil
41   "An alist mapping server names to processes.")
42
43 (defvar riece-current-channel nil
44   "The channel you currently have joined.")
45 (defvar riece-current-channels nil
46   "The channels you have currently joined.")
47 (defvar riece-join-channel-candidate nil
48   "The candidate for channel to be used with the next join command.")
49
50 (defvar riece-save-variables-are-dirty nil
51   "Non nil if the variables in `riece-saved-forms' are changed.")
52
53 (defvar riece-polling 0
54   "Interval for polling the server.")
55
56 (defvar riece-reconnect-with-password nil
57   "If non-nil, attempt to reconnect with password.")
58
59 (defvar riece-obarray-size 1327
60   "The size of obarray used by riece on channelname and username space.")
61
62 ;;; Variables local to the server buffers:
63 (defvar riece-server-name nil
64   "The name of the server.
65 Local to the server buffers.")
66 (defvar riece-real-nickname nil
67   "Your nickname the server offers.
68 Local to the server buffers.")
69 (defvar riece-last-nickname nil
70   "The last nickname you requested.
71 Local to the server buffers.")
72 (defvar riece-nick-accepted nil
73   "The flag your nickname is accepted by the server.
74 Possible values are nil, `ok', and `sent'.
75 Local to the server buffers.")
76 (defvar riece-real-server-name nil
77   "The server name offered by the server.
78 Local to the server buffers.")
79 (defvar riece-real-userhost nil
80   "Your hostname the server offers.
81 Local to the server buffers.")
82 (defvar riece-user-at-host ""
83   "The user@host for the current input.
84 Local to the server buffers.")
85 (defvar riece-user-at-host-type nil
86   "The authentication type of `riece-user-at-host'.
87 Possible values are 'ok 'not-verified 'fake or 'invalid.
88 Local to the server buffers.")
89 (defvar riece-supported-user-modes nil
90   "User modes supported by server.
91 Local to the server buffers.")
92 (defvar riece-supported-channel-modes nil
93   "Channel modes supported by server.
94 Local to the server buffers.")
95 (defvar riece-channel-filter ""
96   "Filter of the result of NAMES or LIST.
97 This enables us to use \\[universal-argument] with NAMES and TOPIC.
98 Local to the server buffers.")
99 (defvar riece-read-point nil
100   "Point at the last input was seen.
101 Local to the server buffers.")
102 (defvar riece-obarray nil
103   "Namespace of the IRC world.
104 Local to the server buffers.")
105 (defvar riece-coding-system nil
106   "Coding system for process I/O.
107 Local to the server buffers.")
108
109 ;;; Variables local to the channel buffers:
110 (defvar riece-freeze nil
111   "If t, channel window is not scrolled.
112 If 'own, channel window is not scrolled until you speak.
113 Local to the channel buffers.")
114
115 ;;; Modeline indicators:
116 (defvar riece-channel-indicator "None"
117   "A modeline indicator of the current channel.")
118 (defvar riece-long-channel-indicator "None"
119   "A modeline indicator of the current channel.")
120 (defvar riece-channel-list-indicator "No channel"
121   "A modeline indicator of the current joined channels.")
122 (defvar riece-user-indicator nil)
123
124 (defvar riece-away-indicator "-")
125 (defvar riece-operator-indicator "-")
126 (defvar riece-freeze-indicator "-")
127
128 ;;; Buffers:
129 (defvar riece-command-buffer nil
130   "The command buffer.")
131 (defvar riece-dialogue-buffer nil
132   "Buffer for whole conversation.")
133 (defvar riece-others-buffer nil
134   "Buffer for other messages.")
135 (defvar riece-channel-list-buffer nil
136   "Buffer for channel list.")
137 (defvar riece-user-list-buffer nil
138   "Buffer for user list.")
139
140 (defvar riece-channel-buffer nil
141   "Buffer for messages arrived in the current channel.")
142
143 (defvar riece-buffer-list nil)
144 (defvar riece-overriding-server-name nil)
145
146 (defconst riece-change-prefix "*** Change: ")
147 (defconst riece-notice-prefix "*** Notice: ")
148 (defconst riece-wallops-prefix "*** Notice: ")
149 (defconst riece-error-prefix "*** Error: ")
150 (defconst riece-info-prefix "*** Info: ")
151 (defconst riece-prefix-regexp "\\*\\*\\* \\([^:]+: \\)")
152
153 (defconst riece-time-prefix-regexp "[0-9][0-9]:[0-9][0-9] ")
154
155 (provide 'riece-globals)
156
157 ;;; riece-globals.el ends here