aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Danjou2014-02-25 18:37:25 +0100
committerJulien Danjou2014-02-25 18:37:25 +0100
commitea922c8bb309d1e3d52ea27960ed626f589fd63f (patch)
tree191dd91918c24d6acb3918b992f29f838bd5d788
parent98bd6b321c3efbb5d7c5d3c0dbbcecbccf5fda3f (diff)
downloademacs-ea922c8bb309d1e3d52ea27960ed626f589fd63f.tar.gz
emacs-ea922c8bb309d1e3d52ea27960ed626f589fd63f.zip
erc-network: fix erc-determine-network when no network
* erc-networks.el (erc-determine-network): Check that NETWORK as a value, some servers set it to nothing.
-rw-r--r--lisp/erc/ChangeLog5
-rw-r--r--lisp/erc/erc-networks.el21
2 files changed, 16 insertions, 10 deletions
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog
index 8d0fc723f14..6d99fdf73d9 100644
--- a/lisp/erc/ChangeLog
+++ b/lisp/erc/ChangeLog
@@ -1,3 +1,8 @@
12014-02-25 Julien Danjou <julien@danjou.info>
2
3 * erc-networks.el (erc-determine-network): Check that NETWORK as a
4 value, some servers set it to nothing.
5
12014-01-31 Glenn Morris <rgm@gnu.org> 62014-01-31 Glenn Morris <rgm@gnu.org>
2 7
3 * erc.el (erc-accidental-paste-threshold-seconds): Doc tweak. 8 * erc.el (erc-accidental-paste-threshold-seconds): Doc tweak.
diff --git a/lisp/erc/erc-networks.el b/lisp/erc/erc-networks.el
index 191aad0e0cc..29a13ae5e30 100644
--- a/lisp/erc/erc-networks.el
+++ b/lisp/erc/erc-networks.el
@@ -724,16 +724,17 @@ MATCHER is used to find a corresponding network to a server while connected to
724server parameter NETWORK if provided, otherwise parse the server name and 724server parameter NETWORK if provided, otherwise parse the server name and
725search for a match in `erc-networks-alist'." 725search for a match in `erc-networks-alist'."
726 ;; The server made it easy for us and told us the name of the NETWORK 726 ;; The server made it easy for us and told us the name of the NETWORK
727 (if (assoc "NETWORK" erc-server-parameters) 727 (let ((network-name (cdr (assoc "NETWORK" erc-server-parameters))))
728 (intern (cdr (assoc "NETWORK" erc-server-parameters))) 728 (if network-name
729 (or 729 (intern network-name)
730 ;; Loop through `erc-networks-alist' looking for a match. 730 (or
731 (let ((server (or erc-server-announced-name erc-session-server))) 731 ;; Loop through `erc-networks-alist' looking for a match.
732 (cl-loop for (name matcher) in erc-networks-alist 732 (let ((server (or erc-server-announced-name erc-session-server)))
733 when (and matcher 733 (cl-loop for (name matcher) in erc-networks-alist
734 (string-match (concat matcher "\\'") server)) 734 when (and matcher
735 do (cl-return name))) 735 (string-match (concat matcher "\\'") server))
736 'Unknown))) 736 do (cl-return name)))
737 'Unknown))))
737 738
738(defun erc-network () 739(defun erc-network ()
739 "Return the value of `erc-network' for the current server." 740 "Return the value of `erc-network' for the current server."