unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#56767: New commands to split frame
@ 2022-07-25 19:32 Juri Linkov
  2022-07-26 12:41 ` Lars Ingebrigtsen
  2022-07-26 17:00 ` Pankaj Jangid
  0 siblings, 2 replies; 7+ messages in thread
From: Juri Linkov @ 2022-07-25 19:32 UTC (permalink / raw)
  To: 56767

Since we already have the commands to split the current window,
shouldn't we also have the commands to split the current frame:

```
diff --git a/lisp/window.el b/lisp/window.el
index 4d88ffa903..86dec25cdf 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -5754,6 +5754,17 @@ split-window-right
     new-window))
 
 (defalias 'split-window-horizontally 'split-window-right)
+
+(defun split-frame-vertically (&optional size)
+  "Like `split-window-vertically' but splits frame instead of window."
+  (interactive "P")
+  (split-window (frame-root-window) size))
+
+(defun split-frame-horizontally (&optional size)
+  "Like `split-window-horizontally' but splits frame instead of window."
+  (interactive "P")
+  (split-window (frame-root-window) size t))
+
 \f
 ;;; Balancing windows.
 
```





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#56767: New commands to split frame
  2022-07-25 19:32 bug#56767: New commands to split frame Juri Linkov
@ 2022-07-26 12:41 ` Lars Ingebrigtsen
  2022-07-26 12:51   ` Visuwesh
  2022-07-26 17:00 ` Pankaj Jangid
  1 sibling, 1 reply; 7+ messages in thread
From: Lars Ingebrigtsen @ 2022-07-26 12:41 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 56767

Juri Linkov <juri@linkov.net> writes:

> Since we already have the commands to split the current window,
> shouldn't we also have the commands to split the current frame:
>
> ```
> diff --git a/lisp/window.el b/lisp/window.el
> index 4d88ffa903..86dec25cdf 100644
> --- a/lisp/window.el
> +++ b/lisp/window.el
> @@ -5754,6 +5754,17 @@ split-window-right
>      new-window))
>
>  (defalias 'split-window-horizontally 'split-window-right)
> +
> +(defun split-frame-vertically (&optional size)
> +  "Like `split-window-vertically' but splits frame instead of window."
> +  (interactive "P")
> +  (split-window (frame-root-window) size))
> +
> +(defun split-frame-horizontally (&optional size)
> +  "Like `split-window-horizontally' but splits frame instead of window."
> +  (interactive "P")
> +  (split-window (frame-root-window) size t))

I don't think I understand what this is supposed to do.  When testing
it, it just splits the topmost window (no matter what window is
selected), and I don't undertand why anybody would want that in
particular.






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#56767: New commands to split frame
  2022-07-26 12:41 ` Lars Ingebrigtsen
@ 2022-07-26 12:51   ` Visuwesh
  2022-07-27  9:53     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Visuwesh @ 2022-07-26 12:51 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 56767, Juri Linkov

[செவ்வாய் ஜூலை 26, 2022] Lars Ingebrigtsen wrote:

> I don't think I understand what this is supposed to do.  When testing
> it, it just splits the topmost window (no matter what window is
> selected), and I don't undertand why anybody would want that in
> particular.

If the window configuration is like the following,

+-----------------------------------------------------------------+
|                                                                 |
|                          A                                      |
|                                                                 |
|                                                                 |
|                                                                 |
|                                                                 |
+-----------------------------------------------------------------+
|                                                                 |
|                                                                 |
|                           B                                     |
|                                                                 |
|                                                                 |
|                                                                 |
+-----------------------------------------------------------------+

and you say M-x split-frame-horizontally, then you get

+--------------------------------+--------------------------------+
|                                |                                |
|                                |                                |
|                A               |                                |
|                                |                                |
|                                |                                |
+--------------------------------+                                |
|                                |               C                |
|                                |                                |
|                                |                                |
|                B               |                                |
|                                |                                |
|                                |                                |
|                                |                                |
+--------------------------------+--------------------------------+





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#56767: New commands to split frame
  2022-07-25 19:32 bug#56767: New commands to split frame Juri Linkov
  2022-07-26 12:41 ` Lars Ingebrigtsen
@ 2022-07-26 17:00 ` Pankaj Jangid
  2022-07-27  7:42   ` Juri Linkov
  1 sibling, 1 reply; 7+ messages in thread
From: Pankaj Jangid @ 2022-07-26 17:00 UTC (permalink / raw)
  To: 56767

Juri Linkov <juri@linkov.net> writes:

> Since we already have the commands to split the current window,
> shouldn't we also have the commands to split the current frame:
>
and may be you would like to add aliases, just like

split-window-horizontally -> split-window-right,
split-window-vertically -> split-window-below






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#56767: New commands to split frame
  2022-07-26 17:00 ` Pankaj Jangid
@ 2022-07-27  7:42   ` Juri Linkov
  0 siblings, 0 replies; 7+ messages in thread
From: Juri Linkov @ 2022-07-27  7:42 UTC (permalink / raw)
  To: Pankaj Jangid; +Cc: 56767

>> Since we already have the commands to split the current window,
>> shouldn't we also have the commands to split the current frame:
>
> and may be you would like to add aliases, just like
>
> split-window-horizontally -> split-window-right,
> split-window-vertically -> split-window-below

The word "below" is not quite correct because
display-buffer-below-selected uses positioning
relative to the current window.  Whereas the
corresponding function the uses the absolute
positioning contains the word "bottom" in its name:
display-buffer-at-bottom.

So the right alias would be split-frame-at-bottom.

Also display-buffer-in-direction supports the word
"rightmost", so its counterpart alias would be
split-frame-at-rightmost.

Then why not add also split-frame-at-leftmost
and split-frame-at-top?





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#56767: New commands to split frame
  2022-07-26 12:51   ` Visuwesh
@ 2022-07-27  9:53     ` Lars Ingebrigtsen
  2022-09-05 18:56       ` Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Lars Ingebrigtsen @ 2022-07-27  9:53 UTC (permalink / raw)
  To: Visuwesh; +Cc: 56767, Juri Linkov

Visuwesh <visuweshm@gmail.com> writes:

> and you say M-x split-frame-horizontally, then you get
>
> +--------------------------------+--------------------------------+
> |                                |                                |
> |                                |                                |
> |                A               |                                |
> |                                |                                |
> |                                |                                |
> +--------------------------------+                                |
> |                                |               C                |
> |                                |                                |
> |                                |                                |
> |                B               |                                |
> |                                |                                |
> |                                |                                |
> |                                |                                |
> +--------------------------------+--------------------------------+

Oh, I see.  Yes, then I think Juri's new commands look useful.






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#56767: New commands to split frame
  2022-07-27  9:53     ` Lars Ingebrigtsen
@ 2022-09-05 18:56       ` Lars Ingebrigtsen
  0 siblings, 0 replies; 7+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-05 18:56 UTC (permalink / raw)
  To: Visuwesh; +Cc: 56767, Juri Linkov

I applied the patch series from bug#56791 instead, since they do the
same.





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-09-05 18:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-25 19:32 bug#56767: New commands to split frame Juri Linkov
2022-07-26 12:41 ` Lars Ingebrigtsen
2022-07-26 12:51   ` Visuwesh
2022-07-27  9:53     ` Lars Ingebrigtsen
2022-09-05 18:56       ` Lars Ingebrigtsen
2022-07-26 17:00 ` Pankaj Jangid
2022-07-27  7:42   ` Juri Linkov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).