* riece-300.el (riece-handle-312-message): Use server name
[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 locked and will not be scrolled.
112 If 'own, channel window is locked until the user begins to speak.
113 Local to the channel buffers.")
114
115 (defvar riece-freeze-indicator nil
116   "String displayed on the modeline to allow the user to tell if the
117 channel buffer is locked.
118 Local to the channel buffers.")
119
120 ;;; Modeline indicators:
121 (defvar riece-channel-indicator "None"
122   "String displayed on the modeline to indicate the current channel.")
123 (defvar riece-long-channel-indicator "None"
124   "String displayed on the modeline to indicate the current channel.
125 Generally, this string will contain more information than
126 riece-channel-indicator.")
127 (defvar riece-channel-list-indicator "No channel"
128   "String displayed on the modeline to show the joined channels.")
129 (defvar riece-user-indicator nil
130   "String displayed on the modeline to show the current nickname.")
131
132 (defvar riece-away-indicator "-"
133   "String displayed on the modeline to allow the user to tell if the
134 user is away.")
135 (defvar riece-operator-indicator "-"
136   "String displayed on the modeline to allow the user to tell if the
137 user is a operator.")
138
139 ;;; Buffers:
140 (defvar riece-command-buffer nil
141   "The command buffer.")
142 (defvar riece-dialogue-buffer nil
143   "Buffer for whole conversation.")
144 (defvar riece-others-buffer nil
145   "Buffer for other messages.")
146 (defvar riece-channel-list-buffer nil
147   "Buffer for channel list.")
148 (defvar riece-user-list-buffer nil
149   "Buffer for user list.")
150
151 (defvar riece-channel-buffer nil
152   "Buffer for messages arrived in the current channel.")
153
154 (defvar riece-buffer-list nil)
155 (defvar riece-overriding-server-name nil)
156
157 (defconst riece-change-prefix "*** Change: ")
158 (defconst riece-notice-prefix "*** Notice: ")
159 (defconst riece-wallops-prefix "*** Notice: ")
160 (defconst riece-error-prefix "*** Error: ")
161 (defconst riece-info-prefix "*** Info: ")
162 (defconst riece-prefix-regexp "\\*\\*\\* \\([^:]+: \\)")
163
164 (defconst riece-time-prefix-regexp "[0-9][0-9]:[0-9][0-9] ")
165
166 (provide 'riece-globals)
167
168 ;;; riece-globals.el ends here