emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/erc/erc.el


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/erc/erc.el
Date: Wed, 08 Feb 2006 02:41:28 +0000

Index: emacs/lisp/erc/erc.el
diff -u emacs/lisp/erc/erc.el:1.4 emacs/lisp/erc/erc.el:1.5
--- emacs/lisp/erc/erc.el:1.4   Sun Feb  5 12:42:51 2006
+++ emacs/lisp/erc/erc.el       Wed Feb  8 02:41:23 2006
@@ -1716,6 +1716,22 @@
   "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 @@
 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 @@
                 (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 @@
                     "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 @@
        ;; 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 @@
                            (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)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]