define with-current-buffer-window for older Emacsen