Invert editor-->buffer so it's buffer-->editor instead, and make
commands take a buffer instead of an editor.