a bunch of changes to make command-log-mode more configurable.