From: Juri Linkov Date: Mon, 9 Mar 2020 23:39:05 +0000 (+0200) Subject: Improve new-frame logic of windmove-display-in-direction (bug#39875) X-Git-Tag: emacs-28.0.90~7779 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a98c8f5a098cf646c282be67cce9fb7999d353d7;p=emacs.git Improve new-frame logic of windmove-display-in-direction (bug#39875) * lisp/windmove.el (windmove-display-in-direction): For frame-based logic use code similar to display-buffer-pop-up-frame. --- diff --git a/lisp/windmove.el b/lisp/windmove.el index 94d2b75210d..f96383197bd 100644 --- a/lisp/windmove.el +++ b/lisp/windmove.el @@ -475,10 +475,14 @@ When `switch-to-buffer-obey-display-actions' is non-nil, (setq type 'tab) (selected-window)) ((eq dir 'new-frame) - (window--maybe-raise-frame - (make-frame-on-current-monitor pop-up-frame-alist)) - (setq type 'frame) - (selected-window)) + (let* ((params (cdr (assq 'pop-up-frame-parameters alist))) + (pop-up-frame-alist (append params pop-up-frame-alist)) + (frame (make-frame-on-current-monitor + pop-up-frame-alist))) + (unless (cdr (assq 'inhibit-switch-frame alist)) + (window--maybe-raise-frame frame)) + (setq type 'frame) + (frame-selected-window frame))) ((eq dir 'same-window) (selected-window)) (t (window-in-direction