]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve new-frame logic of windmove-display-in-direction (bug#39875)
authorJuri Linkov <juri@linkov.net>
Mon, 9 Mar 2020 23:39:05 +0000 (01:39 +0200)
committerJuri Linkov <juri@linkov.net>
Mon, 9 Mar 2020 23:39:05 +0000 (01:39 +0200)
* lisp/windmove.el (windmove-display-in-direction):
For frame-based logic use code similar to display-buffer-pop-up-frame.

lisp/windmove.el

index 94d2b75210da3d97c03fef8593580c4c1a74d24a..f96383197bd9d97d2f2a571f7698314847a4eedc 100644 (file)
@@ -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