Revised.
[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-strict-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-strict-user-regexp
36   (concat "[][\\\\`_^{|}A-Za-z]"
37           (riece-make-interval-regexp "[][\\\\`_^{|}A-Za-z0-9-]" 0 8)))
38
39 (defconst riece-laxed-channel-regexp
40   "[+&#!][^\0\7\r\n ,:]*\\(:[^\0\7\r\n ,:]*\\)?")
41
42 (defconst riece-laxed-user-regexp
43   "[][\\\\`_^{|}A-Za-z][][\\\\`_^{|}A-Za-z0-9-]*")
44
45 (defvar riece-channel-regexp riece-laxed-channel-regexp)
46 (defvar riece-user-regexp riece-laxed-user-regexp)
47
48 ;;; Global variables:
49 (defvar riece-server-process-alist nil
50   "An alist mapping server names to processes.")
51
52 (defvar riece-current-channel nil
53   "The channel you currently have joined.")
54 (defvar riece-current-channels nil
55   "The channels you have currently joined.")
56 (defvar riece-join-channel-candidate nil
57   "The candidate for channel to be used with the next join command.")
58
59 (defvar riece-save-variables-are-dirty nil
60   "Non nil if the variables in `riece-saved-forms' are changed.")
61
62 (defvar riece-polling 0
63   "Interval for polling the server.")
64
65 (defvar riece-reconnect-with-password nil
66   "If non-nil, attempt to reconnect with password.")
67
68 (defvar riece-obarray-size 1327
69   "The size of obarray used by riece on channelname and username space.")
70
71 ;;; Variables local to the server buffers:
72 (defvar riece-server-name nil
73   "The name of the server.
74 Local to the server buffers.")
75 (defvar riece-real-nickname nil
76   "Your nickname the server offers.
77 Local to the server buffers.")
78 (defvar riece-last-nickname nil
79   "The last nickname you requested.
80 Local to the server buffers.")
81 (defvar riece-nick-accepted nil
82   "The flag your nickname is accepted by the server.
83 Possible values are nil, `ok', and `sent'.
84 Local to the server buffers.")
85 (defvar riece-real-server-name nil
86   "The server name offered by the server.
87 Local to the server buffers.")
88 (defvar riece-real-userhost nil
89   "Your hostname the server offers.
90 Local to the server buffers.")
91 (defvar riece-user-at-host ""
92   "The user@host for the current input.
93 Local to the server buffers.")
94 (defvar riece-user-at-host-type nil
95   "The authentication type of `riece-user-at-host'.
96 Possible values are 'ok 'not-verified 'fake or 'invalid.
97 Local to the server buffers.")
98 (defvar riece-supported-user-modes nil
99   "User modes supported by server.
100 Local to the server buffers.")
101 (defvar riece-supported-channel-modes nil
102   "Channel modes supported by server.
103 Local to the server buffers.")
104 (defvar riece-channel-filter ""
105   "Filter of the result of NAMES or LIST.
106 This enables us to use \\[universal-argument] with NAMES and TOPIC.
107 Local to the server buffers.")
108 (defvar riece-read-point nil
109   "Point at the last input was seen.
110 Local to the server buffers.")
111 (defvar riece-obarray nil
112   "Namespace of the IRC world.
113 Local to the server buffers.")
114 (defvar riece-coding-system nil
115   "Coding system for process I/O.
116 Local to the server buffers.")
117
118 ;;; Variables local to the channel buffers:
119 (defvar riece-freeze nil
120   "If t, channel window is locked and will not be scrolled.
121 If 'own, channel window is locked until the user begins to speak.
122 Local to the channel buffers.")
123
124 (defvar riece-freeze-indicator nil
125   "String displayed on the modeline to allow the user to tell if the
126 channel buffer is locked.
127 Local to the channel buffers.")
128
129 ;;; Modeline indicators:
130 (defvar riece-channel-indicator "None"
131   "String displayed on the modeline to indicate the current channel.")
132 (defvar riece-long-channel-indicator "None"
133   "String displayed on the modeline to indicate the current channel.
134 Generally, this string will contain more information than
135 riece-channel-indicator.")
136 (defvar riece-channel-list-indicator "No channel"
137   "String displayed on the modeline to show the joined channels.")
138 (defvar riece-user-indicator nil
139   "String displayed on the modeline to show the current nickname.")
140
141 (defvar riece-away-indicator "-"
142   "String displayed on the modeline to allow the user to tell if the
143 user is away.")
144 (defvar riece-operator-indicator "-"
145   "String displayed on the modeline to allow the user to tell if the
146 user is a operator.")
147
148 ;;; Buffers:
149 (defvar riece-command-buffer nil
150   "The command buffer.")
151 (defvar riece-dialogue-buffer nil
152   "Buffer for whole conversation.")
153 (defvar riece-others-buffer nil
154   "Buffer for other messages.")
155 (defvar riece-channel-list-buffer nil
156   "Buffer for channel list.")
157 (defvar riece-user-list-buffer nil
158   "Buffer for user list.")
159
160 (defvar riece-channel-buffer nil
161   "Buffer for messages arrived in the current channel.")
162
163 (defvar riece-buffer-list nil)
164 (defvar riece-overriding-server-name nil)
165
166 (defconst riece-change-prefix "*** Change: ")
167 (defconst riece-notice-prefix "*** Notice: ")
168 (defconst riece-wallops-prefix "*** Notice: ")
169 (defconst riece-error-prefix "*** Error: ")
170 (defconst riece-info-prefix "*** Info: ")
171 (defconst riece-prefix-regexp "\\*\\*\\* \\([^:]+: \\)")
172
173 (defconst riece-time-prefix-regexp "[0-9][0-9]:[0-9][0-9] ")
174
175 (provide 'riece-globals)
176
177 ;;; riece-globals.el ends here