Commit 6d4dd885 authored by Gerd Moellmann's avatar Gerd Moellmann
Browse files

(server-switch-buffer): Use some-window instead of

cycling through windows with next-window.
parent 8822bfb6
......@@ -477,10 +477,8 @@ Arg NEXT-BUFFER is a suggestion; if it is a live buffer, use it."
(if (window-minibuffer-p (selected-window))
(select-window (next-window nil 'nomini 0)))
;; Move to a non-dedicated window, if we have one.
(let ((last-window (previous-window nil 'nomini 0)))
(while (and (window-dedicated-p (selected-window))
(not (eq last-window (selected-window))))
(select-window (next-window nil 'nomini 0))))
(select-window (some-window (lambda (w) (not (window-dedicated-p w)))
'nomini 0 (selected-window)))
(set-window-dedicated-p (selected-window) nil)
(if next-buffer
(if (and (bufferp next-buffer)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment