I'd like to cycle between an active minibuffer window and the last recent buffer.
1 (defun cycle-to-minibuffer-window () 2 (interactive) 3 (when (active-minibuffer-window) 4 (if (minibuffer-window-active-p (get-buffer-window)) 5 (select-window (other-buffer (current-buffer))) 6 (select-window (active-minibuffer-window))))) 7 8 (global-set-key (kbd "C-<f9>") #'cycle-to-minibuffer-window)
To bad that line 5
(other-buffer (current-buffer)) returns, in this case, the wrong buffer. :(
Which elisp construct could I use instead to get the buffer|window I wanted?
Example (tested with
- There are 3 buffers:
- My active buffer is
*scratch*. I do
- Now pressing
C-<F9>(calling my function), wants to switch to
*scratch*buffer would be correct.