Anonymous avatar Anonymous committed 01903b6

packages: Sync of erc with upstream version 4.0 revision 1.608

-------------------- ChangeLog entries follow: --------------------

xemacs-packages/erc/ChangeLog addition:

2004-01-18 Adrian Aichner <adrian@xemacs.org>;

* Full sync with upstream erc 4.0 revision 1.608.
* erc-autojoin.el (erc-autojoin-version): Manual expand to
preserve upstream revision number.
* erc-bbdb.el (erc-bbdb-version): Ditto.
* erc-button.el (erc-button-version): Ditto.
* erc-chess.el (erc-chess-version): Ditto.
* erc-compat.el:
* erc-compat.el (erc-compat-version): Ditto.
* erc-compat.el (nil):
* erc-complete.el (erc-complete-version): Ditto.
* erc-dcc.el (erc-dcc-version): Ditto.
* erc-ezbounce.el (erc-ezb-version): Ditto.
* erc-fill.el (erc-fill-version): Ditto.
* erc-ibuffer.el (erc-ibuffer-version): Ditto.
* erc-imenu.el (erc-imenu-version): Ditto.
* erc-list.el:
* erc-list.el (erc-no-list-networks): New.
* erc-list.el (erc-chanlist-frame-parameters): New.
* erc-list.el (erc-chanlist-hide-modeline): New.
* erc-list.el (erc-chanlist-channel-line-regexp): New.
* erc-list.el (erc-chanlist-last-time):
* erc-list.el (erc-chanlist-frame): New.
* erc-list.el (erc-chanlist-sort-state): New.
* erc-list.el (erc-chanlist-mode-hook): New.
* erc-list.el (erc-chanlist-mode):
* erc-list.el (erc-chanlist-mode-map): Removed.
* erc-list.el (erc-cmd-LIST): New.
* erc-list.el (erc-chanlist):
* erc-list.el (erc-chanlist-322):
* erc-list.el (erc-chanlist-post-command-hook): New.
* erc-list.el (erc-chanlist-highlight-line): New.
* erc-list.el (erc-prettify-channel-list): New.
* erc-list.el (erc-chanlist-toggle-sort-state): New.
* erc-list.el (erc-chanlist-quit): New.
* erc-list.el (erc-chanlist-join-channel): New.
* erc-match.el (erc-match-version): Manual expand to preserve
upstream revision number.
* erc-netsplit.el (erc-netsplit-version): Ditto.
* erc-nickserv.el (erc-nickserv-version): Ditto.
* erc-nickserv.el (erc-current-network):
* erc-pcomplete.el:
* erc-pcomplete.el (erc-pcomplete-version): Manual expand to
preserve upstream revision number.
* erc-pcomplete.el (pcomplete/erc-mode/IDLE): New.
* erc-replace.el (erc-replace-version): Manual expand to preserve
upstream revision number.
* erc-ring.el (erc-ring-version): Ditto.
* erc-stamp.el (erc-stamp-version): Ditto.
* erc-track.el:
* erc-track.el (erc-track-version): Ditto.
* erc-track.el (erc-track-visibility): New.
* erc-track.el (erc-track-exclude-types):
* erc-track.el (track):
* erc-track.el (track-when-inactive): New.
* erc-track.el (erc-buffer-activity): New.
* erc-track.el (erc-buffer-activity-timeout): New.
* erc-track.el (erc-user-is-active): New.
* erc-track.el (erc-buffer-visible): New.
* erc-track.el (erc-modified-channels-update):
* erc-track.el (erc-modified-channels-display):
* erc-track.el (erc-track-modified-channels):
* erc.el:
* erc.el (erc-version-string):
* erc.el (erc-official-location):
* erc.el (erc-user-mode):
* erc.el (erc-hide-prompt):
* erc.el (erc-show-my-nick):
* erc.el (erc-message-type):
* erc.el ('erc-message-type): New.
* erc.el (erc-server-parameters):
* erc.el (erc-connected):
* erc.el (channel-members):
* erc.el (erc-string-no-properties):
* erc.el (erc-prompt):
* erc.el (erc-command-indicator):
* erc.el (erc-prompt-interactive-input): Removed.
* erc.el (erc-echo-notices-in-minibuffer-flag):
* erc.el (erc-auto-reconnect):
* erc.el (erc-ignore-list):
* erc.el (erc-ignore-reply-list):
* erc.el (erc-quit-reason-various-alist):
* erc.el (erc-part-reason-various-alist):
* erc.el (erc-quit-reason):
* erc.el (erc-part-reason):
* erc.el (erc-send-completed-hook):
* erc.el (erc-quit-hook):
* erc.el (erc-part-hook):
* erc.el (erc-connect-pre-hook):
* erc.el (erc-process):
* erc.el (define-erc-module):
* erc.el (erc-once-with-server-event):
* erc.el (erc-once-with-server-event-global): New.
* erc.el (erc-server-buffer):
* erc.el (erc-server-buffer-p):
* erc.el (erc-query-buffer-p): New.
* erc.el (erc-ison-p):
* erc.el (erc-generate-new-buffer-name):
* erc.el (erc-get-buffer-create):
* erc.el (erc-member-ignore-case):
* erc.el (erc-with-buffer):
* erc.el (erc-with-all-buffers-of-server):
* erc.el (erc-channel-list):
* erc.el (erc-buffer-list-with-nick):
* erc.el (erc-network-name):
* erc.el (erc-modules):
* erc.el ("erc"):
* erc.el (erc-update-modules):
* erc.el (erc):
* erc.el (erc-initialize-log-marker):
* erc.el (erc-debug-irc-protocol):
* erc.el (NOTE): New.
* erc.el (erc-log-irc-protocol):
* erc.el (erc-toggle-debug-irc-protocol):
* erc.el (erc-send-command):
* erc.el (erc-split-command):
* erc.el (erc-send-ctcp-message):
* erc.el (erc-send-ctcp-notice):
* erc.el (erc-noncommands-list):
* erc.el (erc-display-line-1):
* erc.el (erc-scroll-to-bottom):
* erc.el (erc-display-message-highlight):
* erc.el (erc-display-message):
* erc.el (erc-message-type-member):
* erc.el (erc-send-input-line):
* erc.el (erc-cmd-AMSG):
* erc.el (erc-cmd-SAY):
* erc.el (erc-cmd-SET):
* erc.el (erc-cmd-default):
* erc.el (erc-cmd-IGNORE):
* erc.el (erc-cmd-OPS): New.
* erc.el (erc-cmd-CTCP):
* erc.el (erc-cmd-HELP):
* erc.el (erc-cmd-JOIN):
* erc.el (erc-channel-new-member-names):
* erc.el (erc-cmd-KICK):
* erc.el (erc-cmd-WHOIS):
* erc.el (erc-cmd-IDLE): New.
* erc.el (erc-cmd-ME):
* erc.el (erc-cmd-LASTLOG):
* erc.el (erc-send-message):
* erc.el (erc-cmd-MSG):
* erc.el (erc-cmd-SQUERY):
* erc.el (erc-cmd-NICK):
* erc.el (erc-cmd-QUOTE):
* erc.el (erc-cmd-QUERY):
* erc.el (erc-quit-reason-normal):
* erc.el (erc-quit-reason-zippy):
* erc.el (erc-quit-reason-various):
* erc.el (erc-part-reason-normal):
* erc.el (erc-part-reason-zippy):
* erc.el (erc-part-reason-various):
* erc.el (erc-kill-queries-on-quit):
* erc.el (erc-cmd-GQUIT):
* erc.el (erc-cmd-SV):
* erc.el (erc-cmd-DEOP):
* erc.el (erc-cmd-OP):
* erc.el (erc-cmd-BANLIST):
* erc.el (erc-cmd-MASSUNBAN):
* erc.el (erc-prepend-properties):
* erc.el (erc-strip-controls):
* erc.el (erc-decode-controls):
* erc.el (erc-interpret-controls):
* erc.el (erc-merge-controls):
* erc.el (erc-grab-region):
* erc.el (erc-display-prompt):
* erc.el (erc-interactive-input-map): Removed.
* erc.el (erc-join-channel):
* erc.el (erc-part-from-channel):
* erc.el (erc-quit-server):
* erc.el (erc-bol):
* erc.el (erc-complete-word):
* erc.el (erc-default-server-handler):
* erc.el (erc-debug-missing-hooks):
* erc.el (erc-call-hooks):
* erc.el (erc-duplicate-timeout):
* erc.el (erc-parse-line-from-server):
* erc.el (erc-server-vectors):
* erc.el (erc-query):
* erc.el (erc-auto-query):
* erc.el (erc-nickname-in-use):
* erc.el (erc-server-hook-list):
* erc.el (erc-server-JOIN):
* erc.el (erc-server-MODE):
* erc.el (erc-server-NICK):
* erc.el (erc-server-PART):
* erc.el (erc-server-PING):
* erc.el (erc-server-PONG):
* erc.el (erc-setup-periodical-server-ping):
* erc.el (erc-server-PRIVMSG-or-NOTICE):
* erc.el (erc-server-QUIT):
* erc.el (erc-server-TOPIC):
* erc.el (erc-server-005):
* erc.el (erc-server-305):
* erc.el (erc-server-306):
* erc.el (erc-server-311-or-314):
* erc.el (channel-banlist):
* erc.el (erc-banlist-store):
* erc.el (erc-banlist-finished):
* erc.el (erc-banlist-update):
* erc.el (erc-group-list):
* erc.el (erc-handle-login):
* erc.el (erc-server-MOTD):
* erc.el (erc-connection-established):
* erc.el (erc-set-initial-user-mode):
* erc.el (erc-display-error-notice):
* erc.el (erc-server-401):
* erc.el (erc-server-403):
* erc.el (erc-server-405):
* erc.el (erc-server-406):
* erc.el (erc-process-ctcp-query):
* erc.el (erc-ctcp-query-ACTION):
* erc.el (erc-ctcp-query-CLIENTINFO):
* erc.el (erc-ctcp-query-ECHO):
* erc.el (erc-ctcp-query-FINGER):
* erc.el (erc-ctcp-query-PING):
* erc.el (erc-ctcp-query-TIME):
* erc.el (erc-ctcp-query-USERINFO):
* erc.el (erc-ctcp-query-VERSION):
* erc.el (erc-process-ctcp-reply):
* erc.el (erc-ctcp-reply-ECHO):
* erc.el (erc-ctcp-reply-CLIENTINFO):
* erc.el (erc-ctcp-reply-FINGER):
* erc.el (erc-ctcp-reply-PING):
* erc.el (erc-ctcp-reply-TIME):
* erc.el (erc-ctcp-reply-VERSION):
* erc.el (erc-process-away):
* erc.el (erc-channel-begin-receiving-names):
* erc.el (erc-channel-end-receiving-names):
* erc.el (erc-channel-receive-names):
* erc.el (erc-update-current-channel-member):
* erc.el (erc-update-channel-member):
* erc.el (erc-get-current-channel-members):
* erc.el (erc-get-channel-members):
* erc.el (erc-remove-current-channel-member):
* erc.el (erc-remove-channel-member):
* erc.el (erc-update-channel-topic):
* erc.el (erc-set-modes):
* erc.el (erc-sort-strings):
* erc.el (erc-parse-modes):
* erc.el (erc-update-modes):
* erc.el (erc-update-channel-limit):
* erc.el (erc-find-channel-info-buffer):
* erc.el (erc-update-channel-info-buffer):
* erc.el (erc-remove-member-all-channels):
* erc.el (erc-update-member-all-channels):
* erc.el (erc-update-channel-info-buffers):
* erc.el (erc-handle-user-status-change):
* erc.el (erc-highlight-notice):
* erc.el (erc-highlight-error):
* erc.el (erc-parse-user):
* erc.el (erc-extract-nick):
* erc.el (erc-put-text-properties):
* erc.el (erc-beg-of-input-line):
* erc.el (erc-end-of-input-line):
* erc.el (erc-send-distinguish-noncommands):
* erc.el (erc-set-current-nick):
* erc.el (erc-current-nick):
* erc.el (erc-current-nick-p):
* erc.el (erc-nick-equal-p):
* erc.el (erc-default-target):
* erc.el (erc-add-default-channel):
* erc.el (erc-delete-default-channel):
* erc.el (erc-add-query):
* erc.el (erc-delete-query):
* erc.el (erc-ignored-user-p):
* erc.el (erc-ignored-reply-p):
* erc.el (erc-message-target):
* erc.el (erc-toggle-ctcp-autoresponse):
* erc.el (erc-toggle-flood-control):
* erc.el (erc-toggle-interpret-controls):
* erc.el (erc-invite-only-mode):
* erc.el (erc-toggle-channel-mode):
* erc.el (erc-insert-mode-command):
* erc.el (erc-channel-names):
* erc.el (erc-find-file):
* erc.el (erc-select-startup-file):
* erc.el (erc-find-script-file):
* erc.el (erc-load-script):
* erc.el (erc-process-script-line):
* erc.el (erc-load-irc-script):
* erc.el (erc-load-irc-script-lines):
* erc.el (erc-login):
* erc.el (erc-determine-parameters):
* erc.el (erc-compute-server):
* erc.el (erc-compute-nick):
* erc.el (erc-compute-full-name):
* erc.el (erc-string-to-emacs-time):
* erc.el (found): New.
* erc.el (erc-emacs-time-to-erc-time):
* erc.el (erc-current-time):
* erc.el (erc-time-diff):
* erc.el (erc-time-gt):
* erc.el (erc-sec-to-time):
* erc.el (erc-seconds-to-string): New.
* erc.el (erc-clientinfo-alist):
* erc.el (erc-client-info):
* erc.el (erc-directory-writable-p):
* erc.el (erc-kill-query-buffers):
* erc.el (erc-nick-at-point):
* erc.el (erc-operator-p):
* erc.el (erc-away-p):
* erc.el (erc-mode-line-format):
* erc.el (erc-header-line-format):
* erc.el (erc-common-server-suffixes):
* erc.el (erc-shorten-server-name):
* erc.el (erc-prepare-mode-line-format):
* erc.el (erc-update-mode-line-buffer):
* erc.el (erc-update-mode-line):
* erc.el (erc-port-to-string):
* erc.el (erc-string-to-port):
* erc.el (erc-trim-string):
* erc.el (erc-arrange-session-in-multiple-windows):
* erc.el (erc-make-message-variable-name):
* erc.el (erc-define-catalog-entry):
* erc.el (erc-define-catalog):
* erc.el (erc-message-english-PART):
* erc.el (erc-retrieve-catalog-entry):
* erc.el (erc-format-message):
* erc.el (erc-make-read-only):
* erc.el (erc-kill-buffer-hook):
* erc.el (erc-unmorse):

Comments (0)

Files changed (22)

+2004-01-18  Adrian Aichner  <adrian@xemacs.org>
+
+	* Full sync with upstream erc 4.0 revision 1.608.
+	* erc-autojoin.el (erc-autojoin-version): Manual expand to
+	preserve upstream revision number.
+	* erc-bbdb.el (erc-bbdb-version): Ditto.
+	* erc-button.el (erc-button-version): Ditto.
+	* erc-chess.el (erc-chess-version): Ditto.
+	* erc-compat.el:
+	* erc-compat.el (erc-compat-version): Ditto.
+	* erc-compat.el (nil):
+	* erc-complete.el (erc-complete-version): Ditto.
+	* erc-dcc.el (erc-dcc-version): Ditto.
+	* erc-ezbounce.el (erc-ezb-version): Ditto.
+	* erc-fill.el (erc-fill-version): Ditto.
+	* erc-ibuffer.el (erc-ibuffer-version): Ditto.
+	* erc-imenu.el (erc-imenu-version): Ditto.
+	* erc-list.el:
+	* erc-list.el (erc-no-list-networks): New.
+	* erc-list.el (erc-chanlist-frame-parameters): New.
+	* erc-list.el (erc-chanlist-hide-modeline): New.
+	* erc-list.el (erc-chanlist-channel-line-regexp): New.
+	* erc-list.el (erc-chanlist-last-time):
+	* erc-list.el (erc-chanlist-frame): New.
+	* erc-list.el (erc-chanlist-sort-state): New.
+	* erc-list.el (erc-chanlist-mode-hook): New.
+	* erc-list.el (erc-chanlist-mode):
+	* erc-list.el (erc-chanlist-mode-map): Removed.
+	* erc-list.el (erc-cmd-LIST): New.
+	* erc-list.el (erc-chanlist):
+	* erc-list.el (erc-chanlist-322):
+	* erc-list.el (erc-chanlist-post-command-hook): New.
+	* erc-list.el (erc-chanlist-highlight-line): New.
+	* erc-list.el (erc-prettify-channel-list): New.
+	* erc-list.el (erc-chanlist-toggle-sort-state): New.
+	* erc-list.el (erc-chanlist-quit): New.
+	* erc-list.el (erc-chanlist-join-channel): New.
+	* erc-match.el (erc-match-version): Manual expand to preserve
+	upstream revision number.
+	* erc-netsplit.el (erc-netsplit-version): Ditto.
+	* erc-nickserv.el (erc-nickserv-version): Ditto.
+	* erc-nickserv.el (erc-current-network):
+	* erc-pcomplete.el:
+	* erc-pcomplete.el (erc-pcomplete-version): Manual expand to
+	preserve upstream revision number.
+	* erc-pcomplete.el (pcomplete/erc-mode/IDLE): New.
+	* erc-replace.el (erc-replace-version): Manual expand to preserve
+	upstream revision number.
+	* erc-ring.el (erc-ring-version): Ditto.
+	* erc-stamp.el (erc-stamp-version): Ditto.
+	* erc-track.el:
+	* erc-track.el (erc-track-version): Ditto.
+	* erc-track.el (erc-track-visibility): New.
+	* erc-track.el (erc-track-exclude-types):
+	* erc-track.el (track):
+	* erc-track.el (track-when-inactive): New.
+	* erc-track.el (erc-buffer-activity): New.
+	* erc-track.el (erc-buffer-activity-timeout): New.
+	* erc-track.el (erc-user-is-active): New.
+	* erc-track.el (erc-buffer-visible): New.
+	* erc-track.el (erc-modified-channels-update):
+	* erc-track.el (erc-modified-channels-display):
+	* erc-track.el (erc-track-modified-channels):
+	* erc.el:
+	* erc.el (erc-version-string):
+	* erc.el (erc-official-location):
+	* erc.el (erc-user-mode):
+	* erc.el (erc-hide-prompt):
+	* erc.el (erc-show-my-nick):
+	* erc.el (erc-message-type):
+	* erc.el ('erc-message-type): New.
+	* erc.el (erc-server-parameters):
+	* erc.el (erc-connected):
+	* erc.el (channel-members):
+	* erc.el (erc-string-no-properties):
+	* erc.el (erc-prompt):
+	* erc.el (erc-command-indicator):
+	* erc.el (erc-prompt-interactive-input): Removed.
+	* erc.el (erc-echo-notices-in-minibuffer-flag):
+	* erc.el (erc-auto-reconnect):
+	* erc.el (erc-ignore-list):
+	* erc.el (erc-ignore-reply-list):
+	* erc.el (erc-quit-reason-various-alist):
+	* erc.el (erc-part-reason-various-alist):
+	* erc.el (erc-quit-reason):
+	* erc.el (erc-part-reason):
+	* erc.el (erc-send-completed-hook):
+	* erc.el (erc-quit-hook):
+	* erc.el (erc-part-hook):
+	* erc.el (erc-connect-pre-hook):
+	* erc.el (erc-process):
+	* erc.el (define-erc-module):
+	* erc.el (erc-once-with-server-event):
+	* erc.el (erc-once-with-server-event-global): New.
+	* erc.el (erc-server-buffer):
+	* erc.el (erc-server-buffer-p):
+	* erc.el (erc-query-buffer-p): New.
+	* erc.el (erc-ison-p):
+	* erc.el (erc-generate-new-buffer-name):
+	* erc.el (erc-get-buffer-create):
+	* erc.el (erc-member-ignore-case):
+	* erc.el (erc-with-buffer):
+	* erc.el (erc-with-all-buffers-of-server):
+	* erc.el (erc-channel-list):
+	* erc.el (erc-buffer-list-with-nick):
+	* erc.el (erc-network-name):
+	* erc.el (erc-modules):
+	* erc.el ("erc"):
+	* erc.el (erc-update-modules):
+	* erc.el (erc):
+	* erc.el (erc-initialize-log-marker):
+	* erc.el (erc-debug-irc-protocol):
+	* erc.el (NOTE): New.
+	* erc.el (erc-log-irc-protocol):
+	* erc.el (erc-toggle-debug-irc-protocol):
+	* erc.el (erc-send-command):
+	* erc.el (erc-split-command):
+	* erc.el (erc-send-ctcp-message):
+	* erc.el (erc-send-ctcp-notice):
+	* erc.el (erc-noncommands-list):
+	* erc.el (erc-display-line-1):
+	* erc.el (erc-scroll-to-bottom):
+	* erc.el (erc-display-message-highlight):
+	* erc.el (erc-display-message):
+	* erc.el (erc-message-type-member):
+	* erc.el (erc-send-input-line):
+	* erc.el (erc-cmd-AMSG):
+	* erc.el (erc-cmd-SAY):
+	* erc.el (erc-cmd-SET):
+	* erc.el (erc-cmd-default):
+	* erc.el (erc-cmd-IGNORE):
+	* erc.el (erc-cmd-OPS): New.
+	* erc.el (erc-cmd-CTCP):
+	* erc.el (erc-cmd-HELP):
+	* erc.el (erc-cmd-JOIN):
+	* erc.el (erc-channel-new-member-names):
+	* erc.el (erc-cmd-KICK):
+	* erc.el (erc-cmd-WHOIS):
+	* erc.el (erc-cmd-IDLE): New.
+	* erc.el (erc-cmd-ME):
+	* erc.el (erc-cmd-LASTLOG):
+	* erc.el (erc-send-message):
+	* erc.el (erc-cmd-MSG):
+	* erc.el (erc-cmd-SQUERY):
+	* erc.el (erc-cmd-NICK):
+	* erc.el (erc-cmd-QUOTE):
+	* erc.el (erc-cmd-QUERY):
+	* erc.el (erc-quit-reason-normal):
+	* erc.el (erc-quit-reason-zippy):
+	* erc.el (erc-quit-reason-various):
+	* erc.el (erc-part-reason-normal):
+	* erc.el (erc-part-reason-zippy):
+	* erc.el (erc-part-reason-various):
+	* erc.el (erc-kill-queries-on-quit):
+	* erc.el (erc-cmd-GQUIT):
+	* erc.el (erc-cmd-SV):
+	* erc.el (erc-cmd-DEOP):
+	* erc.el (erc-cmd-OP):
+	* erc.el (erc-cmd-BANLIST):
+	* erc.el (erc-cmd-MASSUNBAN):
+	* erc.el (erc-prepend-properties):
+	* erc.el (erc-strip-controls):
+	* erc.el (erc-decode-controls):
+	* erc.el (erc-interpret-controls):
+	* erc.el (erc-merge-controls):
+	* erc.el (erc-grab-region):
+	* erc.el (erc-display-prompt):
+	* erc.el (erc-interactive-input-map): Removed.
+	* erc.el (erc-join-channel):
+	* erc.el (erc-part-from-channel):
+	* erc.el (erc-quit-server):
+	* erc.el (erc-bol):
+	* erc.el (erc-complete-word):
+	* erc.el (erc-default-server-handler):
+	* erc.el (erc-debug-missing-hooks):
+	* erc.el (erc-call-hooks):
+	* erc.el (erc-duplicate-timeout):
+	* erc.el (erc-parse-line-from-server):
+	* erc.el (erc-server-vectors):
+	* erc.el (erc-query):
+	* erc.el (erc-auto-query):
+	* erc.el (erc-nickname-in-use):
+	* erc.el (erc-server-hook-list):
+	* erc.el (erc-server-JOIN):
+	* erc.el (erc-server-MODE):
+	* erc.el (erc-server-NICK):
+	* erc.el (erc-server-PART):
+	* erc.el (erc-server-PING):
+	* erc.el (erc-server-PONG):
+	* erc.el (erc-setup-periodical-server-ping):
+	* erc.el (erc-server-PRIVMSG-or-NOTICE):
+	* erc.el (erc-server-QUIT):
+	* erc.el (erc-server-TOPIC):
+	* erc.el (erc-server-005):
+	* erc.el (erc-server-305):
+	* erc.el (erc-server-306):
+	* erc.el (erc-server-311-or-314):
+	* erc.el (channel-banlist):
+	* erc.el (erc-banlist-store):
+	* erc.el (erc-banlist-finished):
+	* erc.el (erc-banlist-update):
+	* erc.el (erc-group-list):
+	* erc.el (erc-handle-login):
+	* erc.el (erc-server-MOTD):
+	* erc.el (erc-connection-established):
+	* erc.el (erc-set-initial-user-mode):
+	* erc.el (erc-display-error-notice):
+	* erc.el (erc-server-401):
+	* erc.el (erc-server-403):
+	* erc.el (erc-server-405):
+	* erc.el (erc-server-406):
+	* erc.el (erc-process-ctcp-query):
+	* erc.el (erc-ctcp-query-ACTION):
+	* erc.el (erc-ctcp-query-CLIENTINFO):
+	* erc.el (erc-ctcp-query-ECHO):
+	* erc.el (erc-ctcp-query-FINGER):
+	* erc.el (erc-ctcp-query-PING):
+	* erc.el (erc-ctcp-query-TIME):
+	* erc.el (erc-ctcp-query-USERINFO):
+	* erc.el (erc-ctcp-query-VERSION):
+	* erc.el (erc-process-ctcp-reply):
+	* erc.el (erc-ctcp-reply-ECHO):
+	* erc.el (erc-ctcp-reply-CLIENTINFO):
+	* erc.el (erc-ctcp-reply-FINGER):
+	* erc.el (erc-ctcp-reply-PING):
+	* erc.el (erc-ctcp-reply-TIME):
+	* erc.el (erc-ctcp-reply-VERSION):
+	* erc.el (erc-process-away):
+	* erc.el (erc-channel-begin-receiving-names):
+	* erc.el (erc-channel-end-receiving-names):
+	* erc.el (erc-channel-receive-names):
+	* erc.el (erc-update-current-channel-member):
+	* erc.el (erc-update-channel-member):
+	* erc.el (erc-get-current-channel-members):
+	* erc.el (erc-get-channel-members):
+	* erc.el (erc-remove-current-channel-member):
+	* erc.el (erc-remove-channel-member):
+	* erc.el (erc-update-channel-topic):
+	* erc.el (erc-set-modes):
+	* erc.el (erc-sort-strings):
+	* erc.el (erc-parse-modes):
+	* erc.el (erc-update-modes):
+	* erc.el (erc-update-channel-limit):
+	* erc.el (erc-find-channel-info-buffer):
+	* erc.el (erc-update-channel-info-buffer):
+	* erc.el (erc-remove-member-all-channels):
+	* erc.el (erc-update-member-all-channels):
+	* erc.el (erc-update-channel-info-buffers):
+	* erc.el (erc-handle-user-status-change):
+	* erc.el (erc-highlight-notice):
+	* erc.el (erc-highlight-error):
+	* erc.el (erc-parse-user):
+	* erc.el (erc-extract-nick):
+	* erc.el (erc-put-text-properties):
+	* erc.el (erc-beg-of-input-line):
+	* erc.el (erc-end-of-input-line):
+	* erc.el (erc-send-distinguish-noncommands):
+	* erc.el (erc-set-current-nick):
+	* erc.el (erc-current-nick):
+	* erc.el (erc-current-nick-p):
+	* erc.el (erc-nick-equal-p):
+	* erc.el (erc-default-target):
+	* erc.el (erc-add-default-channel):
+	* erc.el (erc-delete-default-channel):
+	* erc.el (erc-add-query):
+	* erc.el (erc-delete-query):
+	* erc.el (erc-ignored-user-p):
+	* erc.el (erc-ignored-reply-p):
+	* erc.el (erc-message-target):
+	* erc.el (erc-toggle-ctcp-autoresponse):
+	* erc.el (erc-toggle-flood-control):
+	* erc.el (erc-toggle-interpret-controls):
+	* erc.el (erc-invite-only-mode):
+	* erc.el (erc-toggle-channel-mode):
+	* erc.el (erc-insert-mode-command):
+	* erc.el (erc-channel-names):
+	* erc.el (erc-find-file):
+	* erc.el (erc-select-startup-file):
+	* erc.el (erc-find-script-file):
+	* erc.el (erc-load-script):
+	* erc.el (erc-process-script-line):
+	* erc.el (erc-load-irc-script):
+	* erc.el (erc-load-irc-script-lines):
+	* erc.el (erc-login):
+	* erc.el (erc-determine-parameters):
+	* erc.el (erc-compute-server):
+	* erc.el (erc-compute-nick):
+	* erc.el (erc-compute-full-name):
+	* erc.el (erc-string-to-emacs-time):
+	* erc.el (found): New.
+	* erc.el (erc-emacs-time-to-erc-time):
+	* erc.el (erc-current-time):
+	* erc.el (erc-time-diff):
+	* erc.el (erc-time-gt):
+	* erc.el (erc-sec-to-time):
+	* erc.el (erc-seconds-to-string): New.
+	* erc.el (erc-clientinfo-alist):
+	* erc.el (erc-client-info):
+	* erc.el (erc-directory-writable-p):
+	* erc.el (erc-kill-query-buffers):
+	* erc.el (erc-nick-at-point):
+	* erc.el (erc-operator-p):
+	* erc.el (erc-away-p):
+	* erc.el (erc-mode-line-format):
+	* erc.el (erc-header-line-format):
+	* erc.el (erc-common-server-suffixes):
+	* erc.el (erc-shorten-server-name):
+	* erc.el (erc-prepare-mode-line-format):
+	* erc.el (erc-update-mode-line-buffer):
+	* erc.el (erc-update-mode-line):
+	* erc.el (erc-port-to-string):
+	* erc.el (erc-string-to-port):
+	* erc.el (erc-trim-string):
+	* erc.el (erc-arrange-session-in-multiple-windows):
+	* erc.el (erc-make-message-variable-name):
+	* erc.el (erc-define-catalog-entry):
+	* erc.el (erc-define-catalog):
+	* erc.el (erc-message-english-PART):
+	* erc.el (erc-retrieve-catalog-entry):
+	* erc.el (erc-format-message):
+	* erc.el (erc-make-read-only):
+	* erc.el (erc-kill-buffer-hook):
+	* erc.el (erc-unmorse):
+
 2003-11-26  Norbert Koch  <viteno@xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 0.02 released.
 (require 'erc)
 ;;; Minor Mode
 
-(defconst erc-autojoin-version "$Revision$"
+(defconst erc-autojoin-version "Revision: 1.6"
   "ERC autojoin revision.")
 
 (defgroup erc-autojoin nil
 (require 'bbdb-gui)
 (require 'bbdb-hooks)
 
-(defconst erc-bbdb-version "$Revision$"
+(defconst erc-bbdb-version "Revision: 1.21"
   "ERC BBDB revision.")
 
 (defgroup erc-bbdb nil
 
 ;;; Variables
 
-(defconst erc-button-version "$Revision$"
+(defconst erc-button-version "Revision: 1.47"
   "ERC button mode revision.")
 
 (defcustom erc-button-face 'bold
 
 ;;;; Variables
 
-(defconst erc-chess-version "$Revision$"
+(defconst erc-chess-version "Revision: 1.21"
   "ERC chess revision.")
 
 (defgroup erc-chess nil
 
 ;;; Code:
 
-(defconst erc-compat-version "$Revision$"
+(defconst erc-compat-version "Revision: 1.15"
   "ERC compat revision.")
 
 ;; erc-define-minor-mode: the easy-mmode-define-minor-mode available
       (mapc 'unintern (apropos-internal "^erc-compat-test"))
       (defalias 'erc-define-minor-mode 'define-minor-mode))
   (error 
-   (defmacro erc-define-minor-mode (mode doc &optional init-value lighter keymap &rest body)
+   (defmacro erc-define-minor-mode (mode doc &optional init-value lighter
+                                    keymap &rest body)
      "Define a minor mode like in Emacs."
-     `(progn
-	(defvar ,mode ,init-value "Non-nil if the corresponding mode is enabled.")
-	(defun ,mode (&optional arg)
-	  ,doc
-	  (interactive)
-	  (setq ,mode (if arg
-			  (> (prefix-numeric-value arg) 0)
-			(not ,mode)))
-	  ,@body
-	  ,mode)
-	(add-minor-mode ,mode ,lighter ,keymap)))))
+     ;; Deal with at least /some/ keywords.
+     ;; the rest don't seem to be as important.
+     (let (keyw globalp group)
+       (while (keywordp (setq keyw (car body)))
+         (setq body (cdr body))
+         (case keyw
+           (:global (setq globalp (pop body)))
+           (:group (setq group (pop body)))
+           (t (pop body))))
+       `(progn
+          (if ,group
+              (defcustom ,mode ,init-value
+                "Non-nil if the corresponding mode is enabled."
+                :group ,group
+                :type 'boolean)
+              (defvar ,mode ,init-value
+                "Non-nil if the corresponding mode is enabled."))
+          (unless ,globalp
+            (make-variable-buffer-local ',mode))
+          (defun ,mode (&optional arg)
+            ,doc
+            (interactive)
+            (setq ,mode (if arg
+                            (> (prefix-numeric-value arg) 0)
+                            (not ,mode)))
+            ,@body
+            ,mode)
+          (add-minor-mode ,mode ,lighter ,keymap))))
+   ))
 
 ;; MULE: decode-coding-string and encode-coding-string -- note that
 ;; XEmacs' functions do not have the NOCOPY argument.
          (replace-in-string string regexp rep literal))))
 ;;; Done!
 
+;; XEmacs has a string representation of the build time. Really!
+(setq erc-emacs-build-time
+      (if (stringp emacs-build-time)
+          (date-to-time emacs-build-time)
+          emacs-build-time))
+
+
 (provide 'erc-compat)
 
 ;;; erc-compat.el ends here
 (require 'erc-match); for erc-pals
 (require 'hippie-exp); for the hippie expand stuff
 
-(defconst erc-complete-version "$Revision$"
+(defconst erc-complete-version "Revision: 1.13"
   "ERC complete revision.")
 
 ;;;###autoload
 
 (require 'erc)
 
-(defconst erc-dcc-version "$Revision$"
+(defconst erc-dcc-version "Revision: 1.1.1.1"
   "ERC DCC revision")
 
 (defgroup erc-dcc nil
 
 (require 'erc)
 
-(defconst erc-ezb-version "$Revision$"
+(defconst erc-ezb-version "Revision: 1.4"
   "ERC EZBouncer revision.")
 
 (defcustom erc-ezb-regexp "^ezbounce!srv$"
 (require 'erc)
 (require 'erc-stamp); for the timestamp stuff
 
-(defconst erc-fill-version "$Revision$"
+(defconst erc-fill-version "Revision: 1.23"
   "ERC fill revision.")
 
 (defgroup erc-fill nil
 
 (require 'ibuffer)
 
-(defconst erc-ibuffer-version "$Revision$"
+(defconst erc-ibuffer-version "Revision: 1.17"
   "ERC ibuffer revision.")
 
 (defgroup erc-ibuffer nil
 (require 'erc)
 (require 'imenu)
 
-(defconst erc-imenu-version "$Revision$"
+(defconst erc-imenu-version "Revision: 1.5"
   "ERC imenu revision.")
 
 (defun erc-unfill-notice ()
 
 (require 'erc)
 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; User customizable variables.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
 (defcustom erc-chanlist-progress-message t
   "*Show progress message while accumulating channel list."
   :group 'erc
   :type 'boolean)
 
+(defcustom erc-no-list-networks nil
+  "*A list of network names on which the /LIST command refuses to work."
+  :group 'erc
+  :type '(repeat string))
+
+(defvar erc-chanlist-frame-parameters nil
+  "If nil, the channel list is displayed in a new window, otherwise this
+variable holds the frame parameters used to make a frame to display the channel
+list.")
+
+(defcustom erc-chanlist-hide-modeline nil
+  "*If nil, the channel list buffer has a modeline, otherwise the modeline is hidden."
+  :group 'erc
+  :type 'boolean)
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Faces.  There's really no good default value that we can set for the
+;; foreground color of these faces, since we don't know the user's color scheme.
+;; The user should modify these faces as desired.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(make-face 'erc-chanlist-header-face)
+(setq erc-chanlist-header-face 'erc-chanlist-header-face)
+(set-face-foreground 'erc-chanlist-header-face nil)
+(set-face-background 'erc-chanlist-header-face nil)
+
+(make-face 'erc-chanlist-odd-line-face)
+(setq erc-chanlist-odd-line-face 'erc-chanlist-odd-line-face)
+(set-face-foreground 'erc-chanlist-odd-line-face nil)
+(set-face-background 'erc-chanlist-odd-line-face nil)
+
+(make-face 'erc-chanlist-even-line-face)
+(setq erc-chanlist-even-line-face 'erc-chanlist-even-line-face)
+(set-face-foreground 'erc-chanlist-even-line-face nil)
+(set-face-background 'erc-chanlist-even-line-face nil)
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; All variables below this line are for internal use only.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defvar erc-chanlist-channel-line-regexp "^\\([#&]\\S-+\\)\\s-+[0-9]+"
+  "Regexp that matches a channel line in the channel list buffer.")
+
 (defvar erc-chanlist-buffer nil)
 (make-variable-buffer-local 'erc-chanlist-buffer)
 
-(defvar erc-chanlist-last-time 0)
+(defvar erc-chanlist-last-time 0
+  "A time value used to throttle the progress indicator.")
 
-(define-derived-mode erc-chanlist-mode fundamental-mode "ChanList"
+(defvar erc-chanlist-frame nil
+  "The frame displaying the most recent channel list buffer.")
+
+(defvar erc-chanlist-sort-state 'channel
+  "The sort mode of the channel list buffer.  Either 'channel or 'users.")
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Define erc-chanlist-mode.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defvar erc-chanlist-mode-hook nil
+  "A hook run by erc-chanlist-mode.")
+
+(define-derived-mode erc-chanlist-mode fundamental-mode "ERC Channel List"
   "Mode for viewing a channel list of a particular server.
 
-\\{erc-chanlist-mode-map}")
+\\{erc-chanlist-mode-map}"
+  (local-set-key "\C-c\C-j" 'erc-join-channel)
+  (local-set-key "j" 'erc-chanlist-join-channel)
+  (local-set-key "n" 'next-line)
+  (local-set-key "p" 'previous-line)
+  (local-set-key "q" 'erc-chanlist-quit)
+  (local-set-key "s" 'erc-chanlist-toggle-sort-state)
+  (local-set-key "t" 'toggle-truncate-lines)
+  (set (make-local-variable 'erc-chanlist-sort-state) 'channel)
+  (setq truncate-lines t)
+  (add-hook 'post-command-hook 'erc-chanlist-post-command-hook 'append 'local)
+  (run-hooks 'erc-chanlist-mode-hook))
 
-(define-key erc-chanlist-mode-map "j" 'erc-join-channel)
-(define-key erc-chanlist-mode-map "\C-c\C-j" 'erc-join-channel)
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Functions.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 ;;;###autoload
-(defun erc-chanlist ()
+(defun erc-cmd-LIST (&optional channels)
+  "Displays a buffer containing a list of channels on the current server."
+  (interactive)
+  (if (and (null channels)
+	   (member-ignore-case (erc-network-name) erc-no-list-networks))
+      (erc-display-line "ERC is configured not to allow the /LIST command on this network!"
+			(current-buffer))
+    (erc-display-line (erc-make-notice "Listing channels.  This may take a while."))
+    (erc-chanlist channels))
+  t)
+
+;;;###autoload
+(defun erc-chanlist (&optional channels)
   "Show a channel listing of the current server in a special mode.
 Please note that this function only works with IRC servers which conform
 to RFC and send the LIST header (#321) at start of list transmission."
      321
      '(progn
 	(add-hook 'erc-server-322-hook 'erc-chanlist-322 nil t)
+
 	(erc-once-with-server-event
 	 323
 	 '(progn
 	    (remove-hook 'erc-server-322-hook 'erc-chanlist-322 t)
 	    (let ((buf erc-chanlist-buffer))
-	      (if (buffer-live-p buf)
-		  (progn
-		    (set-buffer buf)
-		    (let (buffer-read-only)
-		      (sort-lines nil (point-min) (point-max))
-		      (let ((sum (count-lines (point-min) (point-max))))
-			(goto-char (point-max))
-			(insert (format "\nTotal %d channels" sum)))
-		      (goto-char (point-min))
-		      (insert (format "%-15s%5s %s\n-------------- ----- ----------\n"
-				      "Channel"
-				      "Users"
-				      "Topic"))
-		      (view-buffer buf)))
-		(error "`erc-chanlist-buffer' does not refer to a live buffer")))
+	      (if (not (buffer-live-p buf))
+		  (error "`erc-chanlist-buffer' does not refer to a live buffer"))
+
+	      (set-buffer buf)
+	      (let (buffer-read-only
+		    (sort-fold-case t))
+		(sort-lines nil (point-min) (point-max))
+		(setq erc-chanlist-sort-state 'channel)
+
+		(let ((sum (count-lines (point-min) (point-max))))
+		  (goto-char (point-min))
+		  (insert (substitute-command-keys
+			   (concat "'\\[erc-chanlist-toggle-sort-state]' toggles sort mode.\n"
+				   "'\\[erc-chanlist-quit]' kills this buffer.\n"
+				   "'\\[toggle-truncate-lines]' toggles line truncation.\n"
+				   "'\\[erc-chanlist-join-channel]' joins the channel listed on the current line.\n\n")))
+		  (insert (format "%d channels (sorted by %s).\n\n"
+				  sum (if (eq erc-chanlist-sort-state 'channel)
+					  "channel name"
+					"number of users"))))
+
+		(insert (format "%-25s%5s %s\n------------------------ ----- ----------------------------\n"
+				"Channel"
+				"Users"
+				"Topic"))
+
+		;; Display the channel list buffer.
+		(if erc-chanlist-frame-parameters
+		    (progn
+		      (if (or (null erc-chanlist-frame)
+			      (not (frame-live-p erc-chanlist-frame)))
+			  (setq erc-chanlist-frame
+				(make-frame `((name . ,(format "Channels on %s"
+							       erc-session-server))
+					      ,@erc-chanlist-frame-parameters))))
+		      (select-frame erc-chanlist-frame)
+		      (switch-to-buffer buf)
+		      (erc-prettify-channel-list))
+		  (pop-to-buffer buf)
+		  (erc-prettify-channel-list))))
+	    (goto-char (point-min))
+	    (search-forward-regexp "^------" nil t)
+	    (forward-line 1)
+	    (erc-chanlist-highlight-line)
+	    (message "")
 	    t))
-	(setq erc-chanlist-buffer (get-buffer-create (format "*Channels on %s*"
-							     (aref parsed 1))))
+
+	(setq erc-chanlist-buffer (get-buffer-create (format "*Channels on %s*" (aref parsed 1))))
 	(with-current-buffer erc-chanlist-buffer
 	  (setq buffer-read-only nil)
 	  (erase-buffer)
 	  (erc-chanlist-mode)
 	  (setq erc-process proc)
+	  (if erc-chanlist-hide-modeline
+	      (setq mode-line-format nil))
 	  (setq buffer-read-only t))
 	t))
-    ;; Now that we setup our callbacks, we pull the trigger
-    (erc-send-command "LIST")))
+
+    ;; Now that we've setup our callbacks, pull the trigger.
+    (if (interactive-p)
+	(message "Collecting channel list for server %s" erc-session-server))
+    (erc-send-command (if (null channels)
+			  "LIST"
+			(concat "LIST " channels)))))
 
 (defun erc-chanlist-322 (proc parsed)
+  "Processes an IRC 322 message, which carries information about one channel for
+the LIST command."
   (let ((chnl (aref parsed 3))
 	(nv (aref parsed 4))
 	(topic (aref parsed 5)))
       (save-excursion
 	(goto-char (point-max))
 	(let (buffer-read-only)
-	  (insert (format "%-16s%4s %s\n" chnl nv (erc-interpret-controls topic))))
+	  (insert (format "%-26s%4s %s\n" (erc-interpret-controls chnl) nv
+			  (erc-interpret-controls topic))))
+
+	;; Maybe display a progress indicator in the minibuffer.
 	(when (and erc-chanlist-progress-message
-		 (> (erc-time-diff
-		     erc-chanlist-last-time (erc-current-time))
-		    1))
+		   (> (erc-time-diff
+		       erc-chanlist-last-time (erc-current-time))
+		      3))
 	  (setq erc-chanlist-last-time (erc-current-time))
-	  (message "Accumulating information... %c"
+	  (message "Accumulating channel list ... %c"
 		   (aref [?/ ?| ?\\ ?- ?! ?O ?o] (random 7))))
+
 	;; Return success to prevent other hook functions from being run.
 	t))))
 
+(defun erc-chanlist-post-command-hook ()
+  "Keeps the current line highlighted."
+  (ignore-errors
+    ;; First, restore all channel lines to their normal faces.
+    (erc-prettify-channel-list)
+
+    ;; Then, highlight the current line.
+    ;;(sleep-for 2)
+    (save-excursion
+      (beginning-of-line)
+      (when (looking-at erc-chanlist-channel-line-regexp)
+	(erc-chanlist-highlight-line)))))
+
+(defun erc-chanlist-highlight-line ()
+  "Highlights the current line."
+  (save-excursion
+    (let ((bol (point))
+	  (inhibit-read-only t))
+      (end-of-line)
+      (add-text-properties bol (point) `(face highlight)))))
+
+(defun erc-prettify-channel-list ()
+  "Makes the channel list buffer look pretty.  When this function runs, the
+current buffer must be the channel list buffer, or it doesn't nothing."
+  (if (eq major-mode 'erc-chanlist-mode)
+      (save-excursion
+	(let ((inhibit-read-only t))
+	  (goto-char (point-min))
+	  (when (search-forward-regexp "^-------" nil t)
+	    (end-of-line)
+	    (add-text-properties (point-min) (point) '(face erc-chanlist-header-face))
+	    (forward-line 1))
+
+	  (while (not (eobp))
+	    (let ((sol (point)))
+	      (end-of-line)
+	      (add-text-properties sol (point) '(face erc-chanlist-odd-line-face))
+	      (forward-line 1)
+	      (setq sol (point))
+	      (when (not (eobp))
+		(end-of-line)
+		(add-text-properties sol (point) '(face erc-chanlist-even-line-face)))
+	      (forward-line 1)))))))
+
+(defun erc-chanlist-toggle-sort-state ()
+  "Toggles the channel list buffer between sorting by channel names and sorting
+by number of users in each channel."
+  (interactive)
+  (let ((inhibit-read-only t)
+	(sort-fold-case t))
+    (save-excursion
+      (goto-char (point-min))
+      (search-forward-regexp "^-----" nil t)
+      (forward-line 1)
+      (when (not (eobp))
+	(if (eq erc-chanlist-sort-state 'channel)
+	    (progn
+	      (sort-numeric-fields 2 (point) (point-max))
+	      (reverse-region (point) (point-max))
+	      (setq erc-chanlist-sort-state 'users))
+	  (sort-lines nil (point) (point-max))
+	  (setq erc-chanlist-sort-state 'channel))
+
+	(goto-char (point-min))
+	(if (search-forward-regexp "^[0-9]+ channels (sorted by \\(.*\\)).$" nil t)
+	    (replace-match (if (eq erc-chanlist-sort-state 'channel)
+			       "channel name"
+			     "number of users")
+			   nil nil nil 1))
+
+	(goto-char (point-min))
+	(search-forward-regexp "^-----" nil t)
+	(forward-line 1)
+	(recenter -1)
+
+      	(erc-prettify-channel-list)))))
+
+(defun erc-chanlist-quit ()
+  "Bound to 'q' in erc-chanlist-mode.  Kills the channel list buffer, window, and frame (if there's a frame devoted to the channel list)."
+  (interactive)
+  (kill-buffer (current-buffer))
+  (if (eq (selected-frame) erc-chanlist-frame)
+      (delete-frame)
+    (delete-window)))
+
+(defun erc-chanlist-join-channel ()
+  "Joins the channel listed on the current line of the channel list buffer."
+  (interactive)
+  (save-excursion
+    (beginning-of-line)
+    (if (looking-at erc-chanlist-channel-line-regexp)
+	(let ((channel-name (match-string 1)))
+	  (if (stringp channel-name)
+	      (run-at-time 0.5 nil 'erc-join-channel channel-name))))))
+
 (provide 'erc-list)
 
 ;;; erc-list.el ends here
 
 ;; Customisation:
 
-(defconst erc-match-version "$Revision$"
+(defconst erc-match-version "Revision: 1.22"
   "ERC match mode revision.")
 
 (defgroup erc-match nil
 
 (require 'erc)
 
-(defconst erc-netsplit-version "$Revision$"
+(defconst erc-netsplit-version "Revision: 1.8"
   "ERC netsplit version.")
 
 (defgroup erc-netsplit nil
 
 (require 'erc)
 
-(defconst erc-nickserv-version "$Revision$"
+(defconst erc-nickserv-version "Revision: 1.13"
   "ERC NickServ revision.")
 
 ;; Customization:
   (when erc-announced-server-name
     (if (string= erc-announced-server-name "anon.iip")
 	'iip
-      (string-match "\\.\\([-a-zA-Z]+\\.\\w+\\)$" erc-announced-server-name)
+      (string-match "\\.\\(.*\\)$" erc-announced-server-name)
       (let* ((domain erc-announced-server-name)
 	     (server (downcase (match-string 1 domain)))
 	     (network (nth 1 (assoc server erc-networks))))
 (require 'erc)
 (require 'erc-compat)
 
-(defconst erc-pcomplete-version "$Revision$"
+(defconst erc-pcomplete-version "Revision: 1.22"
   "ERC pcomplete mode revision")
 
 (defcustom erc-pcomplete-nick-postfix ": "
 (defun pcomplete/erc-mode/DESCRIBE ()
   (pcomplete-here (pcomplete-erc-nicks)))
 
+(defun pcomplete/erc-mode/IDLE ()
+  (while (pcomplete-here (pcomplete-erc-nicks))))
+
 (defun pcomplete/erc-mode/KICK ()
   (pcomplete-here (pcomplete-erc-channels))
   (pcomplete-here (pcomplete-erc-nicks)))
 
 (require 'erc)
 
-(defconst erc-replace-version "$Revision$"
+(defconst erc-replace-version "Revision: 1.5"
   "Revision of the ERC replace module.")
 
 (defcustom erc-replace-alist nil
 (require 'comint)
 (require 'ring)
 
-(defvar erc-ring-version "$Revision$"
+(defvar erc-ring-version "Revision: 1.11"
   "ERC ring revision")
 
 ;;;###autoload (autoload 'erc-ring-mode "erc-ring" nil t)
 (require 'erc)
 (require 'erc-compat)
 
-(defconst erc-stamp-version "$Revision$"
+(defconst erc-stamp-version "Revision: 1.30"
   "ERC stamp mode revision.")
 
 (defgroup erc-stamp nil
 
 ;;; Code:
 
-(defconst erc-track-version "$Revision$"
+(defconst erc-track-version "Revision: 1.58"
   "ERC track mode revision")
 
 (defgroup erc-track nil
   "Track active buffers and show activity in the modeline.")
 
+(defcustom erc-track-visibility t
+  "Where do we look for buffers to determine their visibility?
+The value of this variable determines, when a buffer is considered
+visible or invisible.  New messages in invisible buffers are tracked,
+while switching to visible buffers when they are tracked removes them
+from the list.  See also `erc-track-when-inactive-mode'.
+
+Possible values are:
+
+t                - all frames
+visible          - all visible frames
+nil              - only the selected frame
+selected-visible - only the selected frame if it is visible
+
+Activity means that there was no user input in the last 10 seconds."
+  :group 'erc-track
+  :type  '(choice (const :tag "All frames" t)
+		  (const :tag "All visible frames" visible)
+		  (const :tag "Only the selected frame" nil)
+		  (const :tag "Only the selected frame if it was active" active)))
+
 (defcustom erc-track-exclude nil
   "A list targets (channel names or query targets) which should not be tracked."
   :group 'erc-track
   "*List of message types to be ignored.
 This list could look like '(\"JOIN\" \"PART\")."
   :group 'erc-track
-  :type '(repeat string))
+  :type 'erc-message-type)
 
 (defcustom erc-track-shorten-start 1
   "This number specifies the minimum number of characters a channel name in
    (if (featurep 'xemacs)
        (defadvice switch-to-buffer (after erc-update (&rest args) activate)
          (erc-modified-channels-update))
-     (add-hook 'window-configuration-change-hook
-               'erc-modified-channels-update))
-   (add-hook 'erc-insert-post-hook
-	     'erc-track-modified-channels))
+     (add-hook 'window-configuration-change-hook 'erc-modified-channels-update))
+   (add-hook 'erc-insert-post-hook 'erc-track-modified-channels))
   ((setq global-mode-string
 	 (delq 'erc-modified-channels-string global-mode-string))
-   (remove-hook 'erc-insert-post-hook
-		'erc-track-modified-channels)
    (if (featurep 'xemacs)
        (ad-disable-advice 'switch-to-buffer 'after 'erc-update)
-     (remove-hook 'window-configuration-change-hook
-                  'erc-modified-channels-update))))
+     (remove-hook 'window-configuration-change-hook 'erc-modified-channels-update))
+   (remove-hook 'erc-insert-post-hook 'erc-track-modified-channels)))
+
+;;;###autoload (autoload 'erc-track-when-inactive-mode "erc-track" nil t)
+(define-erc-module track-when-inactive nil
+  "This mode enables channel tracking even for visible buffers,
+if you are inactivity."
+  ((if (featurep 'xemacs)
+       (defadvice switch-to-buffer (after erc-update-when-inactive (&rest args) activate)
+         (erc-user-is-active))
+     (add-hook 'window-configuration-change-hook 'erc-user-is-active))
+   (add-hook 'erc-send-completed-hook 'erc-user-is-active)
+   (add-hook 'erc-server-001-hook 'erc-user-is-active))
+  ((setq global-mode-string
+	 (delq 'erc-modified-channels-string global-mode-string))
+   (if (featurep 'xemacs)
+       (ad-disable-advice 'switch-to-buffer 'after 'erc-update-when-inactive)
+     (remove-hook 'window-configuration-change-hook 'erc-user-is-active))
+   (remove-hook 'erc-send-completed-hook 'erc-user-is-active)
+   (remove-hook 'erc-server-001-hook 'erc-user-is-active)
+   (remove-hook 'erc-timer-hook 'erc-user-is-active)))
+
+;;; Visibility
+
+(defvar erc-buffer-activity nil
+  "Last time the user sent something.")
+
+(defvar erc-buffer-activity-timeout 10
+  "How many seconds of inactivity by the user
+to consider when `erc-track-visibility' is set to
+only consider active buffers visible.")
+
+(defun erc-user-is-active (&rest ignore)
+  "Set `erc-buffer-activity'."
+  (setq erc-buffer-activity (erc-current-time))
+  (erc-track-modified-channels))
+
+(defun erc-buffer-visible (buffer)
+  "Return non-nil when the buffer is visible."
+  (if erc-track-when-inactive-mode
+      (when erc-buffer-activity; could be nil
+	(and (get-buffer-window buffer erc-track-visibility)
+	     (<= (erc-time-diff erc-buffer-activity (erc-current-time))
+		 erc-buffer-activity-timeout)))
+    (get-buffer-window buffer erc-track-visibility)))
 
 ;;; Tracking the channel modifications
 
 		(let ((buffer (car elt)))
 		  (when (or (not (bufferp buffer))
 			    (not (buffer-live-p buffer))
-			    (get-buffer-window buffer t))
+			    (erc-buffer-visible buffer))
 		    (erc-modified-channels-remove-buffer buffer))))
 	      erc-modified-channels-alist)
-      (erc-modified-channels-display))))
+      (erc-modified-channels-display)
+      (force-mode-line-update t))))
 
 (defun erc-make-mode-line-buffer-name (string buffer &optional faces count)
   "Return STRING as a button that switches to BUFFER when clicked.
 			     (car short-names)
 			     (car buffers)
 			     (car faces)
-                 (car counts))
+			     (car counts))
 			    strings)
 	      short-names (cdr short-names)
 	      buffers (cdr buffers)
-          counts (cdr counts)
+	      counts (cdr counts)
 	      faces (cdr faces)))
       (setq erc-modified-channels-string
 	    (concat "[" (mapconcat 'identity (nreverse strings) ",") "] ")))))
 channel.  Assumes it will only be called when current-buffer
 is in `erc-mode'."
   (let ((this-channel (erc-default-target)))
-    (if (and (not (get-buffer-window (current-buffer) t))
+    (if (and (not (erc-buffer-visible (current-buffer)))
 	     (not (member this-channel erc-track-exclude))
 	     (not (erc-message-type-member
 		   (or (erc-find-parsed-property)
 	  (erc-modified-channels-display))
       ;; Else if the active buffer is the current buffer, remove it
       ;; from our list.
-      (when (or (get-buffer-window (current-buffer) t)
+      (when (or (erc-buffer-visible (current-buffer))
 		(and this-channel
 		     (assq (current-buffer) erc-modified-channels-alist)
 		     (member this-channel erc-track-exclude)))
 ;; * http://sf.net/projects/erc/
 ;; * http://www.emacswiki.org/cgi-bin/wiki.pl?EmacsIRCClient
 
-;; Jul-26-2001. erc.el is now in CVS on SourceForge. I invite everyone
+;; Jul-26-2001. erc.el is now in CVS on SourceForge.  I invite everyone
 ;; who wants to hack it to contact me <mlang@delysid.org> in order to
 ;; get write access on the CVS.
 
 (require 'thingatpt)
 (require 'erc-compat)
 
-(defconst erc-version-string "Version 4.0 $Revision$"
+(defconst erc-version-string "Version 4.0 Revision: 1.608"
   "ERC version.  This is used by function `erc-version'.")
 
-(defvar erc-official-location "http://erc.sf.net (comments mailto://mlang@delysid.org)"
+(defvar erc-official-location
+  "http://erc.sf.net (comments mailto://mlang@delysid.org)"
   "Location of the ERC client on the Internet.")
 
 (defgroup erc nil
   "ERC password to use in authentication (not necessary).")
 
 (defcustom erc-user-mode nil
-  "The initial user modes for this server to be set after the connection to
-the server is complete."
+  "Initial user modes to be set after a connection is established."
   :group 'erc
   :type '(choice (const nil) string function))
 
   :type 'boolean)
 
 (defcustom erc-hide-prompt nil
-  "If non-nil, the prompt will not appear in the ERC buffer for commands (i.e.,
-input starting with a '/')."
+  "If non-nil, do not display the prompt for commands.
+
+\(A command is any input starting with a '/').
+
+See also the variables `erc-prompt' and `erc-command-indicator'."
   :group 'erc
   :type 'boolean)
 
 ;; tunable GUI stuff
 
 (defcustom erc-show-my-nick t
-  "If this is non-nil, your nickname will be shown like \"<your-nick> \"
-when you send a message.
-If this is set to nil, only \"> \" will be shown."
+  "If non-nil, display one's own nickname when sending a message.
+
+If non-nil, \"<nickname>\" will be shown.
+If nil, only \"> \" will be shown."
   :group 'erc
   :type 'boolean)
 
+(define-widget 'erc-message-type 'set
+  "A set of standard IRC Message types."
+  :args '((const "JOIN")
+	  (const "KICK")
+	  (const "NICK")
+	  (const "PART")
+	  (const "QUIT")
+	  (repeat :tag "Others" (string :tag "IRC Message Type"))))
+
 (defcustom erc-hide-list nil
   "*List of IRC type messages to hide.
 A typical value would be '(\"JOIN\" \"PART\" \"QUIT\")."
   :group 'erc
-  :type '(set (const "JOIN") (const "KICK") (const "NICK") (const "PART")
-	      (const "QUIT")
-	      (repeat :tag "Others" (string :tag "IRC Message Type"))))
+  :type 'erc-message-type)
 
 (defvar erc-session-server nil
   "The server name used to connect to for this session.")
 
 (defvar erc-server-parameters nil
 
-  "An alist which gets set if the server sends 005 messages saying what is
-supported on the server.  Entries are of the form '(PARAMETER . VALUE) or
-'(PARAMETER) if no value is provided.
+  "Alist listing the supported server parameters.
+
+This is only set if the server sends 005 messages saying what is
+supported on the server.
+
+Entries are of the form:
+  (PARAMETER . VALUE)
+or
+  (PARAMETER) if no value is provided.
 
 Some examples of possible parameters sent by servers:
 CHANMODES=b,k,l,imnpst - list of supported channel modes
 (make-variable-buffer-local 'erc-server-parameters)
 
 (defvar erc-connected nil
-  "Non-nil when an ERC buffer is associated with an open IRC connection.  This
-variable is local to each ERC buffer.")
+  "Non-nil if the `current-buffer' is associated with an open IRC connection.
+This variable is buffer-local.")
 
 (defvar channel-members nil
   "An alist of people seen on this channel (in this buffer).
 Only used in channel buffers.  It's a list of user info entries
  '(NICK OP VOICE HOST USER FULL-NAME ...)
 Only nick and op predicate must be present, other fields are not
-required.")
+required.
+OP and VOICE are non-nil if this mode is set for this user, nil
+otherwise.")
 (make-variable-buffer-local 'channel-members)
 
 (defvar channel-topic nil
 (make-variable-buffer-local 'erc-insert-marker)
 
 (defun erc-string-no-properties (string)
+  "Return a copy of STRING will all text-properties removed."
   (let ((newstring (copy-sequence string)))
     (set-text-properties 0 (length newstring) nil newstring)
     newstring))
   :type '(choice string function))
 
 (defun erc-prompt ()
+  "Return the input prompt as a string.
+
+See also the variable `erc-prompt'."
   (let ((prompt (if (functionp erc-prompt)
 		    (funcall erc-prompt)
 		  erc-prompt)))
       prompt)))
 
 (defcustom erc-command-indicator nil
-  "Prompt used by ERC for showing commands.
+  "Indicator used by ERC for showing commands.
+
 If non-nil, this will be used in the ERC buffer to indicate
-commands (i.e., input starting with a '/'), instead of using
-`erc-prompt'."
+commands (i.e., input starting with a '/').
+
+If nil, the prompt will be constructed from the variable `erc-prompt'."
   :group 'erc
   :type '(choice string function))
 
 (defun erc-command-indicator ()
+  "Return the command indicator prompt as a string.
+
+This only has any meaning if the variable `erc-command-indicator' is non-nil."
   (and erc-command-indicator
        (let ((prompt (if (functionp erc-command-indicator)
 			 (funcall erc-command-indicator)
 	     (concat prompt " ")
 	     prompt))))
 
-; Hmm, is this useful at all. If so, we would need to do it better, because
-; one looses nickname completion when turning this variable on.
-(defcustom erc-prompt-interactive-input nil
-  "*If non-nil, input can be typed in the minibuffer instead.
-This uses a local-map text-property to detect you started typing
-at the prompt, and copies the last key as initial input into the minibuffer.
-Obsolete as of 1.348."
-  :group 'erc
-  :type 'boolean)
-(make-obsolete-variable
- 'erc-prompt-interactive-input
- "Input in the minibuffer is deprecated now because it breaks some stuff, e.g. nick completion")
+;; ; Hmm, is this useful at all. If so, we would need to do it better, because
+;; ; one looses nickname completion when turning this variable on.
+;; Removed -- Lawrence 2004-01-08
+;; (defcustom erc-prompt-interactive-input nil
+;;   "*If non-nil, input can be typed in the minibuffer instead.
+;; This uses a local-map text-property to detect you started typing
+;; at the prompt, and copies the last key as initial input into the minibuffer.
+;; Obsolete as of 1.348."
+;;   :group 'erc
+;;   :type 'boolean)
+;; (make-obsolete-variable 'erc-prompt-interactive-input "Input in the
+;;  minibuffer is deprecated now because it breaks some stuff,
+;;  e.g. nick completion")
 
 (defcustom erc-notice-prefix "*** "
   "*Prefix for all notices."
 		 (const :tag "don't highlight notices at all" nil)))
 
 (defcustom erc-echo-notices-in-minibuffer-flag t
-  "*If non-nil, erc will echo arriving notices from IRC in the
-minibuffer."
+  "*Non-nil means that NOTICEs from IRC will be echoed in the minibuffer."
   :group 'erc
   :type 'boolean)
 
   :type 'boolean)
 
 (defcustom erc-auto-reconnect t
-  "If non-nil, ERC will attempt to automatically reconnect to a server after
-an unexpected disconnection."
+  "Non-nil means that ERC will attempt to restablish broken connections.
+
+Reconnection will happen automatically for any unexpected disconnection."
   :group 'erc
   :type 'boolean)
 
 
 (defcustom erc-ignore-list nil
   "*List of regexps matching user identifiers to ignore.
-A user identifier has the form \"nick!login@host\".  If an id matches,
-the message from the person will not be processed."
+
+A user identifier has the form \"nick!login@host\".  If an
+identifier matches, the message from the person will not be
+processed."
   :group 'erc
   :type '(repeat regexp))
 
 (make-variable-buffer-local 'erc-ignore-list)
 
 (defcustom erc-ignore-reply-list nil
-  "*List of regexps matching user identifiers to ignore as well as
-to ignore any talk directed to them. A user identifier has the form
-\"nick!login@host\". If an id matches, or a message addressed a nick whose
-id matches, the message will not be processed.
-CAVEAT: ERC doesn't know about the user and host of anyone who was already
-in the channel when you joined, but never said anything, so it won't be
-able to match the user and host of those people. You can update the ERC
-internal info using /WHO *."
+  "*List of regexps matching user identifiers to ignore completely.
+
+This differs from `erc-ignore-list' in that it also ignores any
+messages directed at the user.
+
+A user identifier has the form \"nick!login@host\".
+
+If an identifier matches, or a message is addressed to a nick
+whose identifier matches, the message will not be processed.
+
+CAVEAT: ERC doesn't know about the user and host of anyone who
+was already in the channel when you joined, but never said
+anything, so it won't be able to match the user and host of those
+people. You can update the ERC internal info using /WHO *."
   :group 'erc
   :type '(repeat regexp))
 
   :type 'boolean)
 
 (defcustom erc-quit-reason-various-alist nil
-  "Alist of possible arguments to the /quit command and what should happen
-as a result.  For example:
+  "Alist of possible arguments to the /quit command.
+
+Each element has the form:
+  (REGEXP RESULT)
+
+If REGEXP matches the argument to /quit, then its relevant RESULT
+will be used.  RESULT may be either a string, or a function.  If
+a function, it should return the quit message as a string.
+
+If no elements match, then the empty string is used.
+
+As an example:
   (setq erc-quit-reason-various-alist
       '((\"zippy\" erc-quit-reason-zippy)
 	(\"xmms\" dme:now-playing)
 	(\"home\" \"Gone home !\")
 	(\"\" \"Default Reason\")))
 If the user types \"/quit zippy\", then a Zippy the Pinhead quotation
-will be used as the quit message.  The car of each element should be
-a regexp.  If none match, the string is inserted directly."
+will be used as the quit message."
   :group 'erc
   :type '(repeat (list regexp (choice (string) (function)))))
 
 (defcustom erc-part-reason-various-alist nil
-  "Alist of possible arguments to the /PART command and what should happen
-as a result.  For example:
+  "Alist of possible arguments to the /part command.
+
+Each element has the form:
+  (REGEXP RESULT)
+
+If REGEXP matches the argument to /part, then its relevant RESULT
+will be used.  RESULT may be either a string, or a function.  If
+a function, it should return the part message as a string.
+
+If no elements match, then the empty string is used.
+
+As an example:
   (setq erc-part-reason-various-alist
       '((\"zippy\" erc-part-reason-zippy)
 	(\"xmms\" dme:now-playing)
 	(\"home\" \"Gone home !\")
 	(\"\" \"Default Reason\")))
 If the user types \"/part zippy\", then a Zippy the Pinhead quotation
-will be used as the part message.  The car of each element should be
-a regexp.  If none match, the string is inserted directly."
+will be used as the part message."
   :group 'erc
   :type '(repeat (list regexp (choice (string) (function)))))
 
 (defcustom erc-quit-reason 'erc-quit-reason-normal
-  "A function which returns the reason for quitting.  Passed a single
-argument, which is the string typed by the user after \"/quit\"."
+  "*A function which returns the reason for quitting.
+
+The function is passed a single argument, the string typed by the
+user after \"/quit\"."
   :group 'erc
   :type '(choice (const erc-quit-reason-normal)
 		 (const erc-quit-reason-zippy)
 		 (symbol)))
 
 (defcustom erc-part-reason 'erc-part-reason-normal
-  "A function which returns the reason for parting a channel.  Passed a single
-argument, which is the string typed by the user after \"/PART\"."
+  "A function which returns the reason for parting a channel.
+
+The function is passed a single argument, the string typed by the
+user after \"/PART\"."
   :group 'erc
   :type '(choice (const erc-part-reason-normal)
 		 (const erc-part-reason-zippy)
     (list (byte-compile
 	   (lambda (str)
 	     (emacspeak-auditory-icon 'select-object)))))
-  "Hook called after a message has successfully been sent to the
-server.  The single argument to the functions is the unmodified string
+  "Hook called after a message is successfully sent to the server.
+
+The single argument to the functions is the unmodified string
 which the local user typed."
   :group 'erc-hooks
   :type 'hook)
   :type 'hook)
 
 (defvar erc-quit-hook nil
-  "Run this hook with argument (PROCESS) when processing a quit command
-directed to our nick.
+  "Hook run when processing a quit command directed at our nick.
+
+The hook receives one argument, the current PROCESS.
 See also `erc-server-QUIT-hook' and `erc-disconnected-hook'.")
 
 (defvar erc-part-hook nil
-  "Run this hook with argument (BUFFER) when processing a PART message
-directed to our nick.
+  "Hook run when processing a PART message directed at our nick.
+
+The hook receives one argument, the current BUFFER.
 See also `erc-server-QUIT-hook', `erc-quit-hook' and
 `erc-disconnected-hook'.")
 
 (defvar erc-connect-pre-hook '(erc-initialize-log-marker)
-  "These functions get called right before `erc' calls the `erc-connect' function.
+  "Hook called just before `erc' calls `erc-connect'.
 Functions are run in the buffer-to-be.")
 
 (defvar erc-process nil
-  "This variable holds the process object of the corresponding server connection.")
+  "The process object of the corresponding server connection.")
 (make-variable-buffer-local 'erc-process)
 
 ;; mode-specific tables
 (defvar erc-dbuf nil)
 (make-variable-buffer-local 'erc-dbuf)
 
-(defmacro define-erc-module (name alias doc enable-body disable-body)
+(defmacro define-erc-module (name alias doc enable-body disable-body
+			     &optional local-p)
   "Define a new minor mode using ERC conventions.
 Symbol NAME is the name of the module.
 Symbol ALIAS is the alias to use, or nil.
 DOC is the documentation string to use for the minor mode.
 ENABLE-BODY is a list of expressions used to enable the mode.
 DISABLE-BODY is a list of expressions used to disable the mode.
+If LOCAL-P is non-nil, the mode will be created as a buffer-local
+mode.  Rather than a global one.
 
 This will define a minor mode called erc-NAME-mode, possibly
 an alias erc-ALIAS-mode, as well as the helper functions
 With arg, turn ERC %S mode on if and only if arg is positive.
 %s" name name doc)
 	nil nil nil
-	:global t :group (quote ,group)
+	:global ,(not local-p) :group (quote ,group)
 	(if ,mode
 	    (,enable)
 	  (,disable)))
 
 
 (defun erc-once-with-server-event (event &rest forms)
-  "Execute FORMS the next time EVENT occurs in current buffer.  This function
-temporarilly adds a functon to EVENT's hook to execute FORMS.  After FORMS are
-run, the function is removed from EVENT's hook.  The last expression of FORMS
-should be either nil or t.  nil indicates that the other functions on EVENT's
-hook should be run too, and t indicates that other functions should not be run.
-Please be sure to use this function in server-buffers.  In channel-buffers it
-may not work at all, as it uses the LOCAL argument of `add-hook' and
-`remove-hook' to ensure multiserver capabilities."
+  "Execute FORMS the next time EVENT occurs in the `current-buffer'.
+
+You should make sure that `current-buffer' is a server buffer.
+
+This function temporarily adds a functon to EVENT's hook to
+execute FORMS.  After FORMS are run, the function is removed from
+EVENT's hook.  The last expression of FORMS should be either nil
+or t.  nil indicates that the other functions on EVENT's hook
+should be run too, and t indicates that other functions should
+not be run.
+
+Please be sure to use this function in server-buffers.  In
+channel-buffers it may not work at all, as it uses the LOCAL
+argument of `add-hook' and `remove-hook' to ensure multiserver
+capabilities."
+  (unless (erc-server-buffer-p)
+    (error
+     "You should only run `erc-once-with-server-event' in a server buffer"))
   (let ((fun (gensym))
 	(hook (erc-event-to-hook event)))
      (put fun 'erc-original-buffer (current-buffer))
 		    (remove-hook ',hook ',fun t))
 		  (fmakunbound ',fun)
 		  ,@forms))
-     (add-hook hook fun nil t)))
+     (add-hook hook fun nil t)
+     fun))
+
+(defun erc-once-with-server-event-global (event &rest forms)
+  "Execute FORMS the next time EVENT occurs in any server buffer.
+
+This function temporarily prepends a functon to EVENT's hook to
+execute FORMS.  After FORMS are run, the function is removed from
+EVENT's hook.  The last expression of FORMS should be either nil
+or t.  nil indicates that the other functions on EVENT's hook
+should be run too, and t indicates that other functions should
+not be run.
+
+When FORMS execute, the current buffer is the server buffer associated with the
+connection over which the data was received that triggered EVENT."
+  (let ((fun (gensym))
+	(hook (erc-event-to-hook event)))
+     (fset fun `(lambda (proc parsed)
+		  (remove-hook ',hook ',fun)
+		  (fmakunbound ',fun)
+		  ,@forms))
+     (add-hook hook fun nil nil)
+     fun))
 
 (defmacro erc-log (string)
   "Logs STRING if logging is on (see `erc-log-p')."
      (erc-log-aux ,string)))
 
 (defun erc-server-buffer ()
-  "Return the buffer object of the server buffer related to the current-buffer.
-The buffer local variable `erc-process' is used to find the process buffer."
+  "Return the server buffer for the current buffer's process.
+The buffer-local variable `erc-process' is used to find the process buffer."
   (and (boundp 'erc-process)
        (processp erc-process)
        (process-buffer erc-process)))
 
 (defun erc-server-buffer-p (&optional buffer)
-  (let ((argbuf (if buffer (get-buffer buffer))))
-    (eq (if (bufferp argbuf) argbuf (current-buffer))
-	(erc-server-buffer))))
+  "Return non-nil if argument BUFFER is an ERC server buffer.
+
+If BUFFER is nil, the current buffer is used."
+  (with-current-buffer (or buffer (current-buffer))
+    (and (eq major-mode 'erc-mode)
+	 (null (erc-default-target)))))
+
+(defun erc-query-buffer-p (&optional buffer)
+  "Return non-nil if BUFFER is an ERC query buffer.
+If BUFFER is nil, the current buffer is used."
+  (with-current-buffer (or buffer (current-buffer))
+    (let ((target (erc-default-target)))
+      (and (eq major-mode 'erc-mode)
+	   target
+	   (not (memq (aref target 0) '(?# ?& ?+ ?!)))))))
 
 (defun erc-ison-p (nick)
-  "Predicate function which can be used to check if a certain nick is online."
+  "Return non-nil if NICK is online."
   (interactive "sNick: ")
   (with-current-buffer (erc-server-buffer)
     (let ((erc-online-p 'unknown))
 			       name))
 			   ; This fallback should infact never happen
 			   "*erc-server-buffer*"))))
+    ;; Reuse existing buffers, but not if the buffer is a connected server
+    ;; buffer and not if its associated with a different server than the
+    ;; current ERC buffer.
     (if (and erc-reuse-buffers
 	     (get-buffer buf-name)
+	     (or target
+		 (with-current-buffer (get-buffer buf-name)
+		   (and (erc-server-buffer-p)
+			(not erc-connected))))
 	     (with-current-buffer (get-buffer buf-name)
 	       (and (string= erc-session-server server)
 		    (erc-port-equal erc-session-port port))))
       (generate-new-buffer-name buf-name))))
 
 (defun erc-get-buffer-create (server port target &optional proc)
-  "Creates a new buffer based on the arguments."
+  "Create a new buffer based on the arguments."
   (get-buffer-create (erc-generate-new-buffer-name server port target proc)))
 
 (defun erc-downcase (string)
     s))
 
 (defun erc-member-ignore-case (string list)
-  "Just like member-ignore-case, except the IRC protocol case rules are used
-instead of those of ASCII."
+  "Return non-nil if STRING is a member of LIST.
+
+All strings are compared according to IRC protocol case rules, see
+`erc-downcase'."
   (setq string (erc-downcase string))
   (catch 'result
     (while list
 	  (throw 'result list) (setq list (cdr list))))))
 
 (defmacro erc-with-buffer (spec &rest body)
-  "Execute the forms in BODY with the TARGET associated with PROC as
-the current buffer.  If PROC is not specified, the current
-process is used.  The value returned is the value of the last
-form in BODY.
+  "Execute BODY in the buffer associated with SPEC.
+
+SPEC should have the form
+
+ (TARGET [PROCESS])
+
+The buffer used is the buffer associated with TARGET.
+If PROCESS is not specified, the current process is used.
+
 See also `with-current-buffer' and `erc-get-buffer'.
 
-\(fn (TARGET [PROC]) BODY...)"
+\(fn (TARGET [PROCESS]) BODY...)"
   (list 'let* (list (list 'target (car spec))
                     (list 'proc (cadr spec))
                     '(proc (or proc (and (boundp 'erc-process)
   (erc-buffer-filter predicate proc))
 
 (defmacro erc-with-all-buffers-of-server (process pred &rest forms)
-  "Run FORMS in all buffers which have same process as this server.
+  "Execute FORMS in all buffers which have same process as this server.
 FORMS will be evaluated in all buffers having the process PROCESS and
 where PRED matches or in all buffers of the server process if PRED is
 nil."
 
 (defun erc-channel-list (proc)
   "Return a list of channel buffers.
-PROC is the process for the server connection. If PROC is nil, return
+PROC is the process for the server connection.  If PROC is nil, return
 all channel buffers on all servers."
   (erc-buffer-filter
    (lambda ()
   (erc-buffer-filter
    (lambda ()
      (and (erc-default-target)
+	  ;; FIXME: should this be commented out?  If so, why?  --
+	  ;; Lawrence 2004-01-11
 ;	  (erc-channel-p (erc-default-target))
 	  (boundp 'channel-members)
 	  (find-if (lambda (n)
    proc))
 
 (defun erc-network-name ()
-  "Returns the name of the network that the current buffer is associated with,
-or nil if the current buffer has no associated ERC server buffer.  Not every
-server sends the 005 messages that enable the network name to be known.  If the
-network name is not known, the name of the IRC server is returned.  This
-function attempts to guess the network name based on the server name."
+  "Return the name of the network that the current buffer is associated with.
+If the current buffer has no associated ERC server buffer, return nil.
+
+Not every server sends the 005 messages that enable the network
+name to be known.  If the network name is not known, the name of
+the IRC server is returned.  This function attempts to guess the
+network name based on the server name."
   (let ((serverbuf (erc-server-buffer)))
     (if (buffer-live-p serverbuf)
 	(with-current-buffer serverbuf
 	  (let ((network-name (cdr (assoc "NETWORK" erc-server-parameters))))
 	    (if network-name
 		network-name
-
-	      ;; We need to synthesize the network name because the server didn't
-	      ;; tell us what it was.
+	      ;; We need to synthesize the network name because the server
+	      ;; didn't tell us what it was.
 	      (let* ((serverbuf-name (buffer-name))
-		     (servername (if (string-match "^\\([^:]+\\)" serverbuf-name)
+		     (servername (if (string-match "^\\([^:]+\\)"
+						   serverbuf-name)
 				     (match-string 1 serverbuf-name)
 				   serverbuf-name))
 		     (case-fold-search t))
 		   ((string-match "\\bfreenode\\.net$" servername)
 		    "freenode")
 		   ;; Add more guess clauses here...
-		   (t servername))))))))) 
+		   ;; FIXME: we should really make this matching as a variable
+                   ;; -- Lawrence 2004-01-08
+		   (t servername)))))))))
 		
 
 ;; Some local variables
 (defcustom erc-modules '(netsplit fill track completion ring button autojoin)
   "A list of modules which erc should enable.
 Use \\[customize-set-variable] to set this value, or remember to call
-\(erc-update-modules) after you change it. Removing entries from the list will
+\(erc-update-modules) after you change it.  Removing entries from the list will
 not cause them to be unloaded at this time."
   :set (lambda (sym val) (set-default sym val)
 	 ;; this test is for the case where erc hasn't been loaded yet
 ;; We use eval-after-load here to ensure recursive dependencies don't
 ;; break things. E.g. we might want to require erc-foo.el which uses
 ;; erc.el, so it should be loaded after this file is loaded.
-(eval-after-load "erc" '(erc-update-modules))
+(eval-after-load "erc" '(and
+			 ;; Make sure we finished loading erc.
+			 (featurep 'erc)
+			 (erc-update-modules)))
 
 (defun erc-update-modules ()
-  "Run this to enable erc-foo-mode for all modules in `erc-modules'"
+  "Run this to enable erc-foo-mode for all modules in `erc-modules'."
   (let (req)
     (dolist (mod erc-modules)
       (setq req (concat "erc-" (symbol-name mod)))
 (defun erc (&optional server port nick full-name
 		      connect passwd tgt-list channel process)
   "Run the Emacs Internet Relay Chat Client.
+
 Connect to SERVER on PORT as NICK with FULL-NAME If CONNECT is
-non-nil, connect to the server.  Otherwise assume already connected
-and just create a separate buffer for the new target CHANNEL.  Use
-PASSWD as user password on the server.  Returns the buffer for the
-given server or channel."
+non-nil, connect to the server.  Otherwise assume already
+connected and just create a separate buffer for the new target
+CHANNEL.  Use PASSWD as user password on the server.  If TGT-LIST
+is non-nil, use it to initialise `erc-default-recipiets'.
+
+Returns the buffer for the given server or channel."
   (let ((announced-server-name (when (and (boundp 'erc-session-server)
 					  (string= server erc-session-server)
 					  (boundp 'erc-announced-server-name))
 (defun erc-initialize-log-marker ()
   "Initialize the `erc-last-saved-position' marker to a sensible position."
     (setq erc-last-saved-position (make-marker))
-    (move-marker erc-last-saved-position (1- (marker-position erc-insert-marker))))
+    (move-marker erc-last-saved-position
+		 (1- (marker-position erc-insert-marker))))
 
 ;; interactive startup
 
     (nreverse l)))
 
 (defvar erc-debug-irc-protocol nil
-  "If non-nil, append all IRC protocol traffic to buffer *erc-protocol*.  The
-buffer is created if it doesn't exist.  BEWARE: If this variable is non-nil, and
-you kill the the only visible *erc-protocol* buffer, it will be recreated
-shortly, but you won't see it.
-
-WARNING: Do not set this variable directly!  Instead, call function
-erc-toggle-debug-irc-protocol to toggle its value.")
+  "If non-nil, log all IRC protocol traffic to the buffer \"*erc-protocol*\".
+
+The buffer is created if it doesn't exist.
+
+NOTE: If this variable is non-nil, and you kill the the only
+visible \"*erc-protocol*\" buffer, it will be recreated shortly,
+but you won't see it.
+
+WARNING: Do not set this variable directly!  Instead, use the
+function `erc-toggle-debug-irc-protocol' to toggle its value.")
 
 (defun erc-log-irc-protocol (string &optional outbound)
-  "If variable erc-debug-irc-protocol is non-nil, appends STRING to end of
-buffer *erc-protocol*.  The buffer is created if it doesn't exist.  If optional
-argument OUTBOUND is non-nil, STRING is being sent to the IRC server and appears
-in erc-input-face in the buffer."
+  "Append STRING to the buffer *erc-protocol*.
+
+This only has any effect if `erc-debug-irc-protocol' is non-nil.
+
+The buffer is created if it doesn't exist.
+
+If OUTBOUND is non-nil, STRING is being sent to the IRC server
+and appears in erc-input-face in the buffer."
   (when erc-debug-irc-protocol
     (with-current-buffer (get-buffer-create "*erc-protocol*")
       (save-excursion
 	(let ((inhibit-read-only t))
 	  (insert (if (not outbound)
 		      string
-		    (erc-propertize (concat ">>> " string
-					    (if (/= ?\n
-						    (aref string
-							  (1- (length string))))
-						"\n"))
-				    'face 'erc-input-face)))))
-
+		    (erc-propertize
+		     (concat ">>> " string
+			     (if (/= ?\n
+				     (aref string
+					   (1- (length string))))
+				 "\n"))
+		     'face 'erc-input-face)))))
       (let ((orig-win (selected-window))
 	    (debug-buffer-window (get-buffer-window (current-buffer) t)))
 	(when debug-buffer-window
 	    (recenter -1))
 	  (select-window orig-win))))))
 
-(defun erc-toggle-debug-irc-protocol ()
-  "Toggle the value of variable erc-debug-irc-protocol, which controls the
-logging of raw IRC protocol traffic.  Interactively, a prefix of C-u pops up
-the protocol logging buffer."
-  (interactive)
+(defun erc-toggle-debug-irc-protocol (&optional arg)
+  "Toggle the value of `erc-debug-irc-protocol'.
+
+If ARG is non-nil, show the *erc-protocol* buffer."
+  (interactive "P")
   (let* ((buf (get-buffer-create "*erc-protocol*")))
     (with-current-buffer buf
       (view-mode 1)
       (when (null (current-local-map))
 	(use-local-map (make-sparse-keymap))
-	(local-set-key [return] 'erc-toggle-debug-irc-protocol))
-      (add-hook 'kill-buffer-hook #'(lambda () (setq erc-debug-irc-protocol nil)) nil 'local)
+	(local-set-key (kbd "RET") 'erc-toggle-debug-irc-protocol))
+      (add-hook 'kill-buffer-hook
+		#'(lambda () (setq erc-debug-irc-protocol nil))
+		nil 'local)
       (goto-char (point-max))
       (let ((inhibit-read-only t))
-	(insert (erc-make-notice (format "IRC protocol logging %s at %s\n"
-					 (if erc-debug-irc-protocol "disabled" "enabled")
-					 (current-time-string))))))
+	(insert (erc-make-notice
+		 (format "IRC protocol logging %s at %s\n"
+			 (if erc-debug-irc-protocol "disabled" "enabled")
+			 (current-time-string))))))
     (setq erc-debug-irc-protocol (not erc-debug-irc-protocol))
-    (if (not (get-buffer-window "*erc-protocol*" t))
+    (if (and arg
+	     (not (get-buffer-window "*erc-protocol*" t)))
 	(display-buffer buf t))
     (message "IRC protocol traffic logging %s (see buffer *erc-protocol*)."
 	     (if erc-debug-irc-protocol "enabled" "disabled"))))
 		   (when exceeded
 		     (message "Warning: flood exceeded, but send forced")
 		     (erc-log-aux
-		      (format "ERC FLOOD PROTECT: flood exceeded, but send forced on %S\n" l)))
+		      (format (concat "ERC FLOOD PROTECT: flood exceeded,"
+				      " but send forced on %S\n")
+			      l)))
 		   (erc-log-irc-protocol l 'outbound)
 		   (process-send-string
 		    erc-process
     (erc-decode-coding-string str coding)))
 
 (defun erc-split-command (line)
-  "Returns a list of commands if `line' is too big. Otherwise line is returned
-in a sole-element list. An error will be raised if the line is too big and it
-doesn't make sense to split this type of command"
+  "Split LINE into manageable chunks.
+
+LINE is split so that no single command is longer than 510 bytes (the max
+length of a command according to the the IRC RFC).
+
+LINE is returned as a list of strings.
+
+Signals an error if the line is too long and it doesn't make
+sense to split it."
   (let ((splittable "^\\(PRIVMSG\\|NOTICE\\)")
 	;; IRC RFC says max 510 for the whole command, which means
 	;; :nick!user@host COMMAND args :arg
+	;; FIXME: We ought to calculate the length of :nick!user@host --
+	;; Lawrence 2004-01-08
 	;; So we're forced to go with a conservative estimate
 	(maxlen 450)
 	preamble lines div curline ctcpp)
     lines))
 
 (defun erc-send-ctcp-message (tgt l &optional force)
-  "Send CTCP message L to TGT. If TGT is nil the message is not sent.
-The command must contain neither prefix nor trailing `\\n'"
+  "Send CTCP message L to TGT.
+
+If TGT is nil the message is not sent.
+The command must contain neither a prefix nor a trailing `\\n'.
+
+See also `erc-send-command'."
   (cond
    (tgt
     (erc-log (format "erc-send-CTCP-message: [%s] %s" tgt l))
     (erc-send-command (format "PRIVMSG %s :\C-a%s\C-a" tgt l) force))))
 
 (defun erc-send-ctcp-notice (tgt l &optional force)
-  "Send CTCP notice L to TGT. If TGT is nil the message is not sent.
-The command must contain neither prefix nor trailing `\\n'"
+  "Send CTCP notice L to TGT.
+
+If TGT is nil the message is not sent.
+The command must contain neither a prefix nor a trailing `\\n'.
+
+See also `erc-send-command'."
   (cond
    (tgt
     (erc-log (format "erc-send-CTCP-notice: [%s] %s" tgt l))
 			       erc-cmd-SM
 			       erc-cmd-SMV
 			       erc-cmd-LASTLOG)
-  "List of commands that are just aliases for CTCP ACTION or for erc messages.  If a
-command's function symbol is in this list, the typed command does not appear in the
-ERC buffer after the user presses ENTER.")
+  "List of commands that are aliases for CTCP ACTION or for erc messages.
+
+If a command's function symbol is in this list, the typed command
+does not appear in the ERC buffer after the user presses ENTER.")
 
 ;; Display interface
 
 	(unless (string-match "\n$" string)
 	  (setq string (concat string "\n"))
 	  (when (erc-string-invisible-p string)
-	    (erc-put-text-properties 0 (length string) string '(invisible intangible))))
+	    (erc-put-text-properties 0 (length string) string
+				     '(invisible intangible))))
 	(erc-log (concat "erc-display-line: " string
 			   (format "(%S)" string) " in buffer "
 			   (format "%s" buffer)))
 	(setq erc-insert-this t)
 	(run-hook-with-args 'erc-insert-pre-hook string)
 	(if (null erc-insert-this)
-	    ;; Leave erc-insert-this set to t as much as possible.  Fran Litterio <franl>
-	    ;; has seen erc-insert-this set to nil while erc-send-pre-hook is running, which
-	    ;; should never happen.  This may cure it.
+	    ;; Leave erc-insert-this set to t as much as possible.  Fran
+	    ;; Litterio <franl> has seen erc-insert-this set to nil while
+	    ;; erc-send-pre-hook is running, which should never happen.  This
+	    ;; may cure it.
 	    (setq erc-insert-this t)
 	  (save-excursion ;; to restore point in the new buffer
 	    (goto-char insert-position)
        (string-match (concat "^" erc-valid-nick-regexp "$") nick)))
 
 (defun erc-scroll-to-bottom (window display-start)
-  "This is added to `window-scroll-functions' by erc-add-scroll-to-bottom."
+  "Recenter WINDOW so that `point' is on the last line.
+
+This is added to `window-scroll-functions' by `erc-add-scroll-to-bottom'.
+
+DISPLAY-START is ignored."
   (if (and window (window-live-p window))
       ;; Temporarilly bind resize-mini-windows to nil so that users who have it
       ;; set to a non-nil value will not suffer from premature minibuffer
 	    (widen)
 	    (when (> (point) erc-insert-marker) ; we're editing a line. Scroll.
 	      (save-excursion
-		(recenter -1)	    ; antifuchs removed (goto-char (point-max)),
-					;		 as it messed up redisplay.
+		;; antifuchs removed (goto-char
+		;; (point-max)), as it messed up redisplay.
+		(recenter -1)
 		(sit-for 0))))))))
 
 (defun erc-add-scroll-to-bottom ()
 	(erc-display-line-1 string (current-buffer))))))
 
 (defun erc-display-message-highlight (type string)
+  "Highlight STRING according to TYPE.
+
+See also `erc-make-notice' and `erc-highlight-error'."
   (cond
    ((eq type 'notice)
     (erc-make-notice string))
    ((eq type 'error)
-    (erc-highlight-error string))))
+    (erc-highlight-error string))
+   ;; FIXME: Do we want to deal with the fall-through case in a sensible
+   ;; manner?  -- Lawrence 2004-01-08
+   (t (error "This should never be reached"))))
 
 (defun erc-display-message (parsed type buffer msg &rest args)
+  "Display MSG in BUFFER.
+
+ARGS, PARSED, and TYPE are used to format MSG sensibly.
+
+See also `erc-format-message' and `erc-display-line'."
   (let ((string (if (symbolp msg)
 		    (apply 'erc-format-message msg args)
 		  msg)))
     (when (vectorp parsed)
       (erc-put-text-property 0 (length string) 'erc-parsed parsed string)
       (erc-put-text-property 0 (length string) 'rear-sticky t string))
-    (erc-display-line
-     string buffer)))
+    (erc-display-line string buffer)))
 
 (defun erc-message-type-member (position list)
-  "Test if the text at POSITION is one of the message types
-passed in by LIST.
+  "Return non-nil if the erc-parsed text-property at POSITION is in LIST.
+
 This function relies on the erc-parsed text-property being
 present."
   (let ((prop-val (get-text-property position 'erc-parsed)))
  (defvar erc-send-input-line-function 'erc-send-input-line))
 
 (defun erc-send-input-line (target line &optional force)
+  "Send LINE to TARGET.
+
+See also `erc-send-command'."
   (erc-send-command (format "PRIVMSG %s :%s" target line) force target))
 
 ;; if we're in emacs21 CVS, we use help-function-arglist which is more
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (defun erc-cmd-AMSG (line)
-  "Sends the specifed message to all channels which you are currently
-on this server."
+  "Send LINE to all channels of the current server that you are on."
   (interactive "sSend to all channels you're on: ")
   (setq line (erc-trim-string line))
   (erc-with-all-buffers-of-server nil
 (put 'erc-cmd-AMSG 'do-not-parse-args t)
 
 (defun erc-cmd-SAY (line)
-  "Send line to the current query or channel as a message, not a command. Use
-this when you want to send a message with a leading '/'. Note that since
-multi-line messages are never a command, you don't need this when pasting
-multiple lines of text."
+  "Send LINE to the current query or channel as a message, not a command.
+
+Use this when you want to send a message with a leading '/'.  Note
+that since multi-line messages are never a command, you don't
+need this when pasting multiple lines of text."
   (if (string-match "^\\s-*$" line)
       nil
     (erc-process-input-line line nil t)))
 
 (defun erc-cmd-SET (line)
   "Set the variable named by the first word in LINE to some VALUE.
-VALUE is computed by evaluating the rest of LINE in lisp."
+VALUE is computed by evaluating the rest of LINE in Lisp."
   (cond
    ((string-match "^\\s-*\\(\\S-+\\)\\s-+\\(.*\\)$" line)
     (let ((var (read (concat "erc-" (match-string 1 line))))
 (put 'erc-cmd-SET 'do-not-parse-args t)
 
 (defun erc-cmd-default (line)
-  "Fallback command.  Commands for which no erc-cmd-xxx exists, are
-tunneled through this function.	 LINE is sent to the server verbatim,
-and therefore has to contain the command itself as well."
+  "Fallback command.
+
+Commands for which no erc-cmd-xxx exists, are tunnelled through
+this function.  LINE is sent to the server verbatim, and
+therefore has to contain the command itself as well."
   (erc-log (format "cmd: DEFAULT: %s" line))
   (erc-send-command (substring line 1))
   t)
 
 (defun erc-cmd-IGNORE (&optional user)
-  "Ignore USER. This should be a regexp matching nick!user@host.
+  "Ignore USER.  This should be a regexp matching nick!user@host.
 If no USER argument is specified, list the contents of `erc-ignore-list'."
   (if user
       (progn
 	(erc-display-line
 	 (erc-make-notice (format "Now ignoring %s" user))
 	 'active)
-	(with-current-buffer (erc-server-buffer) (add-to-list 'erc-ignore-list user)))
+	(with-current-buffer (erc-server-buffer)
+	  (add-to-list 'erc-ignore-list user)))
     (if (null (with-current-buffer (erc-server-buffer) erc-ignore-list))
 	(erc-display-line (erc-make-notice "Ignore list is empty") 'active)
       (erc-display-line (erc-make-notice "Ignore list:") 'active)
   (recenter 0)
   t)
 
-(defun erc-cmd-COUNTRY (country)
-  "Display the country name of COUNTRY, the trailing portion of a hostname,
-with no dot."
+(defun erc-cmd-OPS ()
+  "Show the ops in the current channel."
+  (let ((ops (mapcar '(lambda (nickinfo) (if (car (cdr nickinfo))
+					     (car nickinfo)))
+		     channel-members)))
+    (setq ops (sort (delete nil ops) 'string-lessp))
+    (setq ops (if ops
+		  (format "%d operator%s: %s" (length ops)
+			  (if (> (length ops) 1) "s" "")
+			  (mapconcat 'identity ops " "))
+		"No operators in this channel."))
+    (erc-display-line (erc-make-notice ops) (current-buffer)))
+  t)
+
+(defun erc-cmd-COUNTRY (tld)
+  "Display the country associated with the top level domain TLD."
   (require 'mail-extr)
-  (let ((co (ignore-errors (what-domain country))))
+  (let ((co (ignore-errors (what-domain tld))))
     (erc-display-message
      nil 'notice 'active
      (or co (concat country ": No such domain")))
 
 (defun erc-cmd-CTCP (nick cmd &rest args)
   "Send a Client To Client Protocol message to NICK.
+
 CMD is the CTCP command, possible values being ECHO, FINGER, CLIENTINFO, TIME,
-VERSION and so on."
-  (let ((str (concat cmd " " (mapconcat #'identity args " "))))
+VERSION and so on.  It is called with ARGS."
+  (let ((str (concat cmd
+		     (when args
+		       (concat " " (mapconcat #'identity args " "))))))
     (erc-log (format "cmd: CTCP [%s]: [%s]" nick str))
     (erc-send-ctcp-message nick str)
     t))
 
 (defun erc-cmd-HELP (&optional func)
   "Popup help information.
-If LINE contains a valid function or variable, help about that will be displayed.
-If LINE is empty, display an apropos about erc commands.
-Otherwise, do apropos in erc-namespace (\"erc-.*LINE\".
+
+If FUNC contains a valid function or variable, help about that
+will be displayed.  If FUNC is empty, display an apropos about
+erc commands.  Otherwise, do apropos in the erc namespace
+\(\"erc-.*LINE\"\).
 
 Examples:
 To find out about erc and bbdb, do
   /help whois
 
 For a list of user commands (/join /part, ...):
-  /help
-"
+  /help."
   (if func
-    (let* ((sym (or (let ((sym (intern-soft func)))
+    (let* ((sym (or (let ((sym (intern-soft
+				(concat "erc-cmd-" (upcase func)))))
+		      (if (and sym (or (boundp sym) (fboundp sym)))
+			  sym
+			nil))
+		    (let ((sym (intern-soft func)))
 		      (if (and sym (or (boundp sym) (fboundp sym)))
 			  sym
 			nil))
 		    (let ((sym (intern-soft (concat "erc-" func))))
 		      (if (and sym (or (boundp sym) (fboundp sym)))
 			  sym
-			nil))
-		    (let ((sym (intern-soft (concat "erc-cmd-" (upcase func)))))
-		      (if (and sym (or (boundp sym) (fboundp sym)))
-			  sym
 			nil)))))