Commit ff59d266 authored by Miles Bader's avatar Miles Bader

Release ERC 5.2.

I have updated the version of ERC to 5.2, since it fixes a bug with C-c
C-SPC being bound globally by default.  For the full list of changes in
this version, see etc/ERC-NEWS.

Creator:  Michael Olson <>
parent 25c8c159
2007-04-01 Michael Olson <>
* ERC-NEWS: Update for the ERC 5.2 release. Most of these entries
were for previously-committed changes.
2007-03-31 Michael Albinus <>
* PROBLEMS: Remove Tramp problem; it has been fixed.
......@@ -3,8 +3,7 @@ ERC NEWS -*- outline -*-
Copyright (C) 2006, 2007 Free Software Foundation, Inc.
See the end of the file for license conditions.
* Changes in ERC 5.2 (stable pre-release for Emacs 22)
* Changes in ERC 5.2
** M-x erc RET now starts ERC.
`erc-select' has been changed to `erc'. `erc-select' still remains as
......@@ -12,37 +11,173 @@ an alias of `erc'. Likewise, `erc-select-ssl' has been renamed to
`erc-ssl' with `erc-select-ssl' as its alias. The function that was
known as `erc' is now `erc-open'.
** Open query buffers by default when private messages are received.
The default value of `erc-auto-query' has been changed to 'bury.
** New command: /RECONNECT
This command tries to reconnect to the current IRC server exactly
once. It does not work in server buffers (throws an error before the
command is run), but works in query and channel buffers.
** In MS-DOS environments, look for _ercrc.el rather than .ercrc.el.
** Fix buggy interaction with multi-tty Emacs.
** After running /QUIT, make sure that the IRC process is killed within
4 seconds. Freenode, in particular, needs this at times.
** If the IRC process has not responded to our PINGs within a certain
time, kill it and restart the connection. See
`erc-server-auto-reconnect', `erc-server-reconnect-attempts',
`erc-server-reconnect-timeout', `erc-server-send-ping-interval', and
`erc-server-send-ping-timeout' to fine-tune ERC's behavior.
** Avoid getting into an infinite connection loop.
Previously, this could happen if your nick was banned, you were using
Tor, incorrect information was entered, or the connection was bad.
** Make ban messages less confusing.
** Restore the point correctly when reconnecting to an IRC server.
** Make /IGNORE and /UNIGNORE prompt to determine whether their
argument is a user or a regexp. This results in less-confusing
behavior when trying to ignore someone who has a bracket in their
** Make the default port "6667" rather than "ircd", because some
operating systems don't know what port "ircd" maps to.
** Fix several bugs in erc-iswitchb (C-c C-b).
** Clean up internal documentation.
Special thanks go to Juanma Barranquero for the thorough vetting of
ERC's internal documentation.
** Display a more informative message when a module is not found.
** Fix a bug where paths were being colored like IRC commands.
** In the customize interface for `erc-modules', add the name of the module.
This makes it easier to find modules by name.
** erc-server-send-ping-interval: Change to use a default of 30 seconds.
** Some files which are included with the release of ERC 5.2 will not
appear in the version of ERC that is bundled with Emacs 22. These
extras files may be found at:
o, or
** Renamed files
Several files were renamed so as to make them distinct to users of the
MS-DOS operating system.
o erc-autojoin.el -> erc-join.el
o erc-complete.el -> erc-hecomplete.el
o erc-nickserv.el -> erc-services.el
o ChangeLog.NNNN -> ChangeLog.NN
** Header line changes
*** Remove "[IRC]" from the header line.
*** Add the %l format character to `erc-header-line-format',
*** Document how to remove the header line.
Namely: (setq erc-header-line-format nil).
** New options
*** erc-server-reconnect-attempts: Determines the number of
reconnection attempts that ERC will make per server.
*** erc-server-reconnect-timeout: New option that determines the
amount of time, in seconds, that ERC will wait between successive
reconnect attempts.
*** erc-server-reconnect-timeout: Determines the amount of time,
in seconds, that ERC will wait between successive reconnect attempts.
*** erc-server-send-ping-timeout: Determines when to consider a connection
stalled and restart it. The default is after 120 seconds.
*** erc-system-name: Determines the system name to use when logging in.
The default is to figure this out by calling `system-name'.
** New face: `erc-my-nick-face'
This helps make it easier to distinguish messages sent by yourself
from messages sent by other users when the value of the variable
`erc-show-my-nick' is non-nil.
** Namespace changes
*** New macro: `erc-with-server-buffer'
Switches to the current ERC server buffer and runs some code. If no
server buffer is available, return nil. This is a useful way to
access variables in the server buffer.
*** New function: `erc-open-server-buffer-p'
Returns non-nil if the given buffer is an ERC server buffer that has
an open IRC process.
*** New function: `erc-format-lag-time'
Returns the estimated lag time to server, `erc-server-lag'.
*** Renamed items
o `erc-server-setup-periodical-server-ping' is now
o `erc-away-p' is now `erc-away-time'
** Changes to the ERC manual
*** New section: Sample Session.
Describes a sample ERC session for connecting to the #emacs channel on
Freenode. Also mention the #erc channel.
*** New section: Special Features.
Describes some of the special features of ERC.
*** Getting Started: Mention ~/.emacs.d/.ercrc.el and the Customize
*** Development: Mention ErcDevelopment page on
*** Tips and Tricks: Remove empty section for now.
*** Options: Mention how to see available ERC options.
*** Sample Configuration: Add an example of how to configure ERC.
** New modules
*** Autoaway (erc-autoaway.el)
**** Make this much more reliable.
**** Avoid duplicate messages when coming back from being away.
**** Fix bug where autoaway was enabled just by loading the file.
*** BBDB (erc-bbdb.el)
**** Display information on how to cancel merging of info or how to
create a new John Doe record.
**** Make it so that information from /whois continues to come in, even
while prompting for a record to merge.
**** Make hitting C-g correctly abort merging the record.
*** Capab identify (erc-capab.el)
Mark users who haven't identified to NickServ on servers supporting
** Changes and additions to modules
*** Channel lists (erc-list.el)
*** Button (erc-button.el)
**** This has been removed from Emacs 22, since a major contributor
to it has not yet assigned changes.
**** Make <backtab> go to the previous button.
*** Channel tracking (erc-track.el)
......@@ -50,6 +185,103 @@ to it has not yet assigned changes.
This helps people using a mouse know that they are buttons and can be
clicked on.
**** Fix issue where C-c C-SPC could conflict with user-defined keybindings.
This is accomplished by moving these bindings to their own global
minor mode. Now the default is to check whether the user has bound
something to C-c C-SPC or C-c C-@. If they have, prompt them about
whether to really override that binding. This also has the effect of
preventing ERC from clobbering rcirc's keybinding, unless this is
desired. See `erc-track-enable-keybindings' for more details.
**** New option: erc-track-enable-keybindings.
Determine whether or not to enable the C-c C-SPC and C-c C-@
keybindings. The default is to ask whether to do this if a binding to
these keys already exists. It can also be set to t or nil to always
bind or never bind, respectively.
**** Remove `track-when-inactive' module.
See `erc-track-when-inactive' for further details.
**** New option: erc-track-when-inactive.
This option replaces the track-when-inactive module. Set it to
non-nil to track activity even in visible buffers when inactive. The
default is nil.
**** Remove the `track-modified-channels' alias for the `track' module.
*** DCC support (erc-dcc.el)
**** Add Usage section to Commentary.
**** Fix a bug in the server message output.
*** Filling (erc-fill.el)
**** Fix bug involving messages that start with one or more blank lines.
*** Identd (erc-identd.el)
**** New option `erc-identd-port'
Specifies the port to use if none is given as an argument to
`erc-identd-start'. This is placed in the new customization group
**** New function: `erc-identd-quickstart'
Ignores any arguments and calls `erc-identd-start'.
*** Channel lists (erc-list.el)
**** Enable by default, except in the version of ERC bundled with Emacs 22.
*** Logging (erc-log.el)
**** Make sure filenames are safe to use before writing to them.
**** Save all log buffers when exiting Emacs.
**** erc-generate-log-file-name-function: Add option for
`erc-generate-log-file-name-network', which is a new function that
uses the network name rather than the server name when possible.
*** Menu (erc-menu.el)
**** Name the menu "ERC" instead of "IRC" to avoid confusion with rcirc
and other clients.
**** Make this into a proper module and load it by default.
**** Add "Current channel" submenu.
*** Networks (erc-networks.el)
**** Add support for Ars OpenIRC, LinuxChix, and OFTC networks.
**** Escape periods in Konfido.Net and Kewl.Org.
*** Internet services / Nickserv (erc-nickserv.el)
**** Add new 'both method for the `erc-nickserv-identify-mode' option
and make it the default. This tries to do the right thing both when a
known nickserv message exists for an IRC network, and when it does
**** Support nickserv authentication on OFTC, Azzurra, Ars, and QuakeNet.
**** Support authentication on BitlBee.
**** Make source code easier to understand by using accessor functions.
*** Sound support (erc-sound.el)
**** Make this work with both Emacs 21 and Emacs 22.
*** Timestamps (erc-stamp.el)
**** Exclude the newline from the erc-timestamp field.
**** New function: `erc-toggle-timestamps'.
Toggles display of timestamps.
* Changes in ERC 5.1.4
** Make find-function and find-variable work in Emacs 22 for
......@@ -156,6 +388,10 @@ to make the BBDB buffer electric. This defaults to not electric.
**** Don't create an extra buffer for the identd process.
*** Channel lists (erc-list.el)
**** Enable by default, except in the version of ERC bundled with Emacs 22.
*** Logging (erc-log.el)
**** By default, don't insert old logs when opening an ERC buffer.
This diff is collapsed.
This diff is collapsed.
......@@ -40,6 +40,49 @@ yourself back when you type something."
"The Emacs idletimer.
This is only used when `erc-autoaway-idle-method' is set to 'emacs.")
(defvar erc-autoaway-last-sent-time (erc-current-time)
"The last time the user sent something.")
(defvar erc-autoaway-caused-away nil
"Indicates whether this module was responsible for setting the
user's away status.")
(eval-when-compile (defvar erc-autoaway-idle-seconds))
(defun erc-autoaway-reestablish-idletimer ()
"Reestablish the Emacs idletimer.
If `erc-autoaway-idle-method' is 'emacs, you must call this
function each time you change `erc-autoaway-idle-seconds'."
(when erc-autoaway-idletimer
(erc-cancel-timer erc-autoaway-idletimer))
(setq erc-autoaway-idletimer
(run-with-idle-timer erc-autoaway-idle-seconds
(defun erc-autoaway-some-server-buffer ()
"Return some ERC server buffer if its connection is alive.
If none is found, return nil."
(car (erc-buffer-list #'erc-open-server-buffer-p)))
(defun erc-autoaway-insinuate-maybe (&optional server &rest ignored)
"Add autoaway reset function to `post-command-hook' if at least one
ERC process is alive.
This is used when `erc-autoaway-idle-method' is 'user."
(when (or server (erc-autoaway-some-server-buffer))
(add-hook 'post-command-hook 'erc-autoaway-reset-idle-user)))
(defun erc-autoaway-remove-maybe (&rest ignored)
"Remove the autoaway reset function from `post-command-hook' if
no ERC process is alive.
This is used when `erc-autoaway-idle-method' is 'user."
(unless (erc-autoaway-some-server-buffer)
(remove-hook 'post-command-hook 'erc-autoaway-reset-idle-user)))
;;;###autoload (autoload 'erc-autoaway-mode "erc-autoaway")
(define-erc-module autoaway nil
"In ERC autoaway mode, you can be set away automatically.
......@@ -65,24 +108,31 @@ set you no longer away.
Related variables: `erc-public-away-p' and `erc-away-nickname'."
;; Enable:
((when (boundp 'erc-autoaway-idle-method)
(add-hook 'erc-connect-pre-hook 'erc-autoaway-reset-indicators)
(setq erc-autoaway-last-sent-time (erc-current-time))
((eq erc-autoaway-idle-method 'irc)
(add-hook 'erc-send-completed-hook 'erc-autoaway-reset-idle-irc)
(add-hook 'erc-server-001-functions 'erc-autoaway-reset-idle-irc))
((eq erc-autoaway-idle-method 'user)
(add-hook 'post-command-hook 'erc-autoaway-reset-idle-user))
(add-hook 'erc-after-connect 'erc-autoaway-insinuate-maybe)
(add-hook 'erc-disconnected-hook 'erc-autoaway-remove-maybe)
((eq erc-autoaway-idle-method 'emacs)
(add-hook 'erc-timer-hook 'erc-autoaway-possibly-set-away)
(add-hook 'erc-server-305-functions 'erc-autoaway-reset-indicators)))
;; Disable:
((when (boundp 'erc-autoaway-idle-method)
(remove-hook 'erc-connect-pre-hook 'erc-autoaway-reset-indicators)
((eq erc-autoaway-idle-method 'irc)
(remove-hook 'erc-send-completed-hook 'erc-autoaway-reset-idle-irc)
(remove-hook 'erc-server-001-functions 'erc-autoaway-reset-idle-irc))
((eq erc-autoaway-idle-method 'user)
(remove-hook 'post-command-hook 'erc-autoaway-reset-idle-user))
(remove-hook 'post-command-hook 'erc-autoaway-reset-idle-user)
(remove-hook 'erc-after-connect 'erc-autoaway-insinuate-maybe)
(remove-hook 'erc-disconnected-hook 'erc-autoaway-remove-maybe))
((eq erc-autoaway-idle-method 'emacs)
(erc-cancel-timer erc-autoaway-idletimer)
(setq erc-autoaway-idletimer nil)))
......@@ -104,9 +154,12 @@ definitions of being idle."
(const :tag "Emacs idle time" emacs)
(const :tag "Last IRC action" irc))
:set (lambda (sym val)
(set-default sym val)
(if erc-autoaway-mode
(set sym val)
(set sym val))))
(defcustom erc-auto-set-away t
"*If non-nil, set away after `erc-autoaway-idle-seconds' seconds of idling.
......@@ -133,21 +186,6 @@ See `erc-auto-discard-away'."
:group 'erc-autoaway
:type 'regexp)
(eval-when-compile (defvar erc-autoaway-idle-seconds))
(defun erc-autoaway-reestablish-idletimer ()
"Reestablish the Emacs idletimer.
If `erc-autoaway-idle-method' is 'emacs, you must call this
function each time you change `erc-autoaway-idle-seconds'."
(when erc-autoaway-idletimer
(erc-cancel-timer erc-autoaway-idletimer))
(setq erc-autoaway-idletimer
(run-with-idle-timer erc-autoaway-idle-seconds
(defcustom erc-autoaway-idle-seconds 1800
"*Number of seconds after which ERC will set you automatically away.
If you are changing this variable using lisp instead of customizing it,
......@@ -167,19 +205,12 @@ in seconds."
:group 'erc-autoaway
:type 'string)
(defvar erc-autoaway-last-sent-time (erc-current-time)
"The last time the user sent something.")
(defvar erc-autoaway-caused-away nil
"Indicates whether this module was responsible for setting the
user's away status.")
(defun erc-autoaway-reset-idle-user (&rest stuff)
"Reset the stored user idle time.
This is one global variable since a user talking on one net can
talk on another net too."
(when erc-auto-discard-away
(erc-autoaway-set-back #'erc-autoaway-remove-maybe))
(setq erc-autoaway-last-sent-time (erc-current-time)))
(defun erc-autoaway-reset-idle-irc (line &rest stuff)
......@@ -192,12 +223,24 @@ talk on another net too."
(setq erc-autoaway-last-sent-time (erc-current-time)))
(defun erc-autoaway-set-back ()
"Discard the away state globally."
(let ((server-buffer (car (erc-buffer-list #'erc-server-buffer-p))))
(when (and erc-autoaway-caused-away
(with-current-buffer server-buffer (erc-away-p)))
(erc-cmd-GAWAY ""))))
(defun erc-autoaway-set-back (&optional none-alive-func)
"Discard the away state globally.
NONE-ALIVE-FUNC is the function to call if no ERC processes are alive."
(let ((server-buffer (erc-autoaway-some-server-buffer)))
(if (and erc-autoaway-caused-away
(buffer-live-p server-buffer)
(with-current-buffer server-buffer erc-away))
(erc-cmd-GAWAY "")
(when none-alive-func (funcall none-alive-func)))))
(defun erc-autoaway-some-open-server-buffer ()
"Return some ERC server buffer if its connection is alive and the
user is not away.
If none is found, return nil."
(car (erc-buffer-list (lambda ()
(and (erc-open-server-buffer-p)
(not erc-away))))))
(defun erc-autoaway-possibly-set-away (current-time)
"Set autoaway when `erc-auto-set-away' is true and the idletime is
......@@ -207,7 +250,7 @@ exceeds `erc-autoaway-idle-seconds'."
;; whenever the server sends something to the client.
(when (and erc-auto-set-away
(not erc-autoaway-caused-away)
(not (erc-away-p)))
(let ((idle-time (erc-time-diff erc-autoaway-last-sent-time
(when (>= idle-time erc-autoaway-idle-seconds)
......@@ -215,15 +258,17 @@ exceeds `erc-autoaway-idle-seconds'."
nil 'notice nil
(format "Setting automatically away after %i seconds of idle-time"
(erc-autoaway-set-away idle-time)))))
(erc-autoaway-set-away idle-time t)))))
(defun erc-autoaway-set-away (idle-time &optional notest)
"Set the away state globally.
(defun erc-autoaway-set-away (idle-time)
"Set the away state globally."
If NOTEST is specified, do not check to see whether there is an
activer server buffer available."
;; Note that the idle timer runs, even when Emacs is inactive. In
;; order to prevent flooding when we connect, we test for an
;; existing process.
(when (and (erc-server-process-alive)
(not (erc-away-p)))
(when (or notest (erc-autoaway-some-open-server-buffer))
(setq erc-autoaway-caused-away t)
(erc-cmd-GAWAY (format erc-autoaway-message idle-time))))
......@@ -174,9 +174,15 @@ WALLCHOPS - supports sending messages to all operators in a channel")
;;; Server and connection state
(defvar erc-server-ping-timer-alist nil
"Mapping of server buffers to their specific ping timer.")
(defvar erc-server-connected nil
"Non-nil if the `current-buffer' is associated with an open IRC connection.
This variable is buffer-local.")
"Non-nil if the current buffer has been used by ERC to establish
an IRC connection.
If you wish to determine whether an IRC connection is currently
active, use the `erc-server-process-alive' function instead.")
(make-variable-buffer-local 'erc-server-connected)
(defvar erc-server-reconnect-count 0
......@@ -187,10 +193,23 @@ This variable is buffer-local.")
"Non-nil if the user requests a quit.")
(make-variable-buffer-local 'erc-server-quitting)
(defvar erc-server-reconnecting nil
"Non-nil if the user requests an explicit reconnect, and the
current IRC process is still alive.")
(make-variable-buffer-local 'erc-server-reconnecting)
(defvar erc-server-timed-out nil
"Non-nil if the IRC server failed to respond to a ping.")
(make-variable-buffer-local 'erc-server-timed-out)
(defvar erc-server-banned nil
"Non-nil if the user is denied access because of a server ban.")
(make-variable-buffer-local 'erc-server-banned)
(defvar erc-server-error-occurred nil
"Non-nil if the user triggers some server error.")
(make-variable-buffer-local 'erc-server-error-occurred)
(defvar erc-server-lines-sent nil
"Line counter.")
(make-variable-buffer-local 'erc-server-lines-sent)
......@@ -210,6 +229,11 @@ This is useful for flood protection.")
This is useful for flood protection.")
(make-variable-buffer-local 'erc-server-last-ping-time)
(defvar erc-server-last-received-time nil
"Time the last message was received from the server.
This is useful for detecting hung connections.")
(make-variable-buffer-local 'erc-server-last-received-time)
(defvar erc-server-lag nil
"Calculated server lag time in seconds.
This variable is only set in a server buffer.")
......@@ -387,11 +411,24 @@ protection algorithm."
;; Ping handling
(defcustom erc-server-send-ping-interval 90
(defcustom erc-server-send-ping-interval 30
"*Interval of sending pings to the server, in seconds.
If this is set to nil, pinging the server is disabled."
:group 'erc-server
:type '(choice (const nil) (integer :tag "Seconds")))
:type '(choice (const :tag "Disabled" nil)
(integer :tag "Seconds")))
(defcustom erc-server-send-ping-timeout 120
"*If the time between ping and response is greater than this, reconnect.
The time is in seconds.
This must be greater than or equal to the value for
If this is set to nil, never try to reconnect."
:group 'erc-server
:type '(choice (const :tag "Disabled" nil)
(integer :tag "Seconds")))
(defvar erc-server-ping-handler nil
"This variable holds the periodic ping timer.")
......@@ -424,20 +461,40 @@ Currently this is called by `erc-send-input'."
(upcase-word 1)
(defun erc-server-setup-periodical-server-ping (&rest ignore)
"Set up a timer to periodically ping the current server."
(and erc-server-ping-handler (erc-cancel-timer erc-server-ping-handler))
(when erc-server-send-ping-interval
(setq erc-server-ping-handler
4 erc-server-send-ping-interval
(lambda (buf)
(when (buffer-live-p buf)
(with-current-buffer buf
(format "PING %.0f"
(defun erc-server-send-ping (buf)
"Send a ping to the IRC server buffer in BUF.
Additionally, detect whether the IRC process has hung."
(if (buffer-live-p buf)
(with-current-buffer buf
(if (and erc-server-send-ping-timeout
(erc-time-diff (erc-current-time)
;; if the process is hung, kill it
(setq erc-server-timed-out t)
(delete-process erc-server-process))
(erc-server-send (format "PING %.0f" (erc-current-time)))))
;; remove timer if the server buffer has been killed
(let ((timer (assq buf erc-server-ping-timer-alist)))
(when timer
(erc-cancel-timer (cdr timer))
(setcdr timer nil)))))
(defun erc-server-setup-periodical-ping (buffer)
"Set up a timer to periodically ping the current server.
The current buffer is given by BUFFER."