From 0b6bb13008bc74c054c00b8f9d24507dd9383689 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Fri, 14 Jul 2006 02:29:50 +0000 Subject: [PATCH] Update for ERC 5.1.3. Revision: emacs@sv.gnu.org/emacs--devo--0--patch-348 Creator: Michael Olson --- etc/ChangeLog | 4 + etc/ERC-NEWS | 110 ++++++++++++ lisp/erc/ChangeLog | 194 +++++++++++++++++++++ lisp/erc/erc-autoaway.el | 128 +++++++++----- lisp/erc/erc-backend.el | 12 +- lisp/erc/erc-identd.el | 31 +++- lisp/erc/erc-imenu.el | 5 - lisp/erc/erc-log.el | 80 +++++---- lisp/erc/erc-match.el | 7 +- lisp/erc/erc-pcomplete.el | 27 ++- lisp/erc/erc-track.el | 2 +- lisp/erc/erc.el | 232 ++++++++++++------------- lisp/url/ChangeLog | 4 + lisp/url/url-irc.el | 4 +- man/ChangeLog | 4 + man/erc.texi | 347 ++++++++++++++++++++++++++++---------- 16 files changed, 881 insertions(+), 310 deletions(-) diff --git a/etc/ChangeLog b/etc/ChangeLog index 613ff0a095..f2924f7640 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,7 @@ +2006-07-12 Michael Olson + + * ERC-NEWS: Update for ERC 5.1.3. + 2006-07-08 David Kastrup * TODO: Suggest consolidation with user customization when the diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index 67345efe09..778344c68c 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS @@ -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 instead of 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. diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 49b274b514..216d14d0aa 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,3 +1,197 @@ +2006-07-12 Michael Olson + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * erc.el: Update maintainer information and URLs. + +2006-06-14 Michael Olson + + * 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 + + * 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 + + * erc.texi (History): Fix various typos. + +2006-06-04 Michael Olson + + * 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 + + * 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 + + * erc.el (erc-buffer-filter): Make sure all buffers returned from + this are live. + +2006-05-01 Edward O'Connor + + * erc-goodies.el: (erc-handle-irc-url): New function, suitable as + a value for `url-irc-function'. + +2006-04-18 Diane Murray + + * 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 * erc.el (erc-cmd-SV): Removed the exclamation point. Show the diff --git a/lisp/erc/erc-autoaway.el b/lisp/erc/erc-autoaway.el index 56713cba8b..4614bd70e2 100644 --- a/lisp/erc/erc-autoaway.el +++ b/lisp/erc/erc-autoaway.el @@ -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 diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 3ea0f74eed..7dce9e4bf0 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -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) diff --git a/lisp/erc/erc-identd.el b/lisp/erc/erc-identd.el index 0f70aab0fb..f30c40d479 100644 --- a/lisp/erc/erc-identd.el +++ b/lisp/erc/erc-identd.el @@ -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) diff --git a/lisp/erc/erc-imenu.el b/lisp/erc/erc-imenu.el index 88de1cedf6..e897a9d8a0 100644 --- a/lisp/erc/erc-imenu.el +++ b/lisp/erc/erc-imenu.el @@ -31,11 +31,6 @@ ;;; Code: - -;; Author: Mario Lang - -;; This file is not part of GNU Emacs. But the same license applies. - ;;; Commentary: ;; This package defines the function `erc-create-imenu-index'. ERC diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el index db60e5629b..b316a8588b 100644 --- a/lisp/erc/erc-log.el +++ b/lisp/erc/erc-log.el @@ -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 +`erc-log-write-after-send' and `erc-log-write-after-insert'." + :group 'erc-log + :type 'boolean) + +(defcustom erc-log-write-after-send nil + "*If non-nil, write to log file after every message you send. + +If you set this to nil, you may want to enable both +`erc-save-buffer-on-part' and `erc-save-queries-on-quit'." + :group 'erc-log + :type 'boolean) + +(defcustom erc-log-write-after-insert nil + "*If non-nil, write to log file when new text is added to a +logged ERC buffer. + +If you set this to nil, you may want to enable both +`erc-save-buffer-on-part' and `erc-save-queries-on-quit'." :group 'erc-log :type 'boolean) @@ -187,29 +209,28 @@ also be a predicate function. To only log when you are not set away, use: (with-current-buffer buffer (not erc-away))))" ;; enable - ((add-hook 'erc-insert-post-hook - 'erc-save-buffer-in-logs) - (add-hook 'erc-send-post-hook - 'erc-save-buffer-in-logs)) + ((when erc-log-write-after-insert + (add-hook 'erc-insert-post-hook 'erc-save-buffer-in-logs)) + (when erc-log-write-after-send + (add-hook 'erc-send-post-hook 'erc-save-buffer-in-logs)) + (add-hook 'erc-kill-buffer-hook 'erc-save-buffer-in-logs) + (add-hook 'erc-kill-channel-hook 'erc-save-buffer-in-logs) + (add-hook 'erc-quit-hook 'erc-conditional-save-queries) + (add-hook 'erc-part-hook 'erc-conditional-save-buffer) + ;; append, so that 'erc-initialize-log-marker runs first + (add-hook 'erc-connect-pre-hook 'erc-log-setup-logging 'append)) ;; disable - ((remove-hook 'erc-insert-post-hook - 'erc-save-buffer-in-logs) - (remove-hook 'erc-send-post-hook - 'erc-save-buffer-in-logs))) - -(when erc-enable-logging - (add-hook 'erc-kill-buffer-hook - 'erc-save-buffer-in-logs) - (add-hook 'erc-kill-channel-hook - 'erc-save-buffer-in-logs) - (add-hook 'erc-quit-hook - 'erc-conditional-save-queries) - (add-hook 'erc-part-hook - 'erc-conditional-save-buffer)) + ((remove-hook 'erc-insert-post-hook 'erc-save-buffer-in-logs) + (remove-hook 'erc-send-post-hook 'erc-save-buffer-in-logs) + (remove-hook 'erc-kill-buffer-hook 'erc-save-buffer-in-logs) + (remove-hook 'erc-kill-channel-hook 'erc-save-buffer-in-logs) + (remove-hook 'erc-quit-hook 'erc-conditional-save-queries) + (remove-hook 'erc-part-hook 'erc-conditional-save-buffer) + (remove-hook 'erc-connect-pre-hook 'erc-log-setup-logging))) (define-key erc-mode-map "\C-c\C-l" 'erc-save-buffer-in-logs) -;;;functionality referenced from erc.el +;;; functionality referenced from erc.el (defun erc-log-setup-logging () "Setup the buffer-local logging variables in the current buffer. This function is destined to be run from `erc-connect-pre-hook'." @@ -224,9 +245,6 @@ This function is destined to be run from `erc-connect-pre-hook'." (move-marker erc-last-saved-position (1- (point-max))))))) -;;; Append, so that 'erc-initialize-log-marker keeps running first. -(add-hook 'erc-connect-pre-hook 'erc-log-setup-logging 'append) - (defun erc-log-all-but-server-buffers (buffer) "Returns t if logging should be enabled in BUFFER. Returns nil iff `erc-server-buffer-p' returns t." diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el index 88c6d4c425..ffbc7482aa 100644 --- a/lisp/erc/erc-match.el +++ b/lisp/erc/erc-match.el @@ -553,10 +553,9 @@ deactivate/activate match logging in the latter. See ?m message ?u nickuserhost)))) (with-current-buffer (erc-log-matches-make-buffer match-buffer-name) - (toggle-read-only -1) - (point-max) - (insert line) - (toggle-read-only 1)))))) + (let ((inhibit-read-only t)) + (goto-char (point-max)) + (insert line))))))) (defun erc-log-matches-make-buffer (name) "Create or get a log-matches buffer named NAME and return it." diff --git a/lisp/erc/erc-pcomplete.el b/lisp/erc/erc-pcomplete.el index d6d4dfdd3b..33231ee259 100644 --- a/lisp/erc/erc-pcomplete.el +++ b/lisp/erc/erc-pcomplete.el @@ -106,7 +106,7 @@ the most recent speakers are listed first." (pcomplete-here (append (pcomplete-erc-commands) - (pcomplete-erc-nicks erc-pcomplete-nick-postfix)))) + (pcomplete-erc-nicks erc-pcomplete-nick-postfix t)))) (defvar erc-pcomplete-ctcp-commands '("ACTION" "CLIENTINFO" "ECHO" "FINGER" "PING" "TIME" "USERINFO" "VERSION")) @@ -212,14 +212,23 @@ the most recent speakers are listed first." not-ops)) -(defun pcomplete-erc-nicks (&optional postfix) - "Returns a list of nicks in the current channel." - (let ((users (erc-get-channel-user-list))) - (if erc-pcomplete-order-nickname-completions - (setq users (erc-sort-channel-users-by-activity users))) - (mapcar (lambda (x) - (concat (erc-server-user-nickname (car x)) postfix)) - users))) +(defun pcomplete-erc-nicks (&optional postfix ignore-self) + "Returns a list of nicks in the current channel. +Optional argument POSTFIX is something to append to the nickname. +If optional argument IGNORE-SELF is non-nil, don't return the current nick." + (let ((users (if erc-pcomplete-order-nickname-completions + (erc-sort-channel-users-by-activity + (erc-get-channel-user-list)) + (erc-get-channel-user-list))) + (nicks nil)) + (dolist (user users) + (unless (and ignore-self + (string= (erc-server-user-nickname (car user)) + (erc-current-nick))) + (setq nicks (cons (concat (erc-server-user-nickname (car user)) + postfix) + nicks)))) + (nreverse nicks))) (defun pcomplete-erc-all-nicks (&optional postfix) "Returns a list of all nicks on the current server." diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el index 6300567861..b045fb2499 100644 --- a/lisp/erc/erc-track.el +++ b/lisp/erc/erc-track.el @@ -108,7 +108,7 @@ If this variable is set to `max', then channel names will be shortened to the max. Usually, shortened channel names will remain unique for a given set of existing channels. When shortening to the max, the shortened channel names will be unique for the set of active channels only. -Example: If there are tow active channels #emacs and #vi, and two inactive +Example: If there are two active channels #emacs and #vi, and two inactive channels #electronica and #folk, then usually the active channels are shortened to #em and #v. When shortening to the max, however, #emacs is not compared to #electronica -- only to #vi, therefore it can be shortened diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 1baede0125..fd5a49eae4 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -11,7 +11,7 @@ ;; Andreas Fuchs (afs@void.at) ;; Gergely Nagy (algernon@midgard.debian.net) ;; David Edmondson (dme@dme.org) -;; Maintainer: Mario Lang (mlang@delysid.org) +;; Maintainer: Michael Olson (mwolson@gnu.org) ;; Keywords: IRC, chat, client, Internet ;; This file is part of GNU Emacs. @@ -36,12 +36,13 @@ ;; ERC is an IRC client for Emacs. ;; For more information, see the following URLs: -;; * http://sf.net/projects/erc/ +;; * http://sv.gnu.org/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 -;; who wants to hack it to contact me in order to -;; get write access on the CVS. +;; As of 2006-06-13, ERC development is now hosted on Savannah +;; (http://sv.gnu.org/projects/erc). I invite everyone who wants to +;; hack on it to contact me in order to get write +;; access to the shared Arch archive. ;; Installation: @@ -66,7 +67,7 @@ ;;; Code: -(defconst erc-version-string "Version 5.1.2" +(defconst erc-version-string "Version 5.1.3" "ERC version. This is used by function `erc-version'.") (eval-when-compile (require 'cl)) @@ -77,12 +78,12 @@ (require 'erc-menu) (defvar erc-official-location - "http://erc.sf.net (comments mailto://mlang@delysid.org)" + "http://emacswiki.org/cgi-bin/wiki/ERC (mailing list: erc-discuss@gnu.org)" "Location of the ERC client on the Internet.") (defgroup erc nil "Emacs Internet Relay Chat client." - :link '(url-link "http://www.emacswiki.org/cgi-bin/wiki.pl?EmacsIRCClient") + :link '(url-link "http://www.emacswiki.org/cgi-bin/wiki/ERC") :prefix "erc-" :group 'applications) @@ -143,57 +144,69 @@ ;; tunable connection and authentication parameters (defcustom erc-server nil - "IRC server to use. + "IRC server to use if one is not provided. See function `erc-compute-server' for more details on connection parameters and authentication." :group 'erc - :type '(choice (const nil) string)) + :type '(choice (const :tag "None" nil) + (string :tag "Server"))) (defcustom erc-port nil - "IRC port to use." + "IRC port to use if not specified. + +This can be either a string or a number." :group 'erc - :type '(choice (const nil) number string)) + :type '(choice (const :tag "None" nil) + (const :tag "Port number" number) + (const :tag "Port string" string))) (defcustom erc-nick nil - "Nickname to use. + "Nickname to use if one is not provided. -Can be either a string, or a list of strings. +This can be either a string, or a list of strings. In the latter case, if the first nick in the list is already in use, other nicks are tried in the list order. See function `erc-compute-nick' for more details on connection parameters and authentication." :group 'erc - :type '(choice (const nil) + :type '(choice (const :tag "None" nil) (string :tag "Nickname") - (repeat string))) + (repeat (string :tag "Nickname")))) (defcustom erc-nick-uniquifier "`" - "The character to append to the nick if it is already in use." + "The string to append to the nick if it is already in use." :group 'erc :type 'string) -(defcustom erc-manual-set-nick-on-bad-nick-p nil - "If the nickname you chose isn't available, ERC should not automatically -attempt to set another nickname. You can manually set another nickname with -the /NICK command." +(defcustom erc-try-new-nick-p t + "If the nickname you chose isn't available, and this option is non-nil, +ERC should automatically attempt to connect with another nickname. + +You can manually set another nickname with the /NICK command." :group 'erc :type 'boolean) (defcustom erc-user-full-name nil "User full name. +This can be either a string or a function to call. + See function `erc-compute-full-name' for more details on connection parameters and authentication." :group 'erc - :type '(choice (const nil) string function) + :type '(choice (const :tag "No name" nil) + (string :tag "Name") + (function :tag "Get from function")) :set (lambda (sym val) (if (functionp val) (set sym (funcall val)) (set sym val)))) (defvar erc-password nil - "ERC password to use in authentication (not necessary).") + "Password to use when authenticating to an IRC server. +It is not strictly necessary to provide this, since ERC will +prompt you for it.") (defcustom erc-user-mode nil "Initial user modes to be set after a connection is established." @@ -871,7 +884,7 @@ As an example: (\"xmms\" dme:now-playing) (\"version\" erc-quit-reason-normal) (\"home\" \"Gone home !\") - (\"\" \"Default Reason\"))) + (\"^$\" \"Default Reason\"))) If the user types \"/quit zippy\", then a Zippy the Pinhead quotation will be used as the quit message." :group 'erc-quit-and-part @@ -895,7 +908,7 @@ As an example: (\"xmms\" dme:now-playing) (\"version\" erc-part-reason-normal) (\"home\" \"Gone home !\") - (\"\" \"Default Reason\"))) + (\"^$\" \"Default Reason\"))) If the user types \"/part zippy\", then a Zippy the Pinhead quotation will be used as the part message." :group 'erc-quit-and-part @@ -1373,7 +1386,10 @@ server buffer") (defun erc-active-buffer () "Return the value of `erc-active-buffer' for the current server. Defaults to the server buffer." - (with-current-buffer (erc-server-buffer) erc-active-buffer)) + (with-current-buffer (erc-server-buffer) + (if (buffer-live-p erc-active-buffer) + erc-active-buffer) + (setq erc-active-buffer (current-buffer)))) (defun erc-set-active-buffer (buffer) "Set the value of `erc-active-buffer' to BUFFER." @@ -1595,12 +1611,13 @@ server connection, or nil which means all open connections." (delq nil (mapcar (lambda (buf) - (with-current-buffer buf - (and (eq major-mode 'erc-mode) - (or (not proc) - (eq proc erc-server-process)) - (funcall predicate) - buf))) + (when (buffer-live-p buf) + (with-current-buffer buf + (and (eq major-mode 'erc-mode) + (or (not proc) + (eq proc erc-server-process)) + (funcall predicate) + buf)))) (buffer-list))))) (defun erc-buffer-list (&optional predicate proc) @@ -1760,11 +1777,12 @@ removed from the list will be disabled." :greedy t (const :tag "Set away status automatically" autoaway) (const :tag "Join channels automatically" autojoin) - (const :tag "Integrate with Big Brother Database" bbdb) (const :tag "Buttonize URLs, nicknames, and other text" button) (const :tag "Wrap long lines" fill) + (const :tag "Launch an identd server on port 8113" identd) (const :tag "Highlight or remove IRC control characters" irccontrols) + (const :tag "List channels in a separate buffer" list) (const :tag "Save buffers in logs" log) (const :tag "Highlight pals, fools, and other keywords" match) (const :tag "Detect netsplits" netsplit) @@ -1776,6 +1794,7 @@ removed from the list will be disabled." (const :tag "Complete nicknames and commands (programmable)" completion) (const :tag "Complete nicknames and commands (old)" hecomplete) + (const :tag "Process CTCP PAGE requests from IRC" page) (const :tag "Make displayed lines read-only" readonly) (const :tag "Replace text in messages" replace) (const :tag "Enable an input history" ring) @@ -2063,10 +2082,12 @@ Non-interactively, it takes keyword arguments (full-name (erc-compute-full-name))) That is, if called with + (erc-select :server \"irc.freenode.net\" :full-name \"Harry S Truman\") + server and full-name will be set to those values, whereas -erc-compute-port, erc-compute-nick and erc-compute-full-name will -be invoked for those parameters' values" +`erc-compute-port', `erc-compute-nick' and `erc-compute-full-name' will +be invoked for the values of the other parameters." (interactive (erc-select-read-args)) (run-hook-with-args 'erc-before-connect server port nick) @@ -3047,8 +3068,8 @@ If S is non-nil, it will be used as the quit reason." (cond ((functionp res) (funcall res)) ((stringp res) res) - ;; hopefully never reached - (s)))) + (s s) + (t (erc-quit-reason-normal))))) (defun erc-part-reason-normal (&optional s) "Normal part message. @@ -3074,7 +3095,8 @@ If S is non-nil, it will be used as the quit reason." (cond ((functionp res) (funcall res)) ((stringp res) res) - (s)))) + (s s) + (t (erc-part-reason-normal))))) (defun erc-cmd-QUIT (reason) "Disconnect from the current server. @@ -3713,7 +3735,7 @@ E.g. \"Read error to Nick [user@some.host]: 110\" would be shortened to "If NICK is unavailable, tell the user the REASON. See also `erc-display-error-notice'." - (if (or erc-manual-set-nick-on-bad-nick-p + (if (or (not erc-try-new-nick-p) ;; how many default-nicks are left + one more try... (eq erc-nick-change-attempt-count (if (consp erc-nick) @@ -3735,12 +3757,13 @@ See also `erc-display-error-notice'." (setq newnick (concat (truncate-string-to-width nick (if (and erc-server-connected nicklen) - (- (string-to-number nicklen) 1) + (- (string-to-number nicklen) + (length erc-nick-uniquifier)) ;; rfc2812 max nick length = 9 ;; we must assume this is the ;; server's setting if we haven't ;; established a connection yet - 8)) + (- 9 (length erc-nick-uniquifier)))) erc-nick-uniquifier))) (erc-cmd-NICK newnick) (erc-display-error-notice @@ -5098,13 +5121,16 @@ If ARG is non-nil and not positive, turns CTCP replies off." (defun erc-toggle-flood-control (&optional arg) "Toggle use of flood control on sent messages. -If ARG is non-nil, use flood control. -If ARG is nil, do not use flood control. +If ARG is positive, use flood control. +If ARG is non-nil and not positive, do not use flood control. See `erc-server-flood-margin' for an explanation of the available flood control parameters." (interactive "P") - (setq erc-flood-protect arg) + (cond ((and (numberp arg) (> arg 0)) + (setq erc-flood-protect t)) + (arg (setq erc-flood-protect nil)) + (t (setq erc-flood-protect (not erc-flood-protect)))) (message "ERC flood control is %s" (cond (erc-flood-protect "ON") (t "OFF")))) @@ -5130,10 +5156,10 @@ This command is sent even if excess flood is detected." (defun erc-get-channel-mode-from-keypress (key) "Read a key sequence and call the corresponding channel mode function. -After doing C-c C-o type in a channel mode letter. +After doing C-c C-o, type in a channel mode letter. C-g means quit. -RET let's you type more than one mode at a time. +RET lets you type more than one mode at a time. If \"l\" is pressed, `erc-set-channel-limit' gets called. If \"k\" is pressed, `erc-set-channel-key' gets called. Anything else will be sent to `erc-toggle-channel-mode'." @@ -5384,28 +5410,28 @@ Sets the buffer local variables: (defun erc-compute-server (&optional server) "Return an IRC server name. -Tries a number of increasingly more default methods until a non-nil value is -found: +This tries a number of increasingly more default methods until a +non-nil value is found. -- SERVER -- `erc-server' +- SERVER (the argument passwd to this function) +- The `erc-server' option - The value of the IRCSERVER environment variable -- `erc-default-server'." +- The `erc-default-server' variable" (or server erc-server (getenv "IRCSERVER") erc-default-server)) (defun erc-compute-nick (&optional nick) - "Return user's NICK. + "Return user's IRC nick. -Tries a number of increasingly more default methods until a non-nil value is -found: +This tries a number of increasingly more default methods until a +non-nil value is found. -- NICK -- `erc-nick' +- NICK (the argument passed to this function) +- The `erc-nick' option - The value of the IRCNICK environment variable -- via the function `user-login-name'." +- The result from the `user-login-name' function" (or nick (if (consp erc-nick) (car erc-nick) erc-nick) (getenv "IRCNICK") @@ -5413,15 +5439,15 @@ found: (defun erc-compute-full-name (&optional full-name) - "Return user's FULL-NAME. + "Return user's full name. -Tries a number of increasingly more default methods until a non-nil value is -found: +This tries a number of increasingly more default methods until a +non-nil value is found. -- FULL-NAME -- `erc-user-full-name' +- FULL-NAME (the argument passed to this function) +- The `erc-user-full-name' option - The value of the IRCNAME environment variable -- via the function `user-full-name'." +- The result from the `user-full-name' function" (or full-name erc-user-full-name (getenv "IRCNAME") @@ -5431,12 +5457,13 @@ found: (defun erc-compute-port (&optional port) "Return a port for an IRC server. -Tries a number of increasingly more default methods until a non-nil -value is found: +This tries a number of increasingly more default methods until a +non-nil value is found. -- PORT -- \"ircd\"." - (or port erc-port "ircd")) +- PORT (the argument passed to this function) +- The `erc-port' option +- The `erc-default-port' variable" + (or port erc-port erc-default-port)) ;; time routines @@ -5818,26 +5845,6 @@ If optional argument HERE is non-nil, insert version number at point." (message "%s" version-string) version-string)))) -(defun erc-version-modules (&optional here) - "Show the version numbers of all loaded ERC modules in the minibuffer. -If optional argument HERE is non-nil, insert version number at point." - (interactive "P") - (let ((version-string - (mapconcat 'identity - (let (versions (case-fold-search nil)) - (dolist (var (apropos-internal "^erc-.*version$")) - (when (and (boundp var) - (stringp (symbol-value var))) - (setq versions (cons (format "%S: %s" - var (symbol-value var)) - versions)))) - versions) ", "))) - (if here - (insert version-string) - (if (interactive-p) - (message "%s" version-string) - version-string)))) - (defun erc-modes (&optional here) "Show the active ERC modes in the minibuffer. If optional argument HERE is non-nil, insert version number at point." @@ -5858,32 +5865,6 @@ If optional argument HERE is non-nil, insert version number at point." (message "%s" string) string)))) -(defun erc-latest-version () - "Retrieve the latest erc.el version from CVS." - (interactive) - (if (ignore-errors (require 'url)) - (progn - (switch-to-buffer (get-buffer-create "*erc.el latest version*")) - (delete-region (point-min) (point-max)) - (kill-all-local-variables) - (url-insert-file-contents (concat - "http://cvs.sourceforge.net/viewcvs.py/" - "*checkout*/erc/erc/erc.el?content-type" - "=text%2Fplain&rev=HEAD")) - (emacs-lisp-mode) - (current-buffer)) - (error "URL needs to be installed"))) - -(defun erc-ediff-latest-version () - "Ediff your installed erc.el with the latest CVS version. -See also `erc-latest-version'." - (interactive) - (let ((current (locate-library "erc.el"))) - (if current - (ediff-buffers (find-file current) - (erc-latest-version)) - (error "You do not appear to have the uncompiled erc.el file")))) - (defun erc-trim-string (s) "Trim leading and trailing spaces off S." (cond @@ -6184,6 +6165,29 @@ This function should be on `erc-kill-channel-hook'." (and vect (erc-response.command vect))) +;; Teach url.el how to open irc:// URLs with ERC. +;; To activate, customize `url-irc-function' to `url-irc-erc'. + +;;;###autoload +(defun erc-handle-irc-url (host port channel user password) + "Use ERC to IRC on HOST:PORT in CHANNEL as USER with PASSWORD. +If ERC is already connected to HOST:PORT, simply /join CHANNEL. +Otherwise, connect to HOST:PORT as USER and /join CHANNEL." + (let ((server-buffer + (car (erc-buffer-filter + (lambda () + (and (string-equal erc-session-server host) + (= erc-session-port port) + erc-server-connected + (eq (erc-server-buffer) (current-buffer)))))))) + (with-current-buffer (or server-buffer (current-buffer)) + (if (and server-buffer channel) + (erc-cmd-JOIN channel) + (erc host port (or user (erc-compute-nick)) (erc-compute-full-name) + (not server-buffer) password nil channel + (when server-buffer + (get-buffer-process server-buffer))))))) + (provide 'erc) ;;; Deprecated. We might eventually stop requiring the goodies automatically. diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index 0eb0b65405..901fac0120 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog @@ -1,3 +1,7 @@ +2006-07-12 Michael Olson + + * url-irc.el (url-irc-erc): Call erc-handle-irc-url. + 2006-07-11 Stefan Monnier * url-cookie.el: Remove spurious * in docstrings. diff --git a/lisp/url/url-irc.el b/lisp/url/url-irc.el index 6a7a62573e..19eec6f2ef 100644 --- a/lisp/url/url-irc.el +++ b/lisp/url/url-irc.el @@ -68,9 +68,7 @@ PASSWORD - What password to use" (switch-to-buffer (concat chan "@" host))))) (defun url-irc-erc (host port channel user password) - (erc-select :server host :port port :nick user :password password) - (when channel - (erc-join-channel channel))) + (erc-handle-irc-url host port channel user password)) ;;;###autoload (defun url-irc (url) diff --git a/man/ChangeLog b/man/ChangeLog index 060d66c9c1..851c37cfdb 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,7 @@ +2006-07-12 Michael Olson + + * erc.texi: Update for ERC 5.1.3. + 2006-07-12 Alex Schroeder * rcirc.texi: Fix typos. diff --git a/man/erc.texi b/man/erc.texi index cc264aa412..29b0f05972 100644 --- a/man/erc.texi +++ b/man/erc.texi @@ -12,7 +12,7 @@ @syncodeindex fn cp @copying -This manual is for ERC version 5.1.2. +This manual is for ERC version 5.1.3. Copyright @copyright{} 2005, 2006 Free Software Foundation, Inc. @@ -68,6 +68,13 @@ Obtaining ERC * Releases:: Released versions of ERC. * Development:: Latest unreleased development changes. +Advanced Usage + +* Connecting:: Ways of connecting to an IRC server. +* Options:: Options that are available for ERC. +* Tips and Tricks:: Ways of enhancing your ERC experience. +* Sample Configuration:: An example configuration file. + @end detailmenu @end menu @@ -114,7 +121,7 @@ comes with Emacs. Choose to install a release if you want to minimize risk. Errors are corrected in development first. User-visible changes will be -announced on the @email{erc-help@@lists.sourceforge.net} mailing list. +announced on the @email{erc-discuss@@gnu.org} mailing list. @pxref{Getting Help and Reporting Bugs}. @cindex releases, Debian package @@ -124,7 +131,7 @@ available in the official Debian repository. @cindex releases, from source Alternatively, you can download the latest release from -@uref{http://sourceforge.net/project/showfiles.php?group_id=30118}. +@uref{http://ftp.gnu.org/gnu/erc}. @node Development, , Releases, Obtaining ERC @comment node-name, next, previous, up @@ -134,43 +141,13 @@ Alternatively, you can download the latest release from Choose the development version if you want to live on the bleeding edge of ERC development or try out new features before release. -@subsection Using CVS -@cindex CVS, using - -ERC is primarily developed using a CVS repository on sourceforge.net. -To check out a copy of the latest changes, do the following. - -@example -cvs -d:pserver:anonymous@@cvs.sourceforge.net:/cvsroot/erc login -cvs -z3 -d:pserver:anonymous@@cvs.sourceforge.net:/cvsroot/erc co -P erc -@end example - -@cindex CVS snapshot -Alternatively, the latest CVS snapshot may be downloaded in the -following forms. - -@itemize @bullet -@item http://mwolson.org/static/dist/erc-latest.tar.gz -@item http://mwolson.org/static/dist/erc-latest.zip -@end itemize - -@subsection Using the GNU Arch Revision Control System -@cindex arch revision control system, using -The Arch revision control system allows you to retrieve previous -versions and select specific features and bug fixes. - -Michael Olson maintains an official Arch branch for ERC which stays -current with the CVS repository for ERC. If you would like to -contribute to ERC development, and would prefer to use a modern Revision -Control System, feel free to make your own branch. +@subheading GNU Arch -If you are new to Arch, you might find this tutorial helpful: -@uref{http://www.mwolson.org/projects/ArchTutorial.html}. - -Downloading ERC with Arch and staying up-to-date involves the following -steps. +ERC is developed using GNU Arch. Downloading ERC with Arch and staying +up-to-date involves the following steps. @enumerate +@cindex GNU Arch, installing @item Install arch @itemize @bullet @@ -178,15 +155,16 @@ steps. @item Other distributions: see @uref{ftp://ftp.gnu.org/gnu/gnu-arch/}. @end itemize +@cindex GNU Arch, downloading ERC @item Register the archive. @example -tla register-archive -f http://www.mwolson.org/archives/2006 +tla register-archive -f http://arch.sv.gnu.org/archives/erc/erc @end example @item Download the ERC source code. @example # Download ERC into the @file{erc} directory. -tla get mwolson@@gnu.org--2006/erc--cvs--0 erc +tla get erc@@sv.gnu.org/erc--main--0 erc @end example @item List upstream changes that are missing from your local copy. @@ -201,24 +179,29 @@ cd erc/ tla missing --summary @end example -@cindex updating ERC with Arch +@cindex GNU Arch, updating ERC @item Update to the latest version by replaying missing changes. @example cd erc -tla replay +tla update @end example @end enumerate -There are other ways to interact with the ERC archive. +If you are new to Arch and want to learn more about developing with it, +you might find this tutorial helpful: +@uref{http://www.mwolson.org/projects/ArchTutorial.html}. + +@subheading Development snapshots -@itemize -@item Browse arch repository: @uref{http://www.mwolson.org/archives/} -@item Latest development snapshot: @uref{http://www.mwolson.org/static/dist/erc-latest.tar.gz} -@end itemize +@cindex development snapshot +Alternatively, the latest development snapshot may be downloaded in both +``.tar.gz'' and ``.zip'' forms. -The latest development snapshot will be kept up-to-date since it is -updated at the same time as the Arch repository. +@itemize @bullet +@item @uref{http://www.mwolson.org/static/dist/erc-latest.tar.gz} +@item @uref{http://www.mwolson.org/static/dist/erc-latest.zip} +@end itemize @node Installation, Getting Started, Obtaining ERC, Top @@ -282,15 +265,13 @@ locations that require this. To use ERC, add the directory containing its files to your @code{load-path} variable, in your @file{.emacs} file. Then, load ERC -itself along with any extra modules you desire. An example follows. +itself. An example follows. @lisp (require 'erc) - -(require 'erc-spelling) @end lisp -Once this is loaded, the command @kbd{M-x erc-select} will start ERC and +Once ERC is loaded, the command @kbd{M-x erc-select} will start ERC and prompt for the server to connect to. @c PRE5_2: Sample session, including: @@ -362,12 +343,12 @@ Run "/names #channel" in the current channel. @item C-c C-o (`erc-get-channel-mode-from-keypress') Read a key sequence and call the corresponding channel mode function. -After doing C-c C-o type in a channel mode letter. +After doing @kbd{C-c C-o}, type in a channel mode letter. -C-g means quit. -RET let's you type more than one mode at a time. -If "l" is pressed, `erc-set-channel-limit' gets called. -If "k" is pressed, `erc-set-channel-key' gets called. +@kbd{C-g} means quit. +@kbd{RET} lets you type more than one mode at a time. +If @kbd{l} is pressed, @code{erc-set-channel-limit} gets called. +If @kbd{k} is pressed, @code{erc-set-channel-key} gets called. Anything else will be sent to `erc-toggle-channel-mode'. @item C-c C-p (`erc-part-from-channel') @@ -406,7 +387,7 @@ The following is a list of available modules. @cindex modules, autoaway @item autoaway -Set away status automatically. +Set away status automatically @cindex modules, autojoin @item autojoin @@ -420,14 +401,31 @@ Integrate with the Big Brother Database @item button Buttonize URLs, nicknames, and other text +@cindex modules, completion +@item pcomplete +Complete nicknames and commands (programmable) + @cindex modules, fill @item fill Wrap long lines +@cindex modules, hecomplete +@item completion +Complete nicknames and commands (old). This is the old module---you +might prefer the ``completion'' module instead. + +@cindex modules, identd +@item identd +Launch an identd server on port 8113 + @cindex modules, irccontrols @item irccontrols Highlight or remove IRC control characters +@cindex modules, list +@item list +List channels nicely in a separate buffer + @cindex modules, log @item log Save buffers in logs @@ -448,9 +446,9 @@ Don't display non-IRC commands after evaluation @item notify Notify when the online status of certain users changes -@cindex modules, pcomplete -@item pcomplete -Complete nicknames and commands (programmable) +@cindex modules, page +@item page +Process CTCP PAGE requests from IRC @cindex modules, readonly @item readonly @@ -480,9 +478,9 @@ Convert smileys to pretty icons @item sound Play sounds when you receive CTCP SOUND requests -@cindex modules, spell -@item spell -Check spelling +@cindex modules, spelling +@item spelling +Check spelling of messages @cindex modules, stamp @item stamp @@ -510,14 +508,175 @@ Translate morse code in messages @chapter Advanced Usage @cindex advanced topics -Write me. +@menu +* Connecting:: Ways of connecting to an IRC server. +* Options:: Options that are available for ERC. +* Tips and Tricks:: Ways of enhancing your ERC experience. +* Sample Configuration:: An example configuration file. +@end menu + +@node Connecting, Options, Advanced Usage, Advanced Usage +@comment node-name, next, previous, up +@section Connecting to an IRC Server +@cindex connecting + +The easiest way to connect to an IRC server is to call +@kbd{M-x erc-select}. If you want to assign this function to a +keystroke, the following will help you figure out its parameters. + +@defun erc-select +Select connection parameters and run ERC. +Non-interactively, it takes the following keyword arguments. + +@itemize @bullet +@item @var{server} +@item @var{port} +@item @var{nick} +@item @var{password} +@item @var{full-name} +@end itemize + +That is, if called with the following arguments, @var{server} and +@var{full-name} will be set to those values, whereas +@code{erc-compute-port}, @code{erc-compute-nick} and +@code{erc-compute-full-name} will be invoked for the values of the other +parameters. + +@example +(erc-select :server "irc.freenode.net" :full-name "Harry S Truman") +@end example +@end defun + +@subheading Server + +@defun erc-compute-server &optional server +Return an IRC server name. + +This tries a number of increasingly more default methods until a non-nil +value is found. + +@itemize @bullet +@item @var{server} (the argument passed to this function) +@item The @code{erc-server} option +@item The value of the IRCSERVER environment variable +@item The @code{erc-default-server} variable +@end itemize + +@end defun + +@defopt erc-server nil +IRC server to use if one is not provided. +@end defopt + +@subheading Port + +@defun erc-compute-port &optional port +Return a port for an IRC server. + +This tries a number of increasingly more default methods until a non-nil +value is found. + +@itemize @bullet +@item @var{port} (the argument passed to this function) +@item The @code{erc-port} option +@item The @code{erc-default-port} variable +@end itemize + +@end defun + +@defopt erc-port +IRC port to use if not specified. + +This can be either a string or a number. +@end defopt + +@subheading Nick + +@defun erc-compute-nick &optional nick +Return user's IRC nick. + +This tries a number of increasingly more default methods until a +non-nil value is found. + +@itemize +@item @var{nick} (the argument passed to this function) +@item The @code{erc-nick} option +@item The value of the IRCNICK environment variable +@item The result from the @code{user-login-name} function +@end itemize + +@end defun + +@defopt erc-nick +Nickname to use if one is not provided. + +This can be either a string, or a list of strings. +In the latter case, if the first nick in the list is already in use, +other nicks are tried in the list order. +@end defopt + +@defopt erc-nick-uniquifier +The string to append to the nick if it is already in use. +@end defopt + +@defopt erc-try-new-nick-p +If the nickname you chose isn't available, and this option is non-nil, +ERC should automatically attempt to connect with another nickname. + +You can manually set another nickname with the /NICK command. +@end defopt + +@subheading Full name -@c PRE5_2: (Node) Document every ERC option +@defun erc-compute-full-name &optional full-name +Return user's full name. + +This tries a number of increasingly more default methods until a +non-nil value is found. + +@itemize @bullet +@item @var{full-name} (the argument passed to this function) +@item The @code{erc-user-full-name} option +@item The value of the IRCNAME environment variable +@item The result from the @code{user-full-name} function +@end itemize + +@end defun + +@defopt erc-user-full-name +User full name. + +This can be either a string or a function to call. +@end defopt + +@node Options, Tips and Tricks, Connecting, Advanced Usage +@comment node-name, next, previous, up +@section Options +@cindex options + +@c PRE5_2: (Node) Document every ERC option (module options go in +@c previous chapter) + +This section has not yet been written. + +@node Tips and Tricks, Sample Configuration, Options, Advanced Usage +@comment node-name, next, previous, up +@section Tips and Tricks +@cindex tips and tricks @c PRE5_2: (Node) Tips and tricks +This section has not yet been written. + +@node Sample Configuration, , Tips and Tricks, Advanced Usage +@comment node-name, next, previous, up +@section Sample Configuration +@cindex configuration, sample + @c PRE5_2: (Node) Sample configs +This section has not yet been written. + @node Getting Help and Reporting Bugs, History, Advanced Usage, Top @comment node-name, next, previous, up @@ -536,14 +695,24 @@ emacswiki.org page for ERC. Anyone may add tips, hints, or bug descriptions to it. @item -You can join the mailing list at @email{erc-help@@lists.sourceforge.net} -using the subscription form at -@uref{http://lists.sourceforge.net/lists/listinfo/erc-help}. +There are several mailing lists for ERC. To subscribe, visit +@uref{http://savannah.gnu.org/mail/?group=erc}. + +The mailing lists are also available on Gmane. +(@url{http://gmane.org/}). Gmane provides additional methods for +accessing the mailing lists, adding content to them, and searching them. -This mailing list is also available via Gmane -(@url{http://gmane.org/}). The group is called -@samp{gmane.emacs.erc.general}. This provides additional methods for -accessing the mailing list, adding content to it, and searching it. +@enumerate +@item gmane.emacs.erc.announce +Announcements + +@item gmane.emacs.erc.discuss +General discussion + +@item gmane.emacs.erc.cvs +Log messages for changes to the ERC source code + +@end enumerate @item You can visit the IRC Freenode channel @samp{#emacs}. Many of the @@ -561,7 +730,7 @@ questions. ERC was originally written by Alexander L. Belikoff @email{abel@@bfr.co.il} and Sergey Berezin @email{sergey.berezin@@cs.cmu.edu}. They stopped development around -December 1999. Their last released version was ERC 2.0. +December 1999. Their last released version was ERC 2.0. P.S.: If one of the original developers of ERC reads this, we'd like to receive additional information for this file and hear comments in @@ -572,42 +741,46 @@ general. In June 2001, Mario Lang @email{mlang@@delysid.org} and Alex Schroeder @email{alex@@gnu.org} took over development and created a ERC Project at -sourceforge.net. +@uref{http://sourceforge.net/projects/erc}. -In reaction to a mail about the new erc development, Sergey Berezin -said, "First of all, I'm glad that my version of ERC is being used out -there. The thing is, I do not have free time and enough incentive -anymore to work on ERC, so I would be happy if you guys take over the -project entirely." +In reaction to a mail about the new ERC development effort, Sergey +Berezin said, ``First of all, I'm glad that my version of ERC is being +used out there. The thing is, I do not have free time and enough +incentive anymore to work on ERC, so I would be happy if you guys take +over the project entirely.'' So we happily hacked away on ERC, and soon after (September 2001) released the next "stable" version, 2.1. Most of the development of the new ERC happened on #emacs on -irc.openprojects.net. Over time, many people contributed code, ideas, -bugfixes. And not to forget a lot of alpha/beta/gamma testing. +irc.openprojects.net. Over time, many people contributed code, ideas, +bugfixes, and a lot of alpha/beta/gamma testing. See the @file{CREDITS} file for a list of contributors. @item 2003 -ERC 3.0 is released. +ERC 3.0 was released. @item 2004 -ERC 4.0 is released. +ERC 4.0 was released. @item 2005 -ERC 5.0 is released. Michael Olson @email{mwolson@@gnu.org} becomes +ERC 5.0 was released. Michael Olson @email{mwolson@@gnu.org} became the release manager and eventually the maintainer. -After some discussion between him and the Emacs developers, it is +After some discussion between him and the Emacs developers, it was decided to include ERC in Emacs. @item 2006 -ERC 5.1 is released. It is subsequently included in Emacs 22. +ERC 5.1 was released. It was subsequently included in Emacs 22. + +ERC became an official GNU project, and development moved to +@uref{http://sv.gnu.org/projects/erc}. We switched to using GNU Arch as +our revision control system. Our mailing list address changed as well. @end itemize -- 2.20.1