GNU bug report logs -
#39875
28.0.50; Use make-frame-on-current-monitor in windmove
Previous Next
Reported by: Juri Linkov <juri <at> linkov.net>
Date: Mon, 2 Mar 2020 22:44:02 UTC
Severity: wishlist
Tags: fixed, patch
Fixed in version 28.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 39875 in the body.
You can then email your comments to 39875 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#39875
; Package
emacs
.
(Mon, 02 Mar 2020 22:44:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Juri Linkov <juri <at> linkov.net>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Mon, 02 Mar 2020 22:44:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Severity: wishlist
Here are two related feature requests:
1. A new command make-frame-on-current-monitor that is useful when the user
uses only one monitor on multiple-monitor setup. The problem is that the
command make-frame creates a new frame on unused non-selected monitor.
Here comes make-frame-on-current-monitor to rescue:
diff --git a/lisp/frame.el b/lisp/frame.el
index 16ee7580f8..dc8dabc5a5 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -713,6 +713,18 @@ make-frame-on-display
(x-display-list))))
(make-frame (cons (cons 'display display) parameters)))
+(defun make-frame-on-current-monitor (&optional parameters)
+ "Make a frame on the currently selected monitor.
+Like `make-frame-on-monitor' and with the same PARAMETERS as in `make-frame'."
+ (interactive)
+ (let* ((monitor-workarea
+ (cdr (assq 'workarea (frame-monitor-attributes))))
+ (geometry-parameters
+ (when monitor-workarea
+ `((top . ,(nth 1 monitor-workarea))
+ (left . ,(nth 0 monitor-workarea))))))
+ (make-frame (append geometry-parameters parameters))))
+
(defun make-frame-on-monitor (monitor &optional display parameters)
"Make a frame on monitor MONITOR.
The optional argument DISPLAY can be a display name, and the optional
2. This command could be used in windmove-display-new-frame
to display the next buffer in a new frame as well as
windmove-display-new-window to display the buffer in a new window:
[windmove-display-new-frame.patch (text/x-diff, inline)]
diff --git a/lisp/windmove.el b/lisp/windmove.el
index 40adb49e20..57f521e2be 100644
--- a/lisp/windmove.el
+++ b/lisp/windmove.el
@@ -474,6 +474,14 @@ windmove-display-in-direction
(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 'new-window)
+ ;; Split window in any direction
+ (setq dir nil))
((eq dir 'same-window)
(selected-window))
(t (window-in-direction
@@ -541,6 +549,18 @@ windmove-display-same-window
(interactive "P")
(windmove-display-in-direction 'same-window arg))
+;;;###autoload
+(defun windmove-display-new-window (&optional arg)
+ "Display the next buffer in a new window."
+ (interactive "P")
+ (windmove-display-in-direction 'new-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."
@@ -562,6 +582,8 @@ windmove-display-default-keybindings
(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 '(?w))) 'windmove-display-new-window)
+ (global-set-key (vector (append modifiers '(?f))) 'windmove-display-new-frame)
(global-set-key (vector (append modifiers '(?t))) 'windmove-display-new-tab))
diff --git a/lisp/window.el b/lisp/window.el
index bd825c09e1..d9ab70253f 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -7891,15 +7891,15 @@ display-buffer-in-direction
such alists.
ALIST has to contain a `direction' entry whose value should be
-one of `left', `above' (or `up'), `right' and `below' (or
-'down'). Other values are usually interpreted as `below'.
+one of `left', `above' (or `up'), `right' and `below' (or `down').
+Other values are usually interpreted as `below'.
If ALIST also contains a `window' entry, its value specifies a
reference window. That value can be a special symbol like
-'main' (which stands for the selected frame's main window) or
-'root' (standings for the selected frame's root window) or an
+`main' (which stands for the selected frame's main window) or
+`root' (standings for the selected frame's root window) or an
arbitrary valid window. Any other value (or omitting the
-'window' entry) means to use the selected window as reference
+`window' entry) means to use the selected window as reference
window.
This function tries to reuse or split a window such that the
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#39875
; Package
emacs
.
(Fri, 06 Mar 2020 00:20:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 39875 <at> debbugs.gnu.org (full text, mbox):
tags 39875 + patch fixed
close 39875 28.0.50
quit
> Severity: wishlist
>
> Here are two related feature requests:
>
> 1. A new command make-frame-on-current-monitor that is useful when the user
> uses only one monitor on multiple-monitor setup. The problem is that the
> command make-frame creates a new frame on unused non-selected monitor.
> Here comes make-frame-on-current-monitor to rescue:
Pushed to master, and closed.
Added tag(s) fixed and patch.
Request was from
Juri Linkov <juri <at> linkov.net>
to
control <at> debbugs.gnu.org
.
(Fri, 06 Mar 2020 00:20:02 GMT)
Full text and
rfc822 format available.
bug marked as fixed in version 28.0.50, send any further explanations to
39875 <at> debbugs.gnu.org and Juri Linkov <juri <at> linkov.net>
Request was from
Juri Linkov <juri <at> linkov.net>
to
control <at> debbugs.gnu.org
.
(Fri, 06 Mar 2020 00:20:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Fri, 03 Apr 2020 11:24:06 GMT)
Full text and
rfc822 format available.
This bug report was last modified 5 years and 80 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.