From: Jeremy Maitin-S. <jb...@at...> - 2003-12-24 11:12:56
|
Hello, Noticing the comment in erc-nets.el, the in-progress `scoped' setting system (`erc-settings') seemed to be a good idea, so I replaced `erc-get' with accessor functions that work. Refer to the code in the attached file. Note that I changed the format of `erc-settings' to something that is both easier for the accessor functions to deal with and also should be easier for users to deal with. Specifically, the old format was: (VAR nil VALUE) ; applies to all networks (VAR NETWORK VALUE) ; applies only to NETWORK (VAR (NETWORK CHANNEL) VALUE) ; applies only to CHANNEL on NETWORK The new accessor functions use this format: (VAR VALUE) ; applies to all networks (VAR VALUE NETWORK) ; applies only to NETWORK (VAR VALUE NETWORK CHANNEL) ; applies only to CHANNEL on NETWORK You will notice that the definitions of the accessor functions are rather complicated, especially `erc-get-setting'; this is because it is necessary to handle a large number of specific cases separately, and I do not believe there is any elegant way of doing it. Using a hash table to store the settings (instead of a list) would greatly simplify the definitions; but it is not clear that a sufficient number of settings will be stored in this system that a hash table would be more efficient. I also use a case-insensitive string to specify the network rather than a symbol. I believe this is a better way of doing things. Anyway, next on my list of stuff to tackle is `erc-macs.el'. Perhaps before integrating it `victim' should be replaced with `member', or specifically, `erc-victims' changed to `erc-global-members' and `erc-channel-victims' changed to `erc-channel-members'. Conveniently, the existing code uses the unqualified name `channel-members', and so there is no conflict. |