3 # Convert mIRC's servers.ini to a elisp structure.
4 # Get the file from http://www.mirc.co.uk/servers.ini
6 # TODO: We need a separate file where we can store regexp/functions
7 # to match a erc-server-announced-name against a erc-networks-alist entry.
8 # For sanity, we'df need a lookup procedure here, and insert the
9 # regexp/function instead of the nil value in the erc-networks-alist.
11 # There is a error somehow in the servers.ini. There are two
12 # undernets, undernet and Undernet. They are the same though.
13 # So we'd need to unify them somehow (change case)?
15 print "(defcustom erc-server-alist\n'(\n";
17 if(($sname, $shost, $sport, $grp) = $_ =~ /^n\d+=(.*)SERVER:(.*):(.*)GROUP:(.*)/){
19 @ports = split ",", $sport;
20 print " (\"$sname\" '$grp \"$shost\" ";
22 if (($p1,$p2)=$sport=~/(\d+)-(\d+)/) {
30 foreach $port (@ports) {
31 if (($p1,$p2)=$port=~/(\d+)-(\d+)/) {
42 print ")\n \"Server Alist\"\n :group 'erc\n :type 'sexp)\n\n";
44 print "(defcustom erc-networks-alist\n'(\n";
45 foreach $grp (sort(keys(%groups))) {
46 print " ($grp nil)\n";
48 print ")\n \"Network alist\"\n :group 'erc\n :type 'sexp)\n";