aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/erc
diff options
context:
space:
mode:
authorMiles Bader2008-01-30 07:57:28 +0000
committerMiles Bader2008-01-30 07:57:28 +0000
commitd235ca2ff8fab139ce797757fcb159d1e28fa7e0 (patch)
tree96c5cd1a06a0d9dc26e8470c6eabfc032c0046f3 /lisp/erc
parent3709a060f679dba14df71ae64a0035fa2b5b3106 (diff)
parent02cbe062bee38a6705bafb1699d77e3c44cfafcf (diff)
downloademacs-d235ca2ff8fab139ce797757fcb159d1e28fa7e0.tar.gz
emacs-d235ca2ff8fab139ce797757fcb159d1e28fa7e0.zip
Merge from emacs--devo--0
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-324
Diffstat (limited to 'lisp/erc')
-rw-r--r--lisp/erc/ChangeLog1088
-rw-r--r--lisp/erc/ChangeLog.07839
-rw-r--r--lisp/erc/erc-backend.el102
-rw-r--r--lisp/erc/erc-button.el26
-rw-r--r--lisp/erc/erc-compat.el47
-rw-r--r--lisp/erc/erc-dcc.el133
-rw-r--r--lisp/erc/erc-goodies.el82
-rw-r--r--lisp/erc/erc-list.el229
-rw-r--r--lisp/erc/erc-networks.el16
-rw-r--r--lisp/erc/erc-page.el8
-rw-r--r--lisp/erc/erc-replace.el11
-rw-r--r--lisp/erc/erc-services.el26
-rw-r--r--lisp/erc/erc-track.el135
-rw-r--r--lisp/erc/erc-xdcc.el13
-rw-r--r--lisp/erc/erc.el150
15 files changed, 1847 insertions, 1058 deletions
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog
index b7d1d1bfe30..23057faa0b6 100644
--- a/lisp/erc/ChangeLog
+++ b/lisp/erc/ChangeLog
@@ -1,828 +1,288 @@
12008-01-04 Stefan Monnier <monnier@iro.umontreal.ca> 12008-01-26 Michael Olson <mwolson@gnu.org>
2
3 * erc-ibuffer.el (erc-channel-modes):
4 Pass mode-name through format-mode-line
5
62007-12-09 Michael Olson <mwolson@gnu.org>
7
8 * erc-services.el (erc-nickserv-alist): Fix regexps for GRnet.
9
102007-12-09 Giorgos Keramidas <keramida@ceid.upatras.gr> (tiny change)
11
12 * erc-backend.el, erc.el:
13 Parse 275 (secure connection) responses.
14
15 * erc-services.el: Add identification hooks for GRnet, the Greek
16 IRC network <http://www.irc.gr>.
17
182007-12-08 David Kastrup <dak@gnu.org>
19
20 * erc-stamp.el (erc-echo-timestamp):
21 * erc-lang.el (language):
22 * erc-backend.el (erc-server-connect): Fix buggy call to `message'.
23
242007-12-07 Edward O'Connor <ted@oconnor.cx>
25
26 * erc-services.el: Provide a hook that runs when nickserv confirms
27 that the user has successfully identified.
28 (services, erc-nickserv-identify-mode): Add and remove
29 erc-nickserv-identification-autodetect from
30 erc-server-NOTICE-functions.
31 (erc-nickserv-alist): Add SUCCESS-REGEXP to each entry.
32 (erc-nickserv-alist-identified-regexp)
33 (erc-nickserv-identification-autodetect): New functions.
34 (erc-nickserv-identified-hook): New hook.
35
362007-12-06 D. Goel <deego3@gmail.com>
37
38 * erc-match.el (erc-add-entry-to-list): Fix buggy call to `error'.
39
402007-12-01 Glenn Morris <rgm@gnu.org>
41
42 * erc-backend.el (erc-server-send-ping): Move after definition of
43 erc-server-send.
44
45 * erc.el (iswitchb-temp-buflist, iswitchb-read-buffer)
46 (erc-controls-strip): Declare for compiler.
47 (erc-iswitchb): Don't require iswitchb when compiling. Test
48 iswitchb-mode is bound.
49
502007-11-30 Dan Nicolaescu <dann@ics.uci.edu>
51
52 * erc.el (open-ssl-stream, open-tls-stream, erc-network-name):
53 Declare as functions.
54
552007-11-29 Giorgos Keramidas <keramida@ceid.upatras.gr> (tiny change)
56
57 * erc-backend.el, erc.el:
58 Parse 307 (nick has identified) responses.
59
602007-11-15 Juanma Barranquero <lekktu@gmail.com>
61
62 * erc.el (erc-open):
63 * erc-backend.el (define-erc-response-handler):
64 * erc-log.el (log):
65 * erc-match.el (erc-log-matches): Fix typos in docstrings.
66
672007-11-11 Michael Olson <mwolson@gnu.org>
68
69 * erc-autoaway.el (erc-autoaway-possibly-set-away):
70 * erc-netsplit.el (erc-netsplit-timer):
71 * erc-notify.el (erc-notify-timer):
72 * erc-track.el (erc-user-is-active): Only run if we have
73 successfully established a connection to the server and have
74 logged in. I suspect that sending messages too soon may make some
75 IRC servers not respond well, particularly when the network
76 connection is iffy or subject to traffic-shaping.
77
782007-11-01 Michael Olson <mwolson@gnu.org>
79
80 * erc-compat.el (erc-set-write-file-functions): New compatibility
81 function to set the write hooks appropriately.
82
83 * erc-log.el (erc-log-setup-logging): Use
84 erc-set-write-file-functions. This fixes a byte-compiler warning.
85
86 * erc-stamp.el: Silence byte-compiler warning about
87 erc-fill-column.
88
89 * erc.el (erc-with-all-buffers-of-server): Bind the result of
90 mapcar to a variable in order to silence a byte-compiler warning.
91
922007-10-29 Michael Olson <mwolson@gnu.org>
93
94 * erc-ibuffer.el (erc-modified-channels-alist): Use
95 eval-when-compile, and explain why we are doing this.
96
972007-10-25 Dan Nicolaescu <dann@ics.uci.edu>
98
99 * erc-ibuffer.el (erc-modified-channels-alist): Pacify
100 byte-compiler.
101
1022007-10-13 Glenn Morris <rgm@gnu.org>
103
104 * erc-track.el (erc-modified-channels-update): Use mapc rather
105 than mapcar.
106
1072007-10-12 Diane Murray <disumu@x3y2z1.net>
108
109 * erc.el (erc-join-channel): Prompt for channel key if C-u or
110 another prefix-arg was typed.
111
112 * NEWS: Noted this change.
113
1142007-10-07 Michael Olson <mwolson@gnu.org>
115
116 * erc.el (erc-cmd-ME'S): New command that handles the case where
117 someone types "/me's". It concatenates the text " 's" to the
118 beginning of the input and then sends the result like a normal
119 "/me" command.
120 (erc-command-regexp): Permit single-quote character.
121
1222007-09-30 Aidan Kehoe <kehoea@parhasard.net> (tiny change)
123
124 * erc-log.el (erc-save-buffer-in-logs): Prevent spurious warnings
125 when looking at a log file and concurrently saving to it.
126
1272007-09-18 Exal de Jesus Garcia Carrillo <exal@gnu.org> (tiny change)
128
129 * erc.texi (Special-Features): Fix small typo.
130
1312007-09-16 Michael Olson <mwolson@gnu.org>
132
133 * erc-track.el (erc-track-switch-direction): Mention
134 erc-track-faces-priority-list. Thanks to Leo for the suggestion.
135
1362007-09-11 Exal de Jesus Garcia Carrillo <exal@gnu.org> (tiny change)
137
138 * erc-sound.el: Fix typo in setting up instructions.
139
1402007-09-10 Michael Olson <mwolson@gnu.org>
141
142 * Makefile (elpa): Copy dir template rather than echoing a few
143 lines. The reason for this is that the ELPA package for ERC was
144 getting a corrupt dir entry.
145
146 * dir-template: Template for the ELPA dir file.
147
1482007-09-08 Michael Olson <mwolson@gnu.org>
149
150 * erc-log.el (erc-log-filter-function): New option that specifies
151 the function to call for filtering text before writing it to a log
152 file. Thanks to David O'Toole for the suggestion.
153 (erc-save-buffer-in-logs): Use erc-log-filter-function. Make sure
154 we carry along the value of coding-system-for-write, because this
155 could potentially be shadowed by the temporary buffer.
156
157 * erc.el (erc-version-string): Update to 5.3, development version.
158
1592007-09-07 Glenn Morris <rgm@gnu.org>
160
161 * erc.el (erc-toggle-debug-irc-protocol): Fix call to
162 erc-view-mode-enter.
163
1642007-08-08 Glenn Morris <rgm@gnu.org>
165
166 * erc-log.el, erc.el: Replace `iff' in doc-strings and comments.
167
1682007-09-03 Michael Olson <mwolson@gnu.org>
169
170 * erc.el (erc-default-port): Make this an integer value rather
171 than a string. Thanks to Luca Capello for the report.
172
1732007-08-27 Michael Olson <mwolson@gnu.org>
174
175 * erc.el (erc-cmd-GQUIT): If erc-kill-queries-on-quit is non-nil,
176 kill all query buffers after 4 seconds.
177
1782007-08-16 Michael Olson <mwolson@gnu.org>
179
180 * NEWS: Add ERC 5.3 changes section, and mention jbms' erc-track
181 compatibility note.
182
183 * erc-track.el (erc-track-list-changed-hook): Turn this into a
184 customizable option.
185 (erc-track-switch-direction): Add 'importance option.
186 (erc-modified-channels-display): If erc-track-switch-direction is
187 'importance, call erc-track-sort-by-importance.
188 (erc-track-face-priority): New function that returns a number
189 indicating the position of a face in erc-track-faces-priority-list.
190 (erc-track-sort-by-importance): New function that sorts
191 erc-modified-channels-list according to erc-track-face-priority.
192 (erc-track-get-active-buffer): Make 'oldest a rough opposite of
193 'importance.
194
1952007-08-14 Jeremy Maitin-Shepard <jbms@cmu.edu>
196
197 * erc-track.el (erc-track-remove-disconnected-buffers): New
198 variable which controls whether buffers associated with a server
199 that is disconnected should be removed from
200 `erc-modified-channels-alist'. Existing behavior is to
201 unconditionally remove such buffers, which is achieved by setting
202 `erc-track-removed-disconnected-buffers' to t. When set to t,
203 which is the new default value, such buffers remain in the list,
204 which I think is often the desired behavior, since the user may
205 likely wish to find out about activity that occurred in a channel
206 prior to it being disconnected.
207 (erc-track-list-changed-hook): New hook that is run whenever the
208 contents of `erc-modified-channels-alist' changes; it is useful
209 for users such as myself that don't use the default mode-line
210 notification but instead use a separate mechanism (which is tied
211 to my window manager) to provide notification of channel activity.
212 (erc-track-get-buffer-window): New function that acts as a wrapper
213 around `get-buffer-window' that handles the `selected-visible'
214 option of `erc-track-visibility'; previously, the value of
215 `erc-track-visibility' was passed directly to `get-buffer-window',
216 which does not support `selected-visible'; consequently,
217 `selected-visible' was not properly supported.
218 (erc-track-modified-channels): Fix a bug in the logic for removing
219 buffers from the list in certain cases.
220 (erc-track-position-in-mode-line): Add a supported value that
221 specifies that the tracking information should not be added to the
222 mode line at all. The value of nil is used to indicate that the
223 information should not be added at all to the mode line.
224 (erc-track-add-to-mode-line): Check for position eq to t, rather
225 than non-nil.
226 (erc-buffer-visible): Use erc-track-get-buffer-window.
227 (erc-modified-channels-update): Take
228 erc-track-remove-disconnected-buffers into account.
229 (erc-modified-channels-display): Run `erc-track-list-changed-hook'.
230
231 * erc.el (erc-reuse-frames): New option that determines whether
232 new frames are always created. Defaults to t. This only has an
233 effect when erc-join-buffer is set to 'frame.
234 (erc-setup-buffer): Use it.
235
2362007-08-14 Michael Olson <mwolson@gnu.org>
237
238 * erc-backend.el (erc-server-reconnect): If the server buffer has
239 been killed, use the current buffer instead. If the current
240 buffer is not an ERC buffer, give an error. This fixes a bug when
241 /reconnect is run from a channel buffer whose server buffer has
242 been deleted. Thanks to jbms for the report.
243 (erc-process-sentinel-1): Take server buffer as an argument, so
244 that we can make sure that it is current.
245 (erc-process-sentinel): Pass buffer to erc-process-sentinel-1.
246 (erc-process-sentinel-2): New function split from
247 erc-process-sentinel-1. If server buffer is deleted during a
248 reconnect attempt, stop trying to reconnect. Fix bug where
249 reconnect was not happening when erc-server-reconnect-attempts was
250 t. Call erc-server-reconnect-p only once each time. If we are
251 instructed to try connecting indefinitely, tell the user that they
252 can stop this by killing the server buffer. Call the process
253 sentinel by means of run-at-time, so that there is time to kill
254 the buffer if need be; this also removes the need for a while
255 loop. Refuse to reconnect again if erc-server-reconnect-timeout
256 is not an number.
257
258 * erc.el (erc-command-no-process-p): Fix bug: the return value of
259 erc-extract-command-from-line is a list rather than a single
260 symbol. Thanks to jbms for the report.
261 (erc-cmd-RECONNECT): Use simpler logic, and use buffer-live-p
262 rather than bufferp.
263 (erc-send-current-line, erc-display-command, erc-display-msg):
264 Handle case where erc-server-process is nil, so that /reconnect
265 works.
266
2672007-08-12 Michael Olson <mwolson@gnu.org>
268
269 * erc-identd.el (erc-identd-filter): Instead of sending an EOF
270 character, which now confuses freenode, stop the server process,
271 so that no new connections are accepted, and kill the current
272 client process.
273
2742007-07-30 Michael Olson <mwolson@gnu.org>
275
276 * erc-nicklist.el: Remove from the Emacs source tree. This file
277 is not release quality, and relies heavily on a module which
278 cannot be distributed with ERC due to licensing reasons.
279
2802007-07-29 Michael Olson <mwolson@gnu.org>
281
282 * erc-list.el: Relicense to GPLv3. Since the file was already
283 licensed under version 2 or later, it turns out that we do not
284 need the permission of all of the authors in order to proceed.
285
2862007-07-25 Glenn Morris <rgm@gnu.org>
287
288 * Relicense all FSF files to GPLv3 or later.
289
2902007-07-13 Michael Olson <mwolson@gnu.org>
291
292 * erc-goodies.el (erc-get-bg-color-face, erc-get-fg-color-face):
293 Use erc-error rather than message and beep.
294
295 * erc-sound.el: Indentation fix.
296
297 * erc.el (erc-command-no-process-p): New function that determines
298 if its argument is an ERC command that can be run when the server
299 process is not alive.
300 (erc-cmd-SET, erc-cmd-CLEAR, erc-cmd-COUNTRY, erc-cmd-HELP)
301 (erc-cmd-LASTLOG, erc-cmd-QUIT, erc-cmd-GQUIT)
302 (erc-cmd-RECONNECT, erc-cmd-SERVER): Denote that these commands
303 can be run even when the server process is not alive.
304 (erc-send-current-line): Call erc-command-no-process-p if the
305 server process is not alive, to determine if we have a command
306 that can be run anyway. Thanks to Tom Tromey for the bug report.
307 (erc-error): New function that either displays a message or throws
308 an error, depending on whether debug-on-error is non-nil.
309 (erc-cmd-SERVER, erc-send-current-line): Use it.
310
3112007-07-10 Michael Olson <mwolson@gnu.org>
312
313 * Relicense all FSF-assigned code to GPLv3.
314
3152007-06-25 Michael Olson <mwolson@gnu.org>
316
317 * erc.texi (Options): Fix typo.
318 (Getting Help and Reporting Bugs): Update webpage URL. Make Gmane
319 part more readable.
320
3212007-06-20 Michael Olson <mwolson@gnu.org>
322
323 * erc-stamp.el (erc-timestamp-format-left): New option that
324 specifies the left timestamp to use for
325 erc-insert-timestamp-left-and-right.
326 (erc-timestamp-format-right): New option that specifies the right
327 timestamp to use for erc-insert-timestamp-left-and-right.
328 (erc-insert-timestamp-function): Change default to
329 erc-insert-timestamp-left-and-right.
330 (erc-insert-away-timestamp-function): Ditto.
331 (erc-timestamp-last-inserted-left)
332 (erc-timestamp-last-inserted-right): New variables to keep track
333 of data for erc-insert-timestamp-left-and-right.
334 (erc-insert-timestamp-left-and-right): New function that places
335 timestamps on both the left and right sides of the screen, but
336 only if each timestamp has changed since it was last computed.
337 Thanks to offby1 for urging me to merge this.
338
339 * erc.el (erc-open-ssl-stream): Display informative error when
340 ssl.el not found.
341 (erc-tls): New function to connect using tls.el.
342 (erc-open-tls-stream): New function to initiate tls connection.
343 Display informative error when tls.el not found.
344
3452007-06-19 Michael Olson <mwolson@gnu.org>
346 2
347 * erc-log.el: Update header with accurate instructions. 3 * erc.el (erc-version-string): Release ERC 5.3.
348 4
3492007-06-17 Michael Olson <mwolson@gnu.org> 5 * Makefile (VERSION): Update.
6 (EXTRAS): Remove erc-list.el after all, because this is mainly for
7 users of the version that comes with Emacs, and they will have
8 erc-list.el by Emacs 23.
9 (MISC): Add ChangeLog.07.
350 10
351 * erc-pkg.el: Update description to match what is currently in ELPA. 11 * README.extras: Mention Emacs 23.
352 12
3532007-06-14 Juanma Barranquero <lekktu@gmail.com> 13 * erc.texi (Obtaining ERC): Update extras URLs for 5.3.
14 (Development): Write instructions for git, and remove those for
15 Arch.
16 (History): Mention the switch to git.
354 17
355 * erc-goodies.el (erc-scroll-to-bottom): Remove redundant check. 182008-01-25 Michael Olson <mwolson@gnu.org>
356 19
3572007-06-13 Michael Olson <mwolson@gnu.org> 20 * NEWS: Update.
358 21
359 * erc-compat.el (erc-with-selected-window): New compatibility 22 * erc-goodies.el (keep-place): New module which keeps your place
360 macro that implements `with-selected-window'. 23 in unvisited ERC buffers when new messages arrive. This is mostly
24 taken from Johan Bockgård's init file.
25 (erc-noncommands-list): Move to correct place.
26
27 * erc-networks.el: Add a module definition.
28
29 * erc-services.el (erc-nickserv-identify-mode): Force-enable the
30 networks module, because we need it to set erc-network for us.
31
32 * erc-track.el (erc-track-faces-normal-list): Indicate in the
33 docstring that this variable can be set to nil.
34
35 * erc.el: On second thought, don't load erc-networks. Just enable
36 the networks module by default.
37 (erc-modules): Add option for keep-place and networks. Enable
38 networks by default.
39 (erc-version-string): Make release candidate 1 available.
40
412008-01-24 Michael Olson <mwolson@gnu.org>
42
43 * erc.el: Load erc-networks.el so that functions get access to the
44 `erc-network-name' function.
45
46 * erc-track.el (erc-track-faces-normal-list): Add
47 erc-dangerous-host-face.
48 (erc-track-exclude-types): Add 333 and 353 to the default list of
49 things to ignore, and explain what they are in the docstring.
50
512008-01-23 Michael Olson <mwolson@gnu.org>
52
53 * erc-track.el (erc-track-faces-priority-list): Move
54 erc-nick-default-face higher, so that it can be used for the
55 activity indication effect. Add erc-current-nick-face,
56 erc-pal-face, erc-dangerous-host-face, and erc-fool-face by
57 themselves.
58 (erc-track-faces-normal-list): New option that contains a list of
59 faces to consider "normal".
60 (erc-track-position-in-mode-line): Minor docfix.
61 (erc-track-find-face): Use erc-track-faces-normal-list to produce
62 a sort of blinking activity effect.
63
642008-01-22 Michael Olson <mwolson@gnu.org>
65
66 * erc-button.el (erc-button-add-nickname-buttons): When in a
67 channel buffer, only look at nicks from the current channel.
68 Thanks to e1f for the report.
69
702008-01-21 Michael Olson <mwolson@gnu.org>
71
72 * erc-compat.el (erc-const-expr-p, erc-list*, erc-assert): Remove,
73 since we can use the default `assert' function without it causing
74 us any problems, even in Emacs 21. Thanks to bojohan for the
75 suggestion.
76
77 * erc-goodies.el (move-to-prompt): Use the "XEmacs" method
78 instead, because the [remap ...] method interferes with
79 delete-selection-mode.
80 (erc-move-to-prompt): Rename from erc-move-to-prompt-xemacs.
81 Deactivate mark and call push-mark before moving point. Thanks to
82 bojohan for the suggestion.
83 (erc-move-to-prompt-setup): Rename from
84 erc-move-to-prompt-init-xemacs.
85
86 * erc-track.el (erc-track-faces-priority-list): Replace erc-button
87 with '(erc-button erc-default-face) so that we only care about
88 buttons that are part of normal text. Adjust customization type
89 to handle this case. Make erc-nick-default-face a list. Handle
90 pals, fools, current nick, and dangerous hosts.
91 (erc-track-find-face): Simplify. Adapt for list of faces case.
92 (erc-faces-in): Don't deflate lists of faces. Add them as-is.
93 (erc-track-face-priority): Use equal instead of eq.
94
952008-01-20 Michael Olson <mwolson@gnu.org>
96
97 * erc-goodies.el (erc-move-to-prompt, erc-move-to-prompt-xemacs):
98 Fix off-by-one error that caused the point to move when placed at
99 the beginning of some already-typed text. Thanks to e1f for the
100 report.
101
102 * erc-dcc.el, erc-xdcc.el: Add simple module definitions.
103
104 * erc.el (erc-modules): Add dcc and xdcc.
105
1062008-01-19 Michael Olson <mwolson@gnu.org>
107
108 * erc-bbdb.el (erc-bbdb-insinuate-and-show-entry): Work around bug
109 in XEmacs 21.4 that throws an error when the first argument to
110 run-at-time is nil.
111
112 * erc-button.el (button): Undo XEmacs-specific change to all ERC
113 buffers when module is removed.
114 (erc-button-setup): Rename from erc-button-add-keys, and move
115 XEmacs-specific stuff here.
116
117 * erc-goodies.el (erc-unmorse): Improve regexp for detecting
118 morse. Deal with the morse style that has "/ " at the end of
119 every letter.
120 (erc-imenu-setup): New function that sets up Imenu support. Add
121 it instead of a lambda form to erc-mode-hook.
122 (scrolltobottom): Remove erc-scroll-to-bottom from all ERC buffers
123 when module is removed. Activate the functionality in all ERC
124 buffers when the module is activated, rather than leaving it up to
125 the user.
126 (move-to-prompt): New module that moves to the ERC prompt if a
127 user tries to type elsewhere in the buffer, and then inserts their
128 keystrokes there. This is mostly taken from Johan Bockgård's init
129 file.
130 (erc-move-to-prompt): New function that implements this.
131 (erc-move-to-prompt-xemacs): New function that implements this for
132 XEmacs.
133 (erc-move-to-prompt-init-xemacs): New function to perform the
134 extra initialization step needed for XEmacs.
135
136 * erc-page.el, erc-replace.el: Fix header and footer.
137
138 * erc-track.el (erc-track-minor-mode-maybe): Take an optional
139 buffer arg so that we can put this in erc-connect-pre-hook. If
140 given this argument, include it in the check to determine whether
141 to activate erc-track-minor-mode.
142 (track): Add erc-track-minor-mode-maybe to erc-connect-pre-hook,
143 so that we can use it as soon as a connection is attempted.
144
145 * erc.el (erc-format-network, erc-format-target-and/or-network):
146 Use erc-network-name function instead, and check to see whether
147 that function is bound. This fixes an error in process filter for
148 people who did not have erc-services or erc-networks loaded.
149 (erc-modules): Add move-to-prompt module and enable it by
150 default. Thanks to e1f for the suggestion.
151
1522008-01-18 Michael Olson <mwolson@gnu.org>
153
154 * Makefile (EXTRAS): Include erc-list-old.el.
155
156 * erc-dcc.el (erc-dcc-verbose): Rename from erc-verbose-dcc.
157 (erc-pack-int): Rewrite to not depend on a count argument.
158 (erc-unpack-int): Rewrite to remove 4-character limitation.
159 (erc-dcc-server): Call set-process-coding-system and
160 set-process-filter-multibyte so that the contents get sent out
161 without modification.
162 (erc-dcc-send-filter): Don't take a substring -- just pass the
163 whole string to erc-unpack-int.
164 (erc-dcc-receive-cache): New option that indicates the number of
165 bytes to let the receive buffer grow before flushing it.
166 (erc-dcc-file-name): New buffer-local variable to keep track of
167 the filename of the currently-received file.
168 (erc-dcc-get-file): Disable undo for a speed increase. Set
169 erc-dcc-file-name. Truncate the file before writing to it.
170 (erc-dcc-append-contents): New function to append the contents of
171 a buffer to a file and then erase the contents of the buffer.
172 (erc-dcc-get-filter): Flush buffer contents after exceeding
173 erc-dcc-receive-cache. This allows large files to be downloaded
174 without storing the whole thing in memory.
175 (erc-dcc-get-sentinel): Flush any remaining contents before
176 closing. No need to save buffer.
177 (erc-dcc-listen-host): New option that determines which IP address
178 to listen on.
179 (erc-dcc-public-host): New option that determines which IP address
180 to advertise when sending a file. This is useful for people who
181 are on a local subnet. Together, these two options replace
182 erc-dcc-host.
183
184 * erc.el (erc-mode-line-format): Add %N and %S. %N is the name of
185 the network, and %S is much like %s but with the network name
186 trumping the server name. Default to "%S %a". Thanks to e1f for
187 the suggestion.
188 (erc-format-network): New function that formats the network name.
189 (erc-format-target-and/or-network): New function that formats both
190 the network name and target, falling back on the server name if
191 the network name is not available.
192 (erc-update-mode-line-buffer): Add the new format spec items.
193
1942008-01-17 Michael Olson <mwolson@gnu.org>
195
196 * erc.el (erc-join-buffer): Improve documentation.
197 (erc-query-display): New option indicating how to display a query
198 buffer that is made by using the /QUERY command. The default is
199 to display the query in a new window.
200 (erc-cmd-QUERY): Use it. Improve docstring.
201 (erc-auto-query): Default this to 'window-noselect instead,
202 because I've already seen bug reports about new users thinking
203 that ERC didn't display their test messages. Improve
204 customization type.
205 (erc-notice-face): Make this work with XEmacs.
206 (erc-join-buffer): Mention 'buffer in docstring. Improve
207 customization type.
208
209 * erc-dcc.el (erc-dcc-send-sentinel): Better handle case where elt
210 is nil, in order to avoid an error. Thanks to Brent Goodrick for
211 the initial patch.
212 (erc-dcc-display-send): New function split from erc-dcc-send-hook.
213 (erc-dcc-send-connect-hook): Use it -- we don't like lambda forms
214 in hooks.
215 (erc-dcc-send-filter): Display byte count if the client confirmed
216 too much, and kill the buffer. Otherwise a DoS might be possible
217 by making Emacs run out of RAM.
218
219 * erc-backend.el (erc-server-connect): Detect early on whether the
220 connection attempt has failed in order to avoid confusing error
221 messages.
222
223 * erc-networks.el (erc-server-alist): Add Rizon network.
224
225 * erc-services.el (erc-nickserv-passwords): Add Rizon to options.
226 (erc-nickserv-alist): Add support for Rizon.
227
228 * erc-track.el (erc-track-find-face): Don't let buttons in notices
229 trump default text. Use catch/throw. Default to first element of
230 FACES is nothing is found.
231
232 * erc-xdcc.el: Add local variables for proper indentation setup.
233
2342008-01-15 Michael Olson <mwolson@gnu.org>
235
236 * erc-backend.el (erc-server-coding-system): Docfix.
237 (erc-coding-system-for-target): Pass the `target' argument along
238 as the first and only argument. It's not good to just depend on a
239 dynamic binding.
240
2412008-01-10 Michael Olson <mwolson@gnu.org>
242
243 * erc-backend.el (321, 322): Split message-displaying parts into
244 new functions, which are added to each response's respective
245 hook. This makes them easier to disable.
246
247 * erc-list.el: New file from Tom Tromey. Use erc-propertize
248 instead of propertize. Require 'erc.
249 (list): New module definition. Remove message-displaying
250 functions for 321 and 322 response handlers when enabling the
251 module, and restore them when disabling. As a sanity check,
252 remove the erc-list-handle-322 function when disabling the module.
253 (erc-list-handle-322): Handle the case where we run the LIST
254 command, but do not go through the normal steps.
255 (erc-cmd-LIST): Add docstring. Strip initial space from line if
256 it is non-nil. Use make-local-variable to silence compiler
257 warning. Capture current buffer and pass it to
258 erc-list-install-322-handler.
259 (erc-list-install-322-handler): Take server-buffer argument, so
260 that we are certain of being in the right buffer. Use 4th
261 argument to add-hook, so that erc-server-322-functions is only
262 modified in one buffer.
263
264 * erc-list-old.el: Renamed from old erc-list.el.
265
266 * erc.el (erc-modules): Add list-old.
267 (erc-set-topic): Handle case where there are no newlines in the
268 existing topic, which happens when /LIST is run.
269 (erc-notice-face): If we have less than 88 colors, make this
270 blue. Otherwise the text will be pink in a tty, which looks
271 dreadful. Thanks to e1f for the report.
272 (erc-remove-parsed-property): New option that determines whether
273 to remove the erc-parsed property after displaying a message.
274 This should have the effect of making ERC take up less memory.
275 (erc-display-line-1): Use it.
361 276
362 * erc-goodies.el (erc-scroll-to-bottom): Use it. This fixes a bug 2772008-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
363 with buffer ordering where ERC buffers would move to the top.
364 Thanks to Ivan Kanis for the patch.
365
3662007-06-10 Michael Olson <mwolson@gnu.org>
367
368 * erc-log.el (erc-logging-enabled): Fix a bug that occurred when
369 `erc-log-channels-directory' had the name of a function.
370
3712007-06-06 Juanma Barranquero <lekktu@gmail.com>
372
373 * erc.el (erc-show-channel-key-p, erc-startup-file-list):
374 Fix typo in docstring.
375
3762007-06-03 Michael Olson <mwolson@gnu.org>
377
378 * erc-compat.el (erc-view-mode-enter): Make this its own function,
379 in order to document what we do, and provide sane fallback
380 behavior.
381
382 * erc.el (erc-toggle-debug-irc-protocol): Don't pass any arguments
383 to erc-view-mode-enter, since we don't do anything special with
384 the exit function. This fixes a bug with Emacs 21 and Emacs 22.
385 Thanks to Leo for noticing.
386
3872007-05-30 Michael Olson <mwolson@gnu.org>
388
389 * erc-compat.el (erc-user-emacs-directory): New variable that
390 determines where to find user-specific Emacs settings. For Emacs,
391 this is usually ~/.emacs.d, and for XEmacs this is usually
392 ~/.xemacs.
393
394 * erc.el (erc-startup-file-list): Use erc-user-emacs-directory.
395
3962007-05-28 Michael Olson <mwolson@gnu.org>
397
398 * erc-button.el (erc-button-url-regexp): Recognize parentheses as
399 part of URLs. Thanks to Lawrence Mitchell for the fix.
400
4012007-05-26 Michael Olson <mwolson@gnu.org>
402
403 * erc.texi (Modules): Fix references to completion modules.
404
4052007-05-21 Michael Olson <mwolson@gnu.org>
406
407 * Makefile (SOURCE): Remove erc-pkg.el.
408 (debclean): New rule to clean old Debian packages of ERC.
409 (debprepare): Don't modify the released tarball, but copy it as
410 the .orig.tar.gz file.
411 (debrelease, debrevision): Remove.
412 (debinstall): New target that copies the generated Debian file to
413 a distro-specific location.
414 (deb): New rule that chains together the stages in building a
415 Debian package.
416 (EXTRAS): Add erc-nicklist.el, since it is not release-quality.
417 (extras): Copy images directory.
418
419 * erc-nicklist.el (erc-nicklist-icons-directory): Use
420 locate-library to find the "images" directory. This should be
421 more failsafe. Thanks to Tom Tromey for the idea.
422
4232007-05-19 Michael Olson <mwolson@gnu.org>
424
425 * Makefile (ELPA): New variable that contains the location of my
426 local ELPA repository.
427 (elpa): New rule that makes an ELPA package for ERC.
428
4292007-04-19 Michael Olson <mwolson@gnu.org>
430
431 * erc.el (erc-parse-prefix): New function that retrieves the
432 PREFIX server parameter from the current server and returns an
433 alist of prefix type to prefix character.
434 (erc-channel-receive-names): Use `erc-parse-prefix' to determine
435 whether the first character of a nick is a prefix character or
436 not. This should fix a bug reported by bromine about needing to
437 type "%" first to complete nicks of people who are "hops" on
438 Slashnet. This should also support for very exotic IRC server
439 setups, if any exist.
440 (erc-update-current-channel-member): Indentation.
441
4422007-04-15 Michael Olson <mwolson@gnu.org>
443
444 * erc-log.el (erc-generate-log-file-name-function): Docfix.
445 Mention how to deal with the case for putting log files in
446 different directories. Change a customization type from `symbol'
447 to `function'.
448 (erc-log-channels-directory): Allow this to contain a function
449 name, which is called with the same args as in
450 `erc-generate-log-file-name-function'. Thanks to andrewy for the
451 report and use case.
452 (erc-current-logfile): Detect if `erc-log-channels-directory' is a
453 function and call it with arguments if so.
454
4552007-04-12 Michael Olson <mwolson@gnu.org>
456
457 * erc-backend.el (define-erc-response-handler): Mention that hook
458 processing stops when the function returns non-nil. This should
459 help avoid a nasty "gotcha" when making custom functions. Thanks
460 to John Sullivan for the report.
461
4622007-04-08 Diane Murray <disumu@x3y2z1.net>
463
464 * erc-nicklist.el (erc-nicklist-voiced-position): Fixed
465 customization mismatch.
466
4672007-04-01 Michael Olson <mwolson@gnu.org>
468
469 * erc.el (erc-version-string): Release ERC 5.2.
470
471 * erc-auto.in, erc-chess.el, erc-list.el, erc-speak.el:
472 * erc-viper.el: Update copyright notices.
473
474 * erc.texi: Make Emacs Lisp source code in this document
475 essentially public domain. Update version to 5.2.
476 (Obtaining ERC): Mention extras tarball.
477 (Releases): Mention local GNU mirror.
478 (Sample Configuration): Remove notice.
479
480 * FOR-RELEASE (5.3): Add item for erc-nicklist.
481 Mark NEWS as done. Mark extras tarball as done.
482
483 * Makefile (VERSION): Increment to 5.2.
484 (TESTING): Remove.
485 (EXTRAS): New variable containing the contents of our "Emacs 22
486 extras" tarball.
487 (SOURCE): Remove $(TESTING).
488 (MISC): Add COPYING and ChangeLog.06. Fix ChangeLog.NNNN ->
489 ChangeLog.NN.
490 (release): Use $(SNAPDIR) instead of erc-$(VERSION).
491 (extras): New rule which implements the building of the extras
492 tarball.
493 (upload-extras): New rule to upload the extras tarball. It's
494 yucky to replicate upload, but oh well.
495 (DISTRIBUTOR): New variable used to differentiate between building
496 packages for Ubuntu and Debian.
497 (debrelease, debrevision): Use it.
498 (debbuild): Run linda in addition to lintian.
499
500 * NEWS: Mention extras tarball. Note which files have been
501 renamed. Note that erc-list is enabled by default, except in
502 Emacs 22.
503
504 * README.extras: New file which serves as a README for the extras
505 tarball.
506
5072007-03-31 Michael Olson <mwolson@gnu.org>
508
509 * NEWS: Update for the 5.2 release.
510
511 * FOR-RELEASE: Finish up 5.2 manual item. Add documentation item
512 for 5.3.
513
514 * erc.texi (Sample Session): Flesh out. Mention #erc.
515 (Modules): Defer to 5.3 release.
516 (Advanced Usage): Move Sample Configuration chapter ahead of
517 unfinished chapters.
518 (Sample Configuration): Write.
519 (Options): Mention how to see available ERC options. Defer to 5.3
520 release.
521 (Tips and Tricks): Remove, since it seems better to just include
522 tips and tricks in the sample configuration, commented out.
523
524 * erc-bbdb.el (erc-bbdb-search-name-and-create): Make prompt more
525 informative about how to skip merging.
526 (erc-bbdb-insinuate-and-show-entry-1): Move contents of
527 erc-bbdb-insinuate-and-show-entry here.
528 (erc-bbdb-insinuate-and-show-entry): Run
529 erc-bbdb-insinuate-and-show-entry-1 "outside" of the calling
530 function, so that we can avoid triggering a process-filter error
531 if the user hits C-g.
532
5332007-03-30 Michael Olson <mwolson@gnu.org>
534
535 * FOR-RELEASE: Solve C-c C-SPC keybinding dilemma.
536
537 * erc-autoaway.el (erc-autoaway-idle-method): Use `if' rather than
538 `cond' and `set' rather than `set-default'.
539
540 * erc-log.el: Avoid compiler warning by requiring erc-network
541 during compilation.
542 (erc-generate-log-file-name-function): Add tag to each option.
543 Add erc-generate-log-file-name-network.
544 (erc-generate-log-file-name-network): New function which generates
545 a log file name that uses network name rather than server name,
546 when possible.
547
548 * erc-track.el (track): Assimilate track-when-inactive module,
549 since there's no need to have two modules in one file -- an option
550 will do. Remove track-modified-channels alias. Call
551 erc-track-minor-mode-maybe, and tear down the minor mode when
552 disabling.
553 (erc-track-when-inactive): New option which determines whether to
554 track visible buffers when inactive. The default is not to do so.
555 (erc-track-visibility): Mention erc-track-when-inactive.
556 (erc-buffer-visible): Use erc-track-when-inactive.
557 (erc-track-enable-keybindings): New option which determines
558 whether to enable the global-level tracking keybindings. The
559 default is to do so, unless they would override another binding,
560 in which case we prompt the user about it.
561 (erc-track-minor-mode-map): Move global keybindings here.
562 (erc-track-minor-mode): New minor mode which only enables the
563 keybindings and does nothing else.
564 (erc-track-minor-mode-maybe): New function which starts
565 erc-track-minor-mode, but only if it hasn't already been started,
566 an ERC buffer exists, and the user OK's it, depending on the value
567 of `erc-track-enable-keybindings'.
568 (erc-track-switch-buffer): Display a message if someone calls this
569 without first enabling erc-track-mode.
570
5712007-03-17 Michael Olson <mwolson@gnu.org>
572
573 * erc.texi (Development): Mention ErcDevelopment page on
574 emacswiki.
575 (Getting Started): Mention ~/.emacs.d/.ercrc.el and the Customize
576 interface.
577 (Sample Session): New section that has a very rough draft for a
578 sample ERC session.
579 (Special Features): New section that explains some of the special
580 features of ERC. Taken from ErcFeatures on emacswiki, with
581 enhancements.
582
5832007-03-12 Diane Murray <disumu@x3y2z1.net>
584
585 * erc-autoaway.el (erc-autoaway-idle-method): When setting the new
586 value, disable and re-enable `erc-autoaway-mode' only if it was
587 already enabled. This fixes a bug where autoaway was enabled just
588 by loading the file.
589
5902007-03-10 Diane Murray <disumu@x3y2z1.net>
591
592 * erc-capab.el: Added more information to the Usage section.
593 (erc-capab-identify-prefix): Doc fix.
594 (erc-capab-identify-unidentified): New face.
595 (290): Removed. Definition moved to erc-backend.el.
596 (erc-capab-identify-send-messages): Renamed from
597 `erc-capab-send-identify-messages'.
598 (erc-capab-identify-setup): Use it.
599 (erc-capab-identify-get-unidentified-nickname): Renamed from
600 `erc-capab-get-unidentified-nickname'.
601 (erc-capab-identify-add-prefix): Use it. Use
602 `erc-capab-identify-unidentified' as the face.
603
604 * erc-backend.el (290): Moved here from erc-capab.el.
605
606 * erc.el (erc-select): Added an autoload cookie.
607 (erc-message-type-member, erc-restore-text-properties): Use
608 `erc-get-parsed-vector'.
609 (erc-auto-query): Set the default to 'bury since many new users
610 expect private messages from others to be in dedicated query
611 buffers, not the server buffer.
612 (erc-common-server-suffixes): Use "freenode" for freenode.net, not
613 "OPN". Added oftc.net.
614
615 * NEWS: Added note about erc-auto-query's new default setting.
616
6172007-03-03 Michael Olson <mwolson@gnu.org>
618
619 * erc.el (erc-open, erc): Docfixes.
620
6212007-03-02 Michael Olson <mwolson@gnu.org>
622
623 * FOR-RELEASE: Make section for 5.3 release and move erc-backend
624 cleanup there. Awaiting discussion before doing other things.
625 Add tasks for merging filename changes from the 5.2 release
626 branch, and for making a tarball of modules not in Emacs 22. Add
627 item to remind me to update NEWS. Mark backtab entry as done.
628
629 * erc-button.el (button): Add call to `erc-button-add-keys'.
630 (erc-button-keys-added): New variable tracking whether we've added
631 the keys yet.
632 (erc-button-add-keys): New function that adds the <backtab> key to
633 erc-mode-map.
634
635 * erc.texi: Change version to 5.2 (pre-release).
636
6372007-02-15 Michael Olson <mwolson@gnu.org>
638
639 * CREDITS: Update.
640
641 * erc-backend.el (erc-server-send-ping-interval): Change to use a
642 default of 30 seconds. Improve customize interface.
643 (erc-server-send-ping-timeout): New option that determines when to
644 consider a connection stalled and restart it. The default is
645 after 120 seconds.
646 (erc-server-send-ping): Use erc-server-send-ping-timeout instead
647 of erc-server-send-ping-interval. If
648 erc-server-send-ping-timeout is nil, do not ever kill and restart
649 a hung IRC process.
650
651 * erc.el (erc-modules): Include the name of the module in its
652 description. This should make it easier for people to find and
653 enable a particular module.
654
6552007-02-15 Vivek Dasmohapatra <vivek@etla.org>
656
657 * erc.el (erc-cmd-RECONNECT): Kill old process if it is still
658 alive.
659 (erc-message-english-PART): Properly escape "%" characters in
660 reason.
661
662 * erc-backend.el (erc-server-reconnecting): New variable that is
663 set when the user requests a reconnect, but the old process is
664 still alive. This forces the reconnect to work even though the
665 process is killed manually during reconnect.
666 (erc-server-connect): Initialize it.
667 (erc-server-reconnect-p): Use it.
668 (erc-process-sentinel-1): Set it to nil after the first reconnect
669 attempt.
670
6712007-02-07 Diane Murray <disumu@x3y2z1.net>
672
673 * erc-menu.el (erc-menu-definition): Fixed so that the separator
674 is between "Current channel" and "Pals, fools and other keywords",
675 not at the bottom of the "Current channel" submenu.
676
6772007-01-25 Diane Murray <disumu@x3y2z1.net>
678
679 * erc-networks.el (erc-server-alist): Removed SSL server for now
680 since `erc-server-select' doesn't know to use `erc-ssl'.
681
682 * erc-networks.el (erc-server-alist, erc-networks-alist): Added
683 definitions for oftc.net.
684
685 * erc-services.el (erc-nickserv-alist): Fixed OFTC message regexp.
686
6872007-01-22 Michael Olson <mwolson@gnu.org>
688
689 * erc-backend.el (erc-server-error-occurred): New variable that
690 indicates when an error has been signaled by the server. This
691 should fix an infinite reconnect bug when giving some servers a
692 bogus :full-name. Thanks to Angelina Carlton for the report.
693 (erc-server-connect): Initialize erc-server-error-occurred.
694 (erc-server-reconnect-p): Use it.
695 (ERROR): Set it.
696
697 * erc-services.el (erc-nickserv-alist): Alphabetize and add Ars
698 and QuakeNet. Standardize look of entries. Fix type mismatch
699 error in customize interface.
700 (erc-nickserv-passwords): Alphabetize and add missing entries from
701 erc-nickserv-alist.
702
7032007-01-21 Michael Olson <mwolson@gnu.org>
704
705 * erc.el (erc-header-line-format): Document how to disable the
706 header line, and add a customization type for it. Also, make the
707 changes take effect immediately.
708
7092007-01-19 Michael Olson <mwolson@gnu.org>
710
711 * erc.texi (Modules): Document new menu module. Thanks to Leo
712 for noticing.
713
7142007-01-16 Diane Murray <disumu@x3y2z1.net>
715
716 * erc-stamp.el (erc-insert-timestamp-left): Fixed so that the
717 whitespace string filler is hidden correctly when timestamps are
718 hidden.
719 (erc-toggle-timestamps): New function to use instead of
720 `erc-show-timestamps' and `erc-hide-timestamps'.
721
722 * erc.el (erc-restore-text-properties): Moved here from
723 erc-fill.el since it could be useful in general.
724
725 * erc-fill.el (erc-restore-text-properties): Removed.
726
7272007-01-13 Michael Olson <mwolson@gnu.org>
728
729 * erc.el (erc-command-regexp): New variable that is used to match
730 a command.
731 (erc-send-input): Use it. This fixes a bug where paths --
732 "/usr/bin/foo", for example -- were being displayed as commands,
733 but still sent correctly.
734 (erc-extract-command-from-line): Use it.
735
736 * erc.texi (Modules): Document erc-capab-identify.
737
7382007-01-11 Diane Murray <disumu@x3y2z1.net>
739
740 * erc.el (erc-find-parsed-property): Moved here from erc-track.el
741 since it can be useful in general.
742
743 * erc-track.el (erc-find-parsed-property): Removed.
744
745 * erc-capab.el (erc-capab-find-parsed): Removed.
746 (erc-capab-identify-add-prefix): Use `erc-find-parsed-property'.
747
748 * erc.el (erc-open): Run `erc-before-connect' hook here. This
749 makes sure the hook always gets called before a connection is
750 made, as some functions, like `erc-handle-irc-url', use `erc-open'
751 instead of `erc'.
752 (erc): Removed `erc-before-connect' hook.
753
754 * erc-menu.el (erc-menu-definition): Put items specific to
755 channels in a "Current channel" submenu.
756
757 * erc-backend.el (321, 323): Display channel list in server buffer
758 when not using the channel list module.
759
760 * erc.el: Updated copyright years.
761 (erc-version-string): Set to 5.2 (devel).
762 (erc-format-lag-time): Fixed to work when `erc-server-lag' is nil.
763 (erc-update-mode-line-buffer): Set the header face.
764
7652007-01-11 Michael Olson <mwolson@gnu.org>
766
767 * erc-bbdb.el (erc-bbdb-popup-type): Fix customization type and
768 documentation.
769
770 * erc-services.el (erc-nickserv-identify-mode): Improve
771 documentation for nick-change option and move higher to fix
772 compiler warning. Avoid a recursive load error.
773 (erc-nickserv-alist): Add simple entry for BitlBee, to avoid
774 "NickServ is AWAY: User is offline" error. Oddly enough, bitlbee
775 was smart enough to recognize that as an authentication request
776 and log in regardless, which is why I didn't notice this earlier.
777 (erc-nickserv-alist-sender, erc-nickserv-alist-regexp)
778 (erc-nickserv-alist-nickserv, erc-nickserv-alist-ident-keyword)
779 (erc-nickserv-alist-use-nick-p)
780 (erc-nickserv-alist-ident-command): New accessors for
781 erc-nickserv-alist. Using nth is unwieldy.
782 (erc-nickserv-identify-autodetect)
783 (erc-nickserv-identify-on-connect)
784 (erc-nickserv-identify-on-nick-change, erc-nickserv-identify): Use
785 the new accessors.
786
7872007-01-11 Diane Murray <disumu@x3y2z1.net>
788
789 * NEWS: Added note for `erc-my-nick-face'. Fixed capab-identify
790 wording.
791
7922007-01-10 Diane Murray <disumu@x3y2z1.net>
793
794 * erc.el (erc-mode-line-format): Added %l to documentation.
795 (erc-header-line-format): Removed "[IRC]". Use the new %l
796 replacement character. Doc fix.
797 (erc-format-channel-modes): Removed lag code. Removed parentheses
798 from mode string.
799 (erc-format-lag-time): New function.
800 (erc-update-mode-line-buffer): Use it.
801
8022007-01-10 Michael Olson <mwolson@gnu.org>
803
804 * erc.el: Fix typo in url-irc-function instructions.
805
8062007-01-09 Michael Olson <mwolson@gnu.org>
807
808 * erc.el (erc-system-name): New option that determines the system
809 name to use when logging in. The default is to figure this out by
810 calling `system-name'.
811 (erc-login): Use it.
812
8132007-01-07 Michael Olson <mwolson@gnu.org>
814
815 * erc.el (erc-modules): Add the menu module. This should fix a
816 bug with incorrect ERC submenus being displayed.
817 278
818 * erc-menu.el: Turn this into a module. 279 * erc-ibuffer.el (erc-channel-modes):
819 (erc-menu-add, erc-menu-remove): New functions that add and remove 280 Pass mode-name through format-mode-line
820 the ERC menu.
821 281
822 282
823See ChangeLog.06 for earlier changes. 283See ChangeLog.07 for earlier changes.
824 284
825 Copyright (C) 2007, 2008 Free Software Foundation, Inc. 285 Copyright (C) 2008 Free Software Foundation, Inc.
826 286
827 This file is part of GNU Emacs. 287 This file is part of GNU Emacs.
828 288
@@ -846,4 +306,4 @@ See ChangeLog.06 for earlier changes.
846;; add-log-time-zone-rule: t 306;; add-log-time-zone-rule: t
847;; End: 307;; End:
848 308
849;; arch-tag: 3369b6e5-96b1-4b32-96cd-9a905c747496 309;; arch-tag: 15787dfd-e091-4c8c-8b88-747b474e1ac7
diff --git a/lisp/erc/ChangeLog.07 b/lisp/erc/ChangeLog.07
new file mode 100644
index 00000000000..c317fe62177
--- /dev/null
+++ b/lisp/erc/ChangeLog.07
@@ -0,0 +1,839 @@
12007-12-16 Diane Murray <disumu@x3y2z1.net>
2
3 * erc-services.el (erc-nickserv-alist): Removed autodetect regexp,
4 added identified regexp for OFTC.
5 (erc-nickserv-identification-autodetect): Make sure success-regex
6 is non-nil.
7 (erc-nickserv-identify-autodetect): Make sure identify-regex is
8 non-nil. Doc fix.
9
102007-12-13 Diane Murray <disumu@x3y2z1.net>
11
12 * erc-backend.el (PRIVMSG, QUIT, TOPIC, WALLOPS, 376, 004, 221)
13 (312, 315, 319, 330, 331, 333, 367, 368, 391, 405, 406, 412)
14 (421, 432, 433, 437, 442, 461, 474, 477, 482, 431): Doc fix.
15
162007-12-09 Michael Olson <mwolson@gnu.org>
17
18 * erc-services.el (erc-nickserv-alist): Fix regexps for GRnet.
19
202007-12-09 Giorgos Keramidas <keramida@ceid.upatras.gr> (tiny change)
21
22 * erc-backend.el, erc.el:
23 Parse 275 (secure connection) responses.
24
25 * erc-services.el: Add identification hooks for GRnet, the Greek
26 IRC network <http://www.irc.gr>.
27
282007-12-08 David Kastrup <dak@gnu.org>
29
30 * erc-stamp.el (erc-echo-timestamp):
31 * erc-lang.el (language):
32 * erc-backend.el (erc-server-connect): Fix buggy call to `message'.
33
342007-12-07 Edward O'Connor <ted@oconnor.cx>
35
36 * erc-services.el: Provide a hook that runs when nickserv confirms
37 that the user has successfully identified.
38 (services, erc-nickserv-identify-mode): Add and remove
39 erc-nickserv-identification-autodetect from
40 erc-server-NOTICE-functions.
41 (erc-nickserv-alist): Add SUCCESS-REGEXP to each entry.
42 (erc-nickserv-alist-identified-regexp)
43 (erc-nickserv-identification-autodetect): New functions.
44 (erc-nickserv-identified-hook): New hook.
45
462007-12-06 D. Goel <deego3@gmail.com>
47
48 * erc-match.el (erc-add-entry-to-list): Fix buggy call to `error'.
49
502007-12-01 Glenn Morris <rgm@gnu.org>
51
52 * erc-backend.el (erc-server-send-ping): Move after definition of
53 erc-server-send.
54
552007-11-29 Giorgos Keramidas <keramida@ceid.upatras.gr> (tiny change)
56
57 * erc-backend.el, erc.el:
58 Parse 307 (nick has identified) responses.
59
602007-11-15 Juanma Barranquero <lekktu@gmail.com>
61
62 * erc.el (erc-open):
63 * erc-backend.el (define-erc-response-handler):
64 * erc-log.el (log):
65 * erc-match.el (erc-log-matches): Fix typos in docstrings.
66
672007-11-11 Michael Olson <mwolson@gnu.org>
68
69 * erc-autoaway.el (erc-autoaway-possibly-set-away):
70 * erc-netsplit.el (erc-netsplit-timer):
71 * erc-notify.el (erc-notify-timer):
72 * erc-track.el (erc-user-is-active): Only run if we have
73 successfully established a connection to the server and have
74 logged in. I suspect that sending messages too soon may make some
75 IRC servers not respond well, particularly when the network
76 connection is iffy or subject to traffic-shaping.
77
782007-11-01 Michael Olson <mwolson@gnu.org>
79
80 * erc-compat.el (erc-set-write-file-functions): New compatibility
81 function to set the write hooks appropriately.
82
83 * erc-log.el (erc-log-setup-logging): Use
84 erc-set-write-file-functions. This fixes a byte-compiler warning.
85
86 * erc-stamp.el: Silence byte-compiler warning about
87 erc-fill-column.
88
89 * erc.el (erc-with-all-buffers-of-server): Bind the result of
90 mapcar to a variable in order to silence a byte-compiler warning.
91
922007-10-29 Michael Olson <mwolson@gnu.org>
93
94 * erc-ibuffer.el (erc-modified-channels-alist): Use
95 eval-when-compile, and explain why we are doing this.
96
972007-10-25 Dan Nicolaescu <dann@ics.uci.edu>
98
99 * erc-ibuffer.el (erc-modified-channels-alist): Pacify
100 byte-compiler.
101
1022007-10-13 Glenn Morris <rgm@gnu.org>
103
104 * erc-track.el (erc-modified-channels-update): Use mapc rather
105 than mapcar.
106
1072007-10-12 Diane Murray <disumu@x3y2z1.net>
108
109 * erc.el (erc-join-channel): Prompt for channel key if C-u or
110 another prefix-arg was typed.
111
112 * NEWS: Noted this change.
113
1142007-10-07 Michael Olson <mwolson@gnu.org>
115
116 * erc.el (erc-cmd-ME'S): New command that handles the case where
117 someone types "/me's". It concatenates the text " 's" to the
118 beginning of the input and then sends the result like a normal
119 "/me" command.
120 (erc-command-regexp): Permit single-quote character.
121
1222007-09-30 Aidan Kehoe <kehoea@parhasard.net> (tiny change)
123
124 * erc-log.el (erc-save-buffer-in-logs): Prevent spurious warnings
125 when looking at a log file and concurrently saving to it.
126
1272007-09-18 Exal de Jesus Garcia Carrillo <exal@gnu.org> (tiny change)
128
129 * erc.texi (Special-Features): Fix small typo.
130
1312007-09-16 Michael Olson <mwolson@gnu.org>
132
133 * erc-track.el (erc-track-switch-direction): Mention
134 erc-track-faces-priority-list. Thanks to Leo for the suggestion.
135
1362007-09-11 Exal de Jesus Garcia Carrillo <exal@gnu.org> (tiny change)
137
138 * erc-sound.el: Fix typo in setting up instructions.
139
1402007-09-10 Michael Olson <mwolson@gnu.org>
141
142 * Makefile (elpa): Copy dir template rather than echoing a few
143 lines. The reason for this is that the ELPA package for ERC was
144 getting a corrupt dir entry.
145
146 * dir-template: Template for the ELPA dir file.
147
1482007-09-08 Michael Olson <mwolson@gnu.org>
149
150 * erc-log.el (erc-log-filter-function): New option that specifies
151 the function to call for filtering text before writing it to a log
152 file. Thanks to David O'Toole for the suggestion.
153 (erc-save-buffer-in-logs): Use erc-log-filter-function. Make sure
154 we carry along the value of coding-system-for-write, because this
155 could potentially be shadowed by the temporary buffer.
156
157 * erc.el (erc-version-string): Update to 5.3, development version.
158
1592007-09-07 Glenn Morris <rgm@gnu.org>
160
161 * erc.el (erc-toggle-debug-irc-protocol): Fix call to
162 erc-view-mode-enter.
163
1642007-08-08 Glenn Morris <rgm@gnu.org>
165
166 * erc-log.el, erc.el: Replace `iff' in doc-strings and comments.
167
1682007-09-03 Michael Olson <mwolson@gnu.org>
169
170 * erc.el (erc-default-port): Make this an integer value rather
171 than a string. Thanks to Luca Capello for the report.
172
1732007-08-27 Michael Olson <mwolson@gnu.org>
174
175 * erc.el (erc-cmd-GQUIT): If erc-kill-queries-on-quit is non-nil,
176 kill all query buffers after 4 seconds.
177
1782007-08-16 Michael Olson <mwolson@gnu.org>
179
180 * NEWS: Add ERC 5.3 changes section, and mention jbms' erc-track
181 compatibility note.
182
183 * erc-track.el (erc-track-list-changed-hook): Turn this into a
184 customizable option.
185 (erc-track-switch-direction): Add 'importance option.
186 (erc-modified-channels-display): If erc-track-switch-direction is
187 'importance, call erc-track-sort-by-importance.
188 (erc-track-face-priority): New function that returns a number
189 indicating the position of a face in erc-track-faces-priority-list.
190 (erc-track-sort-by-importance): New function that sorts
191 erc-modified-channels-list according to erc-track-face-priority.
192 (erc-track-get-active-buffer): Make 'oldest a rough opposite of
193 'importance.
194
1952007-08-14 Jeremy Maitin-Shepard <jbms@cmu.edu>
196
197 * erc-track.el (erc-track-remove-disconnected-buffers): New
198 variable which controls whether buffers associated with a server
199 that is disconnected should be removed from
200 `erc-modified-channels-alist'. Existing behavior is to
201 unconditionally remove such buffers, which is achieved by setting
202 `erc-track-removed-disconnected-buffers' to t. When set to t,
203 which is the new default value, such buffers remain in the list,
204 which I think is often the desired behavior, since the user may
205 likely wish to find out about activity that occurred in a channel
206 prior to it being disconnected.
207 (erc-track-list-changed-hook): New hook that is run whenever the
208 contents of `erc-modified-channels-alist' changes; it is useful
209 for users such as myself that don't use the default mode-line
210 notification but instead use a separate mechanism (which is tied
211 to my window manager) to provide notification of channel activity.
212 (erc-track-get-buffer-window): New function that acts as a wrapper
213 around `get-buffer-window' that handles the `selected-visible'
214 option of `erc-track-visibility'; previously, the value of
215 `erc-track-visibility' was passed directly to `get-buffer-window',
216 which does not support `selected-visible'; consequently,
217 `selected-visible' was not properly supported.
218 (erc-track-modified-channels): Fix a bug in the logic for removing
219 buffers from the list in certain cases.
220 (erc-track-position-in-mode-line): Add a supported value that
221 specifies that the tracking information should not be added to the
222 mode line at all. The value of nil is used to indicate that the
223 information should not be added at all to the mode line.
224 (erc-track-add-to-mode-line): Check for position eq to t, rather
225 than non-nil.
226 (erc-buffer-visible): Use erc-track-get-buffer-window.
227 (erc-modified-channels-update): Take
228 erc-track-remove-disconnected-buffers into account.
229 (erc-modified-channels-display): Run `erc-track-list-changed-hook'.
230
231 * erc.el (erc-reuse-frames): New option that determines whether
232 new frames are always created. Defaults to t. This only has an
233 effect when erc-join-buffer is set to 'frame.
234 (erc-setup-buffer): Use it.
235
2362007-08-14 Michael Olson <mwolson@gnu.org>
237
238 * erc-backend.el (erc-server-reconnect): If the server buffer has
239 been killed, use the current buffer instead. If the current
240 buffer is not an ERC buffer, give an error. This fixes a bug when
241 /reconnect is run from a channel buffer whose server buffer has
242 been deleted. Thanks to jbms for the report.
243 (erc-process-sentinel-1): Take server buffer as an argument, so
244 that we can make sure that it is current.
245 (erc-process-sentinel): Pass buffer to erc-process-sentinel-1.
246 (erc-process-sentinel-2): New function split from
247 erc-process-sentinel-1. If server buffer is deleted during a
248 reconnect attempt, stop trying to reconnect. Fix bug where
249 reconnect was not happening when erc-server-reconnect-attempts was
250 t. Call erc-server-reconnect-p only once each time. If we are
251 instructed to try connecting indefinitely, tell the user that they
252 can stop this by killing the server buffer. Call the process
253 sentinel by means of run-at-time, so that there is time to kill
254 the buffer if need be; this also removes the need for a while
255 loop. Refuse to reconnect again if erc-server-reconnect-timeout
256 is not an number.
257
258 * erc.el (erc-command-no-process-p): Fix bug: the return value of
259 erc-extract-command-from-line is a list rather than a single
260 symbol. Thanks to jbms for the report.
261 (erc-cmd-RECONNECT): Use simpler logic, and use buffer-live-p
262 rather than bufferp.
263 (erc-send-current-line, erc-display-command, erc-display-msg):
264 Handle case where erc-server-process is nil, so that /reconnect
265 works.
266
2672007-08-12 Michael Olson <mwolson@gnu.org>
268
269 * erc-identd.el (erc-identd-filter): Instead of sending an EOF
270 character, which now confuses freenode, stop the server process,
271 so that no new connections are accepted, and kill the current
272 client process.
273
2742007-07-29 Michael Olson <mwolson@gnu.org>
275
276 * erc-list.el: Relicense to GPLv3. Since the file was already
277 licensed under version 2 or later, it turns out that we do not
278 need the permission of all of the authors in order to proceed.
279
2802007-07-13 Michael Olson <mwolson@gnu.org>
281
282 * erc-goodies.el (erc-get-bg-color-face, erc-get-fg-color-face):
283 Use erc-error rather than message and beep.
284
285 * erc-sound.el: Indentation fix.
286
287 * erc.el (erc-command-no-process-p): New function that determines
288 if its argument is an ERC command that can be run when the server
289 process is not alive.
290 (erc-cmd-SET, erc-cmd-CLEAR, erc-cmd-COUNTRY, erc-cmd-HELP)
291 (erc-cmd-LASTLOG, erc-cmd-QUIT, erc-cmd-GQUIT)
292 (erc-cmd-RECONNECT, erc-cmd-SERVER): Denote that these commands
293 can be run even when the server process is not alive.
294 (erc-send-current-line): Call erc-command-no-process-p if the
295 server process is not alive, to determine if we have a command
296 that can be run anyway. Thanks to Tom Tromey for the bug report.
297 (erc-error): New function that either displays a message or throws
298 an error, depending on whether debug-on-error is non-nil.
299 (erc-cmd-SERVER, erc-send-current-line): Use it.
300
3012007-07-10 Michael Olson <mwolson@gnu.org>
302
303 * Relicense all FSF-assigned code to GPLv3.
304
3052007-06-25 Michael Olson <mwolson@gnu.org>
306
307 * erc.texi (Options): Fix typo.
308 (Getting Help and Reporting Bugs): Update webpage URL. Make Gmane
309 part more readable.
310
3112007-06-20 Michael Olson <mwolson@gnu.org>
312
313 * erc-stamp.el (erc-timestamp-format-left): New option that
314 specifies the left timestamp to use for
315 erc-insert-timestamp-left-and-right.
316 (erc-timestamp-format-right): New option that specifies the right
317 timestamp to use for erc-insert-timestamp-left-and-right.
318 (erc-insert-timestamp-function): Change default to
319 erc-insert-timestamp-left-and-right.
320 (erc-insert-away-timestamp-function): Ditto.
321 (erc-timestamp-last-inserted-left)
322 (erc-timestamp-last-inserted-right): New variables to keep track
323 of data for erc-insert-timestamp-left-and-right.
324 (erc-insert-timestamp-left-and-right): New function that places
325 timestamps on both the left and right sides of the screen, but
326 only if each timestamp has changed since it was last computed.
327 Thanks to offby1 for urging me to merge this.
328
329 * erc.el (erc-open-ssl-stream): Display informative error when
330 ssl.el not found.
331 (erc-tls): New function to connect using tls.el.
332 (erc-open-tls-stream): New function to initiate tls connection.
333 Display informative error when tls.el not found.
334
3352007-06-19 Michael Olson <mwolson@gnu.org>
336
337 * erc-log.el: Update header with accurate instructions.
338
3392007-06-17 Michael Olson <mwolson@gnu.org>
340
341 * erc-pkg.el: Update description to match what is currently in ELPA.
342
3432007-06-14 Juanma Barranquero <lekktu@gmail.com>
344
345 * erc-goodies.el (erc-scroll-to-bottom): Remove redundant check.
346
3472007-06-13 Michael Olson <mwolson@gnu.org>
348
349 * erc-compat.el (erc-with-selected-window): New compatibility
350 macro that implements `with-selected-window'.
351
352 * erc-goodies.el (erc-scroll-to-bottom): Use it. This fixes a bug
353 with buffer ordering where ERC buffers would move to the top.
354 Thanks to Ivan Kanis for the patch.
355
3562007-06-10 Michael Olson <mwolson@gnu.org>
357
358 * erc-log.el (erc-logging-enabled): Fix a bug that occurred when
359 `erc-log-channels-directory' had the name of a function.
360
3612007-06-06 Juanma Barranquero <lekktu@gmail.com>
362
363 * erc.el (erc-show-channel-key-p, erc-startup-file-list):
364 Fix typo in docstring.
365
3662007-06-03 Michael Olson <mwolson@gnu.org>
367
368 * erc-compat.el (erc-view-mode-enter): Make this its own function,
369 in order to document what we do, and provide sane fallback
370 behavior.
371
372 * erc.el (erc-toggle-debug-irc-protocol): Don't pass any arguments
373 to erc-view-mode-enter, since we don't do anything special with
374 the exit function. This fixes a bug with Emacs 21 and Emacs 22.
375 Thanks to Leo for noticing.
376
3772007-05-30 Michael Olson <mwolson@gnu.org>
378
379 * erc-compat.el (erc-user-emacs-directory): New variable that
380 determines where to find user-specific Emacs settings. For Emacs,
381 this is usually ~/.emacs.d, and for XEmacs this is usually
382 ~/.xemacs.
383
384 * erc.el (erc-startup-file-list): Use erc-user-emacs-directory.
385
3862007-05-28 Michael Olson <mwolson@gnu.org>
387
388 * erc-button.el (erc-button-url-regexp): Recognize parentheses as
389 part of URLs. Thanks to Lawrence Mitchell for the fix.
390
3912007-05-26 Michael Olson <mwolson@gnu.org>
392
393 * erc.texi (Modules): Fix references to completion modules.
394
3952007-05-21 Michael Olson <mwolson@gnu.org>
396
397 * Makefile (SOURCE): Remove erc-pkg.el.
398 (debclean): New rule to clean old Debian packages of ERC.
399 (debprepare): Don't modify the released tarball, but copy it as
400 the .orig.tar.gz file.
401 (debrelease, debrevision): Remove.
402 (debinstall): New target that copies the generated Debian file to
403 a distro-specific location.
404 (deb): New rule that chains together the stages in building a
405 Debian package.
406 (EXTRAS): Add erc-nicklist.el, since it is not release-quality.
407 (extras): Copy images directory.
408
409 * erc-nicklist.el (erc-nicklist-icons-directory): Use
410 locate-library to find the "images" directory. This should be
411 more failsafe. Thanks to Tom Tromey for the idea.
412
4132007-05-19 Michael Olson <mwolson@gnu.org>
414
415 * Makefile (ELPA): New variable that contains the location of my
416 local ELPA repository.
417 (elpa): New rule that makes an ELPA package for ERC.
418
4192007-04-19 Michael Olson <mwolson@gnu.org>
420
421 * erc.el (erc-parse-prefix): New function that retrieves the
422 PREFIX server parameter from the current server and returns an
423 alist of prefix type to prefix character.
424 (erc-channel-receive-names): Use `erc-parse-prefix' to determine
425 whether the first character of a nick is a prefix character or
426 not. This should fix a bug reported by bromine about needing to
427 type "%" first to complete nicks of people who are "hops" on
428 Slashnet. This should also support for very exotic IRC server
429 setups, if any exist.
430 (erc-update-current-channel-member): Indentation.
431
4322007-04-15 Michael Olson <mwolson@gnu.org>
433
434 * erc-log.el (erc-generate-log-file-name-function): Docfix.
435 Mention how to deal with the case for putting log files in
436 different directories. Change a customization type from `symbol'
437 to `function'.
438 (erc-log-channels-directory): Allow this to contain a function
439 name, which is called with the same args as in
440 `erc-generate-log-file-name-function'. Thanks to andrewy for the
441 report and use case.
442 (erc-current-logfile): Detect if `erc-log-channels-directory' is a
443 function and call it with arguments if so.
444
4452007-04-12 Michael Olson <mwolson@gnu.org>
446
447 * erc-backend.el (define-erc-response-handler): Mention that hook
448 processing stops when the function returns non-nil. This should
449 help avoid a nasty "gotcha" when making custom functions. Thanks
450 to John Sullivan for the report.
451
4522007-04-08 Diane Murray <disumu@x3y2z1.net>
453
454 * erc-nicklist.el (erc-nicklist-voiced-position): Fixed
455 customization mismatch.
456
4572007-04-01 Michael Olson <mwolson@gnu.org>
458
459 * erc.el (erc-version-string): Release ERC 5.2.
460
461 * erc-auto.in, erc-chess.el, erc-list.el, erc-speak.el:
462 * erc-viper.el: Update copyright notices.
463
464 * erc.texi: Make Emacs Lisp source code in this document
465 essentially public domain. Update version to 5.2.
466 (Obtaining ERC): Mention extras tarball.
467 (Releases): Mention local GNU mirror.
468 (Sample Configuration): Remove notice.
469
470 * FOR-RELEASE (5.3): Add item for erc-nicklist.
471 Mark NEWS as done. Mark extras tarball as done.
472
473 * Makefile (VERSION): Increment to 5.2.
474 (TESTING): Remove.
475 (EXTRAS): New variable containing the contents of our "Emacs 22
476 extras" tarball.
477 (SOURCE): Remove $(TESTING).
478 (MISC): Add COPYING and ChangeLog.06. Fix ChangeLog.NNNN ->
479 ChangeLog.NN.
480 (release): Use $(SNAPDIR) instead of erc-$(VERSION).
481 (extras): New rule which implements the building of the extras
482 tarball.
483 (upload-extras): New rule to upload the extras tarball. It's
484 yucky to replicate upload, but oh well.
485 (DISTRIBUTOR): New variable used to differentiate between building
486 packages for Ubuntu and Debian.
487 (debrelease, debrevision): Use it.
488 (debbuild): Run linda in addition to lintian.
489
490 * NEWS: Mention extras tarball. Note which files have been
491 renamed. Note that erc-list is enabled by default, except in
492 Emacs 22.
493
494 * README.extras: New file which serves as a README for the extras
495 tarball.
496
4972007-03-31 Michael Olson <mwolson@gnu.org>
498
499 * NEWS: Update for the 5.2 release.
500
501 * FOR-RELEASE: Finish up 5.2 manual item. Add documentation item
502 for 5.3.
503
504 * erc.texi (Sample Session): Flesh out. Mention #erc.
505 (Modules): Defer to 5.3 release.
506 (Advanced Usage): Move Sample Configuration chapter ahead of
507 unfinished chapters.
508 (Sample Configuration): Write.
509 (Options): Mention how to see available ERC options. Defer to 5.3
510 release.
511 (Tips and Tricks): Remove, since it seems better to just include
512 tips and tricks in the sample configuration, commented out.
513
514 * erc-bbdb.el (erc-bbdb-search-name-and-create): Make prompt more
515 informative about how to skip merging.
516 (erc-bbdb-insinuate-and-show-entry-1): Move contents of
517 erc-bbdb-insinuate-and-show-entry here.
518 (erc-bbdb-insinuate-and-show-entry): Run
519 erc-bbdb-insinuate-and-show-entry-1 "outside" of the calling
520 function, so that we can avoid triggering a process-filter error
521 if the user hits C-g.
522
5232007-03-30 Michael Olson <mwolson@gnu.org>
524
525 * FOR-RELEASE: Solve C-c C-SPC keybinding dilemma.
526
527 * erc-autoaway.el (erc-autoaway-idle-method): Use `if' rather than
528 `cond' and `set' rather than `set-default'.
529
530 * erc-log.el: Avoid compiler warning by requiring erc-network
531 during compilation.
532 (erc-generate-log-file-name-function): Add tag to each option.
533 Add erc-generate-log-file-name-network.
534 (erc-generate-log-file-name-network): New function which generates
535 a log file name that uses network name rather than server name,
536 when possible.
537
538 * erc-track.el (track): Assimilate track-when-inactive module,
539 since there's no need to have two modules in one file -- an option
540 will do. Remove track-modified-channels alias. Call
541 erc-track-minor-mode-maybe, and tear down the minor mode when
542 disabling.
543 (erc-track-when-inactive): New option which determines whether to
544 track visible buffers when inactive. The default is not to do so.
545 (erc-track-visibility): Mention erc-track-when-inactive.
546 (erc-buffer-visible): Use erc-track-when-inactive.
547 (erc-track-enable-keybindings): New option which determines
548 whether to enable the global-level tracking keybindings. The
549 default is to do so, unless they would override another binding,
550 in which case we prompt the user about it.
551 (erc-track-minor-mode-map): Move global keybindings here.
552 (erc-track-minor-mode): New minor mode which only enables the
553 keybindings and does nothing else.
554 (erc-track-minor-mode-maybe): New function which starts
555 erc-track-minor-mode, but only if it hasn't already been started,
556 an ERC buffer exists, and the user OK's it, depending on the value
557 of `erc-track-enable-keybindings'.
558 (erc-track-switch-buffer): Display a message if someone calls this
559 without first enabling erc-track-mode.
560
5612007-03-17 Michael Olson <mwolson@gnu.org>
562
563 * erc.texi (Development): Mention ErcDevelopment page on
564 emacswiki.
565 (Getting Started): Mention ~/.emacs.d/.ercrc.el and the Customize
566 interface.
567 (Sample Session): New section that has a very rough draft for a
568 sample ERC session.
569 (Special Features): New section that explains some of the special
570 features of ERC. Taken from ErcFeatures on emacswiki, with
571 enhancements.
572
5732007-03-12 Diane Murray <disumu@x3y2z1.net>
574
575 * erc-autoaway.el (erc-autoaway-idle-method): When setting the new
576 value, disable and re-enable `erc-autoaway-mode' only if it was
577 already enabled. This fixes a bug where autoaway was enabled just
578 by loading the file.
579
5802007-03-10 Diane Murray <disumu@x3y2z1.net>
581
582 * erc-capab.el: Added more information to the Usage section.
583 (erc-capab-identify-prefix): Doc fix.
584 (erc-capab-identify-unidentified): New face.
585 (290): Removed. Definition moved to erc-backend.el.
586 (erc-capab-identify-send-messages): Renamed from
587 `erc-capab-send-identify-messages'.
588 (erc-capab-identify-setup): Use it.
589 (erc-capab-identify-get-unidentified-nickname): Renamed from
590 `erc-capab-get-unidentified-nickname'.
591 (erc-capab-identify-add-prefix): Use it. Use
592 `erc-capab-identify-unidentified' as the face.
593
594 * erc-backend.el (290): Moved here from erc-capab.el.
595
596 * erc.el (erc-select): Added an autoload cookie.
597 (erc-message-type-member, erc-restore-text-properties): Use
598 `erc-get-parsed-vector'.
599 (erc-auto-query): Set the default to 'bury since many new users
600 expect private messages from others to be in dedicated query
601 buffers, not the server buffer.
602 (erc-common-server-suffixes): Use "freenode" for freenode.net, not
603 "OPN". Added oftc.net.
604
605 * NEWS: Added note about erc-auto-query's new default setting.
606
6072007-03-03 Michael Olson <mwolson@gnu.org>
608
609 * erc.el (erc-open, erc): Docfixes.
610
6112007-03-02 Michael Olson <mwolson@gnu.org>
612
613 * FOR-RELEASE: Make section for 5.3 release and move erc-backend
614 cleanup there. Awaiting discussion before doing other things.
615 Add tasks for merging filename changes from the 5.2 release
616 branch, and for making a tarball of modules not in Emacs 22. Add
617 item to remind me to update NEWS. Mark backtab entry as done.
618
619 * erc-button.el (button): Add call to `erc-button-add-keys'.
620 (erc-button-keys-added): New variable tracking whether we've added
621 the keys yet.
622 (erc-button-add-keys): New function that adds the <backtab> key to
623 erc-mode-map.
624
625 * erc.texi: Change version to 5.2 (pre-release).
626
6272007-02-15 Michael Olson <mwolson@gnu.org>
628
629 * CREDITS: Update.
630
631 * erc-backend.el (erc-server-send-ping-interval): Change to use a
632 default of 30 seconds. Improve customize interface.
633 (erc-server-send-ping-timeout): New option that determines when to
634 consider a connection stalled and restart it. The default is
635 after 120 seconds.
636 (erc-server-send-ping): Use erc-server-send-ping-timeout instead
637 of erc-server-send-ping-interval. If
638 erc-server-send-ping-timeout is nil, do not ever kill and restart
639 a hung IRC process.
640
641 * erc.el (erc-modules): Include the name of the module in its
642 description. This should make it easier for people to find and
643 enable a particular module.
644
6452007-02-15 Vivek Dasmohapatra <vivek@etla.org>
646
647 * erc.el (erc-cmd-RECONNECT): Kill old process if it is still
648 alive.
649 (erc-message-english-PART): Properly escape "%" characters in
650 reason.
651
652 * erc-backend.el (erc-server-reconnecting): New variable that is
653 set when the user requests a reconnect, but the old process is
654 still alive. This forces the reconnect to work even though the
655 process is killed manually during reconnect.
656 (erc-server-connect): Initialize it.
657 (erc-server-reconnect-p): Use it.
658 (erc-process-sentinel-1): Set it to nil after the first reconnect
659 attempt.
660
6612007-02-07 Diane Murray <disumu@x3y2z1.net>
662
663 * erc-menu.el (erc-menu-definition): Fixed so that the separator
664 is between "Current channel" and "Pals, fools and other keywords",
665 not at the bottom of the "Current channel" submenu.
666
6672007-01-25 Diane Murray <disumu@x3y2z1.net>
668
669 * erc-networks.el (erc-server-alist): Removed SSL server for now
670 since `erc-server-select' doesn't know to use `erc-ssl'.
671
672 * erc-networks.el (erc-server-alist, erc-networks-alist): Added
673 definitions for oftc.net.
674
675 * erc-services.el (erc-nickserv-alist): Fixed OFTC message regexp.
676
6772007-01-22 Michael Olson <mwolson@gnu.org>
678
679 * erc-backend.el (erc-server-error-occurred): New variable that
680 indicates when an error has been signaled by the server. This
681 should fix an infinite reconnect bug when giving some servers a
682 bogus :full-name. Thanks to Angelina Carlton for the report.
683 (erc-server-connect): Initialize erc-server-error-occurred.
684 (erc-server-reconnect-p): Use it.
685 (ERROR): Set it.
686
687 * erc-services.el (erc-nickserv-alist): Alphabetize and add Ars
688 and QuakeNet. Standardize look of entries. Fix type mismatch
689 error in customize interface.
690 (erc-nickserv-passwords): Alphabetize and add missing entries from
691 erc-nickserv-alist.
692
6932007-01-21 Michael Olson <mwolson@gnu.org>
694
695 * erc.el (erc-header-line-format): Document how to disable the
696 header line, and add a customization type for it. Also, make the
697 changes take effect immediately.
698
6992007-01-19 Michael Olson <mwolson@gnu.org>
700
701 * erc.texi (Modules): Document new menu module. Thanks to Leo
702 for noticing.
703
7042007-01-16 Diane Murray <disumu@x3y2z1.net>
705
706 * erc-stamp.el (erc-insert-timestamp-left): Fixed so that the
707 whitespace string filler is hidden correctly when timestamps are
708 hidden.
709 (erc-toggle-timestamps): New function to use instead of
710 `erc-show-timestamps' and `erc-hide-timestamps'.
711
712 * erc.el (erc-restore-text-properties): Moved here from
713 erc-fill.el since it could be useful in general.
714
715 * erc-fill.el (erc-restore-text-properties): Removed.
716
7172007-01-13 Michael Olson <mwolson@gnu.org>
718
719 * erc.el (erc-command-regexp): New variable that is used to match
720 a command.
721 (erc-send-input): Use it. This fixes a bug where paths --
722 "/usr/bin/foo", for example -- were being displayed as commands,
723 but still sent correctly.
724 (erc-extract-command-from-line): Use it.
725
726 * erc.texi (Modules): Document erc-capab-identify.
727
7282007-01-11 Diane Murray <disumu@x3y2z1.net>
729
730 * erc.el (erc-find-parsed-property): Moved here from erc-track.el
731 since it can be useful in general.
732
733 * erc-track.el (erc-find-parsed-property): Removed.
734
735 * erc-capab.el (erc-capab-find-parsed): Removed.
736 (erc-capab-identify-add-prefix): Use `erc-find-parsed-property'.
737
738 * erc.el (erc-open): Run `erc-before-connect' hook here. This
739 makes sure the hook always gets called before a connection is
740 made, as some functions, like `erc-handle-irc-url', use `erc-open'
741 instead of `erc'.
742 (erc): Removed `erc-before-connect' hook.
743
744 * erc-menu.el (erc-menu-definition): Put items specific to
745 channels in a "Current channel" submenu.
746
747 * erc-backend.el (321, 323): Display channel list in server buffer
748 when not using the channel list module.
749
750 * erc.el: Updated copyright years.
751 (erc-version-string): Set to 5.2 (devel).
752 (erc-format-lag-time): Fixed to work when `erc-server-lag' is nil.
753 (erc-update-mode-line-buffer): Set the header face.
754
7552007-01-11 Michael Olson <mwolson@gnu.org>
756
757 * erc-bbdb.el (erc-bbdb-popup-type): Fix customization type and
758 documentation.
759
760 * erc-services.el (erc-nickserv-identify-mode): Improve
761 documentation for nick-change option and move higher to fix
762 compiler warning. Avoid a recursive load error.
763 (erc-nickserv-alist): Add simple entry for BitlBee, to avoid
764 "NickServ is AWAY: User is offline" error. Oddly enough, bitlbee
765 was smart enough to recognize that as an authentication request
766 and log in regardless, which is why I didn't notice this earlier.
767 (erc-nickserv-alist-sender, erc-nickserv-alist-regexp)
768 (erc-nickserv-alist-nickserv, erc-nickserv-alist-ident-keyword)
769 (erc-nickserv-alist-use-nick-p)
770 (erc-nickserv-alist-ident-command): New accessors for
771 erc-nickserv-alist. Using nth is unwieldy.
772 (erc-nickserv-identify-autodetect)
773 (erc-nickserv-identify-on-connect)
774 (erc-nickserv-identify-on-nick-change, erc-nickserv-identify): Use
775 the new accessors.
776
7772007-01-11 Diane Murray <disumu@x3y2z1.net>
778
779 * NEWS: Added note for `erc-my-nick-face'. Fixed capab-identify
780 wording.
781
7822007-01-10 Diane Murray <disumu@x3y2z1.net>
783
784 * erc.el (erc-mode-line-format): Added %l to documentation.
785 (erc-header-line-format): Removed "[IRC]". Use the new %l
786 replacement character. Doc fix.
787 (erc-format-channel-modes): Removed lag code. Removed parentheses
788 from mode string.
789 (erc-format-lag-time): New function.
790 (erc-update-mode-line-buffer): Use it.
791
7922007-01-10 Michael Olson <mwolson@gnu.org>
793
794 * erc.el: Fix typo in url-irc-function instructions.
795
7962007-01-09 Michael Olson <mwolson@gnu.org>
797
798 * erc.el (erc-system-name): New option that determines the system
799 name to use when logging in. The default is to figure this out by
800 calling `system-name'.
801 (erc-login): Use it.
802
8032007-01-07 Michael Olson <mwolson@gnu.org>
804
805 * erc.el (erc-modules): Add the menu module. This should fix a
806 bug with incorrect ERC submenus being displayed.
807
808 * erc-menu.el: Turn this into a module.
809 (erc-menu-add, erc-menu-remove): New functions that add and remove
810 the ERC menu.
811
812
813See ChangeLog.06 for earlier changes.
814
815 Copyright (C) 2007, 2008 Free Software Foundation, Inc.
816
817 This file is part of GNU Emacs.
818
819 GNU Emacs is free software; you can redistribute it and/or modify
820 it under the terms of the GNU General Public License as published by
821 the Free Software Foundation; either version 3, or (at your option)
822 any later version.
823
824 GNU Emacs is distributed in the hope that it will be useful,
825 but WITHOUT ANY WARRANTY; without even the implied warranty of
826 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
827 GNU General Public License for more details.
828
829 You should have received a copy of the GNU General Public License
830 along with GNU Emacs; see the file COPYING. If not, write to the
831 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
832 Boston, MA 02110-1301, USA.
833
834;; Local Variables:
835;; coding: utf-8
836;; add-log-time-zone-rule: t
837;; End:
838
839;; arch-tag: 3369b6e5-96b1-4b32-96cd-9a905c747496
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index 0fead116d8f..1bb3e4aada2 100644
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -332,11 +332,10 @@ This is either a coding system, a cons, a function, or nil.
332 332
333If a cons, the encoding system for outgoing text is in the car 333If a cons, the encoding system for outgoing text is in the car
334and the decoding system for incoming text is in the cdr. The most 334and the decoding system for incoming text is in the cdr. The most
335interesting use for this is to put `undecided' in the cdr. If a 335interesting use for this is to put `undecided' in the cdr.
336function, it is called with no arguments and should return a 336
337coding system or a cons as described above. Note that you can use 337If a function, it is called with the argument `target' and should
338the dynamically bound variable `target' to get the current 338return a coding system or a cons as described above.
339target. See `erc-coding-system-for-target'.
340 339
341If you need to send non-ASCII text to people not using a client that 340If you need to send non-ASCII text to people not using a client that
342does decoding on its own, you must tell ERC what encoding to use. 341does decoding on its own, you must tell ERC what encoding to use.
@@ -491,6 +490,8 @@ We will store server variables in the buffer given by BUFFER."
491 (let ((process (funcall erc-server-connect-function 490 (let ((process (funcall erc-server-connect-function
492 (format "erc-%s-%s" server port) 491 (format "erc-%s-%s" server port)
493 nil server port))) 492 nil server port)))
493 (unless (processp process)
494 (error "Connection attempt failed"))
494 (message "%s...done" msg) 495 (message "%s...done" msg)
495 ;; Misc server variables 496 ;; Misc server variables
496 (with-current-buffer buffer 497 (with-current-buffer buffer
@@ -686,7 +687,7 @@ This is determined via `erc-encoding-coding-alist' or
686 (when (string-match (car pat) target) 687 (when (string-match (car pat) target)
687 (throw 'match (cdr pat))))))) 688 (throw 'match (cdr pat)))))))
688 (and (functionp erc-server-coding-system) 689 (and (functionp erc-server-coding-system)
689 (funcall erc-server-coding-system)) 690 (funcall erc-server-coding-system target))
690 erc-server-coding-system)) 691 erc-server-coding-system))
691 692
692(defun erc-decode-string-from-target (str target) 693(defun erc-decode-string-from-target (str target)
@@ -1349,7 +1350,7 @@ add things to `%s' instead."
1349 (erc-update-mode-line)))) 1350 (erc-update-mode-line))))
1350 1351
1351(define-erc-response-handler (PRIVMSG NOTICE) 1352(define-erc-response-handler (PRIVMSG NOTICE)
1352 nil nil 1353 "Handle private messages, including messages in channels." nil
1353 (let ((sender-spec (erc-response.sender parsed)) 1354 (let ((sender-spec (erc-response.sender parsed))
1354 (cmd (erc-response.command parsed)) 1355 (cmd (erc-response.command parsed))
1355 (tgt (car (erc-response.command-args parsed))) 1356 (tgt (car (erc-response.command-args parsed)))
@@ -1413,7 +1414,7 @@ add things to `%s' instead."
1413(add-hook 'erc-server-PRIVMSG-functions 'erc-auto-query) 1414(add-hook 'erc-server-PRIVMSG-functions 'erc-auto-query)
1414 1415
1415(define-erc-response-handler (QUIT) 1416(define-erc-response-handler (QUIT)
1416 nil nil 1417 "Another user has quit IRC." nil
1417 (let ((reason (erc-response.contents parsed)) 1418 (let ((reason (erc-response.contents parsed))
1418 bufs) 1419 bufs)
1419 (multiple-value-bind (nick login host) 1420 (multiple-value-bind (nick login host)
@@ -1426,7 +1427,7 @@ add things to `%s' instead."
1426 ?h host ?r reason)))) 1427 ?h host ?r reason))))
1427 1428
1428(define-erc-response-handler (TOPIC) 1429(define-erc-response-handler (TOPIC)
1429 nil nil 1430 "The channel topic has changed." nil
1430 (let* ((ch (first (erc-response.command-args parsed))) 1431 (let* ((ch (first (erc-response.command-args parsed)))
1431 (topic (erc-trim-string (erc-response.contents parsed))) 1432 (topic (erc-trim-string (erc-response.contents parsed)))
1432 (time (format-time-string "%T %m/%d/%y" (current-time)))) 1433 (time (format-time-string "%T %m/%d/%y" (current-time))))
@@ -1439,7 +1440,7 @@ add things to `%s' instead."
1439 ?c ch ?T topic)))) 1440 ?c ch ?T topic))))
1440 1441
1441(define-erc-response-handler (WALLOPS) 1442(define-erc-response-handler (WALLOPS)
1442 nil nil 1443 "Display a WALLOPS message." nil
1443 (let ((message (erc-response.contents parsed))) 1444 (let ((message (erc-response.contents parsed)))
1444 (multiple-value-bind (nick login host) 1445 (multiple-value-bind (nick login host)
1445 (erc-parse-user (erc-response.sender parsed)) 1446 (erc-parse-user (erc-response.sender parsed))
@@ -1465,12 +1466,12 @@ add things to `%s' instead."
1465 (erc-response.contents parsed))) 1466 (erc-response.contents parsed)))
1466 1467
1467(define-erc-response-handler (376 422) 1468(define-erc-response-handler (376 422)
1468 nil nil 1469 "End of MOTD/MOTD is missing." nil
1469 (erc-server-MOTD proc parsed) 1470 (erc-server-MOTD proc parsed)
1470 (erc-connection-established proc parsed)) 1471 (erc-connection-established proc parsed))
1471 1472
1472(define-erc-response-handler (004) 1473(define-erc-response-handler (004)
1473 nil nil 1474 "Display the server's identification." nil
1474 (multiple-value-bind (server-name server-version) 1475 (multiple-value-bind (server-name server-version)
1475 (cdr (erc-response.command-args parsed)) 1476 (cdr (erc-response.command-args parsed))
1476 (setq erc-server-version server-version) 1477 (setq erc-server-version server-version)
@@ -1510,7 +1511,7 @@ A server may send more than one 005 message."
1510 (erc-display-message parsed 'notice proc line))) 1511 (erc-display-message parsed 'notice proc line)))
1511 1512
1512(define-erc-response-handler (221) 1513(define-erc-response-handler (221)
1513 nil nil 1514 "Display the current user modes." nil
1514 (let* ((nick (first (erc-response.command-args parsed))) 1515 (let* ((nick (first (erc-response.command-args parsed)))
1515 (modes (mapconcat 'identity 1516 (modes (mapconcat 'identity
1516 (cdr (erc-response.command-args parsed)) " "))) 1517 (cdr (erc-response.command-args parsed)) " ")))
@@ -1596,7 +1597,7 @@ See `erc-display-server-message'." nil
1596 ?n nick ?f fname ?u user ?h host)))) 1597 ?n nick ?f fname ?u user ?h host))))
1597 1598
1598(define-erc-response-handler (312) 1599(define-erc-response-handler (312)
1599 nil nil 1600 "Server name response in WHOIS." nil
1600 (multiple-value-bind (nick server-host) 1601 (multiple-value-bind (nick server-host)
1601 (cdr (erc-response.command-args parsed)) 1602 (cdr (erc-response.command-args parsed))
1602 (erc-display-message 1603 (erc-display-message
@@ -1614,7 +1615,7 @@ See `erc-display-server-message'." nil
1614 ;; 318 - End of WHOIS list 1615 ;; 318 - End of WHOIS list
1615 ;; 323 - End of channel LIST 1616 ;; 323 - End of channel LIST
1616 ;; 369 - End of WHOWAS 1617 ;; 369 - End of WHOWAS
1617 nil nil 1618 "End of WHO/WHOIS/LIST/WHOWAS notices." nil
1618 (ignore proc parsed)) 1619 (ignore proc parsed))
1619 1620
1620(define-erc-response-handler (317) 1621(define-erc-response-handler (317)
@@ -1635,7 +1636,7 @@ See `erc-display-server-message'." nil
1635 ?n nick ?i (erc-sec-to-time (string-to-number seconds-idle)))))) 1636 ?n nick ?i (erc-sec-to-time (string-to-number seconds-idle))))))
1636 1637
1637(define-erc-response-handler (319) 1638(define-erc-response-handler (319)
1638 nil nil 1639 "Channel names in WHOIS response." nil
1639 (erc-display-message 1640 (erc-display-message
1640 parsed 'notice 'active 's319 1641 parsed 'notice 'active 's319
1641 ?n (second (erc-response.command-args parsed)) 1642 ?n (second (erc-response.command-args parsed))
@@ -1649,8 +1650,13 @@ See `erc-display-server-message'." nil
1649 1650
1650(define-erc-response-handler (321) 1651(define-erc-response-handler (321)
1651 "LIST header." nil 1652 "LIST header." nil
1652 (setq erc-channel-list nil) 1653 (setq erc-channel-list nil))
1653 (erc-display-message parsed 'notice proc 's321)) 1654
1655(defun erc-server-321-message (proc parsed)
1656 "Display a message for the 321 event."
1657 (erc-display-message parsed 'notice proc 's321)
1658 nil)
1659(add-hook 'erc-server-321-functions 'erc-server-321-message t)
1654 1660
1655(define-erc-response-handler (322) 1661(define-erc-response-handler (322)
1656 "LIST notice." nil 1662 "LIST notice." nil
@@ -1658,10 +1664,17 @@ See `erc-display-server-message'." nil
1658 (multiple-value-bind (channel num-users) 1664 (multiple-value-bind (channel num-users)
1659 (cdr (erc-response.command-args parsed)) 1665 (cdr (erc-response.command-args parsed))
1660 (add-to-list 'erc-channel-list (list channel)) 1666 (add-to-list 'erc-channel-list (list channel))
1661 (erc-update-channel-topic channel topic) 1667 (erc-update-channel-topic channel topic))))
1668
1669(defun erc-server-322-message (proc parsed)
1670 "Display a message for the 322 event."
1671 (let ((topic (erc-response.contents parsed)))
1672 (multiple-value-bind (channel num-users)
1673 (cdr (erc-response.command-args parsed))
1662 (erc-display-message 1674 (erc-display-message
1663 parsed 'notice proc 's322 1675 parsed 'notice proc 's322
1664 ?c channel ?u num-users ?t (or topic ""))))) 1676 ?c channel ?u num-users ?t (or topic "")))))
1677(add-hook 'erc-server-322-functions 'erc-server-322-message t)
1665 1678
1666(define-erc-response-handler (324) 1679(define-erc-response-handler (324)
1667 "Channel or nick modes." nil 1680 "Channel or nick modes." nil
@@ -1683,7 +1696,7 @@ See `erc-display-server-message'." nil
1683 's329 ?c channel ?t (format-time-string "%A %Y/%m/%d %X" time)))) 1696 's329 ?c channel ?t (format-time-string "%A %Y/%m/%d %X" time))))
1684 1697
1685(define-erc-response-handler (330) 1698(define-erc-response-handler (330)
1686 nil nil 1699 "Nick is authed as (on Quakenet network)." nil
1687 ;; FIXME: I don't know what the magic numbers mean. Mummy, make 1700 ;; FIXME: I don't know what the magic numbers mean. Mummy, make
1688 ;; the magic numbers go away. 1701 ;; the magic numbers go away.
1689 ;; No seriously, I have no clue about the format of this command, 1702 ;; No seriously, I have no clue about the format of this command,
@@ -1699,10 +1712,9 @@ See `erc-display-server-message'." nil
1699 ?n nick ?a authmsg ?i authaccount))) 1712 ?n nick ?a authmsg ?i authaccount)))
1700 1713
1701(define-erc-response-handler (331) 1714(define-erc-response-handler (331)
1702 "Channel topic." nil 1715 "No topic set for channel." nil
1703 (let ((channel (second (erc-response.command-args parsed))) 1716 (let ((channel (second (erc-response.command-args parsed)))
1704 (topic (erc-response.contents parsed))) 1717 (topic (erc-response.contents parsed)))
1705 ;; FIXME: why don't we do anything with the topic? -- Lawrence 2004/05/10
1706 (erc-display-message parsed 'notice (erc-get-buffer channel proc) 1718 (erc-display-message parsed 'notice (erc-get-buffer channel proc)
1707 's331 ?c channel))) 1719 's331 ?c channel)))
1708 1720
@@ -1715,8 +1727,7 @@ See `erc-display-server-message'." nil
1715 's332 ?c channel ?T topic))) 1727 's332 ?c channel ?T topic)))
1716 1728
1717(define-erc-response-handler (333) 1729(define-erc-response-handler (333)
1718 ;; Who set the topic, and when 1730 "Who set the topic, and when." nil
1719 nil nil
1720 (multiple-value-bind (channel nick time) 1731 (multiple-value-bind (channel nick time)
1721 (cdr (erc-response.command-args parsed)) 1732 (cdr (erc-response.command-args parsed))
1722 (setq time (format-time-string "%T %Y/%m/%d" 1733 (setq time (format-time-string "%T %Y/%m/%d"
@@ -1766,7 +1777,7 @@ See `erc-display-server-message'." nil
1766 (erc-channel-end-receiving-names))) 1777 (erc-channel-end-receiving-names)))
1767 1778
1768(define-erc-response-handler (367) 1779(define-erc-response-handler (367)
1769 "Channel ban list entries" nil 1780 "Channel ban list entries." nil
1770 (multiple-value-bind (channel banmask setter time) 1781 (multiple-value-bind (channel banmask setter time)
1771 (cdr (erc-response.command-args parsed)) 1782 (cdr (erc-response.command-args parsed))
1772 ;; setter and time are not standard 1783 ;; setter and time are not standard
@@ -1781,7 +1792,7 @@ See `erc-display-server-message'." nil
1781 ?b banmask)))) 1792 ?b banmask))))
1782 1793
1783(define-erc-response-handler (368) 1794(define-erc-response-handler (368)
1784 "End of channel ban list" nil 1795 "End of channel ban list." nil
1785 (let ((channel (second (erc-response.command-args parsed)))) 1796 (let ((channel (second (erc-response.command-args parsed))))
1786 (erc-display-message parsed 'notice 'active 's368 1797 (erc-display-message parsed 'notice 'active 's368
1787 ?c channel))) 1798 ?c channel)))
@@ -1797,7 +1808,7 @@ See `erc-display-server-message'." nil
1797 's379 ?c from ?f to))) 1808 's379 ?c from ?f to)))
1798 1809
1799(define-erc-response-handler (391) 1810(define-erc-response-handler (391)
1800 "Server's time string" nil 1811 "Server's time string." nil
1801 (erc-display-message 1812 (erc-display-message
1802 parsed 'notice 'active 1813 parsed 'notice 'active
1803 's391 ?s (second (erc-response.command-args parsed)) 1814 's391 ?s (second (erc-response.command-args parsed))
@@ -1824,56 +1835,47 @@ See `erc-display-server-message'." nil
1824 1835
1825 1836
1826(define-erc-response-handler (405) 1837(define-erc-response-handler (405)
1827 ;; Can't join that many channels. 1838 "Can't join that many channels." nil
1828 nil nil
1829 (erc-display-message parsed '(notice error) 'active 1839 (erc-display-message parsed '(notice error) 'active
1830 's405 ?c (second (erc-response.command-args parsed)))) 1840 's405 ?c (second (erc-response.command-args parsed))))
1831 1841
1832(define-erc-response-handler (406) 1842(define-erc-response-handler (406)
1833 ;; No such nick 1843 "No such nick." nil
1834 nil nil
1835 (erc-display-message parsed '(notice error) 'active 1844 (erc-display-message parsed '(notice error) 'active
1836 's406 ?n (second (erc-response.command-args parsed)))) 1845 's406 ?n (second (erc-response.command-args parsed))))
1837 1846
1838(define-erc-response-handler (412) 1847(define-erc-response-handler (412)
1839 ;; No text to send 1848 "No text to send." nil
1840 nil nil
1841 (erc-display-message parsed '(notice error) 'active 's412)) 1849 (erc-display-message parsed '(notice error) 'active 's412))
1842 1850
1843(define-erc-response-handler (421) 1851(define-erc-response-handler (421)
1844 ;; Unknown command 1852 "Unknown command." nil
1845 nil nil
1846 (erc-display-message parsed '(notice error) 'active 's421 1853 (erc-display-message parsed '(notice error) 'active 's421
1847 ?c (second (erc-response.command-args parsed)))) 1854 ?c (second (erc-response.command-args parsed))))
1848 1855
1849(define-erc-response-handler (432) 1856(define-erc-response-handler (432)
1850 ;; Bad nick. 1857 "Bad nick." nil
1851 nil nil
1852 (erc-display-message parsed '(notice error) 'active 's432 1858 (erc-display-message parsed '(notice error) 'active 's432
1853 ?n (second (erc-response.command-args parsed)))) 1859 ?n (second (erc-response.command-args parsed))))
1854 1860
1855(define-erc-response-handler (433) 1861(define-erc-response-handler (433)
1856 ;; Login-time "nick in use" 1862 "Login-time \"nick in use\"." nil
1857 nil nil
1858 (erc-nickname-in-use (second (erc-response.command-args parsed)) 1863 (erc-nickname-in-use (second (erc-response.command-args parsed))
1859 "already in use")) 1864 "already in use"))
1860 1865
1861(define-erc-response-handler (437) 1866(define-erc-response-handler (437)
1862 ;; Nick temporarily unavailable (IRCnet) 1867 "Nick temporarily unavailable (on IRCnet)." nil
1863 nil nil
1864 (let ((nick/channel (second (erc-response.command-args parsed)))) 1868 (let ((nick/channel (second (erc-response.command-args parsed))))
1865 (unless (erc-channel-p nick/channel) 1869 (unless (erc-channel-p nick/channel)
1866 (erc-nickname-in-use nick/channel "temporarily unavailable")))) 1870 (erc-nickname-in-use nick/channel "temporarily unavailable"))))
1867 1871
1868(define-erc-response-handler (442) 1872(define-erc-response-handler (442)
1869 ;; Not on channel 1873 "Not on channel." nil
1870 nil nil
1871 (erc-display-message parsed '(notice error) 'active 's442 1874 (erc-display-message parsed '(notice error) 'active 's442
1872 ?c (second (erc-response.command-args parsed)))) 1875 ?c (second (erc-response.command-args parsed))))
1873 1876
1874(define-erc-response-handler (461) 1877(define-erc-response-handler (461)
1875 ;; Not enough params for command. 1878 "Not enough parameters for command." nil
1876 nil nil
1877 (erc-display-message parsed '(notice error) 'active 's461 1879 (erc-display-message parsed '(notice error) 'active 's461
1878 ?c (second (erc-response.command-args parsed)) 1880 ?c (second (erc-response.command-args parsed))
1879 ?m (erc-response.contents parsed))) 1881 ?m (erc-response.contents parsed)))
@@ -1887,7 +1889,7 @@ See `erc-display-server-message'." nil
1887 (erc-response.contents parsed))) 1889 (erc-response.contents parsed)))
1888 1890
1889(define-erc-response-handler (474) 1891(define-erc-response-handler (474)
1890 "Banned from channel errors" nil 1892 "Banned from channel errors." nil
1891 (erc-display-message parsed '(notice error) nil 1893 (erc-display-message parsed '(notice error) nil
1892 (intern (format "s%s" 1894 (intern (format "s%s"
1893 (erc-response.command parsed))) 1895 (erc-response.command parsed)))
@@ -1906,14 +1908,14 @@ See `erc-display-server-message'." nil
1906 (erc-cmd-JOIN channel key))))) 1908 (erc-cmd-JOIN channel key)))))
1907 1909
1908(define-erc-response-handler (477) 1910(define-erc-response-handler (477)
1909 nil nil 1911 "Channel doesn't support modes." nil
1910 (let ((channel (second (erc-response.command-args parsed))) 1912 (let ((channel (second (erc-response.command-args parsed)))
1911 (message (erc-response.contents parsed))) 1913 (message (erc-response.contents parsed)))
1912 (erc-display-message parsed 'notice (erc-get-buffer channel proc) 1914 (erc-display-message parsed 'notice (erc-get-buffer channel proc)
1913 (format "%s: %s" channel message)))) 1915 (format "%s: %s" channel message))))
1914 1916
1915(define-erc-response-handler (482) 1917(define-erc-response-handler (482)
1916 nil nil 1918 "You need to be a channel operator to do that." nil
1917 (let ((channel (second (erc-response.command-args parsed))) 1919 (let ((channel (second (erc-response.command-args parsed)))
1918 (message (erc-response.contents parsed))) 1920 (message (erc-response.contents parsed)))
1919 (erc-display-message parsed '(error notice) 'active 's482 1921 (erc-display-message parsed '(error notice) 'active 's482
@@ -1935,7 +1937,9 @@ See `erc-display-server-message'." nil
1935 ;; 491 - No O-lines for your host 1937 ;; 491 - No O-lines for your host
1936 ;; 501 - Unknown MODE flag 1938 ;; 501 - Unknown MODE flag
1937 ;; 502 - Cannot change mode for other users 1939 ;; 502 - Cannot change mode for other users
1938 nil nil 1940 "Generic display of server error messages.
1941
1942See `erc-display-error-notice'." nil
1939 (erc-display-error-notice 1943 (erc-display-error-notice
1940 parsed 1944 parsed
1941 (intern (format "s%s" (erc-response.command parsed))))) 1945 (intern (format "s%s" (erc-response.command parsed)))))
diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el
index a74d56b90bd..7e45c6cd4ea 100644
--- a/lisp/erc/erc-button.el
+++ b/lisp/erc/erc-button.el
@@ -57,16 +57,15 @@
57 ((add-hook 'erc-insert-modify-hook 'erc-button-add-buttons 'append) 57 ((add-hook 'erc-insert-modify-hook 'erc-button-add-buttons 'append)
58 (add-hook 'erc-send-modify-hook 'erc-button-add-buttons 'append) 58 (add-hook 'erc-send-modify-hook 'erc-button-add-buttons 'append)
59 (add-hook 'erc-complete-functions 'erc-button-next) 59 (add-hook 'erc-complete-functions 'erc-button-next)
60 (add-hook 'erc-mode-hook 'erc-button-add-keys)) 60 (add-hook 'erc-mode-hook 'erc-button-setup))
61 ((remove-hook 'erc-insert-modify-hook 'erc-button-add-buttons) 61 ((remove-hook 'erc-insert-modify-hook 'erc-button-add-buttons)
62 (remove-hook 'erc-send-modify-hook 'erc-button-add-buttons) 62 (remove-hook 'erc-send-modify-hook 'erc-button-add-buttons)
63 (remove-hook 'erc-complete-functions 'erc-button-next) 63 (remove-hook 'erc-complete-functions 'erc-button-next)
64 (remove-hook 'erc-mode-hook 'erc-button-add-keys))) 64 (remove-hook 'erc-mode-hook 'erc-button-setup)
65 65 (when (featurep 'xemacs)
66;; Make XEmacs use `erc-button-face'. 66 (dolist (buffer (erc-buffer-list))
67(when (featurep 'xemacs) 67 (with-current-buffer buffer
68 (add-hook 'erc-mode-hook 68 (kill-local-variable 'widget-button-face))))))
69 (lambda () (set (make-local-variable 'widget-button-face) nil))))
70 69
71;;; Variables 70;;; Variables
72 71
@@ -247,8 +246,12 @@ constituents.")
247 "Internal variable used to keep track of whether we've added the 246 "Internal variable used to keep track of whether we've added the
248global-level ERC button keys yet.") 247global-level ERC button keys yet.")
249 248
250(defun erc-button-add-keys () 249(defun erc-button-setup ()
251 "Add ERC mode-level button movement keys. This is only done once." 250 "Add ERC mode-level button movement keys. This is only done once."
251 ;; Make XEmacs use `erc-button-face'.
252 (when (featurep 'xemacs)
253 (set (make-local-variable 'widget-button-face) nil))
254 ;; Add keys.
252 (unless erc-button-keys-added 255 (unless erc-button-keys-added
253 (define-key erc-mode-map (kbd "<backtab>") 'erc-button-previous) 256 (define-key erc-mode-map (kbd "<backtab>") 'erc-button-previous)
254 (setq erc-button-keys-added t))) 257 (setq erc-button-keys-added t)))
@@ -299,9 +302,10 @@ specified by `erc-button-alist'."
299 (setq bounds (bounds-of-thing-at-point 'word)) 302 (setq bounds (bounds-of-thing-at-point 'word))
300 (setq word (buffer-substring-no-properties 303 (setq word (buffer-substring-no-properties
301 (car bounds) (cdr bounds))) 304 (car bounds) (cdr bounds)))
302 (if (erc-get-server-user word) 305 (when (or (and (erc-server-buffer-p) (erc-get-server-user word))
303 (erc-button-add-button (car bounds) (cdr bounds) 306 (and erc-channel-users (erc-get-channel-user word)))
304 fun t (list word))))))) 307 (erc-button-add-button (car bounds) (cdr bounds)
308 fun t (list word)))))))
305 309
306(defun erc-button-add-buttons-1 (regexp entry) 310(defun erc-button-add-buttons-1 (regexp entry)
307 "Search through the buffer for matches to ENTRY and add buttons." 311 "Search through the buffer for matches to ENTRY and add buttons."
diff --git a/lisp/erc/erc-compat.el b/lisp/erc/erc-compat.el
index d99d8fca7da..dd01280b3aa 100644
--- a/lisp/erc/erc-compat.el
+++ b/lisp/erc/erc-compat.el
@@ -88,53 +88,6 @@ See `replace-match' for explanations of FIXEDCASE and LITERAL."
88(defalias 'erc-make-obsolete 'make-obsolete) 88(defalias 'erc-make-obsolete 'make-obsolete)
89(defalias 'erc-make-obsolete-variable 'make-obsolete-variable) 89(defalias 'erc-make-obsolete-variable 'make-obsolete-variable)
90 90
91;; Provde an equivalent of `assert', based on the code from cl-macs.el
92(defun erc-const-expr-p (x)
93 (cond ((consp x)
94 (or (eq (car x) 'quote)
95 (and (memq (car x) '(function function*))
96 (or (symbolp (nth 1 x))
97 (and (eq (and (consp (nth 1 x))
98 (car (nth 1 x))) 'lambda) 'func)))))
99 ((symbolp x) (and (memq x '(nil t)) t))
100 (t t)))
101
102(put 'erc-assertion-failed 'error-conditions '(error))
103(put 'erc-assertion-failed 'error-message "Assertion failed")
104
105(defun erc-list* (arg &rest rest)
106 "Return a new list with specified args as elements, cons'd to last arg.
107Thus, `(list* A B C D)' is equivalent to `(nconc (list A B C) D)', or to
108`(cons A (cons B (cons C D)))'."
109 (cond ((not rest) arg)
110 ((not (cdr rest)) (cons arg (car rest)))
111 (t (let* ((n (length rest))
112 (copy (copy-sequence rest))
113 (last (nthcdr (- n 2) copy)))
114 (setcdr last (car (cdr last)))
115 (cons arg copy)))))
116
117(defmacro erc-assert (form &optional show-args string &rest args)
118 "Verify that FORM returns non-nil; signal an error if not.
119Second arg SHOW-ARGS means to include arguments of FORM in message.
120Other args STRING and ARGS... are arguments to be passed to `error'.
121They are not evaluated unless the assertion fails. If STRING is
122omitted, a default message listing FORM itself is used."
123 (let ((sargs
124 (and show-args
125 (delq nil (mapcar
126 (function
127 (lambda (x)
128 (and (not (erc-const-expr-p x)) x)))
129 (cdr form))))))
130 (list 'progn
131 (list 'or form
132 (if string
133 (erc-list* 'error string (append sargs args))
134 (list 'signal '(quote erc-assertion-failed)
135 (erc-list* 'list (list 'quote form) sargs))))
136 nil)))
137
138;; Provide a simpler replacement for `member-if' 91;; Provide a simpler replacement for `member-if'
139(defun erc-member-if (predicate list) 92(defun erc-member-if (predicate list)
140 "Find the first item satisfying PREDICATE in LIST. 93 "Find the first item satisfying PREDICATE in LIST.
diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el
index 8158c0999d3..2aca06479f6 100644
--- a/lisp/erc/erc-dcc.el
+++ b/lisp/erc/erc-dcc.el
@@ -60,6 +60,12 @@
60 (require 'cl) 60 (require 'cl)
61 (require 'pcomplete)) 61 (require 'pcomplete))
62 62
63;;;###autoload (autoload 'erc-dcc-mode "erc-dcc")
64(define-erc-module dcc nil
65 "Provide Direct Client-to-Client support for ERC."
66 ((add-hook 'erc-server-401-functions 'erc-dcc-no-such-nick))
67 ((remove-hook 'erc-server-401-functions 'erc-dcc-no-such-nick)))
68
63(defgroup erc-dcc nil 69(defgroup erc-dcc nil
64 "DCC stands for Direct Client Communication, where you and your 70 "DCC stands for Direct Client Communication, where you and your
65friend's client programs connect directly to each other, 71friend's client programs connect directly to each other,
@@ -70,7 +76,7 @@ Using DCC get and send, you can transfer files directly from and to other
70IRC users." 76IRC users."
71 :group 'erc) 77 :group 'erc)
72 78
73(defcustom erc-verbose-dcc t 79(defcustom erc-dcc-verbose nil
74 "*If non-nil, be verbose about DCC activity reporting." 80 "*If non-nil, be verbose about DCC activity reporting."
75 :group 'erc-dcc 81 :group 'erc-dcc
76 :type 'boolean) 82 :type 'boolean)
@@ -195,20 +201,22 @@ compared with `erc-nick-equal-p' which is IRC case-insensitive."
195 (setq list (cdr list))))) 201 (setq list (cdr list)))))
196 result)) 202 result))
197 203
198;; msa wrote this nifty little frob to convert an n-byte integer to a packed 204(defun erc-pack-int (value)
199;; string. 205 "Convert an integer into a packed string."
200(defun erc-pack-int (value count) 206 (let* ((len (ceiling (/ value 256.0)))
201 (if (> count 0) 207 (str (make-string len ?a))
202 (concat (erc-pack-int (/ value 256) (1- count)) 208 (i (1- len)))
203 (char-to-string (% value 256))) 209 (while (>= i 0)
204 "")) 210 (aset str i (% value 256))
211 (setq value (/ value 256))
212 (setq i (1- i)))
213 str))
205 214
206(defun erc-unpack-int (str) 215(defun erc-unpack-int (str)
207 "Unpack a 1-4 character packed string into an integer." 216 "Unpack a packed string into an integer."
208 (let ((len (length str)) 217 (let ((len (length str))
209 (num 0) 218 (num 0)
210 (count 0)) 219 (count 0))
211 (erc-assert (<= len 4)) ;; this isn't going to fit in elisp bounds
212 (while (< count len) 220 (while (< count len)
213 (setq num (+ num (lsh (aref str (- len count 1)) (* 8 count)))) 221 (setq num (+ num (lsh (aref str (- len count 1)) (* 8 count))))
214 (setq count (1+ count))) 222 (setq count (1+ count)))
@@ -256,15 +264,24 @@ The result is also a string."
256 264
257;;; Server code 265;;; Server code
258 266
259(defcustom erc-dcc-host nil 267(defcustom erc-dcc-listen-host nil
260 "*IP address to use for outgoing DCC offers. 268 "IP address to listen on when offering files.
261Should be set to a string or nil, if nil, automatic detection of the 269Should be set to a string or nil. If nil, automatic detection of
262host interface to use will be attempted." 270the host interface to use will be attempted."
263 :group 'erc-dcc 271 :group 'erc-dcc
264 :type (list 'choice (list 'const :tag "Auto-detect" nil) 272 :type (list 'choice (list 'const :tag "Auto-detect" nil)
265 (list 'string :tag "IP-address" 273 (list 'string :tag "IP-address"
266 :valid-regexp erc-dcc-ipv4-regexp))) 274 :valid-regexp erc-dcc-ipv4-regexp)))
267 275
276(defcustom erc-dcc-public-host nil
277 "IP address to use for outgoing DCC offers.
278Should be set to a string or nil. If nil, use the value of
279`erc-dcc-listen-host'."
280 :group 'erc-dcc
281 :type (list 'choice (list 'const :tag "Same as erc-dcc-listen-host" nil)
282 (list 'string :tag "IP-address"
283 :valid-regexp erc-dcc-ipv4-regexp)))
284
268(defcustom erc-dcc-send-request 'ask 285(defcustom erc-dcc-send-request 'ask
269 "*How to treat incoming DCC Send requests. 286 "*How to treat incoming DCC Send requests.
270'ask - Report the Send request, and wait for the user to manually accept it 287'ask - Report the Send request, and wait for the user to manually accept it
@@ -282,7 +299,7 @@ host interface to use will be attempted."
282 "Determine the IP address we are using. 299 "Determine the IP address we are using.
283If variable `erc-dcc-host' is non-nil, use it. Otherwise call 300If variable `erc-dcc-host' is non-nil, use it. Otherwise call
284`erc-dcc-get-host' on the erc-server-process." 301`erc-dcc-get-host' on the erc-server-process."
285 (or erc-dcc-host (erc-dcc-get-host erc-server-process) 302 (or erc-dcc-listen-host (erc-dcc-get-host erc-server-process)
286 (error "Unable to determine local address"))) 303 (error "Unable to determine local address")))
287 304
288(defcustom erc-dcc-port-range nil 305(defcustom erc-dcc-port-range nil
@@ -311,6 +328,7 @@ created subprocess, or nil."
311 process) 328 process)
312 (while (not process) 329 (while (not process)
313 (condition-case err 330 (condition-case err
331 (progn
314 (setq process 332 (setq process
315 (make-network-process :name name 333 (make-network-process :name name
316 :buffer nil 334 :buffer nil
@@ -322,6 +340,11 @@ created subprocess, or nil."
322 :sentinel sentinel 340 :sentinel sentinel
323 :log #'erc-dcc-server-accept 341 :log #'erc-dcc-server-accept
324 :server t)) 342 :server t))
343 (when (processp process)
344 (when (fboundp 'set-process-coding-system)
345 (set-process-coding-system process 'binary 'binary))
346 (when (fboundp 'set-process-filter-multibyte)
347 (set-process-filter-multibyte process nil))))
325 (file-error 348 (file-error
326 (unless (and (string= "Cannot bind server socket" (cadr err)) 349 (unless (and (string= "Cannot bind server socket" (cadr err))
327 (string= "address already in use" (caddr err))) 350 (string= "address already in use" (caddr err)))
@@ -698,7 +721,7 @@ bytes sent."
698 (confirmed-marker (plist-get elt :sent)) 721 (confirmed-marker (plist-get elt :sent))
699 (sent-marker (plist-get elt :sent))) 722 (sent-marker (plist-get elt :sent)))
700 (with-current-buffer (process-buffer proc) 723 (with-current-buffer (process-buffer proc)
701 (when erc-verbose-dcc 724 (when erc-dcc-verbose
702 (erc-display-message 725 (erc-display-message
703 nil 'notice (erc-dcc-get-parent proc) 726 nil 'notice (erc-dcc-get-parent proc)
704 (format "DCC: Confirmed %d, sent %d, sending block now" 727 (format "DCC: Confirmed %d, sent %d, sending block now"
@@ -713,8 +736,7 @@ bytes sent."
713 (length string))))) 736 (length string)))))
714 737
715(defun erc-dcc-send-filter (proc string) 738(defun erc-dcc-send-filter (proc string)
716 (erc-assert (= (% (length string) 4) 0)) 739 (let* ((size (erc-unpack-int string))
717 (let* ((size (erc-unpack-int (substring string (- (length string) 4))))
718 (elt (erc-dcc-member :peer proc)) 740 (elt (erc-dcc-member :peer proc))
719 (parent (plist-get elt :parent)) 741 (parent (plist-get elt :parent))
720 (sent-marker (plist-get elt :sent)) 742 (sent-marker (plist-get elt :sent))
@@ -742,16 +764,21 @@ bytes sent."
742 ((> confirmed-marker sent-marker) 764 ((> confirmed-marker sent-marker)
743 (erc-display-message 765 (erc-display-message
744 nil 'notice parent 766 nil 'notice parent
745 (format "DCC: Client confirmed too much!")) 767 (format "DCC: Client confirmed too much (%s vs %s)!"
768 (marker-position confirmed-marker)
769 (marker-position sent-marker)))
770 (set-buffer-modified-p nil)
771 (kill-buffer (current-buffer))
746 (delete-process proc)))))) 772 (delete-process proc))))))
747 773
774(defun erc-dcc-display-send (proc)
775 (erc-display-message
776 nil 'notice (erc-dcc-get-parent proc)
777 (format "DCC: SEND connect from %s"
778 (format-network-address (process-contact proc :remote)))))
779
748(defcustom erc-dcc-send-connect-hook 780(defcustom erc-dcc-send-connect-hook
749 '((lambda (proc) 781 '(erc-dcc-display-send erc-dcc-send-block)
750 (erc-display-message
751 nil 'notice (erc-dcc-get-parent proc)
752 (format "DCC: SEND connect from %s"
753 (format-network-address (process-contact proc :remote)))))
754 erc-dcc-send-block)
755 "*Hook run whenever the remote end of a DCC SEND offer connected to your 782 "*Hook run whenever the remote end of a DCC SEND offer connected to your
756listening port." 783listening port."
757 :group 'erc-dcc 784 :group 'erc-dcc
@@ -762,14 +789,14 @@ listening port."
762 (erc-extract-nick (plist-get plist :nick))) 789 (erc-extract-nick (plist-get plist :nick)))
763 790
764(defun erc-dcc-send-sentinel (proc event) 791(defun erc-dcc-send-sentinel (proc event)
765 (let* ((elt (erc-dcc-member :peer proc)) 792 (let* ((elt (erc-dcc-member :peer proc)))
766 (buf (marker-buffer (plist-get elt :sent))))
767 (cond 793 (cond
768 ((string-match "^open from " event) 794 ((string-match "^open from " event)
769 (when elt 795 (when elt
770 (with-current-buffer buf 796 (let ((buf (marker-buffer (plist-get elt :sent))))
771 (set-process-buffer proc buf) 797 (with-current-buffer buf
772 (setq erc-dcc-entry-data elt)) 798 (set-process-buffer proc buf)
799 (setq erc-dcc-entry-data elt)))
773 (run-hook-with-args 'erc-dcc-send-connect-hook proc)))))) 800 (run-hook-with-args 'erc-dcc-send-connect-hook proc))))))
774 801
775(defun erc-dcc-find-file (file) 802(defun erc-dcc-find-file (file)
@@ -807,15 +834,23 @@ other client."
807 (process-send-string 834 (process-send-string
808 pproc (format "PRIVMSG %s :\C-aDCC SEND %s %s %d %d\C-a\n" 835 pproc (format "PRIVMSG %s :\C-aDCC SEND %s %s %d %d\C-a\n"
809 nick (erc-dcc-file-to-name file) 836 nick (erc-dcc-file-to-name file)
810 (erc-ip-to-decimal (nth 0 contact)) 837 (erc-ip-to-decimal (or erc-dcc-public-host
838 (nth 0 contact)))
811 (nth 1 contact) 839 (nth 1 contact)
812 size))) 840 size)))
813 (error "`make-network-process' not supported by your Emacs"))) 841 (error "`make-network-process' not supported by your Emacs")))
814 842
815;;; GET handling 843;;; GET handling
816 844
845(defcustom erc-dcc-receive-cache (* 1024 512)
846 "Number of bytes to let the receive buffer grow before flushing it."
847 :group 'erc-dcc
848 :type 'integer)
849
817(defvar erc-dcc-byte-count nil) 850(defvar erc-dcc-byte-count nil)
818(make-variable-buffer-local 'erc-dcc-byte-count) 851(make-variable-buffer-local 'erc-dcc-byte-count)
852(defvar erc-dcc-file-name nil)
853(make-variable-buffer-local 'erc-dcc-file-name)
819 854
820(defun erc-dcc-get-file (entry file parent-proc) 855(defun erc-dcc-get-file (entry file parent-proc)
821 "This function does the work of setting up a transfer from the remote client 856 "This function does the work of setting up a transfer from the remote client
@@ -825,6 +860,7 @@ filter and a process sentinel, and making the connection."
825 proc) 860 proc)
826 (with-current-buffer buffer 861 (with-current-buffer buffer
827 (fundamental-mode) 862 (fundamental-mode)
863 (buffer-disable-undo (current-buffer))
828 ;; This is necessary to have the buffer saved as-is in GNU 864 ;; This is necessary to have the buffer saved as-is in GNU
829 ;; Emacs. 865 ;; Emacs.
830 ;; XEmacs change: We don't have `set-buffer-multibyte', setting 866 ;; XEmacs change: We don't have `set-buffer-multibyte', setting
@@ -835,7 +871,10 @@ filter and a process sentinel, and making the connection."
835 (setq mode-line-process '(":%s") 871 (setq mode-line-process '(":%s")
836 buffer-file-type t 872 buffer-file-type t
837 buffer-read-only t) 873 buffer-read-only t)
838 (set-visited-file-name file) 874 (setq erc-dcc-file-name file)
875
876 ;; Truncate the given file to size 0 before appending to it.
877 (write-region (point) (point) erc-dcc-file-name nil 'nomessage)
839 878
840 (setq erc-server-process parent-proc 879 (setq erc-server-process parent-proc
841 erc-dcc-entry-data entry) 880 erc-dcc-entry-data entry)
@@ -847,7 +886,6 @@ filter and a process sentinel, and making the connection."
847 (string-to-number (plist-get entry :port)) 886 (string-to-number (plist-get entry :port))
848 entry)) 887 entry))
849 (set-process-buffer proc buffer) 888 (set-process-buffer proc buffer)
850 ;; The following two lines make saving as-is work under Windows
851 (set-process-coding-system proc 'binary 'binary) 889 (set-process-coding-system proc 'binary 'binary)
852 (set-buffer-file-coding-system 'binary t) 890 (set-buffer-file-coding-system 'binary t)
853 891
@@ -856,6 +894,14 @@ filter and a process sentinel, and making the connection."
856 (setq entry (plist-put entry :start-time (erc-current-time))) 894 (setq entry (plist-put entry :start-time (erc-current-time)))
857 (setq entry (plist-put entry :peer proc))))) 895 (setq entry (plist-put entry :peer proc)))))
858 896
897(defun erc-dcc-append-contents (buffer file)
898 "Append the contents of BUFFER to FILE.
899The contents of the BUFFER will then be erased."
900 (with-current-buffer buffer
901 (let ((coding-system-for-write 'binary))
902 (write-region (point-min) (point-max) erc-dcc-file-name t 'nomessage)
903 (erase-buffer))))
904
859(defun erc-dcc-get-filter (proc str) 905(defun erc-dcc-get-filter (proc str)
860 "This is the process filter for transfers from other clients to this one. 906 "This is the process filter for transfers from other clients to this one.
861It reads incoming bytes from the network and stores them in the DCC 907It reads incoming bytes from the network and stores them in the DCC
@@ -868,8 +914,10 @@ rather than every 1024 byte block, but nobody seems to care."
868 (insert (string-make-unibyte str)) 914 (insert (string-make-unibyte str))
869 915
870 (setq erc-dcc-byte-count (+ (length str) erc-dcc-byte-count)) 916 (setq erc-dcc-byte-count (+ (length str) erc-dcc-byte-count))
871 (erc-assert (= erc-dcc-byte-count (1- (point-max)))) 917 (when (> (point-max) erc-dcc-receive-cache)
872 (and erc-verbose-dcc 918 (erc-dcc-append-contents (current-buffer) erc-dcc-file-name))
919
920 (and erc-dcc-verbose
873 (erc-display-message 921 (erc-display-message
874 nil 'notice erc-server-process 922 nil 'notice erc-server-process
875 'dcc-get-bytes-received 923 'dcc-get-bytes-received
@@ -885,7 +933,7 @@ rather than every 1024 byte block, but nobody seems to care."
885 (delete-process proc)) 933 (delete-process proc))
886 (t 934 (t
887 (process-send-string 935 (process-send-string
888 proc (erc-pack-int erc-dcc-byte-count 4))))))) 936 proc (erc-pack-int erc-dcc-byte-count)))))))
889 937
890 938
891(defun erc-dcc-get-sentinel (proc event) 939(defun erc-dcc-get-sentinel (proc event)
@@ -895,17 +943,18 @@ transfer is complete."
895 ;; FIXME, we should look at EVENT, and also check size. 943 ;; FIXME, we should look at EVENT, and also check size.
896 (with-current-buffer (process-buffer proc) 944 (with-current-buffer (process-buffer proc)
897 (delete-process proc) 945 (delete-process proc)
898 (setq buffer-read-only nil)
899 (setq erc-dcc-list (delete erc-dcc-entry-data erc-dcc-list)) 946 (setq erc-dcc-list (delete erc-dcc-entry-data erc-dcc-list))
947 (unless (= (point-min) (point-max))
948 (setq erc-dcc-byte-count (+ (buffer-size) erc-dcc-byte-count))
949 (erc-dcc-append-contents (current-buffer) erc-dcc-file-name))
900 (erc-display-message 950 (erc-display-message
901 nil 'notice erc-server-process 951 nil 'notice erc-server-process
902 'dcc-get-complete 952 'dcc-get-complete
903 ?f (file-name-nondirectory buffer-file-name) 953 ?f erc-dcc-file-name
904 ?s (number-to-string (buffer-size)) 954 ?s (number-to-string erc-dcc-byte-count)
905 ?t (format "%.0f" 955 ?t (format "%.0f"
906 (erc-time-diff (plist-get erc-dcc-entry-data :start-time) 956 (erc-time-diff (plist-get erc-dcc-entry-data :start-time)
907 (erc-current-time)))) 957 (erc-current-time)))))
908 (save-buffer))
909 (kill-buffer (process-buffer proc)) 958 (kill-buffer (process-buffer proc))
910 (delete-process proc)) 959 (delete-process proc))
911 960
@@ -1126,8 +1175,6 @@ other client."
1126 (if (processp peer) (delete-process peer))) 1175 (if (processp peer) (delete-process peer)))
1127 nil)) 1176 nil))
1128 1177
1129(add-hook 'erc-server-401-functions 'erc-dcc-no-such-nick)
1130
1131(provide 'erc-dcc) 1178(provide 'erc-dcc)
1132 1179
1133;;; erc-dcc.el ends here 1180;;; erc-dcc.el ends here
diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el
index 9612b001156..ff065467f84 100644
--- a/lisp/erc/erc-goodies.el
+++ b/lisp/erc/erc-goodies.el
@@ -33,10 +33,14 @@
33 33
34(require 'erc) 34(require 'erc)
35 35
36;; Imenu Autoload 36;;; Imenu support
37(add-hook 'erc-mode-hook 37
38 (lambda () 38(defun erc-imenu-setup ()
39 (setq imenu-create-index-function 'erc-create-imenu-index))) 39 "Setup Imenu support in an ERC buffer."
40 (set (make-local-variable 'imenu-create-index-function)
41 'erc-create-imenu-index))
42
43(add-hook 'erc-mode-hook 'erc-imenu-setup)
40(autoload 'erc-create-imenu-index "erc-imenu" "Imenu index creation function") 44(autoload 'erc-create-imenu-index "erc-imenu" "Imenu index creation function")
41 45
42;;; Automatically scroll to bottom 46;;; Automatically scroll to bottom
@@ -51,11 +55,15 @@ argument to `recenter'."
51 :type '(choice integer (const nil))) 55 :type '(choice integer (const nil)))
52 56
53(define-erc-module scrolltobottom nil 57(define-erc-module scrolltobottom nil
54 "This mode causes the prompt to stay at the end of the window. 58 "This mode causes the prompt to stay at the end of the window."
55You have to activate or deactivate it in already created windows 59 ((add-hook 'erc-mode-hook 'erc-add-scroll-to-bottom)
56separately." 60 (dolist (buffer (erc-buffer-list))
57 ((add-hook 'erc-mode-hook 'erc-add-scroll-to-bottom)) 61 (with-current-buffer buffer
58 ((remove-hook 'erc-mode-hook 'erc-add-scroll-to-bottom))) 62 (erc-add-scroll-to-bottom))))
63 ((remove-hook 'erc-mode-hook 'erc-add-scroll-to-bottom)
64 (dolist (buffer (erc-buffer-list))
65 (with-current-buffer buffer
66 (remove-hook 'window-scroll-functions 'erc-scroll-to-bottom t)))))
59 67
60(defun erc-add-scroll-to-bottom () 68(defun erc-add-scroll-to-bottom ()
61 "A hook function for `erc-mode-hook' to recenter output at bottom of window. 69 "A hook function for `erc-mode-hook' to recenter output at bottom of window.
@@ -110,7 +118,46 @@ Put this function on `erc-insert-post-hook' and/or `erc-send-post-hook'."
110 (put-text-property (point-min) (point-max) 'front-sticky t) 118 (put-text-property (point-min) (point-max) 'front-sticky t)
111 (put-text-property (point-min) (point-max) 'rear-nonsticky t)) 119 (put-text-property (point-min) (point-max) 'rear-nonsticky t))
112 120
113;; Distinguish non-commands 121;;; Move to prompt when typing text
122(define-erc-module move-to-prompt nil
123 "This mode causes the point to be moved to the prompt when typing text."
124 ((add-hook 'erc-mode-hook 'erc-move-to-prompt-setup)
125 (dolist (buffer (erc-buffer-list))
126 (with-current-buffer buffer
127 (erc-move-to-prompt-setup))))
128 ((remove-hook 'erc-mode-hook 'erc-move-to-prompt-setup)
129 (dolist (buffer (erc-buffer-list))
130 (with-current-buffer buffer
131 (remove-hook 'pre-command-hook 'erc-move-to-prompt t)))))
132
133(defun erc-move-to-prompt ()
134 "Move the point to the ERC prompt if this is a self-inserting command."
135 (when (and erc-input-marker (< (point) erc-input-marker)
136 (eq 'self-insert-command this-command))
137 (deactivate-mark)
138 (push-mark)
139 (goto-char (point-max))))
140
141(defun erc-move-to-prompt-setup ()
142 "Initialize the move-to-prompt module for XEmacs."
143 (add-hook 'pre-command-hook 'erc-move-to-prompt nil t))
144
145;;; Keep place in unvisited channels
146(define-erc-module keep-place nil
147 "Leave point above un-viewed text in other channels."
148 ((add-hook 'erc-insert-pre-hook 'erc-keep-place))
149 ((remove-hook 'erc-insert-pre-hook 'erc-keep-place)))
150
151(defun erc-keep-place (ignored)
152 "Move point away from the last line in a non-selected ERC buffer."
153 (when (and (not (eq (window-buffer (selected-window))
154 (current-buffer)))
155 (>= (point) erc-insert-marker))
156 (deactivate-mark)
157 (goto-char (erc-beg-of-input-line))
158 (forward-line -1)))
159
160;;; Distinguish non-commands
114(defvar erc-noncommands-list '(erc-cmd-ME 161(defvar erc-noncommands-list '(erc-cmd-ME
115 erc-cmd-COUNTRY 162 erc-cmd-COUNTRY
116 erc-cmd-SV 163 erc-cmd-SV
@@ -496,8 +543,19 @@ channel that has weird people talking in morse to each other.
496 543
497See also `unmorse-region'." 544See also `unmorse-region'."
498 (goto-char (point-min)) 545 (goto-char (point-min))
499 (when (re-search-forward "[.-]+\\([.-]+[/ ]\\)+[.-]+" nil t) 546 (when (re-search-forward "[.-]+\\([.-]*/? *\\)+[.-]+/?" nil t)
500 (unmorse-region (match-beginning 0) (match-end 0)))) 547 (save-restriction
548 (narrow-to-region (match-beginning 0) (match-end 0))
549 ;; Turn " / " into " "
550 (goto-char (point-min))
551 (while (re-search-forward " / " nil t)
552 (replace-match " "))
553 ;; Turn "/ " into "/"
554 (goto-char (point-min))
555 (while (re-search-forward "/ " nil t)
556 (replace-match "/"))
557 ;; Unmorse region
558 (unmorse-region (point-min) (point-max)))))
501 559
502;;; erc-occur 560;;; erc-occur
503(defun erc-occur (string &optional proc) 561(defun erc-occur (string &optional proc)
diff --git a/lisp/erc/erc-list.el b/lisp/erc/erc-list.el
new file mode 100644
index 00000000000..586c720dd19
--- /dev/null
+++ b/lisp/erc/erc-list.el
@@ -0,0 +1,229 @@
1;;; erc-list.el --- /list support for ERC
2
3;; Copyright (C) 2008 Free Software Foundation, Inc.
4
5;; Author: Tom Tromey <tromey@redhat.com>
6;; Version: 0.1
7;; Keywords: comm
8
9;; This file is part of ERC.
10
11;; ERC is free software; you can redistribute it and/or modify
12;; it under the terms of the GNU General Public License as published by
13;; the Free Software Foundation; either version 3, or (at your option)
14;; any later version.
15
16;; ERC is distributed in the hope that it will be useful,
17;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;; GNU General Public License for more details.
20
21;; You should have received a copy of the GNU General Public License
22;; along with ERC; see the file COPYING. If not, write to the
23;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24;; Boston, MA 02110-1301, USA.
25
26;;; Commentary:
27
28;; This file provides nice support for /list in ERC.
29
30;;; Code:
31
32(require 'erc)
33
34;; This is implicitly the width of the channel name column. Pick
35;; something small enough that the topic has a chance of being
36;; readable, but long enough that most channel names won't make for
37;; strange formatting.
38(defconst erc-list-nusers-column 25)
39
40;; Width of the number-of-users column.
41(defconst erc-list-topic-column (+ erc-list-nusers-column 10))
42
43;; The list buffer. This is buffer local in the server buffer.
44(defvar erc-list-buffer nil)
45
46;; The argument to the last "/list". This is buffer local in the
47;; server buffer.
48(defvar erc-list-last-argument nil)
49
50;; The server buffer corresponding to the list buffer. This is buffer
51;; local in the list buffer.
52(defvar erc-list-server-buffer nil)
53
54;; Define module:
55;;;###autoload (autoload 'erc-list-mode "erc-list")
56(define-erc-module list nil
57 "List channels nicely in a separate buffer."
58 ((remove-hook 'erc-server-321-functions 'erc-server-321-message)
59 (remove-hook 'erc-server-322-functions 'erc-server-322-message))
60 ((erc-with-all-buffers-of-server nil
61 #'erc-open-server-buffer-p
62 (remove-hook 'erc-server-322-functions 'erc-list-handle-322 t))
63 (add-hook 'erc-server-321-functions 'erc-server-321-message t)
64 (add-hook 'erc-server-322-functions 'erc-server-322-message t)))
65
66;; Format a record for display.
67(defun erc-list-make-string (channel users topic)
68 (concat
69 channel
70 (erc-propertize " "
71 'display (list 'space :align-to erc-list-nusers-column)
72 'face 'fixed-pitch)
73 users
74 (erc-propertize " "
75 'display (list 'space :align-to erc-list-topic-column)
76 'face 'fixed-pitch)
77 topic))
78
79;; Insert a record into the list buffer.
80(defun erc-list-insert-item (channel users topic)
81 (save-excursion
82 (let ((buffer-read-only nil))
83 (goto-char (point-max))
84 (insert (erc-list-make-string channel users topic) "\n"))))
85
86(defun erc-list-join ()
87 "Join the irc channel named on this line."
88 (interactive)
89 (unless (eobp)
90 (beginning-of-line)
91 (unless (looking-at "\\([&#+!][^ \n]+\\)")
92 (error "Not looking at channel name?"))
93 (let ((chan (match-string 1)))
94 (with-current-buffer erc-list-server-buffer
95 (erc-join-channel chan)))))
96
97(defun erc-list-kill ()
98 "Kill the current ERC list buffer."
99 (interactive)
100 (kill-buffer (current-buffer)))
101
102(defun erc-list-revert ()
103 "Refresh the list of channels."
104 (interactive)
105 (with-current-buffer erc-list-server-buffer
106 (erc-cmd-LIST erc-list-last-argument)))
107
108(defun erc-list-menu-sort-by-column (&optional e)
109 "Sort the channel list by the column clicked on."
110 (interactive (list last-input-event))
111 (if e (mouse-select-window e))
112 (let* ((pos (event-start e))
113 (obj (posn-object pos))
114 (col (if obj
115 (get-text-property (cdr obj) 'column-number (car obj))
116 (get-text-property (posn-point pos) 'column-number))))
117 (let ((buffer-read-only nil))
118 (if (= col 1)
119 (sort-fields col (point-min) (point-max))
120 (sort-numeric-fields col (point-min) (point-max))))))
121
122(defvar erc-list-menu-mode-map nil
123 "Local keymap for `erc-list-mode' buffers.")
124
125(unless erc-list-menu-mode-map
126 (setq erc-list-menu-mode-map (make-keymap))
127 (suppress-keymap erc-list-menu-mode-map)
128 (define-key erc-list-menu-mode-map "k" 'erc-list-kill)
129 (define-key erc-list-menu-mode-map "j" 'erc-list-join)
130 (define-key erc-list-menu-mode-map "g" 'erc-list-revert)
131 (define-key erc-list-menu-mode-map "n" 'next-line)
132 (define-key erc-list-menu-mode-map "p" 'previous-line)
133 (define-key erc-list-menu-mode-map "q" 'quit-window))
134
135(defvar erc-list-menu-sort-button-map nil
136 "Local keymap for ERC list menu mode sorting buttons.")
137
138(unless erc-list-menu-sort-button-map
139 (let ((map (make-sparse-keymap)))
140 (define-key map [header-line mouse-1] 'erc-list-menu-sort-by-column)
141 (define-key map [follow-link] 'mouse-face)
142 (setq erc-list-menu-sort-button-map map)))
143
144;; Helper function that makes a buttonized column header.
145(defun erc-list-button (title column)
146 (erc-propertize title
147 'column-number column
148 'help-echo "mouse-1: sort by column"
149 'mouse-face 'highlight
150 'keymap erc-list-menu-sort-button-map))
151
152(define-derived-mode erc-list-menu-mode nil "ERC-List"
153 "Major mode for editing a list of irc channels."
154 (setq header-line-format
155 (concat
156 (erc-propertize " "
157 'display '(space :align-to 0)
158 'face 'fixed-pitch)
159 (erc-list-make-string (erc-list-button "Channel" 1)
160 (erc-list-button "# Users" 2)
161 "Topic")))
162 (setq truncate-lines t))
163
164(put 'erc-list-menu-mode 'mode-class 'special)
165
166;; Handle a "322" response. This response tells us about a single
167;; channel.
168(defun erc-list-handle-322 (proc parsed)
169 (let* ((args (cdr (erc-response.command-args parsed)))
170 (channel (car args))
171 (nusers (car (cdr args)))
172 (topic (erc-response.contents parsed)))
173 (when (buffer-live-p erc-list-buffer)
174 (with-current-buffer erc-list-buffer
175 (erc-list-insert-item channel nusers topic))))
176 ;; Don't let another hook run.
177 t)
178
179;; Helper function to install our 322 handler and make our buffer.
180(defun erc-list-install-322-handler (server-buffer)
181 (with-current-buffer server-buffer
182 ;; Arrange for 322 responses to insert into our buffer.
183 (add-hook 'erc-server-322-functions 'erc-list-handle-322 t t)
184 ;; Arrange for 323 (end of list) to end this.
185 (erc-once-with-server-event
186 323
187 '(progn
188 (remove-hook 'erc-server-322-functions 'erc-list-handle-322 t)))
189 ;; Find the list buffer, empty it, and display it.
190 (set (make-local-variable 'erc-list-buffer)
191 (get-buffer-create (concat "*Channels of "
192 erc-server-announced-name
193 "*")))
194 (with-current-buffer erc-list-buffer
195 (erc-list-menu-mode)
196 (setq buffer-read-only nil)
197 (erase-buffer)
198 (set (make-local-variable 'erc-list-server-buffer) server-buffer)
199 (setq buffer-read-only t))
200 (pop-to-buffer erc-list-buffer))
201 t)
202
203;; The main entry point.
204(defun erc-cmd-LIST (&optional line)
205 "Show a listing of channels on the current server in a separate window.
206
207If LINE is specified, include it with the /LIST command. It
208should usually be one or more channels, separated by commas.
209
210Please note that this function only works with IRC servers which conform
211to RFC and send the LIST header (#321) at start of list transmission."
212 (erc-with-server-buffer
213 (set (make-local-variable 'erc-list-last-argument) line)
214 (erc-once-with-server-event
215 321
216 (list 'progn
217 (list 'erc-list-install-322-handler (current-buffer)))))
218 (erc-server-send (concat "LIST :" (or (and line (substring line 1))
219 ""))))
220(put 'erc-cmd-LIST 'do-not-parse-args t)
221
222;;; erc-list.el ends here
223;;
224;; Local Variables:
225;; indent-tabs-mode: t
226;; tab-width: 8
227;; End:
228
229;; arch-tag: 99c5f9cb-6bac-4224-86bf-e394768cd1d0
diff --git a/lisp/erc/erc-networks.el b/lisp/erc/erc-networks.el
index 48efd41791f..b74fdb245a4 100644
--- a/lisp/erc/erc-networks.el
+++ b/lisp/erc/erc-networks.el
@@ -28,9 +28,7 @@
28;; 28;;
29;; Usage: 29;; Usage:
30;; 30;;
31;; Put into your .emacs: 31;; This is the "networks" module.
32;;
33;; (require 'erc-networks)
34;; 32;;
35;; M-x erc-server-select provides an alternative way to connect to servers by 33;; M-x erc-server-select provides an alternative way to connect to servers by
36;; choosing networks. 34;; choosing networks.
@@ -351,6 +349,7 @@
351 ("Relicnet: Random server" Relicnet "irc.relic.net" 6667) 349 ("Relicnet: Random server" Relicnet "irc.relic.net" 6667)
352 ("Rezosup: Random server" Rezosup "irc.rezosup.org" 6667) 350 ("Rezosup: Random server" Rezosup "irc.rezosup.org" 6667)
353 ("Risanet: Random server" Risanet "irc.risanet.com" ((6667 6669))) 351 ("Risanet: Random server" Risanet "irc.risanet.com" ((6667 6669)))
352 ("Rizon: Random server" Rizon "irc.rizon.net" (6633 (6660 6669) 6697 7000 8080 9999))
354 ("Rubiks: Random server" Rubiks "irc.rubiks.net" 6667) 353 ("Rubiks: Random server" Rubiks "irc.rubiks.net" 6667)
355 ("Rusnet: EU, RU, Tomsk" Rusnet "irc.tsk.ru" ((6667 6669) (7770 7775) )) 354 ("Rusnet: EU, RU, Tomsk" Rusnet "irc.tsk.ru" ((6667 6669) (7770 7775) ))
356 ("Rusnet: EU, RU, Vladivostok" Rusnet "irc.vladivostok.ru" ((6667 6669) (7770 7775) )) 355 ("Rusnet: EU, RU, Vladivostok" Rusnet "irc.vladivostok.ru" ((6667 6669) (7770 7775) ))
@@ -765,9 +764,14 @@ network as a symbol."
765 (setq erc-network nil) 764 (setq erc-network nil)
766 nil) 765 nil)
767 766
768(add-hook 'erc-server-375-functions 'erc-set-network-name) 767(define-erc-module networks nil
769(add-hook 'erc-server-422-functions 'erc-set-network-name) 768 "Provide data about IRC networks."
770(add-hook 'erc-disconnected-hook 'erc-unset-network-name) 769 ((add-hook 'erc-server-375-functions 'erc-set-network-name)
770 (add-hook 'erc-server-422-functions 'erc-set-network-name)
771 (add-hook 'erc-disconnected-hook 'erc-unset-network-name))
772 ((remove-hook 'erc-server-375-functions 'erc-set-network-name)
773 (remove-hook 'erc-server-422-functions 'erc-set-network-name)
774 (remove-hook 'erc-disconnected-hook 'erc-unset-network-name)))
771 775
772(defun erc-ports-list (ports) 776(defun erc-ports-list (ports)
773 "Return a list of PORTS. 777 "Return a list of PORTS.
diff --git a/lisp/erc/erc-page.el b/lisp/erc/erc-page.el
index 90a2009106f..ff30bcab209 100644
--- a/lisp/erc/erc-page.el
+++ b/lisp/erc/erc-page.el
@@ -104,5 +104,11 @@ receive pages if `erc-page-mode' is on."
104 104
105(provide 'erc-page) 105(provide 'erc-page)
106 106
107;; arch-tag: 82fd2e0e-6060-4dd2-9788-8c1411e844de
108;;; erc-page.el ends here 107;;; erc-page.el ends here
108;;
109;; Local Variables:
110;; indent-tabs-mode: t
111;; tab-width: 8
112;; End:
113
114;; arch-tag: 82fd2e0e-6060-4dd2-9788-8c1411e844de
diff --git a/lisp/erc/erc-replace.el b/lisp/erc/erc-replace.el
index d6713c6a442..45ce20e7fa7 100644
--- a/lisp/erc/erc-replace.el
+++ b/lisp/erc/erc-replace.el
@@ -1,6 +1,7 @@
1;; erc-replace.el -- wash and massage messages inserted into the buffer 1;; erc-replace.el -- wash and massage messages inserted into the buffer
2 2
3;; Copyright (C) 2001, 2002, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. 3;; Copyright (C) 2001, 2002, 2004, 2006, 2007,
4;; 2008 Free Software Foundation, Inc.
4 5
5;; Author: Andreas Fuchs <asf@void.at> 6;; Author: Andreas Fuchs <asf@void.at>
6;; Maintainer: Mario Lang (mlang@delysid.org) 7;; Maintainer: Mario Lang (mlang@delysid.org)
@@ -88,5 +89,11 @@ It replaces text according to `erc-replace-alist'."
88 89
89(provide 'erc-replace) 90(provide 'erc-replace)
90 91
91;; arch-tag: dd904a59-d8a6-47f8-ac3a-76b698289a18
92;;; erc-replace.el ends here 92;;; erc-replace.el ends here
93;;
94;; Local Variables:
95;; indent-tabs-mode: t
96;; tab-width: 8
97;; End:
98
99;; arch-tag: dd904a59-d8a6-47f8-ac3a-76b698289a18
diff --git a/lisp/erc/erc-services.el b/lisp/erc/erc-services.el
index ac57de9cd15..b25a10dc5ca 100644
--- a/lisp/erc/erc-services.el
+++ b/lisp/erc/erc-services.el
@@ -123,6 +123,10 @@ You can also use M-x erc-nickserv-identify-mode to change modes."
123 '(("autodetect") ("nick-change") ("both")) nil t)))) 123 '(("autodetect") ("nick-change") ("both")) nil t))))
124 (add-hook 'erc-server-NOTICE-functions 124 (add-hook 'erc-server-NOTICE-functions
125 'erc-nickserv-identification-autodetect) 125 'erc-nickserv-identification-autodetect)
126 (unless erc-networks-mode
127 ;; Force-enable networks module, because we need it to set
128 ;; erc-network for us.
129 (erc-networks-enable))
126 (cond ((eq mode 'autodetect) 130 (cond ((eq mode 'autodetect)
127 (setq erc-nickserv-identify-mode 'autodetect) 131 (setq erc-nickserv-identify-mode 'autodetect)
128 (add-hook 'erc-server-NOTICE-functions 132 (add-hook 'erc-server-NOTICE-functions
@@ -187,6 +191,7 @@ Example of use:
187 (const iip) 191 (const iip)
188 (const OFTC) 192 (const OFTC)
189 (const QuakeNet) 193 (const QuakeNet)
194 (const Rizon)
190 (const SlashNET) 195 (const SlashNET)
191 (symbol :tag "Network name")) 196 (symbol :tag "Network name"))
192 (repeat :tag "Nickname and password" 197 (repeat :tag "Nickname and password"
@@ -227,6 +232,8 @@ Example of use:
227 "IDENTIFY" nil nil nil) 232 "IDENTIFY" nil nil nil)
228 (freenode 233 (freenode
229 "NickServ!NickServ@services." 234 "NickServ!NickServ@services."
235 ;; freenode also accepts a password at login, see the `erc'
236 ;; :password argument.
230 "/msg\\s-NickServ\\s-IDENTIFY\\s-<password>" 237 "/msg\\s-NickServ\\s-IDENTIFY\\s-<password>"
231 "NickServ" 238 "NickServ"
232 "IDENTIFY" nil nil 239 "IDENTIFY" nil nil
@@ -249,9 +256,17 @@ Example of use:
249 "IDENTIFY" nil "SQUERY" nil) 256 "IDENTIFY" nil "SQUERY" nil)
250 (OFTC 257 (OFTC
251 "NickServ!services@services.oftc.net" 258 "NickServ!services@services.oftc.net"
252 "type\\s-/msg\\s-NickServ\\s-IDENTIFY\\s-password." 259 ;; OFTC's NickServ doesn't ask you to identify anymore.
260 nil
253 "NickServ" 261 "NickServ"
254 "IDENTIFY" nil nil nil) 262 "IDENTIFY" nil nil
263 "You\\s-are\\s-successfully\\s-identified\\s-as\\s-")
264 (Rizon
265 "NickServ!service@rizon.net"
266 "This\\s-nickname\\s-is\\s-registered\\s-and\\s-protected."
267 "NickServ"
268 "IDENTIFY" nil nil
269 "Password\\s-accepted\\s--\\s-you\\s-are\\s-now\\s-recognized.")
255 (QuakeNet 270 (QuakeNet
256 nil nil 271 nil nil
257 "Q@CServe.quakenet.org" 272 "Q@CServe.quakenet.org"
@@ -334,15 +349,15 @@ If this is the case, run `erc-nickserv-identified-hook'."
334 ;; continue only if we're sure it's the real nickserv for this network 349 ;; continue only if we're sure it's the real nickserv for this network
335 ;; and it's told us we've successfully identified 350 ;; and it's told us we've successfully identified
336 (when (and sender (equal sspec sender) 351 (when (and sender (equal sspec sender)
352 success-regex
337 (string-match success-regex msg)) 353 (string-match success-regex msg))
338 (erc-log "NickServ IDENTIFY success notification detected") 354 (erc-log "NickServ IDENTIFY success notification detected")
339 (run-hook-with-args 'erc-nickserv-identified-hook network nick) 355 (run-hook-with-args 'erc-nickserv-identified-hook network nick)
340 nil))) 356 nil)))
341 357
342(defun erc-nickserv-identify-autodetect (proc parsed) 358(defun erc-nickserv-identify-autodetect (proc parsed)
343 "Check for a NickServ identify request everytime a notice is received. 359 "Identify to NickServ when an identify request is received.
344Make sure it is the real NickServ for this network and that it has 360Make sure it is the real NickServ for this network.
345specifically asked the user to IDENTIFY.
346If `erc-prompt-for-nickserv-password' is non-nil, prompt the user for the 361If `erc-prompt-for-nickserv-password' is non-nil, prompt the user for the
347password for this nickname, otherwise try to send it automatically." 362password for this nickname, otherwise try to send it automatically."
348 (unless (and (null erc-nickserv-passwords) 363 (unless (and (null erc-nickserv-passwords)
@@ -356,6 +371,7 @@ password for this nickname, otherwise try to send it automatically."
356 ;; continue only if we're sure it's the real nickserv for this network 371 ;; continue only if we're sure it's the real nickserv for this network
357 ;; and it's asked us to identify 372 ;; and it's asked us to identify
358 (when (and sender (equal sspec sender) 373 (when (and sender (equal sspec sender)
374 identify-regex
359 (string-match identify-regex msg)) 375 (string-match identify-regex msg))
360 (erc-log "NickServ IDENTIFY request detected") 376 (erc-log "NickServ IDENTIFY request detected")
361 (erc-nickserv-call-identify-function nick) 377 (erc-nickserv-call-identify-function nick)
diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el
index 76a692219ca..360d92c32c5 100644
--- a/lisp/erc/erc-track.el
+++ b/lisp/erc/erc-track.el
@@ -101,9 +101,13 @@ disconnected from `erc-modified-channels-alist'."
101 :group 'erc-track 101 :group 'erc-track
102 :type 'boolean) 102 :type 'boolean)
103 103
104(defcustom erc-track-exclude-types '("NICK") 104(defcustom erc-track-exclude-types '("NICK" "333" "353")
105 "*List of message types to be ignored. 105 "*List of message types to be ignored.
106This list could look like '(\"JOIN\" \"PART\")." 106This list could look like '(\"JOIN\" \"PART\").
107
108By default, exclude changes of nicknames (NICK), display of who
109set the channel topic (333), and listing of users on the current
110channel (353)."
107 :group 'erc-track 111 :group 'erc-track
108 :type 'erc-message-type) 112 :type 'erc-message-type)
109 113
@@ -175,15 +179,32 @@ The faces used are the same as used for text in the buffers.
175 :type 'boolean) 179 :type 'boolean)
176 180
177(defcustom erc-track-faces-priority-list 181(defcustom erc-track-faces-priority-list
178 '(erc-error-face erc-current-nick-face erc-keyword-face erc-pal-face 182 '(erc-error-face
179 erc-nick-msg-face erc-direct-msg-face erc-button erc-dangerous-host-face 183 (erc-nick-default-face erc-current-nick-face)
180 erc-default-face erc-action-face erc-nick-default-face erc-fool-face 184 erc-current-nick-face
181 erc-notice-face erc-input-face erc-prompt-face) 185 erc-keyword-face
186 (erc-nick-default-face erc-pal-face)
187 erc-pal-face
188 erc-nick-msg-face
189 erc-direct-msg-face
190 (erc-button erc-default-face)
191 (erc-nick-default-face erc-dangerous-host-face)
192 erc-dangerous-host-face
193 erc-nick-default-face
194 (erc-nick-default-face erc-default-face)
195 erc-default-face
196 erc-action-face
197 (erc-nick-default-face erc-fool-face)
198 erc-fool-face
199 erc-notice-face
200 erc-input-face
201 erc-prompt-face)
182 "A list of faces used to highlight active buffer names in the modeline. 202 "A list of faces used to highlight active buffer names in the modeline.
183If a message contains one of the faces in this list, the buffer name will 203If a message contains one of the faces in this list, the buffer name will
184be highlighted using that face. The first matching face is used." 204be highlighted using that face. The first matching face is used."
185 :group 'erc-track 205 :group 'erc-track
186 :type '(repeat face)) 206 :type '(repeat (choice face
207 (repeat :tag "Combination" face))))
187 208
188(defcustom erc-track-priority-faces-only nil 209(defcustom erc-track-priority-faces-only nil
189 "Only track text highlighted with a priority face. 210 "Only track text highlighted with a priority face.
@@ -193,6 +214,7 @@ this variable. You can set a list of channel name strings, so those
193will be ignored while all other channels will be tracked as normal. 214will be ignored while all other channels will be tracked as normal.
194Other options are 'all, to apply this to all channels or nil, to disable 215Other options are 'all, to apply this to all channels or nil, to disable
195this feature. 216this feature.
217
196Note: If you have a lot of faces listed in `erc-track-faces-priority-list', 218Note: If you have a lot of faces listed in `erc-track-faces-priority-list',
197setting this variable might not be very useful." 219setting this variable might not be very useful."
198 :group 'erc-track 220 :group 'erc-track
@@ -200,17 +222,38 @@ setting this variable might not be very useful."
200 (repeat string) 222 (repeat string)
201 (const all))) 223 (const all)))
202 224
225(defcustom erc-track-faces-normal-list
226 '((erc-button erc-default-face)
227 (erc-nick-default-face erc-dangerous-host-face)
228 erc-dangerous-host-face
229 erc-nick-default-face
230 (erc-nick-default-face erc-default-face)
231 erc-default-face
232 erc-action-face)
233 "A list of faces considered to be part of normal conversations.
234This list is used to highlight active buffer names in the modeline.
235
236If a message contains one of the faces in this list, and the
237previous modeline face for this buffer is also in this list, then
238the buffer name will be highlighted using the face from the
239message. This gives a rough indication that active conversations
240are occurring in these channels.
241
242The effect may be disabled by setting this variable to nil."
243 :group 'erc-track
244 :type '(repeat (choice face
245 (repeat :tag "Combination" face))))
246
203(defcustom erc-track-position-in-mode-line 'before-modes 247(defcustom erc-track-position-in-mode-line 'before-modes
204 "Where to show modified channel information in the mode-line. 248 "Where to show modified channel information in the mode-line.
205 249
206Setting this variable only has effects in GNU Emacs versions above 21.3. 250Setting this variable only has effects in GNU Emacs versions above 21.3.
207 251
208Choices are: 252Choices are:
209'before-modes - add to the beginning of `mode-line-modes' 253'before-modes - add to the beginning of `mode-line-modes',
210'after-modes - add to the end of `mode-line-modes' 254'after-modes - add to the end of `mode-line-modes',
211t - add to the end of `global-mode-string'. 255t - add to the end of `global-mode-string',
212nil - don't add to mode line 256nil - don't add to mode line."
213"
214 :group 'erc-track 257 :group 'erc-track
215 :type '(choice (const :tag "Just before mode information" before-modes) 258 :type '(choice (const :tag "Just before mode information" before-modes)
216 (const :tag "Just after mode information" after-modes) 259 (const :tag "Just after mode information" after-modes)
@@ -443,7 +486,7 @@ START is the minimum length of the name used."
443 486
444;;; Test: 487;;; Test:
445 488
446(erc-assert 489(assert
447 (and 490 (and
448 ;; verify examples from the doc strings 491 ;; verify examples from the doc strings
449 (equal (let ((erc-track-shorten-aggressively nil)) 492 (equal (let ((erc-track-shorten-aggressively nil))
@@ -560,13 +603,15 @@ module, otherwise the keybindings will not do anything useful."
560 :global t 603 :global t
561 :group 'erc-track) 604 :group 'erc-track)
562 605
563(defun erc-track-minor-mode-maybe () 606(defun erc-track-minor-mode-maybe (&optional buffer)
564 "Enable `erc-track-minor-mode', depending on `erc-track-enable-keybindings'." 607 "Enable `erc-track-minor-mode', depending on `erc-track-enable-keybindings'."
565 (unless (or erc-track-minor-mode 608 (when (and (not erc-track-minor-mode)
566 ;; don't start the minor mode until we have an ERC 609 ;; don't start the minor mode until we have an ERC
567 ;; process running, because we don't want to prompt the 610 ;; process running, because we don't want to prompt the
568 ;; user while starting Emacs 611 ;; user while starting Emacs
569 (null (erc-buffer-list))) 612 (or (and (buffer-live-p buffer)
613 (with-current-buffer buffer (eq major-mode 'erc-mode)))
614 (erc-buffer-list)))
570 (cond ((eq erc-track-enable-keybindings 'ask) 615 (cond ((eq erc-track-enable-keybindings 'ask)
571 (let ((key (or (and (key-binding (kbd "C-c C-SPC")) "C-SPC") 616 (let ((key (or (and (key-binding (kbd "C-c C-SPC")) "C-SPC")
572 (and (key-binding (kbd "C-c C-@")) "C-@")))) 617 (and (key-binding (kbd "C-c C-@")) "C-@"))))
@@ -616,6 +661,7 @@ module, otherwise the keybindings will not do anything useful."
616 (add-hook 'erc-insert-post-hook 'erc-track-modified-channels) 661 (add-hook 'erc-insert-post-hook 'erc-track-modified-channels)
617 (add-hook 'erc-disconnected-hook 'erc-modified-channels-update)) 662 (add-hook 'erc-disconnected-hook 'erc-modified-channels-update))
618 ;; enable the tracking keybindings 663 ;; enable the tracking keybindings
664 (add-hook 'erc-connect-pre-hook 'erc-track-minor-mode-maybe)
619 (erc-track-minor-mode-maybe))) 665 (erc-track-minor-mode-maybe)))
620 ;; Disable: 666 ;; Disable:
621 ((when (boundp 'erc-track-when-inactive) 667 ((when (boundp 'erc-track-when-inactive)
@@ -637,6 +683,7 @@ module, otherwise the keybindings will not do anything useful."
637 (remove-hook 'erc-disconnected-hook 'erc-modified-channels-update) 683 (remove-hook 'erc-disconnected-hook 'erc-modified-channels-update)
638 (remove-hook 'erc-insert-post-hook 'erc-track-modified-channels)) 684 (remove-hook 'erc-insert-post-hook 'erc-track-modified-channels))
639 ;; disable the tracking keybindings 685 ;; disable the tracking keybindings
686 (remove-hook 'erc-connect-pre-hook 'erc-track-minor-mode-maybe)
640 (when erc-track-minor-mode 687 (when erc-track-minor-mode
641 (erc-track-minor-mode -1))))) 688 (erc-track-minor-mode -1)))))
642 689
@@ -821,15 +868,36 @@ Use `erc-make-mode-line-buffer-name' to create buttons."
821(defun erc-track-find-face (faces) 868(defun erc-track-find-face (faces)
822 "Return the face to use in the modeline from the faces in FACES. 869 "Return the face to use in the modeline from the faces in FACES.
823If `erc-track-faces-priority-list' is set, the one from FACES who is 870If `erc-track-faces-priority-list' is set, the one from FACES who is
824first in that list will be used." 871first in that list will be used.
825 (let ((candidates erc-track-faces-priority-list) 872
826 candidate face) 873If `erc-track-faces-normal-list' is non-nil, use it to produce a
827 (while (and candidates (not face)) 874blinking effect that indicates channel activity when the first
828 (setq candidate (car candidates) 875element in FACES and the highest-ranking face among the rest of
829 candidates (cdr candidates)) 876FACES are both members of `erc-track-faces-normal-list'.
830 (when (memq candidate faces) 877
831 (setq face candidate))) 878If `erc-track-faces-priority-list' is not set, the first element
832 face)) 879in FACES will be used.
880
881If one of the faces is a list, then it will be ranked according
882to its highest-tanking face member. A list of faces including
883that member will take priority over just the single member
884element."
885 (let ((choice (catch 'face
886 (dolist (candidate erc-track-faces-priority-list)
887 (when (member candidate faces)
888 (throw 'face candidate)))))
889 (no-first (and erc-track-faces-normal-list
890 (catch 'face
891 (dolist (candidate erc-track-faces-priority-list)
892 (when (member candidate (cdr faces))
893 (throw 'face candidate)))))))
894 (cond ((null choice)
895 (car faces))
896 ((and (member choice erc-track-faces-normal-list)
897 (member no-first erc-track-faces-normal-list))
898 no-first)
899 (t
900 choice))))
833 901
834(defun erc-track-modified-channels () 902(defun erc-track-modified-channels ()
835 "Hook function for `erc-insert-post-hook' to check if the current 903 "Hook function for `erc-insert-post-hook' to check if the current
@@ -898,14 +966,15 @@ is in `erc-mode'."
898 "Return a list of all faces used in STR." 966 "Return a list of all faces used in STR."
899 (let ((i 0) 967 (let ((i 0)
900 (m (length str)) 968 (m (length str))
901 (faces (erc-list (get-text-property 0 'face str)))) 969 (faces (erc-list (get-text-property 0 'face str)))
970 cur)
902 (while (and (setq i (next-single-property-change i 'face str m)) 971 (while (and (setq i (next-single-property-change i 'face str m))
903 (not (= i m))) 972 (not (= i m)))
904 (dolist (face (erc-list (get-text-property i 'face str))) 973 (when (setq cur (get-text-property i 'face str))
905 (add-to-list 'faces face))) 974 (add-to-list 'faces cur)))
906 faces)) 975 faces))
907 976
908(erc-assert 977(assert
909 (let ((str "is bold")) 978 (let ((str "is bold"))
910 (put-text-property 3 (length str) 979 (put-text-property 3 (length str)
911 'face '(bold erc-current-nick-face) 980 'face '(bold erc-current-nick-face)
@@ -935,7 +1004,7 @@ higher number than any other face in that list."
935 (let ((count 0)) 1004 (let ((count 0))
936 (catch 'done 1005 (catch 'done
937 (dolist (item erc-track-faces-priority-list) 1006 (dolist (item erc-track-faces-priority-list)
938 (if (eq item face) 1007 (if (equal item face)
939 (throw 'done t) 1008 (throw 'done t)
940 (setq count (1+ count))))) 1009 (setq count (1+ count)))))
941 count)) 1010 count))
diff --git a/lisp/erc/erc-xdcc.el b/lisp/erc/erc-xdcc.el
index ed1d0c948b6..b58a7b61713 100644
--- a/lisp/erc/erc-xdcc.el
+++ b/lisp/erc/erc-xdcc.el
@@ -62,6 +62,11 @@ being evaluated and should return stings."
62 :group 'erc-dcc 62 :group 'erc-dcc
63 :type '(repeat (repeat :tag "Message" (choice string sexp)))) 63 :type '(repeat (repeat :tag "Message" (choice string sexp))))
64 64
65;;;###autoload (autoload 'erc-xdcc-mode "erc-xdcc")
66(define-erc-module xdcc nil
67 "Act as an XDCC file-server."
68 nil nil)
69
65;;;###autoload 70;;;###autoload
66(defun erc-xdcc-add-file (file) 71(defun erc-xdcc-add-file (file)
67 "Add a file to `erc-xdcc-files'." 72 "Add a file to `erc-xdcc-files'."
@@ -126,5 +131,11 @@ being evaluated and should return stings."
126 131
127(provide 'erc-xdcc) 132(provide 'erc-xdcc)
128 133
129;; arch-tag: a13b62fe-2399-4562-af4e-f18a8dd4b9c8
130;;; erc-xdcc.el ends here 134;;; erc-xdcc.el ends here
135;;
136;; Local Variables:
137;; indent-tabs-mode: t
138;; tab-width: 8
139;; End:
140
141;; arch-tag: a13b62fe-2399-4562-af4e-f18a8dd4b9c8
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index c197f618442..e98c9d29baa 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -66,7 +66,7 @@
66 66
67;;; Code: 67;;; Code:
68 68
69(defconst erc-version-string "Version 5.3 (devel)" 69(defconst erc-version-string "Version 5.3"
70 "ERC version. This is used by function `erc-version'.") 70 "ERC version. This is used by function `erc-version'.")
71 71
72(eval-when-compile (require 'cl)) 72(eval-when-compile (require 'cl))
@@ -1167,7 +1167,12 @@ This will only be used if `erc-header-line-face-method' is non-nil."
1167See the variable `erc-command-indicator'." 1167See the variable `erc-command-indicator'."
1168 :group 'erc-faces) 1168 :group 'erc-faces)
1169 1169
1170(defface erc-notice-face '((t (:bold t :foreground "SlateBlue"))) 1170(defface erc-notice-face
1171 (if (featurep 'xemacs)
1172 '((t (:bold t :foreground "blue")))
1173 '((((class color) (min-colors 88))
1174 (:bold t :foreground "SlateBlue"))
1175 (t (:bold t :foreground "blue"))))
1171 "ERC face for notices." 1176 "ERC face for notices."
1172 :group 'erc-faces) 1177 :group 'erc-faces)
1173 1178
@@ -1465,18 +1470,23 @@ Turning on `erc-mode' runs the hook `erc-mode-hook'."
1465 "IRC port to use if it cannot be detected otherwise.") 1470 "IRC port to use if it cannot be detected otherwise.")
1466 1471
1467(defcustom erc-join-buffer 'buffer 1472(defcustom erc-join-buffer 'buffer
1468 "Determines how to display the newly created IRC buffer. 1473 "Determines how to display a newly created IRC buffer.
1469'window - in another window, 1474
1470'window-noselect - in another window, but don't select that one, 1475The available choices are:
1471'frame - in another frame, 1476
1472'bury - bury it in a new buffer, 1477 'window - in another window,
1473any other value - in place of the current buffer." 1478 'window-noselect - in another window, but don't select that one,
1479 'frame - in another frame,
1480 'bury - bury it in a new buffer,
1481 'buffer - in place of the current buffer,
1482 any other value - in place of the current buffer."
1474 :group 'erc-buffers 1483 :group 'erc-buffers
1475 :type '(choice (const window) 1484 :type '(choice (const :tag "Split window and select" window)
1476 (const window-noselect) 1485 (const :tag "Split window, don't select" window-noselect)
1477 (const frame) 1486 (const :tag "New frame" frame)
1478 (const bury) 1487 (const :tag "Bury in new buffer" bury)
1479 (const buffer))) 1488 (const :tag "Use current buffer" buffer)
1489 (const :tag "Use current buffer" t)))
1480 1490
1481(defcustom erc-frame-alist nil 1491(defcustom erc-frame-alist nil
1482 "*Alist of frame parameters for creating erc frames. 1492 "*Alist of frame parameters for creating erc frames.
@@ -1804,8 +1814,8 @@ buffer rather than a server buffer.")
1804 mods)))) 1814 mods))))
1805 1815
1806(defcustom erc-modules '(netsplit fill button match track completion readonly 1816(defcustom erc-modules '(netsplit fill button match track completion readonly
1807 ring autojoin noncommands irccontrols 1817 networks ring autojoin noncommands irccontrols
1808 stamp menu) 1818 move-to-prompt stamp menu list)
1809 "A list of modules which ERC should enable. 1819 "A list of modules which ERC should enable.
1810If you set the value of this without using `customize' remember to call 1820If you set the value of this without using `customize' remember to call
1811\(erc-update-modules) after you change it. When using `customize', modules 1821\(erc-update-modules) after you change it. When using `customize', modules
@@ -1837,14 +1847,20 @@ removed from the list will be disabled."
1837 (const :tag "completion: Complete nicknames and commands (programmable)" 1847 (const :tag "completion: Complete nicknames and commands (programmable)"
1838 completion) 1848 completion)
1839 (const :tag "hecomplete: Complete nicknames and commands (old)" hecomplete) 1849 (const :tag "hecomplete: Complete nicknames and commands (old)" hecomplete)
1850 (const :tag "dcc: Provide Direct Client-to-Client support" dcc)
1840 (const :tag "fill: Wrap long lines" fill) 1851 (const :tag "fill: Wrap long lines" fill)
1841 (const :tag "identd: Launch an identd server on port 8113" identd) 1852 (const :tag "identd: Launch an identd server on port 8113" identd)
1842 (const :tag "irccontrols: Highlight or remove IRC control characters" 1853 (const :tag "irccontrols: Highlight or remove IRC control characters"
1843 irccontrols) 1854 irccontrols)
1855 (const :tag "keep-place: Leave point above un-viewed text" keep-place)
1856 (const :tag "list: List channels in a separate buffer" list)
1844 (const :tag "log: Save buffers in logs" log) 1857 (const :tag "log: Save buffers in logs" log)
1845 (const :tag "match: Highlight pals, fools, and other keywords" match) 1858 (const :tag "match: Highlight pals, fools, and other keywords" match)
1846 (const :tag "menu: Display a menu in ERC buffers" menu) 1859 (const :tag "menu: Display a menu in ERC buffers" menu)
1860 (const :tag "move-to-prompt: Move to the prompt when typing text"
1861 move-to-prompt)
1847 (const :tag "netsplit: Detect netsplits" netsplit) 1862 (const :tag "netsplit: Detect netsplits" netsplit)
1863 (const :tag "networks: Provide data about IRC networks" networks)
1848 (const :tag "noncommands: Don't display non-IRC commands after evaluation" 1864 (const :tag "noncommands: Don't display non-IRC commands after evaluation"
1849 noncommands) 1865 noncommands)
1850 (const :tag 1866 (const :tag
@@ -1866,6 +1882,7 @@ removed from the list will be disabled."
1866 (const :tag "track: Track channel activity in the mode-line" track) 1882 (const :tag "track: Track channel activity in the mode-line" track)
1867 (const :tag "truncate: Truncate buffers to a certain size" truncate) 1883 (const :tag "truncate: Truncate buffers to a certain size" truncate)
1868 (const :tag "unmorse: Translate morse code in messages" unmorse) 1884 (const :tag "unmorse: Translate morse code in messages" unmorse)
1885 (const :tag "xdcc: Act as an XDCC file-server" xdcc)
1869 (repeat :tag "Others" :inline t symbol)) 1886 (repeat :tag "Others" :inline t symbol))
1870 :group 'erc) 1887 :group 'erc)
1871 1888
@@ -2324,6 +2341,15 @@ If ARG is non-nil, show the *erc-protocol* buffer."
2324I.e. any char in it has the `invisible' property set." 2341I.e. any char in it has the `invisible' property set."
2325 (text-property-any 0 (length string) 'invisible t string)) 2342 (text-property-any 0 (length string) 'invisible t string))
2326 2343
2344(defcustom erc-remove-parsed-property t
2345 "Whether to remove the erc-parsed text property after displaying a message.
2346
2347The default is to remove it, since it causes ERC to take up extra
2348memory. If you have code that relies on this property, then set
2349this option to nil."
2350 :type 'boolean
2351 :group 'erc)
2352
2327(defun erc-display-line-1 (string buffer) 2353(defun erc-display-line-1 (string buffer)
2328 "Display STRING in `erc-mode' BUFFER. 2354 "Display STRING in `erc-mode' BUFFER.
2329Auxiliary function used in `erc-display-line'. The line gets filtered to 2355Auxiliary function used in `erc-display-line'. The line gets filtered to
@@ -2364,7 +2390,10 @@ If STRING is nil, the function does nothing."
2364 (save-restriction 2390 (save-restriction
2365 (narrow-to-region insert-position (point)) 2391 (narrow-to-region insert-position (point))
2366 (run-hooks 'erc-insert-modify-hook) 2392 (run-hooks 'erc-insert-modify-hook)
2367 (run-hooks 'erc-insert-post-hook)))))) 2393 (run-hooks 'erc-insert-post-hook)
2394 (when erc-remove-parsed-property
2395 (remove-text-properties (point-min) (point-max)
2396 '(erc-parsed nil))))))))
2368 (erc-update-undo-list (- (or (marker-position erc-insert-marker) 2397 (erc-update-undo-list (- (or (marker-position erc-insert-marker)
2369 (point-max)) 2398 (point-max))
2370 insert-position)))))) 2399 insert-position))))))
@@ -3161,14 +3190,35 @@ just as you provided it. Use this command with care!"
3161 (t nil))) 3190 (t nil)))
3162(put 'erc-cmd-QUOTE 'do-not-parse-args t) 3191(put 'erc-cmd-QUOTE 'do-not-parse-args t)
3163 3192
3193(defcustom erc-query-display 'window
3194 "Indicates how to display query buffers when using the /QUERY
3195command to talk to someone.
3196
3197The default behavior is to display the message in a new window
3198and bring it to the front. See the documentation for
3199`erc-join-buffer' for a description of the available choices.
3200
3201See also `erc-auto-query' to decide how private messages from
3202other people should be displayed."
3203 :group 'erc-query
3204 :type '(choice (const :tag "Split window and select" window)
3205 (const :tag "Split window, don't select" window-noselect)
3206 (const :tag "New frame" frame)
3207 (const :tag "Bury in new buffer" bury)
3208 (const :tag "Use current buffer" buffer)
3209 (const :tag "Use current buffer" t)))
3210
3164(defun erc-cmd-QUERY (&optional user) 3211(defun erc-cmd-QUERY (&optional user)
3165 "Open a query with USER. 3212 "Open a query with USER.
3166The type of query window/frame/etc will depend on the value of 3213The type of query window/frame/etc will depend on the value of
3167`erc-join-buffer'. If USER is omitted, close the current query buffer if one 3214`erc-query-display'.
3168exists - except this is broken now ;-)" 3215
3216If USER is omitted, close the current query buffer if one exists
3217- except this is broken now ;-)"
3169 (interactive 3218 (interactive
3170 (list (read-from-minibuffer "Start a query with: " nil))) 3219 (list (read-from-minibuffer "Start a query with: " nil)))
3171 (let ((session-buffer (erc-server-buffer))) 3220 (let ((session-buffer (erc-server-buffer))
3221 (erc-join-buffer erc-query-display))
3172 (if user 3222 (if user
3173 (erc-query user session-buffer) 3223 (erc-query user session-buffer)
3174 ;; currently broken, evil hack to display help anyway 3224 ;; currently broken, evil hack to display help anyway
@@ -3707,8 +3757,9 @@ If `point' is at the beginning of a channel name, use that as default."
3707 (read-from-minibuffer 3757 (read-from-minibuffer
3708 (concat "Set topic of " (erc-default-target) ": ") 3758 (concat "Set topic of " (erc-default-target) ": ")
3709 (when erc-channel-topic 3759 (when erc-channel-topic
3710 (cons (apply 'concat (butlast (split-string erc-channel-topic "\C-o"))) 3760 (let ((ss (split-string erc-channel-topic "\C-o")))
3711 0))))) 3761 (cons (apply 'concat (if (cdr ss) (butlast ss) ss))
3762 0))))))
3712 (let ((topic-list (split-string topic "\C-o"))) ; strip off the topic setter 3763 (let ((topic-list (split-string topic "\C-o"))) ; strip off the topic setter
3713 (erc-cmd-TOPIC (concat (erc-default-target) " " (car topic-list))))) 3764 (erc-cmd-TOPIC (concat (erc-default-target) " " (car topic-list)))))
3714 3765
@@ -3841,20 +3892,22 @@ To change how this query window is displayed, use `let' to bind
3841 (erc-update-mode-line) 3892 (erc-update-mode-line)
3842 buf)) 3893 buf))
3843 3894
3844(defcustom erc-auto-query 'bury 3895(defcustom erc-auto-query 'window-noselect
3845 "If non-nil, create a query buffer each time you receive a private message. 3896 "If non-nil, create a query buffer each time you receive a private message.
3897If the buffer doesn't already exist, it is created.
3846 3898
3847If the buffer doesn't already exist it is created. This can be 3899This can be set to a symbol, to control how the new query window
3848set to a symbol, to control how the new query window should 3900should appear. The default behavior is to display the buffer in
3849appear. See the documentation for `erc-join-buffer' for 3901a new window, but not to select it. See the documentation for
3850available choices." 3902`erc-join-buffer' for a description of the available choices."
3851 :group 'erc-query 3903 :group 'erc-query
3852 :type '(choice (const nil) 3904 :type '(choice (const :tag "Don't create query window" nil)
3853 (const buffer) 3905 (const :tag "Split window and select" window)
3854 (const window) 3906 (const :tag "Split window, don't select" window-noselect)
3855 (const window-noselect) 3907 (const :tag "New frame" frame)
3856 (const bury) 3908 (const :tag "Bury in new buffer" bury)
3857 (const frame))) 3909 (const :tag "Use current buffer" buffer)
3910 (const :tag "Use current buffer" t)))
3858 3911
3859(defcustom erc-query-on-unjoined-chan-privmsg t 3912(defcustom erc-query-on-unjoined-chan-privmsg t
3860 "If non-nil create query buffer on receiving any PRIVMSG at all. 3913 "If non-nil create query buffer on receiving any PRIVMSG at all.
@@ -5822,7 +5875,7 @@ See `current-time' for details on the time format."
5822 5875
5823;; Mode line handling 5876;; Mode line handling
5824 5877
5825(defcustom erc-mode-line-format "%s %a" 5878(defcustom erc-mode-line-format "%S %a"
5826 "A string to be formatted and shown in the mode-line in `erc-mode'. 5879 "A string to be formatted and shown in the mode-line in `erc-mode'.
5827 5880
5828The string is formatted using `format-spec' and the result is set as the value 5881The string is formatted using `format-spec' and the result is set as the value
@@ -5833,12 +5886,16 @@ The following characters are replaced:
5833%l: The estimated lag time to the server 5886%l: The estimated lag time to the server
5834%m: The modes of the channel 5887%m: The modes of the channel
5835%n: The current nick name 5888%n: The current nick name
5889%N: The name of the network
5836%o: The topic of the channel 5890%o: The topic of the channel
5837%p: The session port 5891%p: The session port
5838%t: The name of the target (channel, nickname, or servername:port) 5892%t: The name of the target (channel, nickname, or servername:port)
5839%s: In the server-buffer, this gets filled with the value of 5893%s: In the server-buffer, this gets filled with the value of
5840 `erc-server-announced-name', in a channel, the value of 5894 `erc-server-announced-name', in a channel, the value of
5841 (erc-default-target) also get concatenated." 5895 (erc-default-target) also get concatenated.
5896%S: In the server-buffer, this gets filled with the value of
5897 `erc-network', in a channel, the value of (erc-default-target)
5898 also get concatenated."
5842 :group 'erc-mode-line-and-header 5899 :group 'erc-mode-line-and-header
5843 :type 'string) 5900 :type 'string)
5844 5901
@@ -5932,6 +5989,29 @@ This should be a string with substitution variables recognized by
5932 (server-name server-name) 5989 (server-name server-name)
5933 (t (buffer-name (current-buffer)))))) 5990 (t (buffer-name (current-buffer))))))
5934 5991
5992(defun erc-format-network ()
5993 "Return the name of the network we are currently on."
5994 (let ((network (and (fboundp 'erc-network-name) (erc-network-name))))
5995 (if (and network (symbolp network))
5996 (symbol-name network)
5997 "")))
5998
5999(defun erc-format-target-and/or-network ()
6000 "Return the network or the current target and network combined.
6001If the name of the network is not available, then use the
6002shortened server name instead."
6003 (let ((network-name (or (and (fboundp 'erc-network-name) (erc-network-name))
6004 (erc-shorten-server-name
6005 (or erc-server-announced-name
6006 erc-session-server)))))
6007 (when (and network-name (symbolp network-name))
6008 (setq network-name (symbol-name network-name)))
6009 (cond ((erc-default-target)
6010 (concat (erc-string-no-properties (erc-default-target))
6011 "@" network-name))
6012 (network-name network-name)
6013 (t (buffer-name (current-buffer))))))
6014
5935(defun erc-format-away-status () 6015(defun erc-format-away-status ()
5936 "Return a formatted `erc-mode-line-away-status-format' 6016 "Return a formatted `erc-mode-line-away-status-format'
5937if `erc-away' is non-nil." 6017if `erc-away' is non-nil."
@@ -5975,9 +6055,11 @@ if `erc-away' is non-nil."
5975 ?l (erc-format-lag-time) 6055 ?l (erc-format-lag-time)
5976 ?m (erc-format-channel-modes) 6056 ?m (erc-format-channel-modes)
5977 ?n (or (erc-current-nick) "") 6057 ?n (or (erc-current-nick) "")
6058 ?N (erc-format-network)
5978 ?o (erc-controls-strip erc-channel-topic) 6059 ?o (erc-controls-strip erc-channel-topic)
5979 ?p (erc-port-to-string erc-session-port) 6060 ?p (erc-port-to-string erc-session-port)
5980 ?s (erc-format-target-and/or-server) 6061 ?s (erc-format-target-and/or-server)
6062 ?S (erc-format-target-and/or-network)
5981 ?t (erc-format-target))) 6063 ?t (erc-format-target)))
5982 (process-status (cond ((and (erc-server-process-alive) 6064 (process-status (cond ((and (erc-server-process-alive)
5983 (not erc-server-connected)) 6065 (not erc-server-connected))