Zajcev Evgeny writes:
 I would like to see macro like below, defined somewhere in (S)XEmacs
 distribution:
 
     
     (defmacro define-toggle-variable (var value doc &rest args)
       "Define new toggle variable.
         VAR is either a symbol, or list of two symbols in form
         (VARNAME FUNCNAME), where VARNAME specifies name for variable and
         FUNCNAME specifies name for toggle command.
         VALUE, DOC and ARGS are same as for `defcustom'.
         ARGS may content additional :message keyword of boolean value.
         If value for :message keyword is non-nil then display message in echo
         area when toggling value." 
I think this is a good idea.  I think it belongs in custom.el.
FWIW YMMV IGWTF[1]:
(1) I don't like the idea of (VARNAME FUNCNAME); I think standardizing
on toggle-VARNAME, turn-on-VARNAME, turn-off-VARNAME is preferable.
This would make creating menu items for them automatable.  If you
really want FUNCNAME to be arbitrary, you could put a property on
VARNAME to get the same ability.
Which of these to create would be determined by a keyword
:define-toggle-functions whose value would be a list containing
'toggle, 'turn-on or both ('turn-on implies defining turn-off-VARNAME,
too).  Optionally accept 'toggle or 'turn-on as symbols as well as
list members.
(2) toggle-VARNAME is not the right English for the function you
define.  Maybe it's OK, but my first reaction is that it will take
users a long time to adjust to it.  Seems more like VARNAME-mode in
GNU Emacs-ish.
Footnotes: 
[1]  I'll Go With The Flow
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta