Commit 0b6bb130 authored by Miles Bader's avatar Miles Bader
Browse files

Update for ERC 5.1.3.

Revision: emacs@sv.gnu.org/emacs--devo--0--patch-348
Creator:  Michael Olson <mwolson@gnu.org>
parent b9602867
2006-07-12 Michael Olson <mwolson@gnu.org>
* ERC-NEWS: Update for ERC 5.1.3.
2006-07-08 David Kastrup <dak@gnu.org>
* TODO: Suggest consolidation with user customization when the
......
......@@ -2,6 +2,116 @@ ERC NEWS -*- outline -*-
* Changes in ERC 5.2 (unreleased)
* Changes in ERC 5.1.3
** Fix use of /quote command with no initial whitespace.
** Make it possible to customize the colorization of the header line.
The `erc-header-line' face is used to color the header line.
The `erc-header-line-face-method' determines the method to use when
colorizing the header line.
** Add the new function `erc-handle-irc-url', which is a suitable
candidate to use for `url-irc-function'. This permits some
integration of url.el and ERC.
** Fix several errors that occur when server or channel buffers are killed
prematurely.
** Fix toggling of flood control.
** Match the patterns in `erc-encoding-coding-alist' as regexps,
instead of verbatim text. Also, match case-insensitively.
** The /SMV command has been removed, since we no longer have
meaningful module-specific version information.
** Fix a "(stringp nil)" error that can happen when doing /PART.
** Use a better example in the `erc-part-reason-various-alist'
documentation.
** When using `erc-quit-reason-various' and `erc-part-reason-various'
and no matches are found, default to using the ERC version string
rather than "nil".
** Add the `list' and `page' modules to the `erc-modules' customize
interface.
** Changes to the ERC manual
*** Update the list of available modules.
*** Revise information about releases and development.
*** Provide a simpler example in the "Getting Started" chapter.
*** Fully document how to connect to an IRC server in the new
"Connecting" chapter.
** Changes and additions to modules
*** Autoaway (erc-autoaway.el)
**** Rename the `erc-autoaway-use-emacs-idle' option to
`erc-autoaway-idle-method'.
**** Add support for autoaway based on user idle time.
This is now the default.
**** If you set the AWAY status yourself, erc-autoaway will not
interfere by un-setting AWAY prematurely.
**** If you are set away while visiting a non-ERC buffer,
erc-autoaway used to fail in bringing the user back. This is now
fixed.
*** BBDB (erc-bbdb.el)
**** Add new option `erc-bbdb-electric-p', which determines whether
to make the BBDB buffer electric. This defaults to not electric.
*** Button (erc-button.el)
**** Use <backtab> instead of <C-tab> for `erc-button-previous'.
*** Identd (erc-identd.el)
**** Fix a bug that involves starting the identd server.
**** Make this work with Emacs 22.
**** Provide a real ERC module named `identd'.
**** Don't create an extra buffer for the identd process.
*** Logging (erc-log.el)
**** By default, don't insert old logs when opening an ERC buffer.
This may be changed by customizing `erc-log-insert-log-on-open'.
**** New option `erc-log-write-after-send' determines whether the
log file will be written to after every sent message. The default is
not to do this.
**** New option `erc-log-write-after-insert' determines whether the
log file will be written to when new text is added to a logged ERC
buffer. The default is not to do this. With this option and the
previous option, logging should no longer slow down ERC as much.
**** Default to saving buffers and queries on quit.
This may be changed by customizing the `erc-save-buffer-on-quit' and
`erc-save-queries-on-quit' options, respectively.
**** Only perform logging when the `logging' module is added to
`erc-modules'. This prevents logging from being activated just by
loading the erc-log.el file, and makes logging act like other ERC
modules.
*** Programmable completion (erc-pcomplete.el)
**** Don't complete the user's current nickname.
* Changes in ERC 5.1.2
** Fix compiler errors in erc-autojoin.el and erc-dcc.el.
......
2006-07-12 Michael Olson <mwolson@gnu.org>
* erc-match.el (erc-log-matches): Bind inhibit-read-only rather
than call toggle-read-only.
* erc.el (erc-handle-irc-url): Move here from erc-goodies.el and
add autoload cookie.
2006-07-09 Michael Olson <mwolson@gnu.org>
* erc.el (erc-version-string): Release ERC 5.1.3.
* erc.texi: Update for the 5.1.3 release.
* erc-autoaway.el (erc-autoaway-set-back): Fix bug after returning
from being set automatically away and current buffer is not an ERC
buffer.
* erc-identd.el: Fix compiler error.
* erc.texi (Development): Use @subheading instead of @subsection.
(Advanced Usage): Add menu.
(Connecting): Fully document how to connect to an IRC server.
(Options, Tips and Tricks, Sample Configuration): New unwritten
sections.
* erc.el (erc-server, erc-port, erc-nick, erc-nick-uniquifier)
(erc-user-full-name, erc-password): Docfixes and customization
interface tweaks.
(erc-try-new-nick-p): Rename from
`erc-manual-set-nick-on-bad-nick-p' and invert meaning.
(erc-nickname-in-use): Use `erc-try-new-nick-p'. Check the length
of `erc-nick-uniquifier', in case someone wants multiple
characters.
(erc-compute-server, erc-compute-nick, erc-compute-full-name)
(erc-compute-port): Docfixes.
* erc-log.el (log): Move all add-hook calls here, rather than
executing them immediately, and also cause them to be un-hooked
when the module is removed.
(erc-save-buffer-on-part): Move next to
`erc-save-queries-on-quit'.
(erc-save-buffer-on-quit, erc-save-queries-on-quit): Default to t.
(erc-log-write-after-send, erc-log-write-after-insert): Default to
nil. This makes things fast, but reasonably failsafe, by default.
2006-07-08 Michael Olson <mwolson@gnu.org>
* erc-log.el (erc-log-insert-log-on-open): Make this nil by
default, since most IRC clients don't do this.
(erc-log-write-after-send): New option that determines whether the
log file will be written to after every sent message.
(erc-log-write-after-insert): New option that determines whether
the log file will be written to when new text is added to a logged
ERC buffer.
(log): Use the aforementioned options.
* erc.texi (Modules): Document the "completion" module.
* erc-pcomplete.el (pcomplete-erc-nicks): Make sure that we don't
have a nil element in the list when ignore-self is non-nil.
2006-07-05 Michael Olson <mwolson@gnu.org>
* erc.el (erc-modules): Add the `page' module to the list.
* erc.texi (Modules): Add entries for `list' and `page' modules.
Change "spell" to "spelling".
(History): Use past tense throughout.
2006-07-02 Michael Olson <mwolson@gnu.org>
* erc-backend.el (erc-call-hooks): Fix (stringp nil) error that
can happen when doing /PART.
* erc.el (erc-quit-reason-various-alist)
(erc-part-reason-various-alist): In the example, use "^$" as an
example, since "" matches anything.
(erc-quit-reason-various, erc-part-reason-various): If no argument
is given, and no matches are found, use our default reason instead
of "nil".
2006-06-30 Michael Olson <mwolson@gnu.org>
* erc.texi (Modules): Mention identd.
(Releases): Update mailing list address and download location.
(Development): Refactor. Provide updated directions for Arch.
Make URLs clickable.
(Keystroke Summary): Typo fix. Use more Texinfo syntax.
(Getting Started): Give simpler example. We do not need to
explicitly load every module.
(History): Update.
* erc.el (erc-version-modules): Remove, since we do not use this
function anymore.
(erc-latest-version, erc-ediff-latest-version): Remove, since this
was only useful back when ERC consisted of one file.
(erc-modules): Add line for identd.
(erc-get-channel-mode-from-keypress): Typo fix.
* erc-imenu.el: Remove unnecessary lines in header.
* erc-goodies.el (erc-handle-irc-url): Docfix.
* erc-identd.el: Define an ERC module for this.
(erc-identd-start): Don't create a process buffer if possible.
Otherwise, use conventional hidden names for process buffers.
2006-06-29 Michael Olson <mwolson@gnu.org>
* erc-backend.el (erc-coding-system-for-target): Match
case-insensitively. Use a pattern match instead of `assoc', as
per the documentation for `erc-encoding-coding-alist'.
* erc-track.el (erc-track-shorten-aggressively): Fix typo.
2006-06-27 Michael Olson <mwolson@gnu.org>
* erc.el: Update maintainer information and URLs.
2006-06-14 Michael Olson <mwolson@gnu.org>
* erc.el (erc-active-buffer): If the active buffer has been
deleted, default to the server buffer.
(erc-toggle-flood-control): When the user hits C-c C-f, make flood
control really toggle, not unconditionally turn off.
2006-06-12 Michael Olson <mwolson@gnu.org>
* NEWS: Add items since the 5.1.2 release.
* erc-autoaway.el (erc-autoaway-caused-away): New variable that
indicates whether the current away status was caused by this
module.
(erc-autoaway-set-back): Only set back if this module set the user
away.
(erc-autoaway-set-away): Update `erc-autoaway-caused-away'.
(erc-autoaway-reset-indicators): New function that resets some
indicators when the user is no longer away.
(autoaway): Add the above function to the 305 hook.
2006-06-05 Romain Francoise <romain@orebokech.com>
* erc.texi (History): Fix various typos.
2006-06-04 Michael Olson <mwolson@gnu.org>
* erc-autoaway.el (erc-autoaway-idle-method): Move after the
definition of the autoaway module.
(autoaway): Don't do anything if erc-autoaway-idle-method is
unbound. This prevents an error on startup.
2006-06-03 Michael Olson <mwolson@gnu.org>
* erc-autoaway.el: Thanks to Mark Plaksin for the ideas and patch.
(erc-autoaway-idle-method): Renamed from
`erc-autoaway-use-emacs-idle'. We have more than two choices for
how to do this, so it's best to make this take symbol values.
Improve documentation. Remove warning against Emacs idle-time;
the point is moot now that we get user idle time via a different
method. Make sure we disable and re-enable the module when
changing this value.
(autoaway): Conditionalize on the above option. If using the idle
timer or user idle methods, don't add anything to the
send-completed or server-001 hooks, since it is unnecessary.
(erc-autoaway-reestablish-idletimer, erc-autoaway-message):
Docfix.
(erc-autoaway-idle-seconds): Use erc-autoaway-idle-method.
(erc-autoaway-reset-idle-irc): Renamed from
`erc-autoaway-reset-idle'. Don't pass line to
`erc-autoaway-set-away', since it is not used.
(erc-autoaway-reset-idle-user): New function that resets the idle
state for user idle time.
(erc-autoaway-set-back): Remove line argument, since it is not
used.
2006-06-01 Michael Olson <mwolson@gnu.org>
* erc.el (erc-buffer-filter): Make sure all buffers returned from
this are live.
2006-05-01 Edward O'Connor <ted@oconnor.cx>
* erc-goodies.el: (erc-handle-irc-url): New function, suitable as
a value for `url-irc-function'.
2006-04-18 Diane Murray <disumu@x3y2z1.net>
* erc-pcomplete.el (pcomplete-erc-nicks): Added new optional
argument IGNORE-SELF. If this is non-nil, don't return the user's
current nickname. Doc fix.
(pcomplete/erc-mode/complete-command): Don't complete the current
nickname.
2006-04-05 Diane Murray <disumu@x3y2z1.net>
* erc.el (erc-cmd-SV): Removed the exclamation point. Show the
......
......@@ -40,19 +40,6 @@ yourself back when you type something."
"The Emacs idletimer.
This is only used when `erc-autoaway-use-emacs-idle' is non-nil.")
(defcustom erc-autoaway-use-emacs-idle nil
"*If non-nil, the idle time refers to idletime in Emacs.
If nil, the idle time refers to idletime on IRC only.
The time itself is specified by `erc-autoaway-idle-seconds'.
See `erc-autoaway-mode' for more information on the various
definitions of being idle.
Note that using Emacs idletime is currently broken for most versions,
since process activity (as happens all the time on IRC) makes Emacs
non-idle. Emacs idle-time and user idle-time are just not the same."
:group 'erc-autoaway
:type 'boolean)
;;;###autoload (autoload 'erc-autoaway-mode "erc-autoaway")
(define-erc-module autoaway nil
"In ERC autoaway mode, you can be set away automatically.
......@@ -61,35 +48,65 @@ the number of seconds specified in `erc-autoaway-idle-seconds'.
There are several kinds of being idle:
IRC idle time measures how long since you last sent something (see
`erc-autoaway-last-sent-time'). This is the default.
User idle time measures how long you have not been sending any
commands to Emacs. This is the default.
Emacs idle time measures how long Emacs has been idle. This is
currently not useful, since Emacs is non-idle when it handles
ping-pong with IRC servers. See `erc-autoaway-use-emacs-idle' for
more information.
ping-pong with IRC servers. See `erc-autoaway-idle-method'
for more information.
User idle time measures how long you have not been sending any
commands to Emacs, or to your system. Emacs currently provides no way
to measure user idle time.
IRC idle time measures how long since you last sent something (see
`erc-autoaway-last-sent-time').
If `erc-auto-discard-away' is set, then typing anything, will
set you no longer away.
Related variables: `erc-public-away-p' and `erc-away-nickname'."
;; Enable:
((add-hook 'erc-send-completed-hook 'erc-autoaway-reset-idletime)
(add-hook 'erc-server-001-functions 'erc-autoaway-reset-idletime)
(add-hook 'erc-timer-hook 'erc-autoaway-possibly-set-away)
(when erc-autoaway-use-emacs-idle
(erc-autoaway-reestablish-idletimer)))
((when (boundp 'erc-autoaway-idle-method)
(cond
((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))
((eq erc-autoaway-idle-method 'emacs)
(erc-autoaway-reestablish-idletimer)))
(add-hook 'erc-timer-hook 'erc-autoaway-possibly-set-away)
(add-hook 'erc-server-305-functions 'erc-autoaway-reset-indicators)))
;; Disable:
((remove-hook 'erc-send-completed-hook 'erc-autoaway-reset-idletime)
(remove-hook 'erc-server-001-functions 'erc-autoaway-reset-idletime)
(remove-hook 'erc-timer-hook 'erc-autoaway-possibly-set-away)
(when erc-autoaway-idletimer
(erc-cancel-timer erc-autoaway-idletimer)
(setq erc-autoaway-idletimer nil))))
((when (boundp 'erc-autoaway-idle-method)
(cond
((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))
((eq erc-autoaway-idle-method 'emacs)
(erc-cancel-timer erc-autoaway-idletimer)
(setq erc-autoaway-idletimer nil)))
(remove-hook 'erc-timer-hook 'erc-autoaway-possibly-set-away)
(remove-hook 'erc-server-305-functions 'erc-autoaway-reset-indicators))))
(defcustom erc-autoaway-idle-method 'user
"*The method used to determine how long you have been idle.
If 'user, the time of the last command sent to Emacs is used.
If 'emacs, the idle time in Emacs is used.
If 'irc, the time of the last IRC command is used.
The time itself is specified by `erc-autoaway-idle-seconds'.
See `erc-autoaway-mode' for more information on the various
definitions of being idle."
:group 'erc-autoaway
:type '(choice (const :tag "User idle time" user)
(const :tag "Emacs idle time" emacs)
(const :tag "Last IRC action" irc))
:set (lambda (sym val)
(erc-autoaway-disable)
(set-default sym val)
(erc-autoaway-enable)))
(defcustom erc-auto-set-away t
"*If non-nil, set away after `erc-autoaway-idle-seconds' seconds of idling.
......@@ -120,8 +137,8 @@ See `erc-auto-discard-away'."
(defun erc-autoaway-reestablish-idletimer ()
"Reestablish the emacs idletimer.
You have to call this function each time you change
`erc-autoaway-idle-seconds', if `erc-autoaway-use-emacs-idle' is set."
If `erc-autoaway-idle-method' is 'emacs, you must call this
function each time you change `erc-autoaway-idle-seconds'."
(interactive)
(when erc-autoaway-idletimer
(erc-cancel-timer erc-autoaway-idletimer))
......@@ -138,36 +155,49 @@ you have to run `erc-autoaway-reestablish-idletimer' afterwards."
:group 'erc-autoaway
:set (lambda (sym val)
(set-default sym val)
(when erc-autoaway-use-emacs-idle
(when (eq erc-autoaway-idle-method 'emacs)
(erc-autoaway-reestablish-idletimer)))
:type 'number)
(defcustom erc-autoaway-message
"I'm gone (autoaway after %i seconds of idletime)"
"*Message ERC will use when he sets you automatically away.
It is used as a `format' string with the argument of the idletime in
seconds."
"*Message ERC will use when setting you automatically away.
It is used as a `format' string with the argument of the idletime
in seconds."
:group 'erc-autoaway
:type 'string)
(defvar erc-autoaway-last-sent-time (erc-current-time)
"The last time the user sent something.")
(defun erc-autoaway-reset-idletime (line &rest stuff)
"Reset the stored idletime for the user.
This is one global variable since a user talking on one net can talk
on another net too."
(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))
(setq erc-autoaway-last-sent-time (erc-current-time)))
(defun erc-autoaway-reset-idle-irc (line &rest stuff)
"Reset the stored IRC idle time.
This is one global variable since a user talking on one net can
talk on another net too."
(when (and erc-auto-discard-away
(stringp line)
(not (string-match erc-autoaway-no-auto-discard-regexp line)))
(erc-autoaway-set-back line))
(erc-autoaway-set-back))
(setq erc-autoaway-last-sent-time (erc-current-time)))
(defun erc-autoaway-set-back (line)
(defun erc-autoaway-set-back ()
"Discard the away state globally."
(when (erc-away-p)
(setq erc-autoaway-last-sent-time (erc-current-time))
(erc-cmd-GAWAY "")))
(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-possibly-set-away (current-time)
"Set autoaway when `erc-auto-set-away' is true and the idletime is
......@@ -193,8 +223,14 @@ exceeds `erc-autoaway-idle-seconds'."
;; existing process.
(when (and (erc-server-process-alive)
(not (erc-away-p)))
(setq erc-autoaway-caused-away t)
(erc-cmd-GAWAY (format erc-autoaway-message idle-time))))
(defun erc-autoaway-reset-indicators (&rest stuff)
"Reset indicators used by the erc-autoaway module."
(setq erc-autoaway-last-sent-time (erc-current-time))
(setq erc-autoaway-caused-away nil))
(provide 'erc-autoaway)
;;; erc-autoaway.el ends here
......
......@@ -563,7 +563,11 @@ action."
"Return the coding system or cons cell appropriate for TARGET.
This is determined via `erc-encoding-coding-alist' or
`erc-server-coding-system'."
(or (cdr (assoc target erc-encoding-coding-alist))
(or (let ((case-fold-search t))
(catch 'match
(dolist (pat erc-encoding-coding-alist)
(when (string-match (car pat) target)
(throw 'match (cdr pat))))))
(and (functionp erc-server-coding-system)
(funcall erc-server-coding-system))
erc-server-coding-system))
......@@ -849,8 +853,10 @@ Finds hooks by looking in the `erc-server-responses' hashtable."
(let ((hook (or (erc-get-hook (erc-response.command message))
'erc-default-server-functions)))
(run-hook-with-args-until-success hook process message)
(with-current-buffer (erc-server-buffer)
(run-hook-with-args 'erc-timer-hook (erc-current-time)))))
(let ((server-buffer (erc-server-buffer)))
(when (buffer-live-p server-buffer)
(with-current-buffer server-buffer
(run-hook-with-args 'erc-timer-hook (erc-current-time)))))))
(add-hook 'erc-default-server-functions 'erc-handle-unknown-server-response)
......
......@@ -24,16 +24,32 @@
;;; Commentary:
;; You can have a local identd server (running on port 8113; I use DNAT
;; to bind 113->8113) if you add this to .emacs.el:
;; This module allows you to run a local identd server on port 8113.
;; You will need to set up DNAT to bind 113->8113, or use a proxy.
;; (add-hook 'erc-connect-pre-hook 'erc-identd-start)
;; (add-hook 'erc-disconnected-hook 'erc-identd-stop)
;; To use this module, add identd to `erc-modules' and run
;; `erc-update-modules'.
;; Here is an example /etc/inetd.conf rule that forwards identd
;; traffic to port 8113. You will need simpleproxy installed for it
;; to work.
;; 113 stream tcp nowait nobody /usr/sbin/tcpd /usr/bin/simpleproxy simpleproxy -i -R 127.0.0.1:8113
;;; Code:
(require 'erc)
(defvar erc-identd-process nil)
;;;###autoload (autoload 'erc-identd-mode "erc-identd")
(define-erc-module identd nil
"This mode launches an identd server on port 8113."
((add-hook 'erc-connect-pre-hook 'erc-identd-start)
(add-hook 'erc-disconnected-hook 'erc-identd-stop))
((remove-hook 'erc-connect-pre-hook 'erc-identd-start)
(remove-hook 'erc-disconnected-hook 'erc-identd-stop)))
(defun erc-identd-filter (proc string)
"This filter implements RFC1413 (identd authentication protocol)."
(let ((erc-identd-process proc))
......@@ -63,10 +79,11 @@ system."
(delete-process erc-identd-process))
(setq erc-identd-process
(make-network-process :name "identd"
:buffer (generate-new-buffer "identd")
:buffer nil
:host 'local :service port
:server t :noquery t
:filter 'erc-identd-filter)))
:server t :noquery t :nowait t
:filter 'erc-identd-filter))
(set-process-query-on-exit-flag erc-identd-process nil))
;;;###autoload
(defun erc-identd-stop (&rest ignore)
......
......@@ -31,11 +31,6 @@
;;; Code:
;; Author: Mario Lang <mlang@delysid.org>
;; This file is not part of GNU Emacs. But the same license applies.
;;; Commentary:
;; This package defines the function `erc-create-imenu-index'. ERC
......
......@@ -115,11 +115,6 @@ SERVER and PORT are the parameters used to connect BUFFERs
(const erc-generate-log-file-name-with-date)
(symbol)))
(defcustom erc-save-buffer-on-part nil
"*Save the channel buffer content using `erc-save-buffer-in-logs' on PART."
:group 'erc-log
:type 'boolean)
(defcustom erc-truncate-buffer-on-save nil
"Truncate any ERC (channel, query, server) buffer when it is saved."
:group 'erc-log
......@@ -150,14 +145,41 @@ directory should not end with a trailing slash."
:type '(choice directory
(const nil)))
(defcustom erc-log-insert-log-on-open t
(defcustom erc-log-insert-log-on-open nil
"*Insert log file contents into the buffer if a log file exists."
:group 'erc-log
:type 'boolean)
(defcustom erc-save-queries-on-quit nil
"Save all query (also channel) buffers of the server on QUIT.
See the variable `erc-save-buffer-on-part' for details."
(defcustom erc-save-buffer-on-part t
"*Save the channel buffer content using `erc-save-buffer-in-logs' on PART.
If you set this to nil, you may want to enable both
`erc-log-write-after-send' and `erc-log-write-after-insert'."
:group 'erc-log
:type 'boolean)
(defcustom erc-save-queries-on-quit t
"*Save all query (also channel) buffers of the server on QUIT.
If you set this to nil, you may want to enable both