Fix byte-compile error
[riece] / lisp / riece-globals.el
1 ;;; riece-globals.el --- global variables and constants. -*- lexical-binding: t -*-
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., 51 Franklin Street, Fifth Floor,
23 ;; Boston, MA 02110-1301, 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-user-obarray-size 1327
69   "The size of obarray used by riece on user name space.")
70
71 (defvar riece-channel-obarray-size 103
72   "The size of obarray used by riece on channel name space.")
73
74 (defvar riece-addon-dependencies nil)
75
76 ;;; Variables local to the server buffers:
77 (defvar riece-server-name nil
78   "The name of the server.
79 Local to the server buffers.")
80 (defvar riece-real-nickname nil
81   "Your nickname the server offers.
82 Local to the server buffers.")
83 (defvar riece-last-nickname nil
84   "The last nickname you requested.
85 Local to the server buffers.")
86 (defvar riece-nick-accepted nil
87   "The flag your nickname is accepted by the server.
88 Possible values are nil, `ok', and `sent'.
89 Local to the server buffers.")
90 (defvar riece-real-server-name nil
91   "The server name offered by the server.
92 Local to the server buffers.")
93 (defvar riece-real-userhost nil
94   "Your hostname the server offers.
95 Local to the server buffers.")
96 (defvar riece-user-at-host ""
97   "The user@host for the current input.
98 Local to the server buffers.")
99 (defvar riece-user-at-host-type nil
100   "The authentication type of `riece-user-at-host'.
101 Possible values are 'ok 'not-verified 'fake or 'invalid.
102 Local to the server buffers.")
103 (defvar riece-supported-user-modes nil
104   "User modes supported by server.
105 Local to the server buffers.")
106 (defvar riece-supported-channel-modes nil
107   "Channel modes supported by server.
108 Local to the server buffers.")
109 (defvar riece-channel-filter ""
110   "Filter of the result of NAMES or LIST.
111 This enables us to use \\[universal-argument] with NAMES and TOPIC.
112 Local to the server buffers.")
113 (defvar riece-read-point nil
114   "Point at the last input was seen.
115 Local to the server buffers.")
116 (defvar riece-filter-running nil
117   "Lock of the process filter; non-nil indicates the process filter is running.
118 Local to the server buffers.")
119 (defvar riece-send-queue nil
120   "Send queue for avoiding client flood.
121 Local to the server buffers.")
122 (defvar riece-send-size nil
123   "Size of the last send.
124 Local to the server buffers.")
125 (defvar riece-last-send-time nil
126   "Timestamp of the last send.
127 Local to the server buffers.")
128 (defvar riece-user-obarray nil
129   "USER namespace of the IRC world.
130 Local to the server buffers.")
131 (defvar riece-channel-obarray nil
132   "Channel namespace of the IRC world.
133 Local to the server buffers.")
134 (defvar riece-coding-system nil
135   "Coding system for process I/O.
136 Local to the server buffers.")
137 (defvar riece-channel-cache nil
138   "Cache of channel names.
139 Local to the server buffers.")
140 (defvar riece-user-cache nil
141   "Cache of user names.
142 Local to the server buffers.")
143
144 ;;; Variables local to the channel buffers:
145 (defvar riece-freeze nil
146   "If t, channel window is locked and will not be scrolled.
147 If 'own, channel window is locked until the user begins to speak.
148 Local to the channel buffers.")
149
150 (defvar riece-freeze-indicator nil
151   "String displayed on the modeline to allow the user to tell if the
152 channel buffer is locked.
153 Local to the channel buffers.")
154
155 (defvar riece-channel-buffer-window-point nil
156   "Last value of point in window which displayed the channel buffer.
157 Local to the channel buffers.")
158
159 ;;; Modeline indicators:
160 (defvar riece-mode-line-buffer-identification nil)
161 (put 'riece-mode-line-buffer-identification 'risky-local-variable t)
162 (defvar riece-channel-indicator "None"
163   "String displayed on the modeline to indicate the current channel.")
164 (put 'riece-channel-indicator 'risky-local-variable t)
165 (defvar riece-long-channel-indicator "None"
166   "String displayed on the modeline to indicate the current channel.
167 Generally, this string will contain more information than
168 riece-channel-indicator.")
169 (put 'riece-long-channel-indicator 'risky-local-variable t)
170 (defvar riece-channel-list-indicator "No channel"
171   "String displayed on the modeline to show the joined channels.")
172 (put 'riece-channel-list-indicator 'risky-local-variable t)
173 (defvar riece-user-indicator nil
174   "String displayed on the modeline to show the current nickname.")
175 (put 'riece-user-indicator 'risky-local-variable t)
176
177 (defvar riece-away-indicator "-"
178   "String displayed on the modeline to allow the user to tell if the
179 user is away.")
180 (put 'riece-away-indicator 'risky-local-variable t)
181 (defvar riece-operator-indicator "-"
182   "String displayed on the modeline to allow the user to tell if the
183 user is an operator.")
184 (put 'riece-operator-indicator 'risky-local-variable t)
185 (defvar riece-channel-status-indicator "-"
186   "String displayed on the modeline to allow the user to tell if the
187 user's status on the current channel.")
188 (put 'riece-channel-status-indicator 'risky-local-variable t)
189
190 ;;; Buffers:
191 (defvar riece-command-buffer nil
192   "The command buffer.")
193 (defvar riece-dialogue-buffer nil
194   "Buffer for whole conversation.")
195 (defvar riece-others-buffer nil
196   "Buffer for other messages.")
197 (defvar riece-channel-list-buffer nil
198   "Buffer for channel list.")
199 (defvar riece-user-list-buffer nil
200   "Buffer for user list.")
201 (defvar riece-channel-buffer nil
202   "Buffer for messages arrived in the current channel.")
203 (defvar riece-temp-buffer nil
204   "Buffer for temporally use.")
205 (defvar riece-debug-buffer nil
206   "Buffer for debug output.")
207
208 (defvar riece-buffer-list nil)
209 (defvar riece-overriding-server-name nil)
210
211 (defconst riece-change-prefix "*** Change: ")
212 (defconst riece-notice-prefix "*** Notice: ")
213 (defconst riece-wallops-prefix "*** Notice: ")
214 (defconst riece-error-prefix "*** Error: ")
215 (defconst riece-info-prefix "*** Info: ")
216 (defconst riece-prefix-regexp "\\*\\*\\* \\([^:]+: \\)")
217
218 (defconst riece-time-prefix-regexp "[0-9][0-9]:[0-9][0-9] ")
219
220 (provide 'riece-globals)
221
222 ;;; riece-globals.el ends here