aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olson2008-01-25 03:28:10 +0000
committerMichael Olson2008-01-25 03:28:10 +0000
commit5e56b3fb5aac96b5a65800da0495cef072388edf (patch)
treedd05be8f7403e54ab1cd3a252ba7b3c5d868b59f
parent409dd1209d15594d85ba083f4954bcc541594c9f (diff)
downloademacs-5e56b3fb5aac96b5a65800da0495cef072388edf.tar.gz
emacs-5e56b3fb5aac96b5a65800da0495cef072388edf.zip
ERC: Sync version 5.3, release candidate 1.
-rw-r--r--etc/ChangeLog4
-rw-r--r--etc/ERC-NEWS231
-rw-r--r--lisp/erc/ChangeLog1096
-rw-r--r--lisp/erc/ChangeLog.07839
-rw-r--r--lisp/erc/erc-backend.el31
-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.el227
-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.el11
-rw-r--r--lisp/erc/erc-track.el135
-rw-r--r--lisp/erc/erc-xdcc.el13
-rw-r--r--lisp/erc/erc.el150
17 files changed, 2022 insertions, 1038 deletions
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 8e783c871fb..655ce0c74fd 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,7 @@
12008-01-25 Michael Olson <mwolson@gnu.org>
2
3 * ERC-NEWS: Update for ERC 5.3 release candidate.
4
12008-01-22 Juanma Barranquero <lekktu@gmail.com> 52008-01-22 Juanma Barranquero <lekktu@gmail.com>
2 6
3 * DEVEL.HUMOR: New entry. 7 * DEVEL.HUMOR: New entry.
diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS
index 450b1cdcf83..ec348a450f6 100644
--- a/etc/ERC-NEWS
+++ b/etc/ERC-NEWS
@@ -15,14 +15,237 @@ of ERC that comes with Emacs.
15`erc-join-channel' now accepts a prefix-argument to prompt for the key 15`erc-join-channel' now accepts a prefix-argument to prompt for the key
16when channels are protected by keywords. 16when channels are protected by keywords.
17 17
18** ERC will now automatically determine which nick prefixes are valid
19when joining a server.
20
21** Figure out which directory contains startup files when looking for
22.erc.el. For Emacs this is usually ~/.emacs.d, and for XEmacs this is
23usually ~/.xemacs.
24
25** Fix bug with view-mode when running erc-toggle-debug-irc-protocol.
26
27** Permit several commands to be run even when the server connection is dead.
28This includes /CLEAR, /COUNTRY, /HELP, /LASTLOG, /QUIT, /GQUIT,
29/RECONNECT, /SERVER, and /SET.
30
31** Make /RECONNECT work better when the server connection is dead.
32Also, handle case where the server buffer has been killed.
33
34** Better handle interaction with /RECONNECT and indefinite reconnect
35attempts. Display message which tells the user that they can stop the
36reconnect attempts by killing the server buffer.
37
38** New option `erc-reuse-frames' determines whether new frames are always
39created. It defaults to not creating a new frame for an ERC buffer if
40there is already a window displaying it. This only has an effect when
41the `erc-join-buffer' option is set to 'frame.
42
43** New command /ME'S handles the case where someone types "/me's" in an
44ERC buffer. It concatenates the text " 's" to the beginning of the
45input and then sends the result like a normal /ME command.
46
47** Fix bug where some messages were being sent to the server too soon.
48In the past, this may have resulted in strange problems like seeing
49the connection attempt stall, which may have especially affected
50spotty or traffic-shaped connections.
51
52** Handle 307 (nick has identified) responses from the server.
53
54** Display a less-confusing message if the connection attempt fails.
55
56** On a tty, make sure that notices are displayed in blue rather than pink.
57
58** By default, open query buffers that are initiated by others in a new
59unselected window. This may be changed by customizing the
60`erc-auto-query' option. This should make ERC more friendly to new
61users.
62
63** New option `erc-query-display' indicates how to display a query buffer
64that is made using the /QUERY command. The default is to display the
65query in a new selected window.
66
67** By default, display network name rather than server name in the modeline.
68This should ERC use less space in the modeline. To get the old
69behavior back, set `erc-mode-line-format' to "%s %a".
70
71** New option `erc-remove-parsed-property' determines whether to remove
72the 'erc-parsed property. This should save some memory in channels
73with large amounts of text on screen. It is enabled by default.
74
75** Modules newly enabled by default
76
77*** move-to-prompt: Move to the prompt when typing text.
78*** networks: Provide data about IRC networks.
79
80** New formatting variables allowed in `erc-format-network':
81
82*** `%N': the name of the network.
83*** `%S': much like %s, but let the network name trump the server name.
84
85** Compatibility with old releases
86
87*** In `erc-server-coding-system' and `erc-coding-system-for-target', pass
88the `target' argument as the first and only argument to the function
89named by these options.
90
91*** In `erc-track-faces-priority-list', permit list entries to be lists of
92faces. This can be used to differentiate between, for example,
93buttons in default text and buttons in notices.
94
95*** The `erc-assert' function has been removed in favor of using `assert'
96from cl-macs.el.
97
98*** If your application uses the 'erc-parsed text property outside of
99the insert hooks, you will need to set `erc-remove-parsed-property'
100to nil.
101
18** Changes and additions to modules 102** Changes and additions to modules
19 103
104*** BBDB (erc-bbdb.el)
105
106**** Work around bug in XEmacs 21.4 that causes an error to be thrown when
107the first argument to `run-at-time' is nil.
108
109*** Button (erc-button.el)
110
111**** Recognize parentheses that are part of URLs.
112
113**** When in a channel, only buttonize nicks from that channel.
114
115*** DCC support (erc-dcc.el)
116
117**** Turn this into the "dcc" module for ERC, so that it can be more
118easily enabled.
119
120**** New option `erc-dcc-listen-host' determines which IP address to listen
121on for outside connection attempts.
122
123**** New option `erc-dcc-public-host' determines which IP address to advertise
124when sending a file. This is useful for people who are on a local
125subnet. Together, these two options replace the `erc-dcc-host'
126option.
127
128**** New option `erc-dcc-receive-cache' indicates how much of a received
129file to store in an Emacs buffer before flushing it to disk. The
130default is 0.5 MB.
131
132**** Save only parts of received files in buffers, writing repeatedly to
133disk after we get at least `erc-dcc-receive-cache' bytes. This allows
134users to receive very large files without running out of memory.
135
136**** Rename `erc-verbose-dcc' option to `erc-dcc-verbose' and also
137default it to nil.
138
139**** Fix edge case in erc-dcc-send-sentinel.
140
141**** If client confirms too much, then display byte count and kill the
142file buffer.
143
144*** Goodies (erc-goodies.el)
145
146**** New module move-to-prompt causes the point to be moved to the prompt
147if a user tries to type elsewhere in the buffer, and then inserts
148their keystrokes after the prompt. It is enabled by default.
149
150**** New module keep-place keeps your place in unvisited ERC buffers
151when new messages arrive.
152
153**** Enable scroll-to-bottom in all ERC buffers when the module is enabled,
154rather than having the user do it manually.
155
156**** Fix bug with buffer ordering and scroll-to-bottom module.
157
158**** In the unmorse module, handle the morse code style that has "/ " at
159the end of every letter.
160
161*** Identd (erc-identd.el)
162
163**** Fix bad behavior when closing the identd process.
164
165*** Channel lists (erc-list.el)
166
167**** Replace the old module with a rewritten one, so that we can include
168it with Emacs. The old version of erc-list.el has been renamed to
169erc-list-old.el, and is available as the list-old module.
170
171The new version does not yet have support for XEmacs.
172
173**** Don't display lots of output in the server buffer when running /LIST.
174
175*** Logging (erc-log.el)
176
177**** Permit the `erc-log-channels-directory' option to be set to a function
178name. This makes it easier to write custom functions that determine
179where log files should be placed.
180
181**** New option `erc-log-filter-function' specifies the function to call
182for filtering text before writing it to a log file. By default, no
183filtering is performed.
184
185*** Networks (erc-networks.el)
186
187**** Turn this into the "networks" module for ERC, so that it can be more
188easily enabled. Enable it by default.
189
190**** Add support for Rizon.
191
192*** Internet services / Nickserv (erc-services.el)
193
194**** New hook option `erc-nickserv-identified-hook' is run after NickServ
195acknowledges a successful identification.
196
197**** Add support for the GRnet and Rizon networks.
198
199*** Timestamps (erc-stamp.el)
200
201**** By default, place timestamps on both the left and the right.
202The left timestamps appear once a day, and the right timestamps appear
203once a minute when new messages arrive. To change this, customize the
204`erc-insert-timestamp-function' and
205`erc-insert-away-timestamp-function' options.
206
20*** Channel tracking (erc-track.el) 207*** Channel tracking (erc-track.el)
21 208
22If erc-track-position-in-mode-line is set to nil, the tracking 209**** If `erc-track-position-in-mode-line' is set to nil, the tracking
23information won't be shown in the mode line, which is a change 210information won't be shown in the mode line, which is a change from
24from the previous behavior of showing it "After all other 211the previous behavior of showing it "After all other information".
25information". 212
213If this variable is set to t, then the information will be added to
214the very end of the mode line.
215
216**** New option `erc-track-remove-disconnected-buffers' controls whether
217buffers associated with a server that is disconnected should be
218removed from the modified buffers list. The default is to keep them
219in the list.
220
221**** New hook option `erc-track-list-changed-hook' is run whenever the
222contents of the modified channels list changes. It is useful for
223people who use a separate mechanism to provide notification of channel
224activity.
225
226**** The `erc-track-switch-direction' option now can be set to the value
227'importance. If set to this value, ERC will switch to channels in
228order of importance, which is determined by the position of the
229channel's face in `erc-track-faces-priority-list'.
230
231**** Activate erc-track-minor-mode earlier in the connection process.
232
233**** Don't track buttons in notices.
234
235**** Get a rough idea for which channels are currently active by
236switching between several normal conversation faces in the modeline.
237This behavior can be modified by changing the new
238`erc-track-faces-normal-list' option.
239
240**** Ignore display of who set the default channel topic and listing of
241users on the current channel. Customize the `erc-track-exclude-types'
242option to indicate the types of messages to exclude. These two
243message types are "333" and "353", respectively.
244
245*** Support for acting as an XDCC file-server (erc-xdcc.el)
246
247**** Turn this into the "xdcc" module for ERC, so that it can be more
248easily enabled.
26 249
27* Changes in ERC 5.2 250* Changes in ERC 5.2
28 251
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog
index 2e8fb250018..cddd0f845b6 100644
--- a/lisp/erc/ChangeLog
+++ b/lisp/erc/ChangeLog
@@ -1,843 +1,271 @@
12008-01-25 Michael Olson <mwolson@gnu.org>
2
3 * NEWS: Update.
4
5 * erc-goodies.el (keep-place): New module which keeps your place
6 in unvisited ERC buffers when new messages arrive. This is mostly
7 taken from Johan Bockgård's init file.
8 (erc-noncommands-list): Move to correct place.
9
10 * erc-networks.el: Add a module definition.
11
12 * erc-services.el (erc-nickserv-identify-mode): Force-enable the
13 networks module, because we need it to set erc-network for us.
14
15 * erc-track.el (erc-track-faces-normal-list): Indicate in the
16 docstring that this variable can be set to nil.
17
18 * erc.el: On second thought, don't load erc-networks. Just enable
19 the networks module by default.
20 (erc-modules): Add option for keep-place and networks. Enable
21 networks by default.
22 (erc-version-string): Make release candidate 1 available.
23
242008-01-24 Michael Olson <mwolson@gnu.org>
25
26 * erc.el: Load erc-networks.el so that functions get access to the
27 `erc-network-name' function.
28
29 * erc-track.el (erc-track-faces-normal-list): Add
30 erc-dangerous-host-face.
31 (erc-track-exclude-types): Add 333 and 353 to the default list of
32 things to ignore, and explain what they are in the docstring.
33
342008-01-23 Michael Olson <mwolson@gnu.org>
35
36 * erc-track.el (erc-track-faces-priority-list): Move
37 erc-nick-default-face higher, so that it can be used for the
38 activity indication effect. Add erc-current-nick-face,
39 erc-pal-face, erc-dangerous-host-face, and erc-fool-face by
40 themselves.
41 (erc-track-faces-normal-list): New option that contains a list of
42 faces to consider "normal".
43 (erc-track-position-in-mode-line): Minor docfix.
44 (erc-track-find-face): Use erc-track-faces-normal-list to produce
45 a sort of blinking activity effect.
46
472008-01-22 Michael Olson <mwolson@gnu.org>
48
49 * erc-button.el (erc-button-add-nickname-buttons): When in a
50 channel buffer, only look at nicks from the current channel.
51 Thanks to e1f for the report.
52
532008-01-21 Michael Olson <mwolson@gnu.org>
54
55 * erc-compat.el (erc-const-expr-p, erc-list*, erc-assert): Remove,
56 since we can use the default `assert' function without it causing
57 us any problems, even in Emacs 21. Thanks to bojohan for the
58 suggestion.
59
60 * erc-goodies.el (move-to-prompt): Use the "XEmacs" method
61 instead, because the [remap ...] method interferes with
62 delete-selection-mode.
63 (erc-move-to-prompt): Rename from erc-move-to-prompt-xemacs.
64 Deactivate mark and call push-mark before moving point. Thanks to
65 bojohan for the suggestion.
66 (erc-move-to-prompt-setup): Rename from
67 erc-move-to-prompt-init-xemacs.
68
69 * erc-track.el (erc-track-faces-priority-list): Replace erc-button
70 with '(erc-button erc-default-face) so that we only care about
71 buttons that are part of normal text. Adjust customization type
72 to handle this case. Make erc-nick-default-face a list. Handle
73 pals, fools, current nick, and dangerous hosts.
74 (erc-track-find-face): Simplify. Adapt for list of faces case.
75 (erc-faces-in): Don't deflate lists of faces. Add them as-is.
76 (erc-track-face-priority): Use equal instead of eq.
77
782008-01-20 Michael Olson <mwolson@gnu.org>
79
80 * erc-goodies.el (erc-move-to-prompt, erc-move-to-prompt-xemacs):
81 Fix off-by-one error that caused the point to move when placed at
82 the beginning of some already-typed text. Thanks to e1f for the
83 report.
84
85 * erc-dcc.el, erc-xdcc.el: Add simple module definitions.
86
87 * erc.el (erc-modules): Add dcc and xdcc.
88
892008-01-19 Michael Olson <mwolson@gnu.org>
90
91 * erc-bbdb.el (erc-bbdb-insinuate-and-show-entry): Work around bug
92 in XEmacs 21.4 that throws an error when the first argument to
93 run-at-time is nil.
94
95 * erc-button.el (button): Undo XEmacs-specific change to all ERC
96 buffers when module is removed.
97 (erc-button-setup): Rename from erc-button-add-keys, and move
98 XEmacs-specific stuff here.
99
100 * erc-goodies.el (erc-unmorse): Improve regexp for detecting
101 morse. Deal with the morse style that has "/ " at the end of
102 every letter.
103 (erc-imenu-setup): New function that sets up Imenu support. Add
104 it instead of a lambda form to erc-mode-hook.
105 (scrolltobottom): Remove erc-scroll-to-bottom from all ERC buffers
106 when module is removed. Activate the functionality in all ERC
107 buffers when the module is activated, rather than leaving it up to
108 the user.
109 (move-to-prompt): New module that moves to the ERC prompt if a
110 user tries to type elsewhere in the buffer, and then inserts their
111 keystrokes there. This is mostly taken from Johan Bockgård's init
112 file.
113 (erc-move-to-prompt): New function that implements this.
114 (erc-move-to-prompt-xemacs): New function that implements this for
115 XEmacs.
116 (erc-move-to-prompt-init-xemacs): New function to perform the
117 extra initialization step needed for XEmacs.
118
119 * erc-page.el, erc-replace.el: Fix header and footer.
120
121 * erc-track.el (erc-track-minor-mode-maybe): Take an optional
122 buffer arg so that we can put this in erc-connect-pre-hook. If
123 given this argument, include it in the check to determine whether
124 to activate erc-track-minor-mode.
125 (track): Add erc-track-minor-mode-maybe to erc-connect-pre-hook,
126 so that we can use it as soon as a connection is attempted.
127
128 * erc.el (erc-format-network, erc-format-target-and/or-network):
129 Use erc-network-name function instead, and check to see whether
130 that function is bound. This fixes an error in process filter for
131 people who did not have erc-services or erc-networks loaded.
132 (erc-modules): Add move-to-prompt module and enable it by
133 default. Thanks to e1f for the suggestion.
134
1352008-01-18 Michael Olson <mwolson@gnu.org>
136
137 * Makefile (EXTRAS): Include erc-list-old.el.
138
139 * erc-dcc.el (erc-dcc-verbose): Rename from erc-verbose-dcc.
140 (erc-pack-int): Rewrite to not depend on a count argument.
141 (erc-unpack-int): Rewrite to remove 4-character limitation.
142 (erc-dcc-server): Call set-process-coding-system and
143 set-process-filter-multibyte so that the contents get sent out
144 without modification.
145 (erc-dcc-send-filter): Don't take a substring -- just pass the
146 whole string to erc-unpack-int.
147 (erc-dcc-receive-cache): New option that indicates the number of
148 bytes to let the receive buffer grow before flushing it.
149 (erc-dcc-file-name): New buffer-local variable to keep track of
150 the filename of the currently-received file.
151 (erc-dcc-get-file): Disable undo for a speed increase. Set
152 erc-dcc-file-name. Truncate the file before writing to it.
153 (erc-dcc-append-contents): New function to append the contents of
154 a buffer to a file and then erase the contents of the buffer.
155 (erc-dcc-get-filter): Flush buffer contents after exceeding
156 erc-dcc-receive-cache. This allows large files to be downloaded
157 without storing the whole thing in memory.
158 (erc-dcc-get-sentinel): Flush any remaining contents before
159 closing. No need to save buffer.
160 (erc-dcc-listen-host): New option that determines which IP address
161 to listen on.
162 (erc-dcc-public-host): New option that determines which IP address
163 to advertise when sending a file. This is useful for people who
164 are on a local subnet. Together, these two options replace
165 erc-dcc-host.
166
167 * erc.el (erc-mode-line-format): Add %N and %S. %N is the name of
168 the network, and %S is much like %s but with the network name
169 trumping the server name. Default to "%S %a". Thanks to e1f for
170 the suggestion.
171 (erc-format-network): New function that formats the network name.
172 (erc-format-target-and/or-network): New function that formats both
173 the network name and target, falling back on the server name if
174 the network name is not available.
175 (erc-update-mode-line-buffer): Add the new format spec items.
176
1772008-01-17 Michael Olson <mwolson@gnu.org>
178
179 * erc.el (erc-join-buffer): Improve documentation.
180 (erc-query-display): New option indicating how to display a query
181 buffer that is made by using the /QUERY command. The default is
182 to display the query in a new window.
183 (erc-cmd-QUERY): Use it. Improve docstring.
184 (erc-auto-query): Default this to 'window-noselect instead,
185 because I've already seen bug reports about new users thinking
186 that ERC didn't display their test messages. Improve
187 customization type.
188 (erc-notice-face): Make this work with XEmacs.
189 (erc-join-buffer): Mention 'buffer in docstring. Improve
190 customization type.
191
192 * erc-dcc.el (erc-dcc-send-sentinel): Better handle case where elt
193 is nil, in order to avoid an error. Thanks to Brent Goodrick for
194 the initial patch.
195 (erc-dcc-display-send): New function split from erc-dcc-send-hook.
196 (erc-dcc-send-connect-hook): Use it -- we don't like lambda forms
197 in hooks.
198 (erc-dcc-send-filter): Display byte count if the client confirmed
199 too much, and kill the buffer. Otherwise a DoS might be possible
200 by making Emacs run out of RAM.
201
202 * erc-backend.el (erc-server-connect): Detect early on whether the
203 connection attempt has failed in order to avoid confusing error
204 messages.
205
206 * erc-networks.el (erc-server-alist): Add Rizon network.
207
208 * erc-services.el (erc-nickserv-passwords): Add Rizon to options.
209 (erc-nickserv-alist): Add support for Rizon.
210
211 * erc-track.el (erc-track-find-face): Don't let buttons in notices
212 trump default text. Use catch/throw. Default to first element of
213 FACES is nothing is found.
214
215 * erc-xdcc.el: Add local variables for proper indentation setup.
216
2172008-01-15 Michael Olson <mwolson@gnu.org>
218
219 * erc-backend.el (erc-server-coding-system): Docfix.
220 (erc-coding-system-for-target): Pass the `target' argument along
221 as the first and only argument. It's not good to just depend on a
222 dynamic binding.
223
2242008-01-10 Michael Olson <mwolson@gnu.org>
225
226 * erc-backend.el (321, 322): Split message-displaying parts into
227 new functions, which are added to each response's respective
228 hook. This makes them easier to disable.
229
230 * erc-list.el: New file from Tom Tromey. Use erc-propertize
231 instead of propertize. Require 'erc.
232 (list): New module definition. Remove message-displaying
233 functions for 321 and 322 response handlers when enabling the
234 module, and restore them when disabling. As a sanity check,
235 remove the erc-list-handle-322 function when disabling the module.
236 (erc-list-handle-322): Handle the case where we run the LIST
237 command, but do not go through the normal steps.
238 (erc-cmd-LIST): Add docstring. Strip initial space from line if
239 it is non-nil. Use make-local-variable to silence compiler
240 warning. Capture current buffer and pass it to
241 erc-list-install-322-handler.
242 (erc-list-install-322-handler): Take server-buffer argument, so
243 that we are certain of being in the right buffer. Use 4th
244 argument to add-hook, so that erc-server-322-functions is only
245 modified in one buffer.
246
247 * erc-list-old.el: Renamed from old erc-list.el.
248
249 * erc.el (erc-modules): Add list-old.
250 (erc-set-topic): Handle case where there are no newlines in the
251 existing topic, which happens when /LIST is run.
252 (erc-notice-face): If we have less than 88 colors, make this
253 blue. Otherwise the text will be pink in a tty, which looks
254 dreadful. Thanks to e1f for the report.
255 (erc-remove-parsed-property): New option that determines whether
256 to remove the erc-parsed property after displaying a message.
257 This should have the effect of making ERC take up less memory.
258 (erc-display-line-1): Use it.
259
12008-01-04 Stefan Monnier <monnier@iro.umontreal.ca> 2602008-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
2 261
3 * erc-ibuffer.el (erc-channel-modes): 262 * erc-ibuffer.el (erc-channel-modes):
4 Pass mode-name through format-mode-line 263 Pass mode-name through format-mode-line
5 264
62007-12-16 Diane Murray <disumu@x3y2z1.net>
7
8 * erc-services.el (erc-nickserv-alist): Removed autodetect regexp,
9 added identified regexp for OFTC.
10 (erc-nickserv-identification-autodetect): Make sure success-regex
11 is non-nil.
12 (erc-nickserv-identify-autodetect): Make sure identify-regex is
13 non-nil. Doc fix.
14
152007-12-13 Diane Murray <disumu@x3y2z1.net>
16
17 * erc-backend.el (PRIVMSG, QUIT, TOPIC, WALLOPS, 376, 004, 221)
18 (312, 315, 319, 330, 331, 333, 367, 368, 391, 405, 406, 412)
19 (421, 432, 433, 437, 442, 461, 474, 477, 482, 431): Doc fix.
20
212007-12-09 Michael Olson <mwolson@gnu.org>
22
23 * erc-services.el (erc-nickserv-alist): Fix regexps for GRnet.
24
252007-12-09 Giorgos Keramidas <keramida@ceid.upatras.gr> (tiny change)
26
27 * erc-backend.el, erc.el:
28 Parse 275 (secure connection) responses.
29
30 * erc-services.el: Add identification hooks for GRnet, the Greek
31 IRC network <http://www.irc.gr>.
32
332007-12-08 David Kastrup <dak@gnu.org>
34
35 * erc-stamp.el (erc-echo-timestamp):
36 * erc-lang.el (language):
37 * erc-backend.el (erc-server-connect): Fix buggy call to `message'.
38
392007-12-07 Edward O'Connor <ted@oconnor.cx>
40
41 * erc-services.el: Provide a hook that runs when nickserv confirms
42 that the user has successfully identified.
43 (services, erc-nickserv-identify-mode): Add and remove
44 erc-nickserv-identification-autodetect from
45 erc-server-NOTICE-functions.
46 (erc-nickserv-alist): Add SUCCESS-REGEXP to each entry.
47 (erc-nickserv-alist-identified-regexp)
48 (erc-nickserv-identification-autodetect): New functions.
49 (erc-nickserv-identified-hook): New hook.
50
512007-12-06 D. Goel <deego3@gmail.com>
52
53 * erc-match.el (erc-add-entry-to-list): Fix buggy call to `error'.
54
552007-12-01 Glenn Morris <rgm@gnu.org>
56
57 * erc-backend.el (erc-server-send-ping): Move after definition of
58 erc-server-send.
59
60 * erc.el (iswitchb-temp-buflist, iswitchb-read-buffer)
61 (erc-controls-strip): Declare for compiler.
62 (erc-iswitchb): Don't require iswitchb when compiling. Test
63 iswitchb-mode is bound.
64
652007-11-30 Dan Nicolaescu <dann@ics.uci.edu>
66
67 * erc.el (open-ssl-stream, open-tls-stream, erc-network-name):
68 Declare as functions.
69
702007-11-29 Giorgos Keramidas <keramida@ceid.upatras.gr> (tiny change)
71
72 * erc-backend.el, erc.el:
73 Parse 307 (nick has identified) responses.
74
752007-11-15 Juanma Barranquero <lekktu@gmail.com>
76
77 * erc.el (erc-open):
78 * erc-backend.el (define-erc-response-handler):
79 * erc-log.el (log):
80 * erc-match.el (erc-log-matches): Fix typos in docstrings.
81
822007-11-11 Michael Olson <mwolson@gnu.org>
83
84 * erc-autoaway.el (erc-autoaway-possibly-set-away):
85 * erc-netsplit.el (erc-netsplit-timer):
86 * erc-notify.el (erc-notify-timer):
87 * erc-track.el (erc-user-is-active): Only run if we have
88 successfully established a connection to the server and have
89 logged in. I suspect that sending messages too soon may make some
90 IRC servers not respond well, particularly when the network
91 connection is iffy or subject to traffic-shaping.
92
932007-11-01 Michael Olson <mwolson@gnu.org>
94
95 * erc-compat.el (erc-set-write-file-functions): New compatibility
96 function to set the write hooks appropriately.
97
98 * erc-log.el (erc-log-setup-logging): Use
99 erc-set-write-file-functions. This fixes a byte-compiler warning.
100
101 * erc-stamp.el: Silence byte-compiler warning about
102 erc-fill-column.
103
104 * erc.el (erc-with-all-buffers-of-server): Bind the result of
105 mapcar to a variable in order to silence a byte-compiler warning.
106
1072007-10-29 Michael Olson <mwolson@gnu.org>
108
109 * erc-ibuffer.el (erc-modified-channels-alist): Use
110 eval-when-compile, and explain why we are doing this.
111
1122007-10-25 Dan Nicolaescu <dann@ics.uci.edu>
113
114 * erc-ibuffer.el (erc-modified-channels-alist): Pacify
115 byte-compiler.
116
1172007-10-13 Glenn Morris <rgm@gnu.org>
118
119 * erc-track.el (erc-modified-channels-update): Use mapc rather
120 than mapcar.
121
1222007-10-12 Diane Murray <disumu@x3y2z1.net>
123
124 * erc.el (erc-join-channel): Prompt for channel key if C-u or
125 another prefix-arg was typed.
126
127 * NEWS: Noted this change.
128
1292007-10-07 Michael Olson <mwolson@gnu.org>
130
131 * erc.el (erc-cmd-ME'S): New command that handles the case where
132 someone types "/me's". It concatenates the text " 's" to the
133 beginning of the input and then sends the result like a normal
134 "/me" command.
135 (erc-command-regexp): Permit single-quote character.
136
1372007-09-30 Aidan Kehoe <kehoea@parhasard.net> (tiny change)
138
139 * erc-log.el (erc-save-buffer-in-logs): Prevent spurious warnings
140 when looking at a log file and concurrently saving to it.
141
1422007-09-18 Exal de Jesus Garcia Carrillo <exal@gnu.org> (tiny change)
143
144 * erc.texi (Special-Features): Fix small typo.
145
1462007-09-16 Michael Olson <mwolson@gnu.org>
147
148 * erc-track.el (erc-track-switch-direction): Mention
149 erc-track-faces-priority-list. Thanks to Leo for the suggestion.
150
1512007-09-11 Exal de Jesus Garcia Carrillo <exal@gnu.org> (tiny change)
152
153 * erc-sound.el: Fix typo in setting up instructions.
154
1552007-09-10 Michael Olson <mwolson@gnu.org>
156
157 * Makefile (elpa): Copy dir template rather than echoing a few
158 lines. The reason for this is that the ELPA package for ERC was
159 getting a corrupt dir entry.
160
161 * dir-template: Template for the ELPA dir file.
162
1632007-09-08 Michael Olson <mwolson@gnu.org>
164
165 * erc-log.el (erc-log-filter-function): New option that specifies
166 the function to call for filtering text before writing it to a log
167 file. Thanks to David O'Toole for the suggestion.
168 (erc-save-buffer-in-logs): Use erc-log-filter-function. Make sure
169 we carry along the value of coding-system-for-write, because this
170 could potentially be shadowed by the temporary buffer.
171
172 * erc.el (erc-version-string): Update to 5.3, development version.
173
1742007-09-07 Glenn Morris <rgm@gnu.org>
175
176 * erc.el (erc-toggle-debug-irc-protocol): Fix call to
177 erc-view-mode-enter.
178
1792007-08-08 Glenn Morris <rgm@gnu.org>
180
181 * erc-log.el, erc.el: Replace `iff' in doc-strings and comments.
182
1832007-09-03 Michael Olson <mwolson@gnu.org>
184
185 * erc.el (erc-default-port): Make this an integer value rather
186 than a string. Thanks to Luca Capello for the report.
187
1882007-08-27 Michael Olson <mwolson@gnu.org>
189
190 * erc.el (erc-cmd-GQUIT): If erc-kill-queries-on-quit is non-nil,
191 kill all query buffers after 4 seconds.
192
1932007-08-16 Michael Olson <mwolson@gnu.org>
194
195 * NEWS: Add ERC 5.3 changes section, and mention jbms' erc-track
196 compatibility note.
197
198 * erc-track.el (erc-track-list-changed-hook): Turn this into a
199 customizable option.
200 (erc-track-switch-direction): Add 'importance option.
201 (erc-modified-channels-display): If erc-track-switch-direction is
202 'importance, call erc-track-sort-by-importance.
203 (erc-track-face-priority): New function that returns a number
204 indicating the position of a face in erc-track-faces-priority-list.
205 (erc-track-sort-by-importance): New function that sorts
206 erc-modified-channels-list according to erc-track-face-priority.
207 (erc-track-get-active-buffer): Make 'oldest a rough opposite of
208 'importance.
209
2102007-08-14 Jeremy Maitin-Shepard <jbms@cmu.edu>
211
212 * erc-track.el (erc-track-remove-disconnected-buffers): New
213 variable which controls whether buffers associated with a server
214 that is disconnected should be removed from
215 `erc-modified-channels-alist'. Existing behavior is to
216 unconditionally remove such buffers, which is achieved by setting
217 `erc-track-removed-disconnected-buffers' to t. When set to t,
218 which is the new default value, such buffers remain in the list,
219 which I think is often the desired behavior, since the user may
220 likely wish to find out about activity that occurred in a channel
221 prior to it being disconnected.
222 (erc-track-list-changed-hook): New hook that is run whenever the
223 contents of `erc-modified-channels-alist' changes; it is useful
224 for users such as myself that don't use the default mode-line
225 notification but instead use a separate mechanism (which is tied
226 to my window manager) to provide notification of channel activity.
227 (erc-track-get-buffer-window): New function that acts as a wrapper
228 around `get-buffer-window' that handles the `selected-visible'
229 option of `erc-track-visibility'; previously, the value of
230 `erc-track-visibility' was passed directly to `get-buffer-window',
231 which does not support `selected-visible'; consequently,
232 `selected-visible' was not properly supported.
233 (erc-track-modified-channels): Fix a bug in the logic for removing
234 buffers from the list in certain cases.
235 (erc-track-position-in-mode-line): Add a supported value that
236 specifies that the tracking information should not be added to the
237 mode line at all. The value of nil is used to indicate that the
238 information should not be added at all to the mode line.
239 (erc-track-add-to-mode-line): Check for position eq to t, rather
240 than non-nil.
241 (erc-buffer-visible): Use erc-track-get-buffer-window.
242 (erc-modified-channels-update): Take
243 erc-track-remove-disconnected-buffers into account.
244 (erc-modified-channels-display): Run `erc-track-list-changed-hook'.
245
246 * erc.el (erc-reuse-frames): New option that determines whether
247 new frames are always created. Defaults to t. This only has an
248 effect when erc-join-buffer is set to 'frame.
249 (erc-setup-buffer): Use it.
250
2512007-08-14 Michael Olson <mwolson@gnu.org>
252
253 * erc-backend.el (erc-server-reconnect): If the server buffer has
254 been killed, use the current buffer instead. If the current
255 buffer is not an ERC buffer, give an error. This fixes a bug when
256 /reconnect is run from a channel buffer whose server buffer has
257 been deleted. Thanks to jbms for the report.
258 (erc-process-sentinel-1): Take server buffer as an argument, so
259 that we can make sure that it is current.
260 (erc-process-sentinel): Pass buffer to erc-process-sentinel-1.
261 (erc-process-sentinel-2): New function split from
262 erc-process-sentinel-1. If server buffer is deleted during a
263 reconnect attempt, stop trying to reconnect. Fix bug where
264 reconnect was not happening when erc-server-reconnect-attempts was
265 t. Call erc-server-reconnect-p only once each time. If we are
266 instructed to try connecting indefinitely, tell the user that they
267 can stop this by killing the server buffer. Call the process
268 sentinel by means of run-at-time, so that there is time to kill
269 the buffer if need be; this also removes the need for a while
270 loop. Refuse to reconnect again if erc-server-reconnect-timeout
271 is not an number.
272
273 * erc.el (erc-command-no-process-p): Fix bug: the return value of
274 erc-extract-command-from-line is a list rather than a single
275 symbol. Thanks to jbms for the report.
276 (erc-cmd-RECONNECT): Use simpler logic, and use buffer-live-p
277 rather than bufferp.
278 (erc-send-current-line, erc-display-command, erc-display-msg):
279 Handle case where erc-server-process is nil, so that /reconnect
280 works.
281
2822007-08-12 Michael Olson <mwolson@gnu.org>
283
284 * erc-identd.el (erc-identd-filter): Instead of sending an EOF
285 character, which now confuses freenode, stop the server process,
286 so that no new connections are accepted, and kill the current
287 client process.
288
2892007-07-30 Michael Olson <mwolson@gnu.org>
290
291 * erc-nicklist.el: Remove from the Emacs source tree. This file
292 is not release quality, and relies heavily on a module which
293 cannot be distributed with ERC due to licensing reasons.
294
2952007-07-29 Michael Olson <mwolson@gnu.org>
296
297 * erc-list.el: Relicense to GPLv3. Since the file was already
298 licensed under version 2 or later, it turns out that we do not
299 need the permission of all of the authors in order to proceed.
300
3012007-07-25 Glenn Morris <rgm@gnu.org>
302
303 * Relicense all FSF files to GPLv3 or later.
304
3052007-07-13 Michael Olson <mwolson@gnu.org>
306
307 * erc-goodies.el (erc-get-bg-color-face, erc-get-fg-color-face):
308 Use erc-error rather than message and beep.
309
310 * erc-sound.el: Indentation fix.
311
312 * erc.el (erc-command-no-process-p): New function that determines
313 if its argument is an ERC command that can be run when the server
314 process is not alive.
315 (erc-cmd-SET, erc-cmd-CLEAR, erc-cmd-COUNTRY, erc-cmd-HELP)
316 (erc-cmd-LASTLOG, erc-cmd-QUIT, erc-cmd-GQUIT)
317 (erc-cmd-RECONNECT, erc-cmd-SERVER): Denote that these commands
318 can be run even when the server process is not alive.
319 (erc-send-current-line): Call erc-command-no-process-p if the
320 server process is not alive, to determine if we have a command
321 that can be run anyway. Thanks to Tom Tromey for the bug report.
322 (erc-error): New function that either displays a message or throws
323 an error, depending on whether debug-on-error is non-nil.
324 (erc-cmd-SERVER, erc-send-current-line): Use it.
325
3262007-07-10 Michael Olson <mwolson@gnu.org>
327
328 * Relicense all FSF-assigned code to GPLv3.
329
3302007-06-25 Michael Olson <mwolson@gnu.org>
331
332 * erc.texi (Options): Fix typo.
333 (Getting Help and Reporting Bugs): Update webpage URL. Make Gmane
334 part more readable.
335
3362007-06-20 Michael Olson <mwolson@gnu.org>
337
338 * erc-stamp.el (erc-timestamp-format-left): New option that
339 specifies the left timestamp to use for
340 erc-insert-timestamp-left-and-right.
341 (erc-timestamp-format-right): New option that specifies the right
342 timestamp to use for erc-insert-timestamp-left-and-right.
343 (erc-insert-timestamp-function): Change default to
344 erc-insert-timestamp-left-and-right.
345 (erc-insert-away-timestamp-function): Ditto.
346 (erc-timestamp-last-inserted-left)
347 (erc-timestamp-last-inserted-right): New variables to keep track
348 of data for erc-insert-timestamp-left-and-right.
349 (erc-insert-timestamp-left-and-right): New function that places
350 timestamps on both the left and right sides of the screen, but
351 only if each timestamp has changed since it was last computed.
352 Thanks to offby1 for urging me to merge this.
353
354 * erc.el (erc-open-ssl-stream): Display informative error when
355 ssl.el not found.
356 (erc-tls): New function to connect using tls.el.
357 (erc-open-tls-stream): New function to initiate tls connection.
358 Display informative error when tls.el not found.
359
3602007-06-19 Michael Olson <mwolson@gnu.org>
361
362 * erc-log.el: Update header with accurate instructions.
363
3642007-06-17 Michael Olson <mwolson@gnu.org>
365
366 * erc-pkg.el: Update description to match what is currently in ELPA.
367
3682007-06-14 Juanma Barranquero <lekktu@gmail.com>
369 265
370 * erc-goodies.el (erc-scroll-to-bottom): Remove redundant check. 266See ChangeLog.07 for earlier changes.
371 267
3722007-06-13 Michael Olson <mwolson@gnu.org> 268 Copyright (C) 2008 Free Software Foundation, Inc.
373
374 * erc-compat.el (erc-with-selected-window): New compatibility
375 macro that implements `with-selected-window'.
376
377 * erc-goodies.el (erc-scroll-to-bottom): Use it. This fixes a bug
378 with buffer ordering where ERC buffers would move to the top.
379 Thanks to Ivan Kanis for the patch.
380
3812007-06-10 Michael Olson <mwolson@gnu.org>
382
383 * erc-log.el (erc-logging-enabled): Fix a bug that occurred when
384 `erc-log-channels-directory' had the name of a function.
385
3862007-06-06 Juanma Barranquero <lekktu@gmail.com>
387
388 * erc.el (erc-show-channel-key-p, erc-startup-file-list):
389 Fix typo in docstring.
390
3912007-06-03 Michael Olson <mwolson@gnu.org>
392
393 * erc-compat.el (erc-view-mode-enter): Make this its own function,
394 in order to document what we do, and provide sane fallback
395 behavior.
396
397 * erc.el (erc-toggle-debug-irc-protocol): Don't pass any arguments
398 to erc-view-mode-enter, since we don't do anything special with
399 the exit function. This fixes a bug with Emacs 21 and Emacs 22.
400 Thanks to Leo for noticing.
401
4022007-05-30 Michael Olson <mwolson@gnu.org>
403
404 * erc-compat.el (erc-user-emacs-directory): New variable that
405 determines where to find user-specific Emacs settings. For Emacs,
406 this is usually ~/.emacs.d, and for XEmacs this is usually
407 ~/.xemacs.
408
409 * erc.el (erc-startup-file-list): Use erc-user-emacs-directory.
410
4112007-05-28 Michael Olson <mwolson@gnu.org>
412
413 * erc-button.el (erc-button-url-regexp): Recognize parentheses as
414 part of URLs. Thanks to Lawrence Mitchell for the fix.
415
4162007-05-26 Michael Olson <mwolson@gnu.org>
417
418 * erc.texi (Modules): Fix references to completion modules.
419
4202007-05-21 Michael Olson <mwolson@gnu.org>
421
422 * Makefile (SOURCE): Remove erc-pkg.el.
423 (debclean): New rule to clean old Debian packages of ERC.
424 (debprepare): Don't modify the released tarball, but copy it as
425 the .orig.tar.gz file.
426 (debrelease, debrevision): Remove.
427 (debinstall): New target that copies the generated Debian file to
428 a distro-specific location.
429 (deb): New rule that chains together the stages in building a
430 Debian package.
431 (EXTRAS): Add erc-nicklist.el, since it is not release-quality.
432 (extras): Copy images directory.
433
434 * erc-nicklist.el (erc-nicklist-icons-directory): Use
435 locate-library to find the "images" directory. This should be
436 more failsafe. Thanks to Tom Tromey for the idea.
437
4382007-05-19 Michael Olson <mwolson@gnu.org>
439
440 * Makefile (ELPA): New variable that contains the location of my
441 local ELPA repository.
442 (elpa): New rule that makes an ELPA package for ERC.
443
4442007-04-19 Michael Olson <mwolson@gnu.org>
445
446 * erc.el (erc-parse-prefix): New function that retrieves the
447 PREFIX server parameter from the current server and returns an
448 alist of prefix type to prefix character.
449 (erc-channel-receive-names): Use `erc-parse-prefix' to determine
450 whether the first character of a nick is a prefix character or
451 not. This should fix a bug reported by bromine about needing to
452 type "%" first to complete nicks of people who are "hops" on
453 Slashnet. This should also support for very exotic IRC server
454 setups, if any exist.
455 (erc-update-current-channel-member): Indentation.
456
4572007-04-15 Michael Olson <mwolson@gnu.org>
458
459 * erc-log.el (erc-generate-log-file-name-function): Docfix.
460 Mention how to deal with the case for putting log files in
461 different directories. Change a customization type from `symbol'
462 to `function'.
463 (erc-log-channels-directory): Allow this to contain a function
464 name, which is called with the same args as in
465 `erc-generate-log-file-name-function'. Thanks to andrewy for the
466 report and use case.
467 (erc-current-logfile): Detect if `erc-log-channels-directory' is a
468 function and call it with arguments if so.
469
4702007-04-12 Michael Olson <mwolson@gnu.org>
471
472 * erc-backend.el (define-erc-response-handler): Mention that hook
473 processing stops when the function returns non-nil. This should
474 help avoid a nasty "gotcha" when making custom functions. Thanks
475 to John Sullivan for the report.
476
4772007-04-08 Diane Murray <disumu@x3y2z1.net>
478
479 * erc-nicklist.el (erc-nicklist-voiced-position): Fixed
480 customization mismatch.
481
4822007-04-01 Michael Olson <mwolson@gnu.org>
483
484 * erc.el (erc-version-string): Release ERC 5.2.
485
486 * erc-auto.in, erc-chess.el, erc-list.el, erc-speak.el:
487 * erc-viper.el: Update copyright notices.
488
489 * erc.texi: Make Emacs Lisp source code in this document
490 essentially public domain. Update version to 5.2.
491 (Obtaining ERC): Mention extras tarball.
492 (Releases): Mention local GNU mirror.
493 (Sample Configuration): Remove notice.
494
495 * FOR-RELEASE (5.3): Add item for erc-nicklist.
496 Mark NEWS as done. Mark extras tarball as done.
497
498 * Makefile (VERSION): Increment to 5.2.
499 (TESTING): Remove.
500 (EXTRAS): New variable containing the contents of our "Emacs 22
501 extras" tarball.
502 (SOURCE): Remove $(TESTING).
503 (MISC): Add COPYING and ChangeLog.06. Fix ChangeLog.NNNN ->
504 ChangeLog.NN.
505 (release): Use $(SNAPDIR) instead of erc-$(VERSION).
506 (extras): New rule which implements the building of the extras
507 tarball.
508 (upload-extras): New rule to upload the extras tarball. It's
509 yucky to replicate upload, but oh well.
510 (DISTRIBUTOR): New variable used to differentiate between building
511 packages for Ubuntu and Debian.
512 (debrelease, debrevision): Use it.
513 (debbuild): Run linda in addition to lintian.
514
515 * NEWS: Mention extras tarball. Note which files have been
516 renamed. Note that erc-list is enabled by default, except in
517 Emacs 22.
518
519 * README.extras: New file which serves as a README for the extras
520 tarball.
521
5222007-03-31 Michael Olson <mwolson@gnu.org>
523
524 * NEWS: Update for the 5.2 release.
525
526 * FOR-RELEASE: Finish up 5.2 manual item. Add documentation item
527 for 5.3.
528
529 * erc.texi (Sample Session): Flesh out. Mention #erc.
530 (Modules): Defer to 5.3 release.
531 (Advanced Usage): Move Sample Configuration chapter ahead of
532 unfinished chapters.
533 (Sample Configuration): Write.
534 (Options): Mention how to see available ERC options. Defer to 5.3
535 release.
536 (Tips and Tricks): Remove, since it seems better to just include
537 tips and tricks in the sample configuration, commented out.
538
539 * erc-bbdb.el (erc-bbdb-search-name-and-create): Make prompt more
540 informative about how to skip merging.
541 (erc-bbdb-insinuate-and-show-entry-1): Move contents of
542 erc-bbdb-insinuate-and-show-entry here.
543 (erc-bbdb-insinuate-and-show-entry): Run
544 erc-bbdb-insinuate-and-show-entry-1 "outside" of the calling
545 function, so that we can avoid triggering a process-filter error
546 if the user hits C-g.
547
5482007-03-30 Michael Olson <mwolson@gnu.org>
549
550 * FOR-RELEASE: Solve C-c C-SPC keybinding dilemma.
551
552 * erc-autoaway.el (erc-autoaway-idle-method): Use `if' rather than
553 `cond' and `set' rather than `set-default'.
554
555 * erc-log.el: Avoid compiler warning by requiring erc-network
556 during compilation.
557 (erc-generate-log-file-name-function): Add tag to each option.
558 Add erc-generate-log-file-name-network.
559 (erc-generate-log-file-name-network): New function which generates
560 a log file name that uses network name rather than server name,
561 when possible.
562
563 * erc-track.el (track): Assimilate track-when-inactive module,
564 since there's no need to have two modules in one file -- an option
565 will do. Remove track-modified-channels alias. Call
566 erc-track-minor-mode-maybe, and tear down the minor mode when
567 disabling.
568 (erc-track-when-inactive): New option which determines whether to
569 track visible buffers when inactive. The default is not to do so.
570 (erc-track-visibility): Mention erc-track-when-inactive.
571 (erc-buffer-visible): Use erc-track-when-inactive.
572 (erc-track-enable-keybindings): New option which determines
573 whether to enable the global-level tracking keybindings. The
574 default is to do so, unless they would override another binding,
575 in which case we prompt the user about it.
576 (erc-track-minor-mode-map): Move global keybindings here.
577 (erc-track-minor-mode): New minor mode which only enables the
578 keybindings and does nothing else.
579 (erc-track-minor-mode-maybe): New function which starts
580 erc-track-minor-mode, but only if it hasn't already been started,
581 an ERC buffer exists, and the user OK's it, depending on the value
582 of `erc-track-enable-keybindings'.
583 (erc-track-switch-buffer): Display a message if someone calls this
584 without first enabling erc-track-mode.
585
5862007-03-17 Michael Olson <mwolson@gnu.org>
587
588 * erc.texi (Development): Mention ErcDevelopment page on
589 emacswiki.
590 (Getting Started): Mention ~/.emacs.d/.ercrc.el and the Customize
591 interface.
592 (Sample Session): New section that has a very rough draft for a
593 sample ERC session.
594 (Special Features): New section that explains some of the special
595 features of ERC. Taken from ErcFeatures on emacswiki, with
596 enhancements.
597
5982007-03-12 Diane Murray <disumu@x3y2z1.net>
599
600 * erc-autoaway.el (erc-autoaway-idle-method): When setting the new
601 value, disable and re-enable `erc-autoaway-mode' only if it was
602 already enabled. This fixes a bug where autoaway was enabled just
603 by loading the file.
604
6052007-03-10 Diane Murray <disumu@x3y2z1.net>
606
607 * erc-capab.el: Added more information to the Usage section.
608 (erc-capab-identify-prefix): Doc fix.
609 (erc-capab-identify-unidentified): New face.
610 (290): Removed. Definition moved to erc-backend.el.
611 (erc-capab-identify-send-messages): Renamed from
612 `erc-capab-send-identify-messages'.
613 (erc-capab-identify-setup): Use it.
614 (erc-capab-identify-get-unidentified-nickname): Renamed from
615 `erc-capab-get-unidentified-nickname'.
616 (erc-capab-identify-add-prefix): Use it. Use
617 `erc-capab-identify-unidentified' as the face.
618
619 * erc-backend.el (290): Moved here from erc-capab.el.
620
621 * erc.el (erc-select): Added an autoload cookie.
622 (erc-message-type-member, erc-restore-text-properties): Use
623 `erc-get-parsed-vector'.
624 (erc-auto-query): Set the default to 'bury since many new users
625 expect private messages from others to be in dedicated query
626 buffers, not the server buffer.
627 (erc-common-server-suffixes): Use "freenode" for freenode.net, not
628 "OPN". Added oftc.net.
629
630 * NEWS: Added note about erc-auto-query's new default setting.
631
6322007-03-03 Michael Olson <mwolson@gnu.org>
633
634 * erc.el (erc-open, erc): Docfixes.
635
6362007-03-02 Michael Olson <mwolson@gnu.org>
637
638 * FOR-RELEASE: Make section for 5.3 release and move erc-backend
639 cleanup there. Awaiting discussion before doing other things.
640 Add tasks for merging filename changes from the 5.2 release
641 branch, and for making a tarball of modules not in Emacs 22. Add
642 item to remind me to update NEWS. Mark backtab entry as done.
643
644 * erc-button.el (button): Add call to `erc-button-add-keys'.
645 (erc-button-keys-added): New variable tracking whether we've added
646 the keys yet.
647 (erc-button-add-keys): New function that adds the <backtab> key to
648 erc-mode-map.
649
650 * erc.texi: Change version to 5.2 (pre-release).
651
6522007-02-15 Michael Olson <mwolson@gnu.org>
653
654 * CREDITS: Update.
655
656 * erc-backend.el (erc-server-send-ping-interval): Change to use a
657 default of 30 seconds. Improve customize interface.
658 (erc-server-send-ping-timeout): New option that determines when to
659 consider a connection stalled and restart it. The default is
660 after 120 seconds.
661 (erc-server-send-ping): Use erc-server-send-ping-timeout instead
662 of erc-server-send-ping-interval. If
663 erc-server-send-ping-timeout is nil, do not ever kill and restart
664 a hung IRC process.
665
666 * erc.el (erc-modules): Include the name of the module in its
667 description. This should make it easier for people to find and
668 enable a particular module.
669
6702007-02-15 Vivek Dasmohapatra <vivek@etla.org>
671
672 * erc.el (erc-cmd-RECONNECT): Kill old process if it is still
673 alive.
674 (erc-message-english-PART): Properly escape "%" characters in
675 reason.
676
677 * erc-backend.el (erc-server-reconnecting): New variable that is
678 set when the user requests a reconnect, but the old process is
679 still alive. This forces the reconnect to work even though the
680 process is killed manually during reconnect.
681 (erc-server-connect): Initialize it.
682 (erc-server-reconnect-p): Use it.
683 (erc-process-sentinel-1): Set it to nil after the first reconnect
684 attempt.
685
6862007-02-07 Diane Murray <disumu@x3y2z1.net>
687
688 * erc-menu.el (erc-menu-definition): Fixed so that the separator
689 is between "Current channel" and "Pals, fools and other keywords",
690 not at the bottom of the "Current channel" submenu.
691
6922007-01-25 Diane Murray <disumu@x3y2z1.net>
693
694 * erc-networks.el (erc-server-alist): Removed SSL server for now
695 since `erc-server-select' doesn't know to use `erc-ssl'.
696
697 * erc-networks.el (erc-server-alist, erc-networks-alist): Added
698 definitions for oftc.net.
699
700 * erc-services.el (erc-nickserv-alist): Fixed OFTC message regexp.
701
7022007-01-22 Michael Olson <mwolson@gnu.org>
703
704 * erc-backend.el (erc-server-error-occurred): New variable that
705 indicates when an error has been signaled by the server. This
706 should fix an infinite reconnect bug when giving some servers a
707 bogus :full-name. Thanks to Angelina Carlton for the report.
708 (erc-server-connect): Initialize erc-server-error-occurred.
709 (erc-server-reconnect-p): Use it.
710 (ERROR): Set it.
711
712 * erc-services.el (erc-nickserv-alist): Alphabetize and add Ars
713 and QuakeNet. Standardize look of entries. Fix type mismatch
714 error in customize interface.
715 (erc-nickserv-passwords): Alphabetize and add missing entries from
716 erc-nickserv-alist.
717
7182007-01-21 Michael Olson <mwolson@gnu.org>
719
720 * erc.el (erc-header-line-format): Document how to disable the
721 header line, and add a customization type for it. Also, make the
722 changes take effect immediately.
723
7242007-01-19 Michael Olson <mwolson@gnu.org>
725
726 * erc.texi (Modules): Document new menu module. Thanks to Leo
727 for noticing.
728
7292007-01-16 Diane Murray <disumu@x3y2z1.net>
730
731 * erc-stamp.el (erc-insert-timestamp-left): Fixed so that the
732 whitespace string filler is hidden correctly when timestamps are
733 hidden.
734 (erc-toggle-timestamps): New function to use instead of
735 `erc-show-timestamps' and `erc-hide-timestamps'.
736
737 * erc.el (erc-restore-text-properties): Moved here from
738 erc-fill.el since it could be useful in general.
739
740 * erc-fill.el (erc-restore-text-properties): Removed.
741
7422007-01-13 Michael Olson <mwolson@gnu.org>
743
744 * erc.el (erc-command-regexp): New variable that is used to match
745 a command.
746 (erc-send-input): Use it. This fixes a bug where paths --
747 "/usr/bin/foo", for example -- were being displayed as commands,
748 but still sent correctly.
749 (erc-extract-command-from-line): Use it.
750
751 * erc.texi (Modules): Document erc-capab-identify.
752
7532007-01-11 Diane Murray <disumu@x3y2z1.net>
754
755 * erc.el (erc-find-parsed-property): Moved here from erc-track.el
756 since it can be useful in general.
757
758 * erc-track.el (erc-find-parsed-property): Removed.
759
760 * erc-capab.el (erc-capab-find-parsed): Removed.
761 (erc-capab-identify-add-prefix): Use `erc-find-parsed-property'.
762
763 * erc.el (erc-open): Run `erc-before-connect' hook here. This
764 makes sure the hook always gets called before a connection is
765 made, as some functions, like `erc-handle-irc-url', use `erc-open'
766 instead of `erc'.
767 (erc): Removed `erc-before-connect' hook.
768
769 * erc-menu.el (erc-menu-definition): Put items specific to
770 channels in a "Current channel" submenu.
771
772 * erc-backend.el (321, 323): Display channel list in server buffer
773 when not using the channel list module.
774
775 * erc.el: Updated copyright years.
776 (erc-version-string): Set to 5.2 (devel).
777 (erc-format-lag-time): Fixed to work when `erc-server-lag' is nil.
778 (erc-update-mode-line-buffer): Set the header face.
779
7802007-01-11 Michael Olson <mwolson@gnu.org>
781
782 * erc-bbdb.el (erc-bbdb-popup-type): Fix customization type and
783 documentation.
784
785 * erc-services.el (erc-nickserv-identify-mode): Improve
786 documentation for nick-change option and move higher to fix
787 compiler warning. Avoid a recursive load error.
788 (erc-nickserv-alist): Add simple entry for BitlBee, to avoid
789 "NickServ is AWAY: User is offline" error. Oddly enough, bitlbee
790 was smart enough to recognize that as an authentication request
791 and log in regardless, which is why I didn't notice this earlier.
792 (erc-nickserv-alist-sender, erc-nickserv-alist-regexp)
793 (erc-nickserv-alist-nickserv, erc-nickserv-alist-ident-keyword)
794 (erc-nickserv-alist-use-nick-p)
795 (erc-nickserv-alist-ident-command): New accessors for
796 erc-nickserv-alist. Using nth is unwieldy.
797 (erc-nickserv-identify-autodetect)
798 (erc-nickserv-identify-on-connect)
799 (erc-nickserv-identify-on-nick-change, erc-nickserv-identify): Use
800 the new accessors.
801
8022007-01-11 Diane Murray <disumu@x3y2z1.net>
803
804 * NEWS: Added note for `erc-my-nick-face'. Fixed capab-identify
805 wording.
806
8072007-01-10 Diane Murray <disumu@x3y2z1.net>
808
809 * erc.el (erc-mode-line-format): Added %l to documentation.
810 (erc-header-line-format): Removed "[IRC]". Use the new %l
811 replacement character. Doc fix.
812 (erc-format-channel-modes): Removed lag code. Removed parentheses
813 from mode string.
814 (erc-format-lag-time): New function.
815 (erc-update-mode-line-buffer): Use it.
816
8172007-01-10 Michael Olson <mwolson@gnu.org>
818
819 * erc.el: Fix typo in url-irc-function instructions.
820
8212007-01-09 Michael Olson <mwolson@gnu.org>
822
823 * erc.el (erc-system-name): New option that determines the system
824 name to use when logging in. The default is to figure this out by
825 calling `system-name'.
826 (erc-login): Use it.
827
8282007-01-07 Michael Olson <mwolson@gnu.org>
829
830 * erc.el (erc-modules): Add the menu module. This should fix a
831 bug with incorrect ERC submenus being displayed.
832
833 * erc-menu.el: Turn this into a module.
834 (erc-menu-add, erc-menu-remove): New functions that add and remove
835 the ERC menu.
836
837
838See ChangeLog.06 for earlier changes.
839
840 Copyright (C) 2007, 2008 Free Software Foundation, Inc.
841 269
842 This file is part of GNU Emacs. 270 This file is part of GNU Emacs.
843 271
@@ -860,5 +288,3 @@ See ChangeLog.06 for earlier changes.
860;; coding: utf-8 288;; coding: utf-8
861;; add-log-time-zone-rule: t 289;; add-log-time-zone-rule: t
862;; End: 290;; End:
863
864;; arch-tag: 3369b6e5-96b1-4b32-96cd-9a905c747496
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 5fe0efd1c94..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)
@@ -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
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..fc8ec9bf10e
--- /dev/null
+++ b/lisp/erc/erc-list.el
@@ -0,0 +1,227 @@
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:
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 028d358ad39..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"
@@ -256,6 +261,12 @@ Example of use:
256 "NickServ" 261 "NickServ"
257 "IDENTIFY" nil nil 262 "IDENTIFY" nil nil
258 "You\\s-are\\s-successfully\\s-identified\\s-as\\s-") 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.")
259 (QuakeNet 270 (QuakeNet
260 nil nil 271 nil nil
261 "Q@CServe.quakenet.org" 272 "Q@CServe.quakenet.org"
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..aa03e67461f 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 (RC 1)"
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))