summaryrefslogtreecommitdiff
path: root/lisp/windmove.el
diff options
context:
space:
mode:
authorJuri Linkov <juri@linkov.net>2020-03-06 02:19:00 +0200
committerJuri Linkov <juri@linkov.net>2020-03-06 02:19:00 +0200
commit32261ed15bc4fb7b9d2cf955286aa21562d2fc8e (patch)
tree88507117a0ae1b52ff3a270018ba067174b93e49 /lisp/windmove.el
parentb5474ba1607fdca620cdee40a11cc0120697fc58 (diff)
downloademacs-32261ed15bc4fb7b9d2cf955286aa21562d2fc8e.tar.gz
New command make-frame-on-current-monitor to use in windmove (bug#39875)
* lisp/frame.el (make-frame-on-current-monitor): New command. * lisp/windmove.el (windmove-display-in-direction): Use make-frame-on-current-monitor for 'new-frame'. (windmove-display-new-frame): New command. (windmove-display-default-keybindings): Bind windmove-display-new-frame to 'f' key. * lisp/window.el (display-buffer-in-direction): Fix quotes in docstring.
Diffstat (limited to 'lisp/windmove.el')
-rw-r--r--lisp/windmove.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/lisp/windmove.el b/lisp/windmove.el
index 40adb49e20f..94d2b75210d 100644
--- a/lisp/windmove.el
+++ b/lisp/windmove.el
@@ -474,6 +474,11 @@ When `switch-to-buffer-obey-display-actions' is non-nil,
(tab-bar-new-tab))
(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))
((eq dir 'same-window)
(selected-window))
(t (window-in-direction
@@ -542,6 +547,12 @@ See the logic of the prefix ARG in `windmove-display-in-direction'."
(windmove-display-in-direction 'same-window arg))
;;;###autoload
+(defun windmove-display-new-frame (&optional arg)
+ "Display the next buffer in a new frame."
+ (interactive "P")
+ (windmove-display-in-direction 'new-frame arg))
+
+;;;###autoload
(defun windmove-display-new-tab (&optional arg)
"Display the next buffer in a new tab."
(interactive "P")
@@ -562,6 +573,7 @@ Default value of MODIFIERS is `shift-meta'."
(global-set-key (vector (append modifiers '(up))) 'windmove-display-up)
(global-set-key (vector (append modifiers '(down))) 'windmove-display-down)
(global-set-key (vector (append modifiers '(?0))) 'windmove-display-same-window)
+ (global-set-key (vector (append modifiers '(?f))) 'windmove-display-new-frame)
(global-set-key (vector (append modifiers '(?t))) 'windmove-display-new-tab))