diff options
Diffstat (limited to 'lisp/erc')
32 files changed, 251 insertions, 141 deletions
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 50b37eb044f..ec2098c7bd3 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,3 +1,97 @@ +2006-02-15 Michael Olson <mwolson@gnu.org> + + * erc.el (erc): Move to the end of the buffer when a continued + session is detected. Thanks to e1f and indio for the report and + testing a potential fix. + +2006-02-14 Michael Olson <mwolson@gnu.org> + + * debian/changelog: Prepare a new Debian package. + + * Makefile (debprepare): New rule that creates an ERC snapshot + directory for use in both new Debian releases and revisions for + Debian packages. + (debrelease, debrevision-mwolson): Use debprepare. + + * NEWS: Bring up-to-date. + + * erc-stamp.el (erc-insert-timestamp-right): For now, put + timestamps before rather than after erc-fill-column when + erc-timestamp-right-column is nil. This way we won't surprise + anyone unpleasantly, or so it is hoped. + +2006-02-13 Michael Olson <mwolson@gnu.org> + + * erc-dcc.el: Use (eval-when-compile (require 'cl)). + +2006-02-12 Michael Olson <mwolson@gnu.org> + + * erc-autoaway.el, erc-dcc.el, erc-ezbounce.el, erc-fill.el, + erc-goodies.el, erc-hecomplete.el, erc-ibuffer.el, erc-identd.el, + erc-imenu.el, erc-join.el, erc-lang.el, erc-list.el, erc-log.el, + erc-match.el, erc-menu.el, erc-netsplit.el, erc-networks.el, + erc-notify.el, erc-page.el, erc-pcomplete.el, erc-replace.el, + erc-ring.el, erc-services.el, erc-sound.el, erc-speedbar.el, + erc-spelling.el, erc-track.el, erc-truncate.el, erc-xdcc.el: Add + 2006 to copyright years, to comply with the changed guidelines. + +2006-02-11 Michael Olson <mwolson@gnu.org> + + * erc.el (erc-update-modules): Make some requirements shorter, so + that it's easier to see why they are needed. + + * erc-stamp.el (erc-timestamp-use-align-to): Renamed from + `erc-timestamp-right-align-by-pixel'. Set the default based on + whether we are in Emacs 22, and using X. Improve documentation. + (erc-insert-aligned): Remove calculation of offset, since + :align-to pos works after all. Unlike the previous solution, this + one works when erc-stamp.el is compiled. + (erc-insert-timestamp-right): Don't add length of string, and then + later remove its displayed width. This puts timestamps after + erc-fill-column when erc-timestamp-right-column is nil, rather + than before it. It also fixes a subtle bug. Remove use of + `current-window', since there is no variable by that name in + Emacs21, Emacs22, or XEmacs21 beta. Check to see whether + `erc-fill-column' is non-nil before using it. + +2006-02-11 Diane Murray <disumu@x3y2z1.net> + + * erc-list.el: Define `list' module which sets the alias + `erc-cmd-LIST' to `erc-list-channels' when enabled and + `erc-list-channels-simple' when disabled. + (erc-list-channels): Was `erc-cmd-LIST', renamed. + (erc-list-channels-simple): New function. + + * erc.el (erc-modules): Added `list' to enabled modules. Moved + customization options left in source code. + + * erc-menu.el (erc-menu-definition): Use `erc-list-channels'. + + * erc-spelling.el (define-erc-module): Make sure there's a buffer + before calling `with-current-buffer'. + +2006-02-10 Michael Olson <mwolson@gnu.org> + + * Makefile (debbuild): Split from debrelease. + (debrevision-mwolson): New rule that causes a Debian revision to + be built. + + * erc.el (erc-migrate-modules): Use a better algorithm. Thanks to + Johan Bockgård. + (erc-modules): Change use of 'pcomplete to 'completion. + +2006-02-09 Diane Murray <disumu@x3y2z1.net> + + * erc.el (erc-get-parsed-vector, erc-get-parsed-vector-nick) + (erc-get-parsed-vector-type): Moved here from erc-match.el. + + * erc-match.el (erc-get-parsed-vector, erc-get-parsed-vector-nick) + (erc-get-parsed-vector-type): Moved these functions to erc.el + since they can be useful outside of the text matching module. + + * erc-dcc.el, erc-stamp.el, erc-xdcc.el: Changed "Emacs IRC Client" + to "ERC". + 2006-02-07 Michael Olson <mwolson@gnu.org> * ChangeLog.01, ChangeLog.02, ChangeLog.03, ChangeLog.04, diff --git a/lisp/erc/erc-autoaway.el b/lisp/erc/erc-autoaway.el index 41c16b82cb1..56713cba8bf 100644 --- a/lisp/erc/erc-autoaway.el +++ b/lisp/erc/erc-autoaway.el @@ -1,6 +1,6 @@ ;;; erc-autoaway.el --- Provides autoaway for ERC -;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc. ;; Author: Jorgen Schaefer <forcer@forcix.cx> ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcAutoAway diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el index d5789a51708..4b9172f06d7 100644 --- a/lisp/erc/erc-dcc.el +++ b/lisp/erc/erc-dcc.el @@ -1,6 +1,6 @@ ;;; erc-dcc.el --- CTCP DCC module for ERC -;; Copyright (C) 1993, 1994, 1995, 1998, 2002, 2003, 2004 +;; Copyright (C) 1993, 1994, 1995, 1998, 2002, 2003, 2004, 2006 ;; Free Software Foundation, Inc. ;; Author: Ben A. Mesander <ben@gnu.ai.mit.edu> @@ -29,7 +29,7 @@ ;;; Commentary: -;; This file provides Direct Client-to-Client support for the Emacs IRC Client. +;; This file provides Direct Client-to-Client support for ERC. ;; ;; The original code was taken from zenirc-dcc.el, heavily mangled and ;; rewritten to support the way how ERC operates. Server socket support @@ -55,7 +55,8 @@ (require 'erc) (eval-when-compile - (require 'pcomplete)) + (require 'cl) + (require 'pcomplete)) (defgroup erc-dcc nil "DCC stands for Direct Client Communication, where you and your diff --git a/lisp/erc/erc-ezbounce.el b/lisp/erc/erc-ezbounce.el index 59e80b60b8d..48395bf1dab 100644 --- a/lisp/erc/erc-ezbounce.el +++ b/lisp/erc/erc-ezbounce.el @@ -1,6 +1,6 @@ ;;; erc-ezbounce.el --- Handle EZBounce bouncer commands -;; Copyright (C) 2002, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2004, 2006 Free Software Foundation, Inc. ;; Author: Andreas Fuchs <asf@void.at> ;; Keywords: comm diff --git a/lisp/erc/erc-fill.el b/lisp/erc/erc-fill.el index f945d838c2a..6a5f80f7fd8 100644 --- a/lisp/erc/erc-fill.el +++ b/lisp/erc/erc-fill.el @@ -1,6 +1,6 @@ ;;; erc-fill.el --- Filling IRC messages in various ways -;; Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc. ;; Author: Andreas Fuchs <asf@void.at> ;; Mario Lang <mlang@delysid.org> diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el index c844af55594..f6d32ee7c06 100644 --- a/lisp/erc/erc-goodies.el +++ b/lisp/erc/erc-goodies.el @@ -1,6 +1,7 @@ ;; erc-goodies.el --- Collection of ERC modules -;; Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation +;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 +;; Free Software Foundation, Inc. ;; Author: Jorgen Schaefer <forcer@forcix.cx> diff --git a/lisp/erc/erc-hecomplete.el b/lisp/erc/erc-hecomplete.el index 763d75c8fc7..85a81569782 100644 --- a/lisp/erc/erc-hecomplete.el +++ b/lisp/erc/erc-hecomplete.el @@ -1,6 +1,6 @@ ;;; erc-hecomplete.el --- Provides Nick name completion for ERC -;; Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2001, 2002, 2004, 2006 Free Software Foundation, Inc. ;; Author: Alex Schroeder <alex@gnu.org> ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcCompletion diff --git a/lisp/erc/erc-ibuffer.el b/lisp/erc/erc-ibuffer.el index a122908ed2c..7ca843d115c 100644 --- a/lisp/erc/erc-ibuffer.el +++ b/lisp/erc/erc-ibuffer.el @@ -1,6 +1,6 @@ ;;; erc-ibuffer.el --- ibuffer integration with ERC -;; Copyright (C) 2002, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2004, 2006 Free Software Foundation, Inc. ;; Author: Mario Lang <mlang@delysid.org> ;; Keywords: comm diff --git a/lisp/erc/erc-identd.el b/lisp/erc/erc-identd.el index 5cb179c7e22..e0ccfb40497 100644 --- a/lisp/erc/erc-identd.el +++ b/lisp/erc/erc-identd.el @@ -1,6 +1,6 @@ ;;; erc-identd.el --- RFC1413 (identd authentication protocol) server -;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2006 Free Software Foundation, Inc. ;; Author: John Wiegley <johnw@gnu.org> ;; Keywords: comm, processes diff --git a/lisp/erc/erc-imenu.el b/lisp/erc/erc-imenu.el index c64c9c04723..88de1cedf6e 100644 --- a/lisp/erc/erc-imenu.el +++ b/lisp/erc/erc-imenu.el @@ -1,6 +1,6 @@ ;;; erc-imenu.el -- Imenu support for ERC -;; Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2001, 2002, 2004, 2006 Free Software Foundation, Inc. ;; Author: Mario Lang <mlang@delysid.org> ;; Keywords: comm diff --git a/lisp/erc/erc-join.el b/lisp/erc/erc-join.el index da41ea77374..0d2c1f98706 100644 --- a/lisp/erc/erc-join.el +++ b/lisp/erc/erc-join.el @@ -1,6 +1,6 @@ ;;; erc-join.el --- autojoin channels on connect and reconnects -;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc. ;; Author: Alex Schroeder <alex@gnu.org> ;; Keywords: irc diff --git a/lisp/erc/erc-lang.el b/lisp/erc/erc-lang.el index 20c89a8b0b6..04cfbe9e220 100644 --- a/lisp/erc/erc-lang.el +++ b/lisp/erc/erc-lang.el @@ -1,6 +1,6 @@ ;;; erc-lang.el --- provide the LANG command to ERC -;; Copyright (C) 2002, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2004, 2006 Free Software Foundation, Inc. ;; Author: Alex Schroeder <alex@gnu.org> ;; Maintainer: Alex Schroeder <alex@gnu.org> diff --git a/lisp/erc/erc-list.el b/lisp/erc/erc-list.el index 9bc561523d9..c041842429e 100644 --- a/lisp/erc/erc-list.el +++ b/lisp/erc/erc-list.el @@ -1,6 +1,6 @@ ;;; erc-list.el --- Provide a faster channel listing mechanism -;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. ;; Copyright (C) 2004 Brian Palmer ;; Author: Mario Lang <mlang@lexx.delysid.org> @@ -140,12 +140,19 @@ display the channel list." (setq truncate-lines t) (add-hook 'post-command-hook 'erc-chanlist-post-command-hook 'append 'local)) +;; Define module: +;;;###autoload (autoload 'erc-list-mode "erc-list") +(define-erc-module list nil + "List channels nicely in a separate buffer." + ((defalias 'erc-cmd-LIST 'erc-list-channels)) + ((defalias 'erc-cmd-LIST 'erc-list-channels-simple))) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Functions. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;###autoload -(defun erc-cmd-LIST (&rest channel) +(defun erc-list-channels (&rest channel) "Display a buffer containing a list of channels on the current server. Optional argument CHANNEL specifies a single channel to list (instead of every available channel)." @@ -163,6 +170,18 @@ available channel)." (erc-chanlist channel)) t) +(defun erc-list-channels-simple (&optional line) + "Send the LIST command to the current server with optional channels LINE." + (when (string-match "^\\s-*\\(.*\\)$" line) + (let ((channels (match-string 1 line))) + (erc-log (format "cmd: LIST: %s" channels)) + (erc-server-send + (if (string= channels "") + "LIST" + (concat "LIST :" channels)))) + t)) +(put 'erc-list-channels-simple 'do-not-parse-args t) + ;;;###autoload (defun erc-chanlist (&optional channels) "Show a channel listing of the current server in a special mode. diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el index d4e6e5ad3fa..db60e5629bf 100644 --- a/lisp/erc/erc-log.el +++ b/lisp/erc/erc-log.el @@ -1,6 +1,6 @@ ;;; erc-log.el --- Logging facilities for ERC. -;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. ;; Author: Lawrence Mitchell <wence@gmx.li> ;; Keywords: IRC, chat, client, Internet, logging diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el index a5e3bf88ccf..88c6d4c425d 100644 --- a/lisp/erc/erc-match.el +++ b/lisp/erc/erc-match.el @@ -1,6 +1,6 @@ ;;; erc-match.el --- Highlight messages matching certain regexps -;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. ;; Author: Andreas Fuchs <asf@void.at> ;; Keywords: comm, faces @@ -428,24 +428,6 @@ In any of the following situations, MSG is directed at an entry FOOL: (or (erc-list-match fools-beg msg) (erc-list-match fools-end msg)))) -(defun erc-get-parsed-vector (point) - "Return the whole parsed vector on POINT." - (get-text-property point 'erc-parsed)) - -(defun erc-get-parsed-vector-nick (vect) - "Return nickname in the parsed vector VECT." - (let* ((untreated-nick (and vect (erc-response.sender vect))) - (maybe-nick (when untreated-nick - (car (split-string untreated-nick "!"))))) - (when (and (not (null maybe-nick)) - (erc-is-valid-nick-p maybe-nick)) - untreated-nick))) - -(defun erc-get-parsed-vector-type (vect) - "Return message type in the parsed vector VECT." - (and vect - (erc-response.command vect))) - (defun erc-match-message () "Mark certain keywords in a region. Use this defun with `erc-insert-modify-hook'." diff --git a/lisp/erc/erc-menu.el b/lisp/erc/erc-menu.el index 8e1f81adf75..7040a7baeee 100644 --- a/lisp/erc/erc-menu.el +++ b/lisp/erc/erc-menu.el @@ -1,6 +1,6 @@ ;; erc-menu.el -- Menu-bar definitions for ERC -;; Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc. +;; Copyright (C) 2001, 2002, 2004, 2005, 2006 Free Software Foundation, Inc. ;; Author: Mario Lang <mlang@delysid.org> ;; Keywords: comm, processes, menu @@ -36,8 +36,8 @@ ["Connect to server..." erc-select t] ["Disconnect from server..." erc-quit-server erc-server-connected] "-" - ["List channels..." erc-cmd-LIST - (and erc-server-connected (fboundp 'erc-cmd-LIST))] + ["List channels..." erc-list-channels + (and erc-server-connected (fboundp 'erc-list-channels))] ["Join channel..." erc-join-channel erc-server-connected] ["Start a query..." erc-cmd-QUERY erc-server-connected] "-" diff --git a/lisp/erc/erc-netsplit.el b/lisp/erc/erc-netsplit.el index 70ec2f2fc0d..a982b5e7c7e 100644 --- a/lisp/erc/erc-netsplit.el +++ b/lisp/erc/erc-netsplit.el @@ -1,6 +1,6 @@ ;;; erc-netsplit.el --- Reduce JOIN/QUIT messages on netsplits -;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc. ;; Author: Mario Lang <mlang@delysid.org> ;; Keywords: comm diff --git a/lisp/erc/erc-networks.el b/lisp/erc/erc-networks.el index b79a56a359c..c15f72e248f 100644 --- a/lisp/erc/erc-networks.el +++ b/lisp/erc/erc-networks.el @@ -1,6 +1,6 @@ ;;; erc-networks.el --- IRC networks -;; Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc. ;; Author: Mario Lang <mlang@lexx.delysid.org> ;; Keywords: comm diff --git a/lisp/erc/erc-notify.el b/lisp/erc/erc-notify.el index 1d2bdbd5f45..bb1c9cdceb3 100644 --- a/lisp/erc/erc-notify.el +++ b/lisp/erc/erc-notify.el @@ -1,6 +1,6 @@ ;;; erc-notify.el --- Online status change notification -;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc. ;; Author: Mario Lang <mlang@lexx.delysid.org> ;; Keywords: comm diff --git a/lisp/erc/erc-page.el b/lisp/erc/erc-page.el index d8e677031e3..4c6b86bd564 100644 --- a/lisp/erc/erc-page.el +++ b/lisp/erc/erc-page.el @@ -1,6 +1,6 @@ ;; erc-page.el - CTCP PAGE support for ERC -;; Copyright (C) 2002, 2004 Free Software Foundation +;; Copyright (C) 2002, 2004, 2006 Free Software Foundation ;; This file is part of GNU Emacs. diff --git a/lisp/erc/erc-pcomplete.el b/lisp/erc/erc-pcomplete.el index 110704304e2..d6d4dfdd3b3 100644 --- a/lisp/erc/erc-pcomplete.el +++ b/lisp/erc/erc-pcomplete.el @@ -1,6 +1,6 @@ ;;; erc-pcomplete.el --- Provides programmable completion for ERC -;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc. ;; Author: Sacha Chua <sacha@free.net.ph> ;; Keywords: comm, convenience diff --git a/lisp/erc/erc-replace.el b/lisp/erc/erc-replace.el index 07e8cd16138..06d3ca77f06 100644 --- a/lisp/erc/erc-replace.el +++ b/lisp/erc/erc-replace.el @@ -1,6 +1,6 @@ ;; erc-replace.el -- wash and massage messages inserted into the buffer -;; Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2001, 2002, 2004, 2006 Free Software Foundation, Inc. ;; Author: Andreas Fuchs <asf@void.at> ;; Maintainer: Mario Lang (mlang@delysid.org) diff --git a/lisp/erc/erc-ring.el b/lisp/erc/erc-ring.el index cabb8e2905f..87707e65faa 100644 --- a/lisp/erc/erc-ring.el +++ b/lisp/erc/erc-ring.el @@ -1,6 +1,6 @@ ;; erc-ring.el -- Command history handling for erc using ring.el -;; Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc. ;; Author: Alex Schroeder <alex@gnu.org> ;; Keywords: comm diff --git a/lisp/erc/erc-services.el b/lisp/erc/erc-services.el index 676948752fd..c8bac7fe45c 100644 --- a/lisp/erc/erc-services.el +++ b/lisp/erc/erc-services.el @@ -1,6 +1,6 @@ ;;; erc-services.el --- Identify to NickServ -;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc. ;; This file is part of GNU Emacs. diff --git a/lisp/erc/erc-sound.el b/lisp/erc/erc-sound.el index c5b0f8177f2..bbcddafc231 100644 --- a/lisp/erc/erc-sound.el +++ b/lisp/erc/erc-sound.el @@ -1,6 +1,6 @@ ;;; erc-sound.el --- CTCP SOUND support for ERC -;; Copyright (C) 2002, 2003 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2003, 2006 Free Software Foundation, Inc. ;; This file is part of GNU Emacs. diff --git a/lisp/erc/erc-speedbar.el b/lisp/erc/erc-speedbar.el index 254d7fc5781..55e24782f77 100644 --- a/lisp/erc/erc-speedbar.el +++ b/lisp/erc/erc-speedbar.el @@ -1,6 +1,6 @@ ;;; erc-speedbar.el --- Speedbar support for ERC -;; Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc. ;; Author: Mario Lang <mlang@delysid.org> ;; Contributor: Eric M. Ludlam <eric@siege-engine.com> diff --git a/lisp/erc/erc-spelling.el b/lisp/erc/erc-spelling.el index 41e342c0e50..3cbc786274d 100644 --- a/lisp/erc/erc-spelling.el +++ b/lisp/erc/erc-spelling.el @@ -1,6 +1,6 @@ ;;; erc-spelling.el --- use flyspell in ERC -;; Copyright (C) 2005, 2006 Free Software Foundation, Inc. +;; Copyright (C) 2005, 2006 Free Software Foundation, Inc. ;; Author: Jorgen Schaefer <forcer@forcix.cx> ;; Keywords: irc @@ -41,11 +41,13 @@ ;; called AFTER the server buffer is initialized. ((add-hook 'erc-connect-pre-hook 'erc-spelling-init) (mapc (lambda (buffer) - (with-current-buffer buffer (erc-spelling-init))) + (when buffer + (with-current-buffer buffer (erc-spelling-init)))) (erc-buffer-list))) ((remove-hook 'erc-connect-pre-hook 'erc-spelling-init) (mapc (lambda (buffer) - (with-current-buffer buffer (flyspell-mode 0))) + (when buffer + (with-current-buffer buffer (flyspell-mode 0)))) (erc-buffer-list)))) (defcustom erc-spelling-dictionaries nil diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el index ead847ff73f..5d43baab6c9 100644 --- a/lisp/erc/erc-stamp.el +++ b/lisp/erc/erc-stamp.el @@ -1,4 +1,4 @@ -;;; erc-stamp.el --- Timestamping for Emacs IRC CLient +;;; erc-stamp.el --- Timestamping for ERC messages ;; Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc. @@ -180,11 +180,17 @@ the correct column." (integer :tag "Column number") (const :tag "Unspecified" nil))) -(defcustom erc-timestamp-right-align-by-pixel nil - "*If non-nil, insert the right timestamp based on a pixel value. -This is needed when variable-width text precedes a timestamp. +(defcustom erc-timestamp-use-align-to (and (not (featurep 'xemacs)) + (>= emacs-major-version 22) + (eq window-system 'x)) + "*If non-nil, use the :align-to display property to align the stamp. +This gives better results when variable-width characters (like +Asian language characters and math symbols) precede a timestamp. Unfortunately, it only works in Emacs 22 and when using the X -Window System." +Window System. + +A side effect of enabling this is that there will only be one +space before a right timestamp in any saved logs." :group 'erc-stamp :type 'boolean) @@ -200,18 +206,15 @@ Window System." (insert s))) (defun erc-insert-aligned (string pos) - "Insert STRING based on a fraction of the width of the buffer. -Fraction is roughly (/ POS (window-width)). + "Insert STRING at the POSth column. -If `erc-timestamp-right-align-by-pixel' is nil, insert STRING at the -POSth column, without using pixel coordinates." - (if (not erc-timestamp-right-align-by-pixel) +If `erc-timestamp-use-align-to' is t, use the :align-to display +property to get to the POSth column." + (if (not erc-timestamp-use-align-to) (indent-to pos) (insert " ") - (let ((offset (floor (* (/ (1- pos) (window-width) 1.0) - (nth 2 (window-inside-pixel-edges)))))) - (put-text-property (1- (point)) (point) 'display - `(space :align-to (,offset))))) + (put-text-property (1- (point)) (point) 'display + (list 'space ':align-to pos))) (insert string)) (defun erc-insert-timestamp-right (string) @@ -237,31 +240,26 @@ be printed just before the window-width." (goto-char (point-max)) (forward-char -1);; before the last newline (let* ((current-window (get-buffer-window (current-buffer))) + (str-width (string-width string)) (pos (cond - (erc-timestamp-right-column - (+ erc-timestamp-right-column (length string))) + (erc-timestamp-right-column erc-timestamp-right-column) ((and (boundp 'erc-fill-mode) erc-fill-mode - (boundp 'erc-fill-column)) - (1+ erc-fill-column)) - (current-window - (- (window-width current-window) - 1)) + (boundp 'erc-fill-column) + erc-fill-column) + (1+ (- erc-fill-column str-width))) (fill-column - (1+ fill-column)) + (1+ (- fill-column str-width))) (t - (- (window-width) - 1)))) + (- (window-width) str-width 1)))) (from (point)) (col (current-column)) indent) - ;; deal with variable-width characters - (setq pos (- pos (string-width string)) - ;; The following is a kludge that works with most - ;; international input. It is now only used to calculate - ;; whether to move to the next line before inserting a - ;; stamp. - col (+ col (ceiling (/ (- col (- (point) (point-at-bol))) 1.6)))) + ;; The following is a kludge used to calculate whether to move + ;; to the next line before inserting a stamp. It allows for + ;; some margin of error if what is displayed on the line differs + ;; from the number of characters on the line. + (setq col (+ col (ceiling (/ (- col (- (point) (point-at-bol))) 1.6)))) (if (< col pos) (erc-insert-aligned string pos) (newline) diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el index 6d760d75ba2..63005678613 100644 --- a/lisp/erc/erc-track.el +++ b/lisp/erc/erc-track.el @@ -1,6 +1,6 @@ ;;; erc-track.el --- Track modified channel buffers -;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. ;; Author: Mario Lang <mlang@delysid.org> ;; Keywords: comm, faces diff --git a/lisp/erc/erc-truncate.el b/lisp/erc/erc-truncate.el index 49cd20d759c..7a1feaaedd2 100644 --- a/lisp/erc/erc-truncate.el +++ b/lisp/erc/erc-truncate.el @@ -1,6 +1,6 @@ ;;; erc-truncate.el --- Functions for truncating ERC buffers -;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc. ;; Author: Andreas Fuchs <asf@void.at> ;; Keywords: IRC, chat, client, Internet, logging diff --git a/lisp/erc/erc-xdcc.el b/lisp/erc/erc-xdcc.el index 7c8ee6fff62..d00dfc5e1a0 100644 --- a/lisp/erc/erc-xdcc.el +++ b/lisp/erc/erc-xdcc.el @@ -1,6 +1,6 @@ ;;; erc-xdcc.el --- XDCC file-server support for ERC -;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc. ;; Author: Mario Lang <mlang@delysid.org> ;; Keywords: comm, processes @@ -24,7 +24,7 @@ ;;; Commentary: -;; This file provides a very simple XDCC file server for the Emacs IRC Client. +;; This file provides a very simple XDCC file server for ERC. ;;; Code: diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 936fffa252f..e1dc240901b 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -1719,22 +1719,15 @@ all channel buffers on all servers." (defun erc-migrate-modules (mods) "Migrate old names of ERC modules to new ones." ;; modify `transforms' to specify what needs to be changed - ;; each item is in the format '(new .old) - (let ((transforms '((pcomplete . completion))) - (modules (copy-alist mods))) - (dolist (transform transforms) - (let ((addp nil)) - (setq modules (erc-delete-if `(lambda (val) - (and (eq val ',(car transform)) - (setq addition t))) - modules)) - (when addp - (add-to-list 'modules (cdr transform))))) - (erc-delete-dups modules))) - -(defcustom erc-modules '(netsplit fill button match track pcomplete readonly + ;; each item is in the format '(old . new) + (let ((transforms '((pcomplete . completion)))) + (erc-delete-dups + (mapcar (lambda (m) (or (cdr (assoc m transforms)) m)) + mods)))) + +(defcustom erc-modules '(netsplit fill button match track completion readonly ring autojoin noncommands irccontrols - stamp) + stamp list) "A list of modules which erc should enable. If you set the value of this without using `customize' remember to call \(erc-update-modules) after you change it. When using `customize', modules @@ -1755,40 +1748,42 @@ removed from the list will be disabled." ;; this test is for the case where erc hasn't been loaded yet (when (fboundp 'erc-update-modules) (erc-update-modules))) - :type '(set :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 "Highlight or remove IRC control characters" - irccontrols) - (const :tag "Save buffers in logs" log) - (const :tag "Highlight pals, fools, and other keywords" match) - (const :tag "Detect netsplits" netsplit) - (const :tag "Don't display non-IRC commands after evaluation" - noncommands) - (const :tag - "Notify when the online status of certain users changes" - notify) - (const :tag "Complete nicknames and commands (programmable)" - completion) - (const :tag "Complete nicknames and commands (old)" hecomplete) - (const :tag "Make displayed lines read-only" readonly) - (const :tag "Replace text in messages" replace) - (const :tag "Enable an input history" ring) - (const :tag "Scroll to the bottom of the buffer" scrolltobottom) - (const :tag "Identify to Nickserv (IRC Services) automatically" - services) - (const :tag "Convert smileys to pretty icons" smiley) - (const :tag "Play sounds when you receive CTCP SOUND requests" - sound) - (const :tag "Add timestamps to messages" stamp) - (const :tag "Check spelling" spelling) - (const :tag "Track channel activity in the mode-line" track) - (const :tag "Truncate buffers to a certain size" truncate) - (const :tag "Translate morse code in messages" unmorse) - (repeat :tag "Others" :inline t symbol)) + :type + '(set + :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 "Highlight or remove IRC control characters" + irccontrols) + (const :tag "Save buffers in logs" log) + (const :tag "Highlight pals, fools, and other keywords" match) + (const :tag "Detect netsplits" netsplit) + (const :tag "Don't display non-IRC commands after evaluation" + noncommands) + (const :tag + "Notify when the online status of certain users changes" + notify) + (const :tag "Complete nicknames and commands (programmable)" + completion) + (const :tag "Complete nicknames and commands (old)" hecomplete) + (const :tag "Make displayed lines read-only" readonly) + (const :tag "Replace text in messages" replace) + (const :tag "Enable an input history" ring) + (const :tag "Scroll to the bottom of the buffer" scrolltobottom) + (const :tag "Identify to Nickserv (IRC Services) automatically" + services) + (const :tag "Convert smileys to pretty icons" smiley) + (const :tag "Play sounds when you receive CTCP SOUND requests" + sound) + (const :tag "Add timestamps to messages" stamp) + (const :tag "Check spelling" spelling) + (const :tag "Track channel activity in the mode-line" track) + (const :tag "Truncate buffers to a certain size" truncate) + (const :tag "Translate morse code in messages" unmorse) + (repeat :tag "Others" :inline t symbol)) :group 'erc) (defun erc-update-modules () @@ -1799,14 +1794,11 @@ removed from the list will be disabled." (cond ;; yuck. perhaps we should bring the filenames into sync? ((string= req "erc-completion") - (setq req "erc-pcomplete") - (setq mod 'completion)) + (setq req "erc-pcomplete")) ((string= req "erc-pcomplete") - (setq req "erc-pcomplete") (setq mod 'completion)) ((string= req "erc-autojoin") - (setq req "erc-join") - (setq mod 'autojoin))) + (setq req "erc-join"))) (condition-case nil (require (intern req)) (error nil)) @@ -1935,7 +1927,8 @@ Returns the buffer for the given server or channel." (goto-char (point-max)) (insert "\n")) (set-marker (process-mark erc-server-process) (point)) - (unless continued-session + (if continued-session + (goto-char (point-max)) (set-marker erc-insert-marker (point)) (erc-display-prompt) (goto-char (point-max))) @@ -6143,6 +6136,26 @@ This function should be on `erc-kill-channel-hook'." (funcall erc-part-reason nil)) nil tgt)))) +;;; Dealing with `erc-parsed' + +(defun erc-get-parsed-vector (point) + "Return the whole parsed vector on POINT." + (get-text-property point 'erc-parsed)) + +(defun erc-get-parsed-vector-nick (vect) + "Return nickname in the parsed vector VECT." + (let* ((untreated-nick (and vect (erc-response.sender vect))) + (maybe-nick (when untreated-nick + (car (split-string untreated-nick "!"))))) + (when (and (not (null maybe-nick)) + (erc-is-valid-nick-p maybe-nick)) + untreated-nick))) + +(defun erc-get-parsed-vector-type (vect) + "Return message type in the parsed vector VECT." + (and vect + (erc-response.command vect))) + (provide 'erc) ;;; Deprecated. We might eventually stop requiring the goodies automatically. |