summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2006-02-08 02:41:23 +0000
committerMiles Bader <miles@gnu.org>2006-02-08 02:41:23 +0000
commitc6b99621a2697da95326e97109f88a321fc66558 (patch)
tree10afb5d917a1d53cde74ce0071b94e91dad19d44
parent012ce704b5fe51b94345f9c7cb4c190390ba391f (diff)
downloademacs-c6b99621a2697da95326e97109f88a321fc66558.tar.gz
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Creator: Michael Olson <mwolson@gnu.org> Merge from erc--emacs--0
-rw-r--r--lisp/erc/ChangeLog36
-rw-r--r--lisp/erc/ChangeLog.01 (renamed from lisp/erc/ChangeLog.2001)0
-rw-r--r--lisp/erc/ChangeLog.02 (renamed from lisp/erc/ChangeLog.2002)2
-rw-r--r--lisp/erc/ChangeLog.03 (renamed from lisp/erc/ChangeLog.2003)2
-rw-r--r--lisp/erc/ChangeLog.04 (renamed from lisp/erc/ChangeLog.2004)2
-rw-r--r--lisp/erc/ChangeLog.05 (renamed from lisp/erc/ChangeLog.2005)2
-rw-r--r--lisp/erc/erc-hecomplete.el (renamed from lisp/erc/erc-complete.el)34
-rw-r--r--lisp/erc/erc-join.el (renamed from lisp/erc/erc-autojoin.el)8
-rw-r--r--lisp/erc/erc-list.el2
-rw-r--r--lisp/erc/erc-networks.el (renamed from lisp/erc/erc-nets.el)11
-rw-r--r--lisp/erc/erc-notify.el2
-rw-r--r--lisp/erc/erc-services.el (renamed from lisp/erc/erc-nickserv.el)12
-rw-r--r--lisp/erc/erc-stamp.el22
-rw-r--r--lisp/erc/erc.el42
14 files changed, 116 insertions, 61 deletions
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog
index 9646318e758..50b37eb044f 100644
--- a/lisp/erc/ChangeLog
+++ b/lisp/erc/ChangeLog
@@ -1,3 +1,37 @@
+2006-02-07 Michael Olson <mwolson@gnu.org>
+
+ * ChangeLog.01, ChangeLog.02, ChangeLog.03, ChangeLog.04,
+ ChangeLog.05: Rename from ChangeLog.NNNN in order to disambiguate
+ the filenames in DOS.
+
+ * erc-goodies.el: Comment fix.
+
+ * erc-hecomplete.el: Rename from erc-complete.el. Update
+ commentary. Use define-erc-module so that it's possible to
+ actually use this.
+ (erc-hecomplete): Rename function from `erc-complete'.
+ (erc-hecomplete): Rename group from `erc-old-complete'. Docfix.
+
+ * erc-join.el: Rename from erc-autojoin.el.
+
+ * erc-networks.el: Rename from erc-nets.el.
+
+ * erc-services.el: Rename from erc-nickserv.el.
+
+ * erc-stamp.el (erc-insert-aligned): Don't take 3rd argument. Use
+ the simpler `indent-to' function when
+ `erc-timestamp-right-align-by-pixel' is nil.
+ (erc-insert-timestamp-right): If the timestamp goes on the
+ following line, don't add timestamp properties to the spaces in
+ front of it.
+
+ * erc.el (erc-migrate-modules): New function that eases migration
+ of module names.
+ (erc-modules): Call erc-migrate-modules in the :get accessor.
+ (erc-modules, erc-update-modules): Update for new modules names.
+ (erc-cmd-SMV): Remove, since this does not give useful output due
+ to the version strings being removed from ERC modules.
+
2006-02-05 Michael Olson <mwolson@gnu.org>
* erc-spelling.el (erc-spelling-init): If
@@ -393,7 +427,7 @@
where global-mode-string is not a list. Emacs22 permits this.
-See ChangeLog.2005 for earlier changes.
+See ChangeLog.05 for earlier changes.
Copyright (C) 2006 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
diff --git a/lisp/erc/ChangeLog.2001 b/lisp/erc/ChangeLog.01
index 20a03801477..20a03801477 100644
--- a/lisp/erc/ChangeLog.2001
+++ b/lisp/erc/ChangeLog.01
diff --git a/lisp/erc/ChangeLog.2002 b/lisp/erc/ChangeLog.02
index 81b3169e98c..006ac0c1415 100644
--- a/lisp/erc/ChangeLog.2002
+++ b/lisp/erc/ChangeLog.02
@@ -2594,7 +2594,7 @@
Default it is used for URLs, but other things could be added.
see if you can find another use, erc-button-alist
-See ChangeLog.2001 for earlier changes.
+See ChangeLog.01 for earlier changes.
Copyright (C) 2002 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
diff --git a/lisp/erc/ChangeLog.2003 b/lisp/erc/ChangeLog.03
index 6d650c9e150..6f55258c04e 100644
--- a/lisp/erc/ChangeLog.2003
+++ b/lisp/erc/ChangeLog.03
@@ -2138,7 +2138,7 @@
behavior - if you think this was the wrong decision, please correct it and
I'll remember it for next time.
-See ChangeLog.2002 for earlier changes.
+See ChangeLog.02 for earlier changes.
Copyright (C) 2003 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
diff --git a/lisp/erc/ChangeLog.2004 b/lisp/erc/ChangeLog.04
index fd5e0aff795..3ab41db65b4 100644
--- a/lisp/erc/ChangeLog.2004
+++ b/lisp/erc/ChangeLog.04
@@ -2067,7 +2067,7 @@
* erc-list.el: Added variable erc-chanlist-mode-hook.
-See ChangeLog.2003 for earlier changes.
+See ChangeLog.03 for earlier changes.
Copyright (C) 2004 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
diff --git a/lisp/erc/ChangeLog.2005 b/lisp/erc/ChangeLog.05
index 09dc245d13c..8fa725459e2 100644
--- a/lisp/erc/ChangeLog.2005
+++ b/lisp/erc/ChangeLog.05
@@ -1215,7 +1215,7 @@
bug where emacs would get stuck in a loop when \C-g was in a
message and `erc-beep-p' was set to nil (default setting).
-See ChangeLog.2004 for earlier changes.
+See ChangeLog.04 for earlier changes.
Copyright (C) 2005 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
diff --git a/lisp/erc/erc-complete.el b/lisp/erc/erc-hecomplete.el
index dd0130156f9..763d75c8fc7 100644
--- a/lisp/erc/erc-complete.el
+++ b/lisp/erc/erc-hecomplete.el
@@ -1,4 +1,4 @@
-;;; erc-complete.el --- Provides Nick name completion for ERC
+;;; erc-hecomplete.el --- Provides Nick name completion for ERC
;; Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
@@ -24,12 +24,11 @@
;;; Commentary:
-;; This file is obsolete. Use completion from erc-pcomplete instead.
-;; This file is based on hippie-expand, while the new file is based on
-;; pcomplete. There is no autoload cookie in this file. If you want
-;; to use the code in this file, add the following to your ~/.emacs:
+;; This file is considered obsolete. It is recommended to use
+;; completion from erc-pcomplete instead.
-;; (autoload 'erc-complete "erc-complete" "Complete nick at point." t)
+;; This file is based on hippie-expand, while the new file is based on
+;; pcomplete.
;;; Code:
@@ -37,8 +36,13 @@
(require 'erc-match); for erc-pals
(require 'hippie-exp); for the hippie expand stuff
-;;;###autoload
-(defun erc-complete ()
+;;;###autoload (autoload 'erc-hecomplete-mode "erc-hecomplete" nil t)
+(define-erc-module hecomplete nil
+ "Complete nick at point."
+ ((add-hook 'erc-complete-functions 'erc-hecomplete))
+ ((remove-hook 'erc-complete-functions 'erc-hecomplete)))
+
+(defun erc-hecomplete ()
"Complete nick at point.
See `erc-try-complete-nick' for more technical info.
This function is obsolete, use `erc-pcomplete' instead."
@@ -46,8 +50,8 @@ This function is obsolete, use `erc-pcomplete' instead."
(let ((hippie-expand-try-functions-list '(erc-try-complete-nick)))
(hippie-expand nil)))
-(defgroup erc-old-complete nil
- "Nick completion. Obsolete, use erc-pcomplete instead."
+(defgroup erc-hecomplete nil
+ "Nick completion. It is recommended to use erc-pcomplete instead."
:group 'erc)
(defcustom erc-nick-completion 'all
@@ -67,14 +71,14 @@ or you may use an arbitrary lisp expression."
(repeat :tag "List" (string :tag "Nick"))
function
sexp)
- :group 'erc-old-complete)
+ :group 'erc-hecomplete)
(defcustom erc-nick-completion-ignore-case t
"*Non-nil means don't consider case significant in nick completion.
Case will be automatically corrected when non-nil.
For instance if you type \"dely TAB\" the word completes and changes to
\"delYsid\"."
- :group 'erc-old-complete
+ :group 'erc-hecomplete
:type 'boolean)
(defun erc-nick-completion-exclude-myself ()
@@ -91,7 +95,7 @@ typing \"f o TAB\" will directly give you foobar. Use this with
(defcustom erc-nick-completion-postfix ": "
"*When `erc-complete' is used in the first word after the prompt,
add this string when a unique expansion was found."
- :group 'erc-old-complete
+ :group 'erc-hecomplete
:type 'string)
(defun erc-command-list ()
@@ -209,9 +213,9 @@ Window configurations are stored in
"Returns t if point is directly after `erc-prompt' when doing completion."
(erc-at-beginning-of-line-p (he-dabbrev-beg)))
-(provide 'erc-complete)
+(provide 'erc-hecomplete)
-;;; erc-complete.el ends here
+;;; erc-hecomplete.el ends here
;;
;; Local Variables:
;; indent-tabs-mode: t
diff --git a/lisp/erc/erc-autojoin.el b/lisp/erc/erc-join.el
index 06b1547b327..da41ea77374 100644
--- a/lisp/erc/erc-autojoin.el
+++ b/lisp/erc/erc-join.el
@@ -1,4 +1,4 @@
-;;; erc-autojoin.el --- autojoin channels on connect and reconnects
+;;; erc-join.el --- autojoin channels on connect and reconnects
;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
@@ -40,7 +40,7 @@
"Enable autojoining."
:group 'erc)
-;;;###autoload (autoload 'erc-autojoin-mode "erc-autojoin" nil t)
+;;;###autoload (autoload 'erc-autojoin-mode "erc-join" nil t)
(define-erc-module autojoin nil
"Makes ERC autojoin on connects and reconnects."
((add-hook 'erc-after-connect 'erc-autojoin-channels)
@@ -127,9 +127,9 @@ servers, presumably in the same domain."
;; functions.
nil)
-(provide 'erc-autojoin)
+(provide 'erc-join)
-;;; erc-autojoin.el ends here
+;;; erc-join.el ends here
;;
;; Local Variables:
;; indent-tabs-mode: t
diff --git a/lisp/erc/erc-list.el b/lisp/erc/erc-list.el
index 785e4d19750..9bc561523d9 100644
--- a/lisp/erc/erc-list.el
+++ b/lisp/erc/erc-list.el
@@ -32,7 +32,7 @@
;;; Code:
(require 'erc)
-(require 'erc-nets)
+(require 'erc-networks)
(require 'sort)
(unless (fboundp 'make-overlay)
(require 'overlay))
diff --git a/lisp/erc/erc-nets.el b/lisp/erc/erc-networks.el
index 716a42996d5..b79a56a359c 100644
--- a/lisp/erc/erc-nets.el
+++ b/lisp/erc/erc-networks.el
@@ -1,4 +1,4 @@
-;;; erc-nets.el --- IRC networks
+;;; erc-networks.el --- IRC networks
;; Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
@@ -30,7 +30,7 @@
;;
;; Put into your .emacs:
;;
-;; (require 'erc-nets)
+;; (require 'erc-networks)
;;
;; M-x erc-server-select provides an alternative way to connect to servers by
;; choosing networks.
@@ -742,7 +742,7 @@ network as a symbol."
(intern (downcase (symbol-name erc-network)))))
(erc-make-obsolete 'erc-current-network 'erc-network
- "Obsolete since erc-nets 1.5")
+ "Obsolete since erc-networks 1.5")
(defun erc-network-name ()
"Returns the name of the current network as a string."
@@ -848,10 +848,9 @@ VALUE is the options value.")
(erc-get 'pals 'freenode)
+(provide 'erc-networks)
-(provide 'erc-nets)
-
-;;; erc-nets.el ends here
+;;; erc-networks.el ends here
;;
;; Local Variables:
;; indent-tabs-mode: t
diff --git a/lisp/erc/erc-notify.el b/lisp/erc/erc-notify.el
index 9fc7f572977..1d2bdbd5f45 100644
--- a/lisp/erc/erc-notify.el
+++ b/lisp/erc/erc-notify.el
@@ -30,7 +30,7 @@
;;; Code:
(require 'erc)
-(require 'erc-nets)
+(require 'erc-networks)
(eval-when-compile
(require 'cl)
(require 'pcomplete))
diff --git a/lisp/erc/erc-nickserv.el b/lisp/erc/erc-services.el
index be5541d3b5c..676948752fd 100644
--- a/lisp/erc/erc-nickserv.el
+++ b/lisp/erc/erc-services.el
@@ -1,4 +1,4 @@
-;;; erc-nickserv.el --- Identify to NickServ
+;;; erc-services.el --- Identify to NickServ
;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
@@ -37,7 +37,7 @@
;;
;; Put into your .emacs:
;;
-;; (require 'erc-nickserv)
+;; (require 'erc-services)
;; (erc-services-mode 1)
;;
;; Add your nickname and NickServ password to `erc-nickserv-passwords'.
@@ -60,7 +60,7 @@
;;; Code:
(require 'erc)
-(require 'erc-nets)
+(require 'erc-networks)
(eval-when-compile (require 'cl))
;; Customization:
@@ -77,7 +77,7 @@ This group allows you to set variables to somewhat automate
communication with those Services."
:group 'erc)
-;;;###autoload (autoload 'erc-services-mode "erc-nickserv" nil t)
+;;;###autoload (autoload 'erc-services-mode "erc-services" nil t)
(define-erc-module services nickserv
"This mode automates communication with services."
((erc-nickserv-identify-mode erc-nickserv-identify-mode))
@@ -325,9 +325,9 @@ When called interactively, read the password using `read-passwd'."
(erc-message msgtype
(concat nickserv " " identify-word " " nick password)))))
-(provide 'erc-nickserv)
+(provide 'erc-services)
-;;; erc-nickserv.el ends here
+;;; erc-services.el ends here
;;
;; Local Variables:
;; indent-tabs-mode: t
diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el
index 6b34a2592f4..ead847ff73f 100644
--- a/lisp/erc/erc-stamp.el
+++ b/lisp/erc/erc-stamp.el
@@ -199,20 +199,20 @@ Window System."
(erc-put-text-property 0 len 'field 'erc-timestamp s)
(insert s)))
-(defun erc-insert-aligned (string pos &optional fallback)
+(defun erc-insert-aligned (string pos)
"Insert STRING based on a fraction of the width of the buffer.
Fraction is roughly (/ POS (window-width)).
-If `erc-timestamp-right-align-by-pixel' is nil, use
-\(- POS FALLBACK) to determine how many spaces to insert."
+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)
- (insert (make-string (- pos fallback) ? ) string)
+ (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))))
- (insert string)))
+ `(space :align-to (,offset)))))
+ (insert string))
(defun erc-insert-timestamp-right (string)
"Insert timestamp on the right side of the screen.
@@ -257,14 +257,16 @@ be printed just before the window-width."
indent)
;; deal with variable-width characters
(setq pos (- pos (string-width string))
- ;; the following is a kludge that works with most
- ;; international input
+ ;; 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))))
(if (< col pos)
- (erc-insert-aligned string pos col)
+ (erc-insert-aligned string pos)
(newline)
- (setq from (point))
(indent-to pos)
+ (setq from (point))
(insert string))
(erc-put-text-property from (1+ (point)) 'field 'erc-timestamp)
(erc-put-text-property from (1+ (point)) 'rear-nonsticky t)
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 8d380847f5a..936fffa252f 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -1716,6 +1716,22 @@ all channel buffers on all servers."
"Used to keep track of how many times an attempt at changing nick is made.")
(make-variable-buffer-local 'erc-nick-change-attempt-count)
+(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
ring autojoin noncommands irccontrols
stamp)
@@ -1723,6 +1739,9 @@ all channel buffers on all servers."
If you set the value of this without using `customize' remember to call
\(erc-update-modules) after you change it. When using `customize', modules
removed from the list will be disabled."
+ :get (lambda (sym)
+ ;; replace outdated names with their newer equivalents
+ (erc-migrate-modules (symbol-value sym)))
:set (lambda (sym val)
;; disable modules which have just been removed
(when (and (boundp 'erc-modules) erc-modules val)
@@ -1732,7 +1751,7 @@ removed from the list will be disabled."
(when (and (fboundp f) (boundp f) (symbol-value f))
(message "Disabling `erc-%s'" module)
(funcall f 0))))))
- (set-default sym val)
+ (set sym val)
;; this test is for the case where erc hasn't been loaded yet
(when (fboundp 'erc-update-modules)
(erc-update-modules)))
@@ -1753,8 +1772,8 @@ removed from the list will be disabled."
"Notify when the online status of certain users changes"
notify)
(const :tag "Complete nicknames and commands (programmable)"
- pcomplete)
- (const :tag "Complete nicknames and commands (old)" completion)
+ 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)
@@ -1781,10 +1800,13 @@ removed from the list will be disabled."
;; yuck. perhaps we should bring the filenames into sync?
((string= req "erc-completion")
(setq req "erc-pcomplete")
- (setq mod 'pcomplete))
- ((string= req "erc-services")
- (setq req "erc-nickserv")
- (setq mod 'services)))
+ (setq mod 'completion))
+ ((string= req "erc-pcomplete")
+ (setq req "erc-pcomplete")
+ (setq mod 'completion))
+ ((string= req "erc-autojoin")
+ (setq req "erc-join")
+ (setq mod 'autojoin)))
(condition-case nil
(require (intern req))
(error nil))
@@ -3142,12 +3164,6 @@ the message given by REASON."
(erc-modes)))
t)
-(defun erc-cmd-SMV ()
- "Say the current ERC module versions into channel."
- (erc-send-message (format "I'm using the following module revisions: %s!"
- (erc-version-modules)))
- t)
-
(defun erc-cmd-DEOP (&rest people)
"Remove the operator setting from user(s) given in PEOPLE."
(when (> (length people) 0)