From: Diane M. <di...@us...> - 2006-03-14 23:23:07
|
Francis Litterio <fli...@gm...> wrote: > In erc-networks.el (in the CVS sources), I see this code: > (defun erc-set-network-name (proc parsed) > "Set `erc-network' to the value returned by `erc-determine-network'." > (unless erc-server-connected > (setq erc-network (erc-determine-network))) > nil) > (add-hook 'erc-server-375-functions 'erc-set-network-name) > (add-hook 'erc-server-422-functions 'erc-set-network-name) > Shouldn't that "unless" be "if"? I mean, if erc-set-network-name is > being called from those hooks, then we must be connected to the server? > As I read it, erc-set-network-name will never call erc-determine-network. > Am I missing something? `erc-server-connected' is set to t after receiving either a 376 or 422 message from the server, "end of MOTD" or "no MOTD", respectively. `erc-network' is set before that. Because it's possible to view the MOTD after you are connected (by using the command /MOTD) and `erc-network' only needs to be set once upon connection, we can ignore things if `erc-server-connected' is non-nil. -- disumu |