Steal window functions from magnars' .emacs.d.