GNU bug report logs - #56791
[PATCH] Add window arg to splitting commands, new commands to split root window

Previous Next

Package: emacs;

Reported by: Hugo Heagren <hugo <at> heagren.com>

Date: Wed, 27 Jul 2022 11:09:02 UTC

Severity: wishlist

Tags: patch

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

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 56791 in the body.
You can then email your comments to 56791 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#56791; Package emacs. (Wed, 27 Jul 2022 11:09:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Hugo Heagren <hugo <at> heagren.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 27 Jul 2022 11:09:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Hugo Heagren <hugo <at> heagren.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Add window arg to splitting commands, new commands to split
 root window
Date: Wed, 27 Jul 2022 08:58:53 +0100
[Message part 1 (text/plain, inline)]
Some proposed new commands and relevant bindings.

Motivation: sometimes, I have a complex window setup, and I want a
large new window to work in for a while, taking up a high proportion
of the frame. The currently-available interactive commands for
splitting windows only operate on the the selected window. For
example, I might have a frame with windows like this:

,----
| +---------------------+
| |                     |
| |         a           |
| |                     |
| +---------------------+
| |                     |
| |         b           |
| |                     |
| +---------------------+
`----

And want to have this:

#+END_EXAMPLE
+---------+-----------+
|         |           |
|   a     |           |
|         |           |
+---------+     c     |
|         |           |
|   b     |           |
|         |           |
+---------+-----------+
#+END_EXAMPLE

So, I have implemented:
- a new optional argument on `split-window-right' and
  `split-window-below' specifying /which/ window is to be split. This
  defaults to the selected window. It also has no effect on the
  interactive use of these functions, since the prefix argument is
  still used for the SIZE arg.
- new commands (implemented using this arg) which split the root window.
- bound these commands to `C-x 7' and `C-x 9'. This seemed
  appropriate, considering that these numbers were free, but the other
  window-splitting commands are bound to numbers in that map.
- (hopefully?) appropriate documentation changes

Patches are attached. I don't know if Emacs has conventions for how
large commits should be---mine are very atomic. Hope that works, but I
could squash them down further and combine the messages if necessary.

I haven't edited the NEWS file yet. I wanted to see what the devs
think of this and make any necessary changes before doing that.

I haven't contributed to the Emacs core before, but I have assigned
copyright to the FSF. Certificate attached as well. 

Thanks

Hugo
[FSF-assignment.pdf (application/pdf, attachment)]
[0003-split-window-right-Add-WINDOW-TO-SPLIT-argument.patch (text/x-diff, attachment)]
[0001-split-window-below-Add-WINDOW-TO-SPLIT-argument.patch (text/x-diff, attachment)]
[0006-Bind-split-root-window-right-to-C-x-9.patch (text/x-diff, attachment)]
[0005-Bind-split-root-window-below-to-C-x-7.patch (text/x-diff, attachment)]
[0004-split-root-window-right-New-function.patch (text/x-diff, attachment)]
[0002-split-root-window-below-New-function.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56791; Package emacs. (Wed, 27 Jul 2022 13:33:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Daniel Martín <mardani29 <at> yahoo.es>
To: Hugo Heagren via "Bug reports for GNU Emacs, the Swiss army knife of
 text editors" <bug-gnu-emacs <at> gnu.org>
Cc: 56791 <at> debbugs.gnu.org, Hugo Heagren <hugo <at> heagren.com>
Subject: Re: bug#56791: [PATCH] Add window arg to splitting commands, new
 commands to split root window
Date: Wed, 27 Jul 2022 15:31:47 +0200
Hugo Heagren via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs <at> gnu.org> writes:

> Some proposed new commands and relevant bindings.
>
> Motivation: sometimes, I have a complex window setup, and I want a
> large new window to work in for a while, taking up a high proportion
> of the frame. The currently-available interactive commands for
> splitting windows only operate on the the selected window.

Thanks.  I think in bug#56767 there is another implementation of the
same use case.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56791; Package emacs. (Wed, 27 Jul 2022 13:33:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56791; Package emacs. (Wed, 27 Jul 2022 19:13:02 GMT) Full text and rfc822 format available.

Message #14 received at 56791 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: 56791 <at> debbugs.gnu.org
Cc: hugo <at> heagren.com, Daniel Martín <mardani29 <at> yahoo.es>
Subject: Re: bug#56791: [PATCH] Add window arg to splitting commands, new
 commands to split root window
Date: Wed, 27 Jul 2022 22:10:01 +0300
>> Some proposed new commands and relevant bindings.
>>
>> Motivation: sometimes, I have a complex window setup, and I want a
>> large new window to work in for a while, taking up a high proportion
>> of the frame. The currently-available interactive commands for
>> splitting windows only operate on the the selected window.
>
> Thanks.  I think in bug#56767 there is another implementation of the
> same use case.

Adding a new arg 'window-to-split' is nicer, so these patches are welcome.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56791; Package emacs. (Wed, 27 Jul 2022 20:40:01 GMT) Full text and rfc822 format available.

Message #17 received at 56791 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: 56791 <at> debbugs.gnu.org
Cc: hugo <at> heagren.com, Daniel Martín <mardani29 <at> yahoo.es>
Subject: Re: bug#56791: [PATCH] Add window arg to splitting commands, new
 commands to split root window
Date: Wed, 27 Jul 2022 23:07:02 +0300
>>> Some proposed new commands and relevant bindings.
>>>
>>> Motivation: sometimes, I have a complex window setup, and I want a
>>> large new window to work in for a while, taking up a high proportion
>>> of the frame. The currently-available interactive commands for
>>> splitting windows only operate on the the selected window.
>>
>> Thanks.  I think in bug#56767 there is another implementation of the
>> same use case.
>
> Adding a new arg 'window-to-split' is nicer, so these patches are welcome.

But need to be careful with adding 'window-to-split' arg to 'split-window-below'.
Its split-window-keep-point=nil logic might not be applicable to some windows.




Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Thu, 04 Aug 2022 13:59:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56791; Package emacs. (Mon, 05 Sep 2022 18:57:02 GMT) Full text and rfc822 format available.

Message #22 received at 56791 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Hugo Heagren <hugo <at> heagren.com>
Cc: 56791 <at> debbugs.gnu.org
Subject: Re: bug#56791: [PATCH] Add window arg to splitting commands, new
 commands to split root window
Date: Mon, 05 Sep 2022 20:56:06 +0200
Hugo Heagren <hugo <at> heagren.com> writes:

> So, I have implemented:
> - a new optional argument on `split-window-right' and
>   `split-window-below' specifying /which/ window is to be split. This
>   defaults to the selected window. It also has no effect on the
>   interactive use of these functions, since the prefix argument is
>   still used for the SIZE arg.
> - new commands (implemented using this arg) which split the root window.
> - bound these commands to `C-x 7' and `C-x 9'. This seemed
>   appropriate, considering that these numbers were free, but the other
>   window-splitting commands are bound to numbers in that map.
> - (hopefully?) appropriate documentation changes
>
> Patches are attached. I don't know if Emacs has conventions for how
> large commits should be---mine are very atomic. Hope that works, but I
> could squash them down further and combine the messages if necessary.

Thanks; looks good to me.  I had some merging issues (since the affected
files have changed a bit since this patch series was proposed), so it
was easier for me to squash them before pushing to Emacs 29.




bug marked as fixed in version 29.1, send any further explanations to 56791 <at> debbugs.gnu.org and Hugo Heagren <hugo <at> heagren.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 05 Sep 2022 18:58:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56791; Package emacs. (Tue, 06 Sep 2022 16:23:02 GMT) Full text and rfc822 format available.

Message #27 received at 56791 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: 56791 <at> debbugs.gnu.org
Cc: hugo <at> heagren.com, Daniel Martín <mardani29 <at> yahoo.es>
Subject: Re: bug#56791: [PATCH] Add window arg to splitting commands, new
 commands to split root window
Date: Tue, 06 Sep 2022 19:20:24 +0300
> But need to be careful with adding 'window-to-split' arg to 'split-window-below'.
> Its split-window-keep-point=nil logic might not be applicable to some windows.

When 'split-window-keep-point' is customized to nil, then the second call of
'split-window-below' fails with

  Debugger entered--Lisp error: (wrong-type-argument stringp nil)
    split-window-below(nil #<window 6>)
    split-root-window-below(nil)
    funcall-interactively(split-root-window-below nil)
    command-execute(split-root-window-below)




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 05 Oct 2022 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 229 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.