erc-commit
[Top][All Lists]
Advanced

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

[Erc-commit] [commit][master] Turn erc-networks.el into the "networks" m


From: mwolson
Subject: [Erc-commit] [commit][master] Turn erc-networks.el into the "networks" module, and enable by default.
Date: Thu, 24 Jan 2008 19:50:05 -0500

commit 67b3f4a71e67a5d3af6218f5583685335e4da667
Author: Michael W. Olson <address@hidden>
Date:   Thu Jan 24 19:46:34 2008 -0500

    Turn erc-networks.el into the "networks" module, and enable by default.

diff --git a/ChangeLog b/ChangeLog
index 715da24..57402f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,18 @@
 2008-01-25  Michael Olson  <address@hidden>
 
+       * NEWS: Update.
+
+       * erc-networks.el: Add a module definition.
+
+       * erc-services.el (erc-nickserv-identify-mode): Force-enable the
+       networks module, because we need it to set erc-network for us.
+
        * erc-track.el (erc-track-faces-normal-list): Indicate in the
        docstring that this variable can be set to nil.
 
+       * erc.el: On second thought, don't load erc-networks.  Just enable
+       the networks module by default.
+
 2008-01-24  Michael Olson  <address@hidden>
 
        * erc.el: Load erc-networks.el so that functions get access to the
diff --git a/NEWS b/NEWS
index 73c36b0..9f0cf1c 100644
--- a/NEWS
+++ b/NEWS
@@ -68,10 +68,14 @@ query in a new selected window.
 This should ERC use less space in the modeline.  To get the old
 behavior back, set `erc-mode-line-format' to "%s %a".
 
+** Modules newly enabled by default
+
+*** move-to-prompt: Move to the prompt when typing text.
+*** networks: Provide data about IRC networks.
+
 ** New formatting variables allowed in `erc-format-network':
 
 *** `%N': the name of the network.
-
 *** `%S': much like %s, but let the network name trump the server name.
 
 ** Compatibility with old releases
@@ -166,7 +170,8 @@ filtering is performed.
 
 *** Networks (erc-networks.el)
 
-**** Load this file so that we get access to `erc-network-name'.
+**** Turn this into the "networks" module for ERC, so that it can be more
+easily enabled.  Enable it by default.
 
 **** Add support for Rizon.
 
diff --git a/erc-networks.el b/erc-networks.el
index 4e7090e..b74fdb2 100644
--- a/erc-networks.el
+++ b/erc-networks.el
@@ -28,9 +28,7 @@
 ;;
 ;; Usage:
 ;;
-;; Put into your .emacs:
-;;
-;; (require 'erc-networks)
+;; This is the "networks" module.
 ;;
 ;; M-x erc-server-select provides an alternative way to connect to servers by
 ;; choosing networks.
@@ -766,9 +764,14 @@ network as a symbol."
   (setq erc-network nil)
   nil)
 
-(add-hook 'erc-server-375-functions 'erc-set-network-name)
-(add-hook 'erc-server-422-functions 'erc-set-network-name)
-(add-hook 'erc-disconnected-hook 'erc-unset-network-name)
+(define-erc-module networks nil
+  "Provide data about IRC networks."
+  ((add-hook 'erc-server-375-functions 'erc-set-network-name)
+   (add-hook 'erc-server-422-functions 'erc-set-network-name)
+   (add-hook 'erc-disconnected-hook 'erc-unset-network-name))
+  ((remove-hook 'erc-server-375-functions 'erc-set-network-name)
+   (remove-hook 'erc-server-422-functions 'erc-set-network-name)
+   (remove-hook 'erc-disconnected-hook 'erc-unset-network-name)))
 
 (defun erc-ports-list (ports)
   "Return a list of PORTS.
diff --git a/erc-services.el b/erc-services.el
index 045b629..b25a10d 100644
--- a/erc-services.el
+++ b/erc-services.el
@@ -123,6 +123,10 @@ You can also use M-x erc-nickserv-identify-mode to change 
modes."
                  '(("autodetect") ("nick-change") ("both")) nil t))))
   (add-hook 'erc-server-NOTICE-functions
            'erc-nickserv-identification-autodetect)
+  (unless erc-networks-mode
+    ;; Force-enable networks module, because we need it to set
+    ;; erc-network for us.
+    (erc-networks-enable))
   (cond ((eq mode 'autodetect)
         (setq erc-nickserv-identify-mode 'autodetect)
         (add-hook 'erc-server-NOTICE-functions
diff --git a/erc.el b/erc.el
index c314809..4c54fe7 100644
--- a/erc.el
+++ b/erc.el
@@ -1811,8 +1811,8 @@ buffer rather than a server buffer.")
             mods))))
 
 (defcustom erc-modules '(netsplit fill button match track completion readonly
-                                 ring autojoin noncommands irccontrols
-                                 move-to-prompt stamp menu list)
+                        networks ring autojoin noncommands irccontrols
+                        move-to-prompt stamp menu 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
@@ -1858,6 +1858,7 @@ removed from the list will be disabled."
     (const :tag "move-to-prompt: Move to the prompt when typing text"
           move-to-prompt)
     (const :tag "netsplit: Detect netsplits" netsplit)
+    (const :tag "networks: Provide data about IRC networks" networks)
     (const :tag "noncommands: Don't display non-IRC commands after evaluation"
           noncommands)
     (const :tag
@@ -6507,9 +6508,6 @@ Otherwise, connect to HOST:PORT as USER and /join 
CHANNEL."
 ;;; avoid a recursive require error when byte-compiling the entire package.
 (require 'erc-goodies)
 
-;;; Provide support for identification of networks.
-(require 'erc-networks)
-
 ;;; erc.el ends here
 ;;
 ;; Local Variables:




reply via email to

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