When executing an action from an *Embark Collect* buffer while forcing buffers to open in the same window, previous-buffer requires two presses to return to the collect buffer.
Steps to reproduce:
- Configure
display-buffer-alist to force buffers into the same window.
(dolist (regexp '("\\*Embark Collect" "\\*Embark Export"))
(push `(,regexp (display-buffer-same-window)) display-buffer-alist))
- Open
*Embark Collect* using consult-ripgrep and embark-collect for example.
- Execute a default action (like opening a file or buffer) from the collect buffer.
- Call
previous-buffer in the newly opened target buffer.
Expected behavior: Calling previous-buffer once should return to the *Embark Collect* buffer.
Actual behavior: Calling previous-buffer once returns to the original source buffer (where the Embark command was initially invoked). Calling it a second time returns to the *Embark Collect* buffer.
This seems to happen because Embark temporarily switches to the source buffer to establish context before executing the action. Because display-buffer-alist forces the new buffer into the same window, Emacs records that intermediate source buffer in window-prev-buffers.
When executing an action from an
*Embark Collect*buffer while forcing buffers to open in the same window,previous-bufferrequires two presses to return to the collect buffer.Steps to reproduce:
display-buffer-alistto force buffers into the same window.*Embark Collect*usingconsult-ripgrepandembark-collectfor example.previous-bufferin the newly opened target buffer.Expected behavior: Calling
previous-bufferonce should return to the*Embark Collect*buffer.Actual behavior: Calling
previous-bufferonce returns to the original source buffer (where the Embark command was initially invoked). Calling it a second time returns to the*Embark Collect*buffer.This seems to happen because Embark temporarily switches to the source buffer to establish context before executing the action. Because
display-buffer-alistforces the new buffer into the same window, Emacs records that intermediate source buffer inwindow-prev-buffers.