branch: externals/detached commit 2afde4869d631a1d4d18b92eb0ec5e70ce9b5348 Author: Niklas Eklund <niklas.ekl...@posteo.net> Commit: Niklas Eklund <niklas.ekl...@posteo.net>
Improve display-buffer implementation If the user changes the display action to e.g. a popup buffer, that window wasn't selected with the current implementation. Here we change to select the window that is returned by display-buffer to make sure it works in those situations as well. --- detached-list.el | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/detached-list.el b/detached-list.el index 435b9cc696..a0019b0b0a 100644 --- a/detached-list.el +++ b/detached-list.el @@ -445,16 +445,17 @@ If prefix-argument is provided unmark instead of mark." (interactive) (if-let* ((existing-buffer (detached-list--get-list-mode-buffer)) (window (display-buffer existing-buffer detached-list-display-buffer-action))) - (with-selected-window window + (progn + (select-window window) (detached-list--revert-sessions)) (let* ((buffer (detached-list--get-buffer)) (window (display-buffer buffer detached-list-display-buffer-action))) - (with-selected-window window - (detached-list-mode) - (setq tabulated-list-entries - (seq-map #'detached-list--get-entry - (detached-list--get-filtered-sessions))) - (tabulated-list-print t))))) + (select-window window) + (detached-list-mode) + (setq tabulated-list-entries + (seq-map #'detached-list--get-entry + (detached-list--get-filtered-sessions))) + (tabulated-list-print t)))) (defun detached-list-narrow-sessions (filters) "Narrow session(s) based on FILTERS."