* Re: master 6a2ee981c3: Add new functions for splitting the root window
[not found] ` <20220905185728.838CEC0088A@vcs2.savannah.gnu.org>
@ 2022-09-06 16:17 ` Juri Linkov
2022-09-07 0:32 ` Sean Whitton
2022-09-07 12:57 ` Lars Ingebrigtsen
0 siblings, 2 replies; 80+ messages in thread
From: Juri Linkov @ 2022-09-06 16:17 UTC (permalink / raw)
To: emacs-devel; +Cc: Hugo Heagren
> (define-key ctl-x-map "{" 'shrink-window-horizontally)
> (define-key ctl-x-map "-" 'shrink-window-if-larger-than-buffer)
> (define-key ctl-x-map "+" 'balance-windows)
> +(define-key ctl-x-map "7" 'split-root-window-below)
> +(define-key ctl-x-map "9" 'split-root-window-right)
> (define-key ctl-x-4-map "0" 'kill-buffer-and-window)
> (define-key ctl-x-4-map "1" 'same-window-prefix)
> (define-key ctl-x-4-map "4" 'other-window-prefix)
Taking one of the most easy to type keys 'C-x 7' and 'C-x 9'
for such rarely used commands? Really? Wouldn't it better
to use a negative prefix arg of the existing commands,
e.g. 'C-- C-x 2' without specifying the size of the root window,
or 'C-u -25 C-x 2'.
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-06 16:17 ` master 6a2ee981c3: Add new functions for splitting the root window Juri Linkov
@ 2022-09-07 0:32 ` Sean Whitton
2022-09-07 12:57 ` Lars Ingebrigtsen
1 sibling, 0 replies; 80+ messages in thread
From: Sean Whitton @ 2022-09-07 0:32 UTC (permalink / raw)
To: Juri Linkov, emacs-devel, Hugo Heagren
Hello,
On Tue 06 Sep 2022 at 07:17PM +03, Juri Linkov wrote:
>> (define-key ctl-x-map "{" 'shrink-window-horizontally)
>> (define-key ctl-x-map "-" 'shrink-window-if-larger-than-buffer)
>> (define-key ctl-x-map "+" 'balance-windows)
>> +(define-key ctl-x-map "7" 'split-root-window-below)
>> +(define-key ctl-x-map "9" 'split-root-window-right)
>> (define-key ctl-x-4-map "0" 'kill-buffer-and-window)
>> (define-key ctl-x-4-map "1" 'same-window-prefix)
>> (define-key ctl-x-4-map "4" 'other-window-prefix)
>
> Taking one of the most easy to type keys 'C-x 7' and 'C-x 9'
> for such rarely used commands? Really? Wouldn't it better
> to use a negative prefix arg of the existing commands,
> e.g. 'C-- C-x 2' without specifying the size of the root window,
> or 'C-u -25 C-x 2'.
Negative prefix argument is a nice idea for this, I agree.
--
Sean Whitton
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-06 16:17 ` master 6a2ee981c3: Add new functions for splitting the root window Juri Linkov
2022-09-07 0:32 ` Sean Whitton
@ 2022-09-07 12:57 ` Lars Ingebrigtsen
2022-09-07 18:01 ` Juri Linkov
1 sibling, 1 reply; 80+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-07 12:57 UTC (permalink / raw)
To: Juri Linkov; +Cc: emacs-devel, Hugo Heagren
Juri Linkov <juri@linkov.net> writes:
> Taking one of the most easy to type keys 'C-x 7' and 'C-x 9'
> for such rarely used commands? Really? Wouldn't it better
> to use a negative prefix arg of the existing commands,
> e.g. 'C-- C-x 2' without specifying the size of the root window,
> or 'C-u -25 C-x 2'.
I thought that all the sensible prefixes to those commands were taken,
but if that's possible, then that's a better solution.
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-07 12:57 ` Lars Ingebrigtsen
@ 2022-09-07 18:01 ` Juri Linkov
2022-09-08 11:50 ` Lars Ingebrigtsen
0 siblings, 1 reply; 80+ messages in thread
From: Juri Linkov @ 2022-09-07 18:01 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: emacs-devel, Hugo Heagren
>> Taking one of the most easy to type keys 'C-x 7' and 'C-x 9'
>> for such rarely used commands? Really? Wouldn't it better
>> to use a negative prefix arg of the existing commands,
>> e.g. 'C-- C-x 2' without specifying the size of the root window,
>> or 'C-u -25 C-x 2'.
>
> I thought that all the sensible prefixes to those commands were taken,
> but if that's possible, then that's a better solution.
Oh, I didn't expect all prefixes are taken, too bad.
Maybe then better to bind them to a common prefix key?
E.g. 'C-x r 2' and 'C-x r 3'.
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-07 18:01 ` Juri Linkov
@ 2022-09-08 11:50 ` Lars Ingebrigtsen
2022-09-08 12:09 ` Robert Pluim
` (3 more replies)
0 siblings, 4 replies; 80+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-08 11:50 UTC (permalink / raw)
To: Juri Linkov; +Cc: emacs-devel, Hugo Heagren
Juri Linkov <juri@linkov.net> writes:
>> I thought that all the sensible prefixes to those commands were taken,
>> but if that's possible, then that's a better solution.
>
> Oh, I didn't expect all prefixes are taken, too bad.
> Maybe then better to bind them to a common prefix key?
> E.g. 'C-x r 2' and 'C-x r 3'.
Ah, yeah, that sounds even better to have them on `something-2' and
`-3', since they're analogous to `C-x 2' and `3'.
Are there any other commands under `C-x r' that deal with windows,
though? Hm... I see bookmark and register commands, so putting some
window commands there seems a bit odd, but perhaps not.
Anybody have other suggestions for where to put these? `C-x x 2'? The
`C-x x' map is for buffer commands, and these are window commands, but
perhaps that's OK.
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-08 11:50 ` Lars Ingebrigtsen
@ 2022-09-08 12:09 ` Robert Pluim
2022-09-08 12:18 ` Lars Ingebrigtsen
2022-09-08 12:22 ` Gregory Heytings
` (2 subsequent siblings)
3 siblings, 1 reply; 80+ messages in thread
From: Robert Pluim @ 2022-09-08 12:09 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: Juri Linkov, emacs-devel, Hugo Heagren
>>>>> On Thu, 08 Sep 2022 13:50:04 +0200, Lars Ingebrigtsen <larsi@gnus.org> said:
Lars> Juri Linkov <juri@linkov.net> writes:
>>> I thought that all the sensible prefixes to those commands were taken,
>>> but if that's possible, then that's a better solution.
>>
>> Oh, I didn't expect all prefixes are taken, too bad.
>> Maybe then better to bind them to a common prefix key?
>> E.g. 'C-x r 2' and 'C-x r 3'.
Lars> Ah, yeah, that sounds even better to have them on `something-2' and
Lars> `-3', since they're analogous to `C-x 2' and `3'.
Lars> Are there any other commands under `C-x r' that deal with windows,
Lars> though? Hm... I see bookmark and register commands, so putting some
Lars> window commands there seems a bit odd, but perhaps not.
Thereʼs 'C-x r w', and 'C-x r f'. I guess they fit into the 'take some
current state and save it' paradigm of the other 'C-x r' bindings, so
I donʼt think that fits with window splitting.
Lars> Anybody have other suggestions for where to put these? `C-x x 2'? The
Lars> `C-x x' map is for buffer commands, and these are window commands, but
Lars> perhaps that's OK.
'C-x w 2' ?
Robert
--
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-08 12:09 ` Robert Pluim
@ 2022-09-08 12:18 ` Lars Ingebrigtsen
2022-09-08 14:54 ` [External] : " Drew Adams
2022-09-10 19:27 ` Juri Linkov
0 siblings, 2 replies; 80+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-08 12:18 UTC (permalink / raw)
To: Robert Pluim; +Cc: Juri Linkov, emacs-devel, Hugo Heagren
Robert Pluim <rpluim@gmail.com> writes:
> Lars> Anybody have other suggestions for where to put these? `C-x
> Lars> x 2'? The
> Lars> `C-x x' map is for buffer commands, and these are window commands, but
> Lars> perhaps that's OK.
>
> 'C-x w 2' ?
I've never noticed that `C-x w' isn't taken before. 😵💫
But I think it'd be overkill to take that for these commands. Of
course, if we had a bunch of window commands that's looking for a
home...
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-08 11:50 ` Lars Ingebrigtsen
2022-09-08 12:09 ` Robert Pluim
@ 2022-09-08 12:22 ` Gregory Heytings
2022-09-08 14:54 ` [External] : " Drew Adams
2022-09-08 17:25 ` Juri Linkov
3 siblings, 0 replies; 80+ messages in thread
From: Gregory Heytings @ 2022-09-08 12:22 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: Juri Linkov, emacs-devel, Hugo Heagren
>
> Anybody have other suggestions for where to put these?
>
C-x - 2 and C-x - 3 (and move C-x - to C-x - -)
C-x C-2 / C-x M-2 and C-x C-3 / C-x M-3
^ permalink raw reply [flat|nested] 80+ messages in thread
* RE: [External] : Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-08 12:18 ` Lars Ingebrigtsen
@ 2022-09-08 14:54 ` Drew Adams
2022-09-10 19:27 ` Juri Linkov
1 sibling, 0 replies; 80+ messages in thread
From: Drew Adams @ 2022-09-08 14:54 UTC (permalink / raw)
To: Lars Ingebrigtsen, Robert Pluim
Cc: Juri Linkov, emacs-devel@gnu.org, Hugo Heagren
Repeat after me:
_Do not bind new commands to keys._
Please.
Give users a (long) chance to let you
know (1) how much they use/like your
new commands and (2) what keys _they_
bind them to.
It's folly to immediately bind new
commands that someone comes up with.
This lesson should have been learned
long ago.
^ permalink raw reply [flat|nested] 80+ messages in thread
* RE: [External] : Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-08 11:50 ` Lars Ingebrigtsen
2022-09-08 12:09 ` Robert Pluim
2022-09-08 12:22 ` Gregory Heytings
@ 2022-09-08 14:54 ` Drew Adams
2022-09-08 17:25 ` Juri Linkov
3 siblings, 0 replies; 80+ messages in thread
From: Drew Adams @ 2022-09-08 14:54 UTC (permalink / raw)
To: Lars Ingebrigtsen, Juri Linkov; +Cc: emacs-devel@gnu.org, Hugo Heagren
> Anybody have other suggestions for where to put these?
(...something about hidden from local starshine?)
But seriously, please don't put them anywhere.
Don't bind new commands, as a general rule.
There's time enough for that later, if useful.
Let (user) practice be a guide.
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-08 11:50 ` Lars Ingebrigtsen
` (2 preceding siblings ...)
2022-09-08 14:54 ` [External] : " Drew Adams
@ 2022-09-08 17:25 ` Juri Linkov
2022-09-09 17:07 ` Lars Ingebrigtsen
3 siblings, 1 reply; 80+ messages in thread
From: Juri Linkov @ 2022-09-08 17:25 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: emacs-devel, Hugo Heagren
>> Maybe then better to bind them to a common prefix key?
>> E.g. 'C-x r 2' and 'C-x r 3'.
>
> Ah, yeah, that sounds even better to have them on `something-2' and
> `-3', since they're analogous to `C-x 2' and `3'.
>
> Are there any other commands under `C-x r' that deal with windows,
> though? Hm... I see bookmark and register commands, so putting some
> window commands there seems a bit odd, but perhaps not.
"r" in 'C-x r 2' was meant to have mnemonics for "root window".
> Anybody have other suggestions for where to put these? `C-x x 2'? The
> `C-x x' map is for buffer commands, and these are window commands, but
> perhaps that's OK.
'C-x w r 2' would keep the same mnemonics, but I'm not sure about this.
Maybe when we will find enough window commands to put on this keymap.
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-08 17:25 ` Juri Linkov
@ 2022-09-09 17:07 ` Lars Ingebrigtsen
2022-09-09 17:25 ` Visuwesh
2022-09-09 17:53 ` Stefan Monnier
0 siblings, 2 replies; 80+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-09 17:07 UTC (permalink / raw)
To: Juri Linkov; +Cc: emacs-devel, Hugo Heagren
Juri Linkov <juri@linkov.net> writes:
> "r" in 'C-x r 2' was meant to have mnemonics for "root window".
"r" already have "register" mnemonics, so I'm not sure people will be
looking in that keymap for root window commands...
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-09 17:07 ` Lars Ingebrigtsen
@ 2022-09-09 17:25 ` Visuwesh
2022-09-09 17:36 ` Lars Ingebrigtsen
2022-09-11 3:37 ` Richard Stallman
2022-09-09 17:53 ` Stefan Monnier
1 sibling, 2 replies; 80+ messages in thread
From: Visuwesh @ 2022-09-09 17:25 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: Juri Linkov, emacs-devel, Hugo Heagren
[வெள்ளி செப்டம்பர் 09, 2022] Lars Ingebrigtsen wrote:
> Juri Linkov <juri@linkov.net> writes:
>
>> "r" in 'C-x r 2' was meant to have mnemonics for "root window".
>
> "r" already have "register" mnemonics,
Rectangle and bookmaRk too. I don't think people will find it
particularly hard to remember yet another mnemonic. ;-)
> so I'm not sure people will be looking in that keymap for root window
> commands...
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-09 17:25 ` Visuwesh
@ 2022-09-09 17:36 ` Lars Ingebrigtsen
2022-09-11 3:37 ` Richard Stallman
1 sibling, 0 replies; 80+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-09 17:36 UTC (permalink / raw)
To: Visuwesh; +Cc: Juri Linkov, emacs-devel, Hugo Heagren
Visuwesh <visuweshm@gmail.com> writes:
> Rectangle and bookmaRk too. I don't think people will find it
> particularly hard to remember yet another mnemonic. ;-)
Rectangle yes -- but bookmarks are a kind of register, which is why they
ended up there, I think.
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-09 17:07 ` Lars Ingebrigtsen
2022-09-09 17:25 ` Visuwesh
@ 2022-09-09 17:53 ` Stefan Monnier
1 sibling, 0 replies; 80+ messages in thread
From: Stefan Monnier @ 2022-09-09 17:53 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: Juri Linkov, emacs-devel, Hugo Heagren
Lars Ingebrigtsen [2022-09-09 19:07:14] wrote:
> Juri Linkov <juri@linkov.net> writes:
>> "r" in 'C-x r 2' was meant to have mnemonics for "root window".
> "r" already have "register" mnemonics,
And "r"ectangle, of course.
Stefan
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-08 12:18 ` Lars Ingebrigtsen
2022-09-08 14:54 ` [External] : " Drew Adams
@ 2022-09-10 19:27 ` Juri Linkov
2022-09-11 11:03 ` Lars Ingebrigtsen
1 sibling, 1 reply; 80+ messages in thread
From: Juri Linkov @ 2022-09-10 19:27 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: Robert Pluim, emacs-devel, Hugo Heagren
>> 'C-x w 2' ?
>
> I've never noticed that `C-x w' isn't taken before. 😵💫
Not too long ago we freed 'C-x w' by moving these to 'M-s h':
C-x w . highlight-symbol-at-point
C-x w b hi-lock-write-interactive-patterns
C-x w h highlight-regexp
C-x w i hi-lock-find-patterns
C-x w l highlight-lines-matching-regexp
C-x w p highlight-phrase
C-x w r unhighlight-regexp
> But I think it'd be overkill to take that for these commands. Of
> course, if we had a bunch of window commands that's looking for a
> home...
There are enough unbound window-related commands to use in 'C-x w',
e.g. from window.el, windmove.el, … For example, there are
no keys for shrink-window, (other-window -1), …
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-09 17:25 ` Visuwesh
2022-09-09 17:36 ` Lars Ingebrigtsen
@ 2022-09-11 3:37 ` Richard Stallman
2022-09-19 23:55 ` Emanuel Berg
1 sibling, 1 reply; 80+ messages in thread
From: Richard Stallman @ 2022-09-11 3:37 UTC (permalink / raw)
To: Visuwesh; +Cc: larsi, juri, emacs-devel, hugo
[[[ To any NSA and FBI agents reading my email: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> Rectangle and bookmaRk too. I don't think people will find it
> particularly hard to remember yet another mnemonic. ;-)
We could squeeze in any commands whatsoever by including `ridiculous'
in their names ;-{.
--
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-10 19:27 ` Juri Linkov
@ 2022-09-11 11:03 ` Lars Ingebrigtsen
2022-09-11 17:48 ` Sean Whitton
2022-09-19 6:53 ` Emanuel Berg
0 siblings, 2 replies; 80+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-11 11:03 UTC (permalink / raw)
To: Juri Linkov; +Cc: Robert Pluim, emacs-devel, Hugo Heagren
Juri Linkov <juri@linkov.net> writes:
> Not too long ago we freed 'C-x w' by moving these to 'M-s h':
>
> C-x w . highlight-symbol-at-point
Ah, right:
NEWS.25:340:** The old 'C-x w' bindings in 'hi-lock-mode' are officially deprecated
So in Emacs 25-ish? Then I guess reusing them for windowing commands
would be OK.
> There are enough unbound window-related commands to use in 'C-x w',
> e.g. from window.el, windmove.el, … For example, there are
> no keys for shrink-window, (other-window -1), …
If somebody could put together a proposal for a `C-x w' map with lots of
useful window commands, that'd be good.
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-11 11:03 ` Lars Ingebrigtsen
@ 2022-09-11 17:48 ` Sean Whitton
2022-09-11 18:31 ` chad
` (3 more replies)
2022-09-19 6:53 ` Emanuel Berg
1 sibling, 4 replies; 80+ messages in thread
From: Sean Whitton @ 2022-09-11 17:48 UTC (permalink / raw)
To: Lars Ingebrigtsen, Juri Linkov, Robert Pluim, emacs-devel,
Hugo Heagren
On Sun 11 Sep 2022 at 01:03PM +02, Lars Ingebrigtsen wrote:
> If somebody could put together a proposal for a `C-x w' map with lots of
> useful window commands, that'd be good.
Will patchify this if it sounds like a reasonable starting point:
C-x w 2 split-root-window-below
C-x w 3 split-root-window-right
C-x w s window-toggle-side-windows
C-x w f tear-off-window [ mnemonic "frame" ]
C-x w t window-swap-states [ mnemonic "tranpose" ]
C-x w - fit-window-to-buffer [ like C-x - ]
C-x w { shrink-window [ like C-x { ]
C-x w 0 delete-windows-on [ like C-x 0 ]
Less sure about these being useful enough, or what keys to use for them:
C-x w + balance-windows-area
C-x w . minimize-window
C-x w b replace-buffer-in-windows
Not sure what key might be good for these:
tab-window-detach
tab-bar-move-window-to-tab
--
Sean Whitton
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-11 17:48 ` Sean Whitton
@ 2022-09-11 18:31 ` chad
2022-09-12 10:00 ` Lars Ingebrigtsen
2022-09-12 10:04 ` Lars Ingebrigtsen
` (2 subsequent siblings)
3 siblings, 1 reply; 80+ messages in thread
From: chad @ 2022-09-11 18:31 UTC (permalink / raw)
To: Sean Whitton
Cc: Lars Ingebrigtsen, Juri Linkov, Robert Pluim,
EMACS development team, Hugo Heagren
[-- Attachment #1: Type: text/plain, Size: 1246 bytes --]
On Sun, Sep 11, 2022 at 1:49 PM Sean Whitton <spwhitton@spwhitton.name>
wrote:
> [...]
> C-x w 2 split-root-window-below
> C-x w 3 split-root-window-right
> C-x w s window-toggle-side-windows
> C-x w f tear-off-window [ mnemonic "frame" ]
> C-x w t window-swap-states [ mnemonic "tranpose" ]
>
> C-x w - fit-window-to-buffer [ like C-x - ]
> C-x w { shrink-window [ like C-x { ]
> C-x w 0 delete-windows-on [ like C-x 0 ]
>
> Less sure about these being useful enough, or what keys to use for them:
>
> C-x w + balance-windows-area
> C-x w . minimize-window
> C-x w b replace-buffer-in-windows
>
By default, windmove binds shift-left/right/up/down for moving in those
directions, and winner binds C-c left/right for undo/redo'ing window
configuration changes. I imagine that many people here have established
habits for these (if they use them), but, for example, both "left" bindings
are also used in Org, and the default machinery for windmove includes an
easy way to replace the Shift modifier with another. How about:
C-x w left windmove-left
C-x w right windmove-right
C-x w up windmove-up
C-x w down windmove-down
C-w w C-z winner-undo
C-w w C-S-z winner-redo
~Chad
[-- Attachment #2: Type: text/html, Size: 1778 bytes --]
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-11 18:31 ` chad
@ 2022-09-12 10:00 ` Lars Ingebrigtsen
2022-09-12 14:10 ` Sean Whitton
2022-09-12 14:29 ` Visuwesh
0 siblings, 2 replies; 80+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-12 10:00 UTC (permalink / raw)
To: chad
Cc: Sean Whitton, Juri Linkov, Robert Pluim, EMACS development team,
Hugo Heagren
chad <yandros@gmail.com> writes:
> By default, windmove binds shift-left/right/up/down for moving in those directions,
> and winner binds C-c left/right for undo/redo'ing window configuration changes. I
> imagine that many people here have established habits for these (if they use them),
> but, for example, both "left" bindings are also used in Org, and the default machinery
> for windmove includes an easy way to replace the Shift modifier with another. How
> about:
>
> C-x w left windmove-left
> C-x w right windmove-right
> C-x w up windmove-up
> C-x w down windmove-down
These might be good for discoverability, but I think people that use
these commands a lot will prefer to have them on simpler keystrokes
(like S-<left> etc) where they are now.
> C-w w C-z winner-undo
> C-w w C-S-z winner-redo
C-z is problematic to use in terminals.
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-11 17:48 ` Sean Whitton
2022-09-11 18:31 ` chad
@ 2022-09-12 10:04 ` Lars Ingebrigtsen
2022-09-12 14:35 ` Sean Whitton
2022-09-13 4:08 ` Richard Stallman
2022-09-12 17:34 ` Juri Linkov
2022-09-12 17:50 ` Stefan Monnier
3 siblings, 2 replies; 80+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-12 10:04 UTC (permalink / raw)
To: Sean Whitton; +Cc: Juri Linkov, Robert Pluim, emacs-devel, Hugo Heagren
Sean Whitton <spwhitton@spwhitton.name> writes:
> Will patchify this if it sounds like a reasonable starting point:
>
> C-x w 2 split-root-window-below
> C-x w 3 split-root-window-right
> C-x w s window-toggle-side-windows
> C-x w f tear-off-window [ mnemonic "frame" ]
> C-x w t window-swap-states [ mnemonic "tranpose" ]
>
> C-x w - fit-window-to-buffer [ like C-x - ]
> C-x w { shrink-window [ like C-x { ]
> C-x w 0 delete-windows-on [ like C-x 0 ]
Yeah, these look good to me. (And `C-x w }' presumably.)
> Less sure about these being useful enough, or what keys to use for them:
>
> C-x w + balance-windows-area
> C-x w . minimize-window
> C-x w b replace-buffer-in-windows
They are more obscure commands; yes.
> Not sure what key might be good for these:
>
> tab-window-detach
> tab-bar-move-window-to-tab
Me neither.
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-12 10:00 ` Lars Ingebrigtsen
@ 2022-09-12 14:10 ` Sean Whitton
2022-09-13 11:11 ` Lars Ingebrigtsen
2022-09-12 14:29 ` Visuwesh
1 sibling, 1 reply; 80+ messages in thread
From: Sean Whitton @ 2022-09-12 14:10 UTC (permalink / raw)
To: Lars Ingebrigtsen, chad, Juri Linkov, Robert Pluim,
EMACS development team, Hugo Heagren
Hello,
On Mon 12 Sep 2022 at 12:00PM +02, Lars Ingebrigtsen wrote:
> C-z is problematic to use in terminals.
I thought the problem with C-z was just that people might be surprised
when it doesn't suspend Emacs. Do some terminals actually grab it?
--
Sean Whitton
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-12 10:00 ` Lars Ingebrigtsen
2022-09-12 14:10 ` Sean Whitton
@ 2022-09-12 14:29 ` Visuwesh
1 sibling, 0 replies; 80+ messages in thread
From: Visuwesh @ 2022-09-12 14:29 UTC (permalink / raw)
To: Lars Ingebrigtsen
Cc: chad, Sean Whitton, Juri Linkov, Robert Pluim,
EMACS development team, Hugo Heagren
[திங்கள் செப்டம்பர் 12, 2022] Lars Ingebrigtsen wrote:
> chad <yandros@gmail.com> writes:
>> C-x w left windmove-left
>> C-x w right windmove-right
>> C-x w up windmove-up
>> C-x w down windmove-down
>
> These might be good for discoverability, but I think people that use
> these commands a lot will prefer to have them on simpler keystrokes
> (like S-<left> etc) where they are now.
If we set up a repeat-map, I think it will be good to have it by
default. I set up a repeat-map for C-x <right> and <left> and I use it
all the time now.
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-12 10:04 ` Lars Ingebrigtsen
@ 2022-09-12 14:35 ` Sean Whitton
2022-09-13 4:08 ` Richard Stallman
1 sibling, 0 replies; 80+ messages in thread
From: Sean Whitton @ 2022-09-12 14:35 UTC (permalink / raw)
To: Lars Ingebrigtsen, Juri Linkov, Robert Pluim, emacs-devel,
Hugo Heagren
Hello,
On Mon 12 Sep 2022 at 12:04PM +02, Lars Ingebrigtsen wrote:
> Sean Whitton <spwhitton@spwhitton.name> writes:
>
>> Will patchify this if it sounds like a reasonable starting point:
>>
>> C-x w 2 split-root-window-below
>> C-x w 3 split-root-window-right
>> C-x w s window-toggle-side-windows
>> C-x w f tear-off-window [ mnemonic "frame" ]
>> C-x w t window-swap-states [ mnemonic "tranpose" ]
Actually, how about tab-window-detach on C-x w t, following C-x w f?
window-swap-states is less useful than I thought it was because it only
considers the next window, not, say, the opposite window if there are
only two.
>> C-x w - fit-window-to-buffer [ like C-x - ]
>> C-x w { shrink-window [ like C-x { ]
>> C-x w 0 delete-windows-on [ like C-x 0 ]
>
> Yeah, these look good to me.
I've pushed the basic bindings.
> (And `C-x w }' presumably.)
Well, C-x ^ is already enlarge-window. We could have both? Not sure.
--
Sean Whitton
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-11 17:48 ` Sean Whitton
2022-09-11 18:31 ` chad
2022-09-12 10:04 ` Lars Ingebrigtsen
@ 2022-09-12 17:34 ` Juri Linkov
2022-09-12 18:57 ` Sean Whitton
2022-09-12 17:50 ` Stefan Monnier
3 siblings, 1 reply; 80+ messages in thread
From: Juri Linkov @ 2022-09-12 17:34 UTC (permalink / raw)
To: Sean Whitton; +Cc: Lars Ingebrigtsen, Robert Pluim, emacs-devel, Hugo Heagren
> C-x w { shrink-window [ like C-x { ]
'{' and '}' look like arrows that point in horizontal direction,
therefore they are bound to horizontal commands 'C-x {' and 'C-x }'.
'v' looks more like a vertical arrow. This is why
'resize-window-repeat-map' binds 'v' to 'shrink-window'.
Still 'C-x w v' doesn't look like the best key for 'shrink-window'.
> Not sure what key might be good for these:
>
> tab-window-detach
> tab-bar-move-window-to-tab
They are window-related indeed, but I think they all should be under
'C-t w' prefix key.
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-11 17:48 ` Sean Whitton
` (2 preceding siblings ...)
2022-09-12 17:34 ` Juri Linkov
@ 2022-09-12 17:50 ` Stefan Monnier
2022-09-12 18:55 ` Sean Whitton
2022-09-13 9:33 ` Gregory Heytings
3 siblings, 2 replies; 80+ messages in thread
From: Stefan Monnier @ 2022-09-12 17:50 UTC (permalink / raw)
To: Sean Whitton
Cc: Lars Ingebrigtsen, Juri Linkov, Robert Pluim, emacs-devel,
Hugo Heagren
> C-x w 2 split-root-window-below
> C-x w 3 split-root-window-right
While I understand the desire to follow the `C-x 2` and `C-x 3`
tradition, these numbers don't actually carry much useful intuition.
How 'bout `C-x w -` and `C-x w |` instead?
Of course, it'd also be nice to bring together/closer the root and
non-root variants of those operations, but I have no good suggestion
here, other than to suggest to use a new command which doesn't accept
a numeric argument at all and only uses `C-u` to choose between a root
split and non-root split. That's because I personally never use that
numeric argument, and prefer to resize the windows afterwards rather
than try to guess sizes beforehand.
Stefan
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-12 17:50 ` Stefan Monnier
@ 2022-09-12 18:55 ` Sean Whitton
2022-09-12 19:29 ` Juri Linkov
2022-09-13 9:33 ` Gregory Heytings
1 sibling, 1 reply; 80+ messages in thread
From: Sean Whitton @ 2022-09-12 18:55 UTC (permalink / raw)
To: Stefan Monnier, Lars Ingebrigtsen, Juri Linkov, Robert Pluim,
emacs-devel, Hugo Heagren
Hello,
On Mon 12 Sep 2022 at 01:50PM -04, Stefan Monnier wrote:
>> C-x w 2 split-root-window-below
>> C-x w 3 split-root-window-right
>
> While I understand the desire to follow the `C-x 2` and `C-x 3`
> tradition, these numbers don't actually carry much useful intuition.
> How 'bout `C-x w -` and `C-x w |` instead?
>
> Of course, it'd also be nice to bring together/closer the root and
> non-root variants of those operations, but I have no good suggestion
> here, other than to suggest to use a new command which doesn't accept
> a numeric argument at all and only uses `C-u` to choose between a root
> split and non-root split. That's because I personally never use that
> numeric argument, and prefer to resize the windows afterwards rather
> than try to guess sizes beforehand.
This is nice, but here are a couple of arguments in favour of 'C-x w 2'
and 'C-x w 3':
(1) it's good to be able to use up 'C-x w 2' and 'C-x w 3' for these
commands and thereby save 'C-x w -' and 'C-x w |' for other
commands, because we're unlikely to be able to put anything else on
'C-x w 2' and 'C-x w 3'.
This seems especially important given that the -root-window-
commands are not going to see heavy use, compared with, e.g.,
fit-window-to-buffer (where C-x w - follows C-x -).
(2) again given that the -root-window- commands will be rarely used, I
think the similarity with the existing commands will make 'C-x w 2'
and 'C-x w 3' easier to memorise / recall-with-effort.
--
Sean Whitton
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-12 17:34 ` Juri Linkov
@ 2022-09-12 18:57 ` Sean Whitton
2022-09-12 19:31 ` Juri Linkov
0 siblings, 1 reply; 80+ messages in thread
From: Sean Whitton @ 2022-09-12 18:57 UTC (permalink / raw)
To: Juri Linkov, Lars Ingebrigtsen, Robert Pluim, emacs-devel,
Hugo Heagren
Hello,
On Mon 12 Sep 2022 at 08:34PM +03, Juri Linkov wrote:
>> C-x w { shrink-window [ like C-x { ]
>
> '{' and '}' look like arrows that point in horizontal direction,
> therefore they are bound to horizontal commands 'C-x {' and 'C-x }'.
>
> 'v' looks more like a vertical arrow. This is why
> 'resize-window-repeat-map' binds 'v' to 'shrink-window'.
>
> Still 'C-x w v' doesn't look like the best key for 'shrink-window'.
Yeah. I have no good ideas here.
>> Not sure what key might be good for these:
>>
>> tab-window-detach
>> tab-bar-move-window-to-tab
>
> They are window-related indeed, but I think they all should be under
> 'C-t w' prefix key.
I think we should have either
'C-x w f' tear-off-frame
'C-x w t' tab-window-detach
or
'C-x 5 xx' tear-off-frame
'C-x t xx' tab-window-detach
where 'xx' is a single key.
--
Sean Whitton
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-12 18:55 ` Sean Whitton
@ 2022-09-12 19:29 ` Juri Linkov
2022-09-12 23:40 ` Sean Whitton
0 siblings, 1 reply; 80+ messages in thread
From: Juri Linkov @ 2022-09-12 19:29 UTC (permalink / raw)
To: Sean Whitton
Cc: Stefan Monnier, Lars Ingebrigtsen, Robert Pluim, emacs-devel,
Hugo Heagren
>> Of course, it'd also be nice to bring together/closer the root and
>> non-root variants of those operations, but I have no good suggestion
>> here, other than to suggest to use a new command which doesn't accept
>> a numeric argument at all and only uses `C-u` to choose between a root
>> split and non-root split. That's because I personally never use that
>> numeric argument, and prefer to resize the windows afterwards rather
>> than try to guess sizes beforehand.
The existing commands could use `C-u` to choose between root/non-root too.
Then there is no need to have a new command.
> This seems especially important given that the -root-window-
> commands are not going to see heavy use, compared with, e.g.,
> fit-window-to-buffer (where C-x w - follows C-x -).
>
> (2) again given that the -root-window- commands will be rarely used, I
> think the similarity with the existing commands will make 'C-x w 2'
> and 'C-x w 3' easier to memorise / recall-with-effort.
Since they will be rarely used, they could be bound to a more consistent
key sequence 'C-x w r 2' and 'C-x w r 3' where "w r" means "window-root",
freeing 'C-x w 2' and 'C-x w 3' for other uses.
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-12 18:57 ` Sean Whitton
@ 2022-09-12 19:31 ` Juri Linkov
2022-09-13 14:01 ` Sean Whitton
0 siblings, 1 reply; 80+ messages in thread
From: Juri Linkov @ 2022-09-12 19:31 UTC (permalink / raw)
To: Sean Whitton; +Cc: Lars Ingebrigtsen, Robert Pluim, emacs-devel, Hugo Heagren
>>> Not sure what key might be good for these:
>>>
>>> tab-window-detach
>>> tab-bar-move-window-to-tab
>>
>> They are window-related indeed, but I think they all should be under
>> 'C-t w' prefix key.
>
> I think we should have either
>
> 'C-x w f' tear-off-frame
> 'C-x w t' tab-window-detach
>
> or
>
> 'C-x 5 xx' tear-off-frame
> 'C-x t xx' tab-window-detach
>
> where 'xx' is a single key.
There is also tab-detach (tab-bar-detach-tab).
So there 3 related commands that need a keybinding:
- tear-off-window - move window to a new frame
- tab-window-detach - move window to a new tab
- tab-detach - move tab to a new frame
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-12 19:29 ` Juri Linkov
@ 2022-09-12 23:40 ` Sean Whitton
2022-09-13 6:50 ` Juri Linkov
0 siblings, 1 reply; 80+ messages in thread
From: Sean Whitton @ 2022-09-12 23:40 UTC (permalink / raw)
To: Juri Linkov, Stefan Monnier, Lars Ingebrigtsen, Robert Pluim,
emacs-devel, Hugo Heagren
Hello,
On Mon 12 Sep 2022 at 10:29PM +03, Juri Linkov wrote:
>>> Of course, it'd also be nice to bring together/closer the root and
>>> non-root variants of those operations, but I have no good suggestion
>>> here, other than to suggest to use a new command which doesn't accept
>>> a numeric argument at all and only uses `C-u` to choose between a root
>>> split and non-root split. That's because I personally never use that
>>> numeric argument, and prefer to resize the windows afterwards rather
>>> than try to guess sizes beforehand.
>
> The existing commands could use `C-u` to choose between root/non-root too.
> Then there is no need to have a new command.
Yes, I still prefer this myself, I think.
>> This seems especially important given that the -root-window-
>> commands are not going to see heavy use, compared with, e.g.,
>> fit-window-to-buffer (where C-x w - follows C-x -).
>>
>> (2) again given that the -root-window- commands will be rarely used, I
>> think the similarity with the existing commands will make 'C-x w 2'
>> and 'C-x w 3' easier to memorise / recall-with-effort.
>
> Since they will be rarely used, they could be bound to a more consistent
> key sequence 'C-x w r 2' and 'C-x w r 3' where "w r" means "window-root",
> freeing 'C-x w 2' and 'C-x w 3' for other uses.
That would definitely make sense if we are expecting some other root
window commands -- do you have some ideas?
--
Sean Whitton
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-12 10:04 ` Lars Ingebrigtsen
2022-09-12 14:35 ` Sean Whitton
@ 2022-09-13 4:08 ` Richard Stallman
2022-09-13 14:29 ` [External] : " Drew Adams
1 sibling, 1 reply; 80+ messages in thread
From: Richard Stallman @ 2022-09-13 4:08 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: spwhitton, juri, rpluim, emacs-devel, hugo
[[[ To any NSA and FBI agents reading my email: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> > Will patchify this if it sounds like a reasonable starting point:
> >
> > C-x w 2 split-root-window-below
> > C-x w 3 split-root-window-right
> > C-x w s window-toggle-side-windows
> > C-x w f tear-off-window [ mnemonic "frame" ]
> > C-x w t window-swap-states [ mnemonic "tranpose" ]
> >
> > C-x w - fit-window-to-buffer [ like C-x - ]
> > C-x w { shrink-window [ like C-x { ]
> > C-x w 0 delete-windows-on [ like C-x 0 ]
The details make sense , but are those commands worth using up a C-x
LETTER prefix? I don't think so. I think we should save it for
something people will use more often.
--
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-12 23:40 ` Sean Whitton
@ 2022-09-13 6:50 ` Juri Linkov
2022-09-13 13:54 ` Sean Whitton
0 siblings, 1 reply; 80+ messages in thread
From: Juri Linkov @ 2022-09-13 6:50 UTC (permalink / raw)
To: Sean Whitton
Cc: Stefan Monnier, Lars Ingebrigtsen, Robert Pluim, emacs-devel,
Hugo Heagren
>>> (2) again given that the -root-window- commands will be rarely used, I
>>> think the similarity with the existing commands will make 'C-x w 2'
>>> and 'C-x w 3' easier to memorise / recall-with-effort.
>>
>> Since they will be rarely used, they could be bound to a more consistent
>> key sequence 'C-x w r 2' and 'C-x w r 3' where "w r" means "window-root",
>> freeing 'C-x w 2' and 'C-x w 3' for other uses.
>
> That would definitely make sense if we are expecting some other root
> window commands -- do you have some ideas?
Even if we have two root commands now, it still makes sense to add more
sub-prefixes to not lock us into a limited set of keys, but to leave
room for possible future extensions. Then every window concept could
have own prefix: 'C-x w s' could be reserved for side windows, then
'window-toggle-side-windows' will be on e.g. 'C-x w s t'. 'C-x w f'
could be reserved for window/frame relationship commands, then
'tear-off-window' will be on e.g. 'C-x w f t', etc.
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-12 17:50 ` Stefan Monnier
2022-09-12 18:55 ` Sean Whitton
@ 2022-09-13 9:33 ` Gregory Heytings
2022-09-13 11:14 ` Lars Ingebrigtsen
` (3 more replies)
1 sibling, 4 replies; 80+ messages in thread
From: Gregory Heytings @ 2022-09-13 9:33 UTC (permalink / raw)
To: Stefan Monnier
Cc: Sean Whitton, Lars Ingebrigtsen, Juri Linkov, Robert Pluim,
emacs-devel, Hugo Heagren
[-- Attachment #1: Type: text/plain, Size: 1811 bytes --]
>
> While I understand the desire to follow the `C-x 2` and `C-x 3`
> tradition, these numbers don't actually carry much useful intuition. How
> 'bout `C-x w -` and `C-x w |` instead?
>
> Of course, it'd also be nice to bring together/closer the root and
> non-root variants of those operations, but I have no good suggestion
> here, other than to suggest to use a new command which doesn't accept a
> numeric argument at all and only uses `C-u` to choose between a root
> split and non-root split. That's because I personally never use that
> numeric argument, and prefer to resize the windows afterwards rather
> than try to guess sizes beforehand.
>
Fully agreed. I we're going to put window commands on C-x w, I thought I
might share the part of my configuration that deals with windows (see
attached), which I adapted to that new prefix.
C-x w | split-window-right
C-u C-x w | split-root-window-right
C-x w - split-window-below
C-u C-x w - split-root-window-below
C-x w d delete-window
C-x w o delete-other-windows (mnemonic "only")
C-x w h window-height-adjust with + - = (repeatable)
C-x w w window-width-adjust with + - = (repeatable)
C-x w f tear-off-window
C-x w m maximize-window-toggle
C-u C-x w m minimize-window
C-x w s window-toggle-side-windows
C-x w ! window-toggle-dedicated
C-x w b balance-windows
C-u C-x w b balance-windows-area
C-x w c window-configuration
left (winner-undo) right (winner-redo) (repeatable)
s (save in register) r (restore from register)
C-x w n/p select-next-window select-previous-window (repeatable)
C-x w up/down/left/right select-window-{up,down,left,right} (repeatable)
C-x w M-up/M-down/M-left/M-right swap-windows-{up,down,left,right} (repeatable)
[-- Attachment #2: window-commands.el --]
[-- Type: text/plain, Size: 5878 bytes --]
(defun split-window-or-root-window-right (&optional arg)
(interactive "P")
(if arg (split-root-window-right) (split-window-right)))
(defun split-window-or-root-window-below (&optional arg)
(interactive "P")
(if arg (split-root-window-below) (split-window-below)))
(global-set-key (kbd "C-x w |") 'split-window-or-root-window-right)
(global-set-key (kbd "C-x w -") 'split-window-or-root-window-below)
(global-set-key (kbd "C-x w d") 'delete-window)
(global-set-key (kbd "C-x w o") 'delete-other-windows)
(defun fit-window-to-buffer-horizontally ()
(interactive)
(let ((fit-window-to-buffer-horizontally 'only))
(fit-window-to-buffer)
(enlarge-window-horizontally 2)))
(defun window-width-adjust ()
(interactive)
(let ((map (make-sparse-keymap)))
(define-key map "+" 'enlarge-window-horizontally)
(define-key map "-" 'shrink-window-horizontally)
(define-key map "=" 'fit-window-to-buffer-horizontally)
(set-transient-map map t)))
(defun window-height-adjust ()
(interactive)
(let ((map (make-sparse-keymap)))
(define-key map "+" 'enlarge-window)
(define-key map "-" 'shrink-window)
(define-key map "=" 'fit-window-to-buffer)
(set-transient-map map t)))
(global-set-key (kbd "C-x w w") 'window-width-adjust)
(global-set-key (kbd "C-x w h") 'window-height-adjust)
(global-set-key (kbd "C-x w f") 'tear-off-window)
(defun maximize-window-toggle ()
(let* ((wc (frame-parameter nil 'window-maximized)))
(if wc
(progn
(set-window-configuration wc)
(set-frame-parameter nil 'window-maximized nil))
(set-frame-parameter nil 'window-maximized
(current-window-configuration))
(delete-other-windows))))
(defun maximize-or-minimize-window (&optional arg)
(interactive "P")
(if arg
(minimize-window)
(maximize-window-toggle)))
(global-set-key (kbd "C-x w m") 'maximize-or-minimize-window)
(global-set-key (kbd "C-x w s") 'window-toggle-side-windows)
(defun windows-balance (&optional arg)
(interactive "P")
(if arg
(balance-windows-area)
(balance-windows)))
(global-set-key (kbd "C-x w b") 'windows-balance)
(defun window-toggle-dedicated ()
(interactive)
(set-window-dedicated-p nil (not (window-dedicated-p)))
(message "Window is %sdedicated" (if (window-dedicated-p) "" "not ")))
(global-set-key (kbd "C-x w !") 'window-toggle-dedicated)
(defun window-configuration-from-register (register)
(interactive
(list (register-read-with-preview "Window configuration from register: ")))
(let ((contents (get-register register)))
(if (and (consp contents)
(window-configuration-p (car contents))
(markerp (cadr contents)))
(jump-to-register register)
(user-error "Register `%c' doesn't contain a window configuration"
register))))
(defun window-configuration ()
(interactive)
(if (and (boundp winner-mode) winner-mode)
(let ((map (make-sparse-keymap)))
(define-key map [left] 'winner-undo)
(define-key map [right] 'winner-redo)
(define-key map "s" 'window-configuration-to-register)
(define-key map "r" 'window-configuration-from-register)
(set-transient-map map t))
(user-error "Winner mode is not enabled")))
(global-set-key (kbd "C-x w c") 'window-configuration)
(defun select-next-window-do ()
(interactive)
(select-window (next-window)))
(defun select-previous-window-do ()
(interactive)
(select-window (previous-window)))
(defun select-window-enter ()
(let ((map (make-sparse-keymap)))
(define-key map "n" 'select-next-window-do)
(define-key map "p" 'select-previous-window-do)
(set-transient-map map t)))
(defun select-next-window ()
(interactive)
(select-next-window-do)
(select-window-enter))
(defun select-previous-window ()
(interactive)
(select-previous-window-do)
(select-window-enter))
(global-set-key (kbd "C-x w n") 'select-next-window)
(global-set-key (kbd "C-x w p") 'select-previous-window)
(defun windmove-enter (fun)
(if windmove-mode
(let ((map (make-sparse-keymap)))
(define-key map [up] 'windmove-up)
(define-key map [down] 'windmove-down)
(define-key map [left] 'windmove-left)
(define-key map [right] 'windmove-right)
(define-key map [M-up] 'windmove-swap-states-up)
(define-key map [M-down] 'windmove-swap-states-down)
(define-key map [M-left] 'windmove-swap-states-left)
(define-key map [M-right] 'windmove-swap-states-right)
(call-interactively fun)
(set-transient-map map t))
(user-error "Windmove mode is not enabled")))
(defun select-window-up (&optional arg)
(interactive "P")
(windmove-enter 'windmove-up))
(defun select-window-down (&optional arg)
(interactive "P")
(windmove-enter 'windmove-down))
(defun select-window-left (&optional arg)
(interactive "P")
(windmove-enter 'windmove-left))
(defun select-window-right (&optional arg)
(interactive "P")
(windmove-enter 'windmove-right))
(defun swap-windows-up (&optional arg)
(interactive)
(windmove-enter 'windmove-swap-states-up))
(defun swap-windows-down (&optional arg)
(interactive)
(windmove-enter 'windmove-swap-states-down))
(defun swap-windows-left (&optional arg)
(interactive)
(windmove-enter 'windmove-swap-states-left))
(defun swap-windows-right (&optional arg)
(interactive)
(windmove-enter 'windmove-swap-states-right))
(global-set-key (kbd "C-x w <up>") 'select-window-up)
(global-set-key (kbd "C-x w <down>") 'select-window-down)
(global-set-key (kbd "C-x w <left>") 'select-window-left)
(global-set-key (kbd "C-x w <right>") 'select-window-right)
(global-set-key (kbd "C-x w M-<up>") 'swap-windows-up)
(global-set-key (kbd "C-x w M-<down>") 'swap-windows-down)
(global-set-key (kbd "C-x w M-<left>") 'swap-windows-left)
(global-set-key (kbd "C-x w M-<right>") 'swap-windows-right)
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-12 14:10 ` Sean Whitton
@ 2022-09-13 11:11 ` Lars Ingebrigtsen
2022-09-13 13:52 ` Sean Whitton
0 siblings, 1 reply; 80+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-13 11:11 UTC (permalink / raw)
To: Sean Whitton
Cc: chad, Juri Linkov, Robert Pluim, EMACS development team,
Hugo Heagren
Sean Whitton <spwhitton@spwhitton.name> writes:
> I thought the problem with C-z was just that people might be surprised
> when it doesn't suspend Emacs. Do some terminals actually grab it?
I thought all of them used `C-z' for job control? But probably not in
Windows, I guess.
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-13 9:33 ` Gregory Heytings
@ 2022-09-13 11:14 ` Lars Ingebrigtsen
2022-09-13 13:51 ` Sean Whitton
` (2 subsequent siblings)
3 siblings, 0 replies; 80+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-13 11:14 UTC (permalink / raw)
To: Gregory Heytings
Cc: Stefan Monnier, Sean Whitton, Juri Linkov, Robert Pluim,
emacs-devel, Hugo Heagren
Gregory Heytings <gregory@heytings.org> writes:
> Fully agreed. I we're going to put window commands on C-x w, I
> thought I might share the part of my configuration that deals with
> windows (see attached), which I adapted to that new prefix.
>
> C-x w | split-window-right
> C-u C-x w | split-root-window-right
> C-x w - split-window-below
> C-u C-x w - split-root-window-below
> C-x w d delete-window
> C-x w o delete-other-windows (mnemonic "only")
> C-x w h window-height-adjust with + - = (repeatable)
> C-x w w window-width-adjust with + - = (repeatable)
> C-x w f tear-off-window
> C-x w m maximize-window-toggle
> C-u C-x w m minimize-window
> C-x w s window-toggle-side-windows
> C-x w ! window-toggle-dedicated
> C-x w b balance-windows
> C-u C-x w b balance-windows-area
> C-x w c window-configuration
> left (winner-undo) right (winner-redo) (repeatable)
> s (save in register) r (restore from register)
> C-x w n/p select-next-window select-previous-window (repeatable)
> C-x w up/down/left/right select-window-{up,down,left,right} (repeatable)
> C-x w M-up/M-down/M-left/M-right swap-windows-{up,down,left,right} (repeatable)
That does look like an attractive set of key bindings, yes.
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-13 9:33 ` Gregory Heytings
2022-09-13 11:14 ` Lars Ingebrigtsen
@ 2022-09-13 13:51 ` Sean Whitton
2022-09-13 14:01 ` Gregory Heytings
2022-09-13 18:16 ` Juri Linkov
2022-09-15 7:19 ` Augusto Stoffel
3 siblings, 1 reply; 80+ messages in thread
From: Sean Whitton @ 2022-09-13 13:51 UTC (permalink / raw)
To: Gregory Heytings, Stefan Monnier, Lars Ingebrigtsen, Juri Linkov,
Robert Pluim, emacs-devel, Hugo Heagren
Hello,
On Tue 13 Sep 2022 at 09:33AM GMT, Gregory Heytings wrote:
> C-x w | split-window-right
> C-u C-x w | split-root-window-right
> C-x w - split-window-below
> C-u C-x w - split-root-window-below
> C-x w d delete-window
> C-x w o delete-other-windows (mnemonic "only")
> C-x w h window-height-adjust with + - = (repeatable)
> C-x w w window-width-adjust with + - = (repeatable)
> C-x w f tear-off-window
> C-x w m maximize-window-toggle
> C-u C-x w m minimize-window
> C-x w s window-toggle-side-windows
> C-x w ! window-toggle-dedicated
> C-x w b balance-windows
> C-u C-x w b balance-windows-area
> C-x w c window-configuration
> left (winner-undo) right (winner-redo) (repeatable)
> s (save in register) r (restore from register)
> C-x w n/p select-next-window select-previous-window (repeatable)
> C-x w up/down/left/right select-window-{up,down,left,right} (repeatable)
> C-x w M-up/M-down/M-left/M-right swap-windows-{up,down,left,right} (repeatable)
Seems like one of your goals here is to replace C-x 2, C-x 3 etc. with
more mnemonic bindings? I'd be inclined not to add duplicate bindings
for those things we already have, but I wonder what others think about
unifying things under C-x w like this.
Also, could you say why for the split- commands you use just C-u to
split the root window, rather than a negative prefix argument as has
been previously discussed?
--
Sean Whitton
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-13 11:11 ` Lars Ingebrigtsen
@ 2022-09-13 13:52 ` Sean Whitton
2022-09-13 13:56 ` Lars Ingebrigtsen
0 siblings, 1 reply; 80+ messages in thread
From: Sean Whitton @ 2022-09-13 13:52 UTC (permalink / raw)
To: Lars Ingebrigtsen, chad, Juri Linkov, Robert Pluim,
EMACS development team, Hugo Heagren
Hello,
On Tue 13 Sep 2022 at 01:11PM +02, Lars Ingebrigtsen wrote:
> Sean Whitton <spwhitton@spwhitton.name> writes:
>
>> I thought the problem with C-z was just that people might be surprised
>> when it doesn't suspend Emacs. Do some terminals actually grab it?
>
> I thought all of them used `C-z' for job control? But probably not in
> Windows, I guess.
Only for programs running in line-mode, I believe. Once you take over
the terminal you can do what you like, I thought.
--
Sean Whitton
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-13 6:50 ` Juri Linkov
@ 2022-09-13 13:54 ` Sean Whitton
0 siblings, 0 replies; 80+ messages in thread
From: Sean Whitton @ 2022-09-13 13:54 UTC (permalink / raw)
To: Juri Linkov, Stefan Monnier, Lars Ingebrigtsen, Robert Pluim,
emacs-devel, Hugo Heagren
Hello,
On Tue 13 Sep 2022 at 09:50AM +03, Juri Linkov wrote:
>>>> (2) again given that the -root-window- commands will be rarely used, I
>>>> think the similarity with the existing commands will make 'C-x w 2'
>>>> and 'C-x w 3' easier to memorise / recall-with-effort.
>>>
>>> Since they will be rarely used, they could be bound to a more consistent
>>> key sequence 'C-x w r 2' and 'C-x w r 3' where "w r" means "window-root",
>>> freeing 'C-x w 2' and 'C-x w 3' for other uses.
>>
>> That would definitely make sense if we are expecting some other root
>> window commands -- do you have some ideas?
>
> Even if we have two root commands now, it still makes sense to add more
> sub-prefixes to not lock us into a limited set of keys, but to leave
> room for possible future extensions. Then every window concept could
> have own prefix: 'C-x w s' could be reserved for side windows, then
> 'window-toggle-side-windows' will be on e.g. 'C-x w s t'. 'C-x w f'
> could be reserved for window/frame relationship commands, then
> 'tear-off-window' will be on e.g. 'C-x w f t', etc.
I agree with you in principle but four key long bindings are too long
for commands like window-toggle-side-windows, I think. I would use my
own thing under C-c if that was what was on offer.
--
Sean Whitton
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-13 13:52 ` Sean Whitton
@ 2022-09-13 13:56 ` Lars Ingebrigtsen
2022-09-13 14:12 ` Sean Whitton
0 siblings, 1 reply; 80+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-13 13:56 UTC (permalink / raw)
To: Sean Whitton
Cc: chad, Juri Linkov, Robert Pluim, EMACS development team,
Hugo Heagren
Sean Whitton <spwhitton@spwhitton.name> writes:
> Only for programs running in line-mode, I believe. Once you take over
> the terminal you can do what you like, I thought.
`C-z' works fine for job control in Emacs on the terminal.
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-12 19:31 ` Juri Linkov
@ 2022-09-13 14:01 ` Sean Whitton
2022-09-13 18:29 ` Juri Linkov
0 siblings, 1 reply; 80+ messages in thread
From: Sean Whitton @ 2022-09-13 14:01 UTC (permalink / raw)
To: Juri Linkov, Lars Ingebrigtsen, Robert Pluim, emacs-devel,
Hugo Heagren
Hello,
On Mon 12 Sep 2022 at 10:31PM +03, Juri Linkov wrote:
>>>> Not sure what key might be good for these:
>>>>
>>>> tab-window-detach
>>>> tab-bar-move-window-to-tab
>>>
>>> They are window-related indeed, but I think they all should be under
>>> 'C-t w' prefix key.
>>
>> I think we should have either
>>
>> 'C-x w f' tear-off-frame
>> 'C-x w t' tab-window-detach
>>
>> or
>>
>> 'C-x 5 xx' tear-off-frame
>> 'C-x t xx' tab-window-detach
>>
>> where 'xx' is a single key.
>
> There is also tab-detach (tab-bar-detach-tab).
> So there 3 related commands that need a keybinding:
>
> - tear-off-window - move window to a new frame
> - tab-window-detach - move window to a new tab
> - tab-detach - move tab to a new frame
Good point. Which of the two ideas in the message of mine you're
replying to do you prefer, for all three of these? Do you have an idea
for 'xx'?
--
Sean Whitton
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-13 13:51 ` Sean Whitton
@ 2022-09-13 14:01 ` Gregory Heytings
2022-09-13 14:19 ` Sean Whitton
0 siblings, 1 reply; 80+ messages in thread
From: Gregory Heytings @ 2022-09-13 14:01 UTC (permalink / raw)
To: Sean Whitton
Cc: Stefan Monnier, Lars Ingebrigtsen, Juri Linkov, Robert Pluim,
emacs-devel, Hugo Heagren
>
> Seems like one of your goals here is to replace C-x 2, C-x 3 etc. with
> more mnemonic bindings?
>
I shared a part of my configuration in the hope that it would be useful.
AFAICS, the only commands in that list that are already bound are C-x 0 1
2 3 +. And C-x { } ^ if you count the subcommands.
>
> Also, could you say why for the split- commands you use just C-u to
> split the root window, rather than a negative prefix argument as has
> been previously discussed?
>
That's what I do (and will continue to do) here, but feel free to use a
negative prefix if you prefer. Like Stefan, I never use a prefix argument
for split-window-{right,below}. FWIW, I very much doubt that such an
argument is widely used.
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-13 13:56 ` Lars Ingebrigtsen
@ 2022-09-13 14:12 ` Sean Whitton
2022-09-14 12:29 ` Lars Ingebrigtsen
0 siblings, 1 reply; 80+ messages in thread
From: Sean Whitton @ 2022-09-13 14:12 UTC (permalink / raw)
To: Lars Ingebrigtsen, chad, Juri Linkov, Robert Pluim,
EMACS development team, Hugo Heagren
Hello,
On Tue 13 Sep 2022 at 03:56PM +02, Lars Ingebrigtsen wrote:
> Sean Whitton <spwhitton@spwhitton.name> writes:
>
>> Only for programs running in line-mode, I believe. Once you take over
>> the terminal you can do what you like, I thought.
>
> `C-z' works fine for job control in Emacs on the terminal.
Right, but it goes via Emacs C code, right? 'M-x suspend-frame' invokes
the shell's job control too. So, having C-z at the end of a series of
keypresses do something other than invoke that function should be fine,
if we want it.
--
Sean Whitton
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-13 14:01 ` Gregory Heytings
@ 2022-09-13 14:19 ` Sean Whitton
2022-09-13 14:26 ` Gregory Heytings
2022-09-13 15:22 ` Yuri Khan
0 siblings, 2 replies; 80+ messages in thread
From: Sean Whitton @ 2022-09-13 14:19 UTC (permalink / raw)
To: Gregory Heytings, Stefan Monnier, Lars Ingebrigtsen, Juri Linkov,
Robert Pluim, emacs-devel, Hugo Heagren
Hello,
On Tue 13 Sep 2022 at 02:01PM GMT, Gregory Heytings wrote:
>>
>> Seems like one of your goals here is to replace C-x 2, C-x 3 etc. with more
>> mnemonic bindings?
>>
>
> I shared a part of my configuration in the hope that it would be
> useful. AFAICS, the only commands in that list that are already bound are C-x
> 0 1 2 3 +. And C-x { } ^ if you count the subcommands.
>
>>
>> Also, could you say why for the split- commands you use just C-u to split
>> the root window, rather than a negative prefix argument as has been
>> previously discussed?
>>
>
> That's what I do (and will continue to do) here, but feel free to use a
> negative prefix if you prefer. Like Stefan, I never use a prefix argument for
> split-window-{right,below}. FWIW, I very much doubt that such an argument is
> widely used.
Okay, thank you for saying more.
I hadn't realised until now, but split-window-{right,below} actually
already have a meaning for a negative prefix argument. I don't know how
we decide whether to usurp that with having it mean the command should
affect the root window. Maybe an experiment requesting feedback, like
was done with unbinding M-o? Or maybe it's not important enough for
that? What do you think, Lars?
My own experience is likewise that I can't imagine ever using a prefix
argument with split-window-{right,below}.
--
Sean Whitton
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-13 14:19 ` Sean Whitton
@ 2022-09-13 14:26 ` Gregory Heytings
2022-09-13 15:22 ` Yuri Khan
1 sibling, 0 replies; 80+ messages in thread
From: Gregory Heytings @ 2022-09-13 14:26 UTC (permalink / raw)
To: Sean Whitton
Cc: Stefan Monnier, Lars Ingebrigtsen, Juri Linkov, Robert Pluim,
emacs-devel, Hugo Heagren
[-- Attachment #1: Type: text/plain, Size: 618 bytes --]
>
> I hadn't realised until now, but split-window-{right,below} actually
> already have a meaning for a negative prefix argument.
>
Indeed.
>
> I don't know how we decide whether to usurp that with having it mean the
> command should affect the root window.
>
Note that the C-x w | and C-x w - that Stefan and I (at least) use solves
that problem by circumventing it (and by putting the command on a key that
is related to its meaning).
>
> My own experience is likewise that I can't imagine ever using a prefix
> argument with split-window-{right,below}.
>
We agree on that point 😃
^ permalink raw reply [flat|nested] 80+ messages in thread
* RE: [External] : Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-13 4:08 ` Richard Stallman
@ 2022-09-13 14:29 ` Drew Adams
0 siblings, 0 replies; 80+ messages in thread
From: Drew Adams @ 2022-09-13 14:29 UTC (permalink / raw)
To: rms@gnu.org, Lars Ingebrigtsen
Cc: spwhitton@spwhitton.name, juri@linkov.net, rpluim@gmail.com,
emacs-devel@gnu.org, hugo@heagren.com
>>> Will patchify this if it sounds like a reasonable starting point:...
>
> The details make sense , but are those commands worth using up a C-x
> LETTER prefix? I don't think so. I think we should save it for
> something people will use more often.
+1.
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-13 14:19 ` Sean Whitton
2022-09-13 14:26 ` Gregory Heytings
@ 2022-09-13 15:22 ` Yuri Khan
2022-09-13 16:33 ` Gregory Heytings
1 sibling, 1 reply; 80+ messages in thread
From: Yuri Khan @ 2022-09-13 15:22 UTC (permalink / raw)
To: Sean Whitton
Cc: Gregory Heytings, Stefan Monnier, Lars Ingebrigtsen, Juri Linkov,
Robert Pluim, emacs-devel, Hugo Heagren
On Tue, 13 Sept 2022 at 21:22, Sean Whitton <spwhitton@spwhitton.name> wrote:
> My own experience is likewise that I can't imagine ever using a prefix
> argument with split-window-{right,below}.
It doesn’t even work (correctly).
C-u -4 C-x 2
⇒ the resulting bottom window displays slightly more than two lines.
(Disclaimer: I’m using a non-nil line-spacing; but if I set it to nil,
then the new window displays slightly less than three lines.)
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-13 15:22 ` Yuri Khan
@ 2022-09-13 16:33 ` Gregory Heytings
2022-09-13 17:09 ` Yuri Khan
0 siblings, 1 reply; 80+ messages in thread
From: Gregory Heytings @ 2022-09-13 16:33 UTC (permalink / raw)
To: Yuri Khan
Cc: Sean Whitton, Stefan Monnier, Lars Ingebrigtsen, Juri Linkov,
Robert Pluim, emacs-devel, Hugo Heagren
[-- Attachment #1: Type: text/plain, Size: 631 bytes --]
>> My own experience is likewise that I can't imagine ever using a prefix
>> argument with split-window-{right,below}.
>
> It doesn’t even work (correctly).
>
> C-u -4 C-x 2
>
> ⇒ the resulting bottom window displays slightly more than two lines.
>
> (Disclaimer: I’m using a non-nil line-spacing; but if I set it to nil,
> then the new window displays slightly less than three lines.)
>
That's the expected behavior, because the mode line is part of the height
of a window. So with emacs -Q, C-u -4 C-x 2 creates a window that is 4
lines tall, 3 lines for the window body and 1 line for the mode line.
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-13 16:33 ` Gregory Heytings
@ 2022-09-13 17:09 ` Yuri Khan
0 siblings, 0 replies; 80+ messages in thread
From: Yuri Khan @ 2022-09-13 17:09 UTC (permalink / raw)
To: Gregory Heytings
Cc: Sean Whitton, Stefan Monnier, Lars Ingebrigtsen, Juri Linkov,
Robert Pluim, emacs-devel, Hugo Heagren
On Tue, 13 Sept 2022 at 23:33, Gregory Heytings <gregory@heytings.org> wrote:
> > It doesn’t even work (correctly).
> >
> > C-u -4 C-x 2
> >
> > ⇒ the resulting bottom window displays slightly more than two lines.
> >
> > (Disclaimer: I’m using a non-nil line-spacing; but if I set it to nil,
> > then the new window displays slightly less than three lines.)
>
> That's the expected behavior, because the mode line is part of the height
> of a window. So with emacs -Q, C-u -4 C-x 2 creates a window that is 4
> lines tall, 3 lines for the window body and 1 line for the mode line.
Even so, surely the more useful behavior would be to create a window
that is exactly 1 modeline + 3 actual lines’ heights taking the
buffer’s remapped default face, line-spacing, and whatever else
affects its display, into account, rather than just 4 abstract lines’
heights?
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-13 9:33 ` Gregory Heytings
2022-09-13 11:14 ` Lars Ingebrigtsen
2022-09-13 13:51 ` Sean Whitton
@ 2022-09-13 18:16 ` Juri Linkov
2022-09-13 19:28 ` Gregory Heytings
2022-09-15 7:19 ` Augusto Stoffel
3 siblings, 1 reply; 80+ messages in thread
From: Juri Linkov @ 2022-09-13 18:16 UTC (permalink / raw)
To: Gregory Heytings
Cc: Stefan Monnier, Sean Whitton, Lars Ingebrigtsen, Robert Pluim,
emacs-devel, Hugo Heagren
> C-x w | split-window-right
> C-u C-x w | split-root-window-right
> C-x w - split-window-below
> C-u C-x w - split-root-window-below
These are really not easier to type than 'C-x 2' and 'C-x 3'.
I'd rather type simply 'C-u C-x 2' and 'C-u C-x 3'
to split the root window.
> C-x w d delete-window
> C-x w o delete-other-windows (mnemonic "only")
In 'C-x o' "o" has mnemonic "other".
> C-x w h window-height-adjust with + - = (repeatable)
> C-x w w window-width-adjust with + - = (repeatable)
These could be also repeatable with arrow keys,
and one keymap 'C-x w r' with mnemonic "resize".
> C-x w m maximize-window-toggle
> C-u C-x w m minimize-window
Window managers have shortcut keys 'x' for maximize,
and 'n' for minimize.
> C-x w b balance-windows
> C-u C-x w b balance-windows-area
Or with visual mnemonic 'C-x w ='.
> C-x w M-up/M-down/M-left/M-right swap-windows-{up,down,left,right} (repeatable)
Or with better mnemonic "Shift": S-up...
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-13 14:01 ` Sean Whitton
@ 2022-09-13 18:29 ` Juri Linkov
2022-09-13 22:12 ` Sean Whitton
0 siblings, 1 reply; 80+ messages in thread
From: Juri Linkov @ 2022-09-13 18:29 UTC (permalink / raw)
To: Sean Whitton; +Cc: Lars Ingebrigtsen, Robert Pluim, emacs-devel, Hugo Heagren
>>>>> Not sure what key might be good for these:
>>>>>
>>>>> tab-window-detach
>>>>> tab-bar-move-window-to-tab
>>>>
>>>> They are window-related indeed, but I think they all should be under
>>>> 'C-t w' prefix key.
>>>
>>> I think we should have either
>>>
>>> 'C-x w f' tear-off-frame
>>> 'C-x w t' tab-window-detach
>>>
>>> or
>>>
>>> 'C-x 5 xx' tear-off-frame
Since the command name is 'tear-off-window', should it be on
the window-related prefix 'C-x 4' or new 'C-x w'?
>>> 'C-x t xx' tab-window-detach
>>>
>>> where 'xx' is a single key.
>>
>> There is also tab-detach (tab-bar-detach-tab).
>> So there 3 related commands that need a keybinding:
>>
>> - tear-off-window - move window to a new frame
>> - tab-window-detach - move window to a new tab
>> - tab-detach - move tab to a new frame
>
> Good point. Which of the two ideas in the message of mine you're
> replying to do you prefer, for all three of these? Do you have an idea
> for 'xx'?
What key has the closest mnemonic for detachment? Maybe '^'?
Then e.g.
- tear-off-window - C-x w ^ - detach window to a new frame
- tab-window-detach - C-x t ^ w - detach window to a new tab
- tab-detach - C-x t ^ f - detach tab to a new frame
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-13 18:16 ` Juri Linkov
@ 2022-09-13 19:28 ` Gregory Heytings
2022-09-14 6:47 ` Juri Linkov
0 siblings, 1 reply; 80+ messages in thread
From: Gregory Heytings @ 2022-09-13 19:28 UTC (permalink / raw)
To: Juri Linkov
Cc: Stefan Monnier, Sean Whitton, Lars Ingebrigtsen, Robert Pluim,
emacs-devel, Hugo Heagren
>> C-x w | split-window-right
>> C-u C-x w | split-root-window-right
>> C-x w - split-window-below
>> C-u C-x w - split-root-window-below
>
> These are really not easier to type than 'C-x 2' and 'C-x 3'. I'd rather
> type simply 'C-u C-x 2' and 'C-u C-x 3' to split the root window.
>
But (1) C-u C-x 2 and C-u C-x 3 are already taken, and (2) unlike 2 and 3,
| and - have a visual relation with the meaning of the command. That
being said, I won't try to convince anyone here, again I just shared a
part of my configuration which I thought could be useful in this
discussion.
>> C-x w h window-height-adjust with + - = (repeatable)
>> C-x w w window-width-adjust with + - = (repeatable)
>
> These could be also repeatable with arrow keys, and one keymap 'C-x w r'
> with mnemonic "resize".
>
But then you lose the possibility to fit the window to the buffer
vertically and horizontally (which is what the = key does in both cases),
at least not without using some arbitrary keys for the two cases. In
practice I rarely adjust both the width and height of a window, but
perhaps that's only me.
>> C-x w m maximize-window-toggle C-u C-x w m minimize-window
>
> Window managers have shortcut keys 'x' for maximize, and 'n' for
> minimize.
>
Out of curiosity: which window managers?
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-13 18:29 ` Juri Linkov
@ 2022-09-13 22:12 ` Sean Whitton
2022-09-14 6:53 ` Juri Linkov
0 siblings, 1 reply; 80+ messages in thread
From: Sean Whitton @ 2022-09-13 22:12 UTC (permalink / raw)
To: Juri Linkov, Lars Ingebrigtsen, Robert Pluim, emacs-devel,
Hugo Heagren
Hello,
On Tue 13 Sep 2022 at 09:29PM +03, Juri Linkov wrote:
> Since the command name is 'tear-off-window', should it be on
> the window-related prefix 'C-x 4' or new 'C-x w'?
Nothing under C-x 4 creates new frames, but tear-off-window does, so I
think either C-x 5 or C-x w.
> What key has the closest mnemonic for detachment? Maybe '^'?
Nice!
> Then e.g.
>
> - tear-off-window - C-x w ^ - detach window to a new frame
> - tab-window-detach - C-x t ^ w - detach window to a new tab
> - tab-detach - C-x t ^ f - detach tab to a new frame
My own intuition is that C-x t is for operations *on* tabs, and C-x w
for operations *on* windows, so what do you (and others) think about:
C-x w ^ f -- tear-off-window
C-x w ^ t -- tab-window-detach
C-x t ^ -- tab-detach
--
Sean Whitton
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-13 19:28 ` Gregory Heytings
@ 2022-09-14 6:47 ` Juri Linkov
2022-09-14 8:13 ` Gregory Heytings
0 siblings, 1 reply; 80+ messages in thread
From: Juri Linkov @ 2022-09-14 6:47 UTC (permalink / raw)
To: Gregory Heytings
Cc: Stefan Monnier, Sean Whitton, Lars Ingebrigtsen, Robert Pluim,
emacs-devel, Hugo Heagren
[-- Attachment #1: Type: text/plain, Size: 1323 bytes --]
>>> C-x w | split-window-right
>>> C-u C-x w | split-root-window-right
>>> C-x w - split-window-below
>>> C-u C-x w - split-root-window-below
>>
>> These are really not easier to type than 'C-x 2' and 'C-x 3'. I'd rather
>> type simply 'C-u C-x 2' and 'C-u C-x 3' to split the root window.
>>
>
> But (1) C-u C-x 2 and C-u C-x 3 are already taken
You meant C-u is taken to split the window to exactly 4 lines high?
>>> C-x w h window-height-adjust with + - = (repeatable)
>>> C-x w w window-width-adjust with + - = (repeatable)
>>
>> These could be also repeatable with arrow keys, and one keymap 'C-x w r'
>> with mnemonic "resize".
>
> But then you lose the possibility to fit the window to the buffer
> vertically and horizontally (which is what the = key does in both cases),
> at least not without using some arbitrary keys for the two cases. In
> practice I rarely adjust both the width and height of a window, but perhaps
> that's only me.
But then we could use two keys in the shared map, e.g. '|' and '-'.
>>> C-x w m maximize-window-toggle C-u C-x w m minimize-window
>>
>> Window managers have shortcut keys 'x' for maximize, and 'n' for
>> minimize.
>
> Out of curiosity: which window managers?
On many window managers. For example, this is how it looks
on MATE Desktop Environment:
[-- Attachment #2: mate.png --]
[-- Type: image/png, Size: 16090 bytes --]
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-13 22:12 ` Sean Whitton
@ 2022-09-14 6:53 ` Juri Linkov
2022-09-14 16:52 ` Sean Whitton
0 siblings, 1 reply; 80+ messages in thread
From: Juri Linkov @ 2022-09-14 6:53 UTC (permalink / raw)
To: Sean Whitton; +Cc: Lars Ingebrigtsen, Robert Pluim, emacs-devel, Hugo Heagren
>> - tear-off-window - C-x w ^ - detach window to a new frame
>> - tab-window-detach - C-x t ^ w - detach window to a new tab
>> - tab-detach - C-x t ^ f - detach tab to a new frame
>
> My own intuition is that C-x t is for operations *on* tabs, and C-x w
> for operations *on* windows, so what do you (and others) think about:
>
> C-x w ^ f -- tear-off-window
> C-x w ^ t -- tab-window-detach
> C-x t ^ -- tab-detach
Nice, these keys also have transitional semantics:
w ^ f - from window to frame
w ^ t - from window to tab
So for consistency tab-detach also could be:
t ^ f - from tab to frame
if another key also makes sense:
t ^ w - from tab to window
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-14 6:47 ` Juri Linkov
@ 2022-09-14 8:13 ` Gregory Heytings
2022-09-14 9:21 ` Yuri Khan
0 siblings, 1 reply; 80+ messages in thread
From: Gregory Heytings @ 2022-09-14 8:13 UTC (permalink / raw)
To: Juri Linkov
Cc: Stefan Monnier, Sean Whitton, Lars Ingebrigtsen, Robert Pluim,
emacs-devel, Hugo Heagren
>>> These are really not easier to type than 'C-x 2' and 'C-x 3'. I'd
>>> rather type simply 'C-u C-x 2' and 'C-u C-x 3' to split the root
>>> window.
>>
>> But (1) C-u C-x 2 and C-u C-x 3 are already taken
>
> You meant C-u is taken to split the window to exactly 4 lines high?
>
Yes. Unless the prefix argument of C-x 2 and C-x 3 is deprecated (which
is unlikely in the short term), suddenly deciding that a raw prefix
argument has a different meaning than a non-raw prefix argument will make
things even more confusing than they are.
>>> Window managers have shortcut keys 'x' for maximize, and 'n' for
>>> minimize.
>>
>> Out of curiosity: which window managers?
>
> On many window managers. For example, this is how it looks on MATE
> Desktop Environment:
>
We cannot draw a conclusion from a single example, and AFAIU the
screenshot you show does not tell that "x" is used to maximize a window
but only that, when that menu is opened, you can select its "maximize"
entry by pressing "x".
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-14 8:13 ` Gregory Heytings
@ 2022-09-14 9:21 ` Yuri Khan
2022-09-14 10:51 ` Gregory Heytings
0 siblings, 1 reply; 80+ messages in thread
From: Yuri Khan @ 2022-09-14 9:21 UTC (permalink / raw)
To: Gregory Heytings
Cc: Juri Linkov, Stefan Monnier, Sean Whitton, Lars Ingebrigtsen,
Robert Pluim, emacs-devel, Hugo Heagren
On Wed, 14 Sept 2022 at 15:14, Gregory Heytings <gregory@heytings.org> wrote:
> >>> Window managers have shortcut keys 'x' for maximize, and 'n' for
> >>> minimize.
> > On many window managers. For example, this is how it looks on MATE
> > Desktop Environment:
> We cannot draw a conclusion from a single example, and AFAIU the
> screenshot you show does not tell that "x" is used to maximize a window
> but only that, when that menu is opened, you can select its "maximize"
> entry by pressing "x".
How many examples do you want? Windows, KDE, Xfce, pretty much every
one with the concept of a window operations menu.
Yes, those are menu item mnemonics, not direct bindings, because no
window manager is going to steal character input for window
operations. You typically invoke the menu with Alt+Space, then use the
mnemonic; in this use, it is similar to Emacs’s prefix maps.
Alternatively, the CUA standard used to specify Alt+F10 for
maximization and Alt+F9 for minimization; Xfce still honors that in
default keybindings.
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-14 9:21 ` Yuri Khan
@ 2022-09-14 10:51 ` Gregory Heytings
2022-09-14 12:11 ` Yuri Khan
0 siblings, 1 reply; 80+ messages in thread
From: Gregory Heytings @ 2022-09-14 10:51 UTC (permalink / raw)
To: Yuri Khan
Cc: Juri Linkov, Stefan Monnier, Sean Whitton, Lars Ingebrigtsen,
Robert Pluim, emacs-devel, Hugo Heagren
[-- Attachment #1: Type: text/plain, Size: 1529 bytes --]
>> We cannot draw a conclusion from a single example, and AFAIU the
>> screenshot you show does not tell that "x" is used to maximize a window
>> but only that, when that menu is opened, you can select its "maximize"
>> entry by pressing "x".
>
> How many examples do you want? Windows, KDE, Xfce, pretty much every one
> with the concept of a window operations menu.
>
> Yes, those are menu item mnemonics, not direct bindings, because no
> window manager is going to steal character input for window operations.
> You typically invoke the menu with Alt+Space, then use the mnemonic; in
> this use, it is similar to Emacs’s prefix maps.
>
I don't use any of these window managers myself, which is why I asked for
examples. I misunderstood his answer, and did not realize that users
could use a window menu the way you describe it.
>
> Alternatively, the CUA standard used to specify Alt+F10 for maximization
> and Alt+F9 for minimization; Xfce still honors that in default
> keybindings.
>
These are the kind of key bindings I had in mind, and a few Google
searches showed a great variety of bindings accross window managers.
Anyway, it seems to me that this is tangent to the discussion. The fact
that some users use M-SPC x (in Emacs key notation) to maximize a frame
(in Emacs parlance) does not seem to be a good reason to use the 'x' key
to toggle the maximization of windows in Emacs. At least I'll continue to
use the 'm' key in my configuration for that purpose.
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-14 10:51 ` Gregory Heytings
@ 2022-09-14 12:11 ` Yuri Khan
0 siblings, 0 replies; 80+ messages in thread
From: Yuri Khan @ 2022-09-14 12:11 UTC (permalink / raw)
To: Gregory Heytings
Cc: Juri Linkov, Stefan Monnier, Sean Whitton, Lars Ingebrigtsen,
Robert Pluim, emacs-devel, Hugo Heagren
On Wed, 14 Sept 2022 at 17:51, Gregory Heytings <gregory@heytings.org> wrote:
> Anyway, it seems to me that this is tangent to the discussion. The fact
> that some users use M-SPC x (in Emacs key notation) to maximize a frame
> (in Emacs parlance) does not seem to be a good reason to use the 'x' key
> to toggle the maximization of windows in Emacs. At least I'll continue to
> use the 'm' key in my configuration for that purpose.
Your config, your rules, of course. However, in the class of window
managers discussed above, ‘m’ is the mnemonic for Move — a mode where
the user can press arrow keys to reposition the window within the
desktop while keeping its size constant.
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-13 14:12 ` Sean Whitton
@ 2022-09-14 12:29 ` Lars Ingebrigtsen
2022-09-14 13:49 ` Eli Zaretskii
2022-09-14 16:37 ` Sean Whitton
0 siblings, 2 replies; 80+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-14 12:29 UTC (permalink / raw)
To: Sean Whitton
Cc: chad, Juri Linkov, Robert Pluim, EMACS development team,
Hugo Heagren
Sean Whitton <spwhitton@spwhitton.name> writes:
> Right, but it goes via Emacs C code, right? 'M-x suspend-frame' invokes
> the shell's job control too. So, having C-z at the end of a series of
> keypresses do something other than invoke that function should be fine,
> if we want it.
Hm -- I'm not actually sure. Eli probably knows -- Eli?
But in any case, I don't think putting anything on `C-z' is a good idea.
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-14 12:29 ` Lars Ingebrigtsen
@ 2022-09-14 13:49 ` Eli Zaretskii
2022-09-14 16:37 ` Sean Whitton
2022-09-14 16:37 ` Sean Whitton
1 sibling, 1 reply; 80+ messages in thread
From: Eli Zaretskii @ 2022-09-14 13:49 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: spwhitton, yandros, juri, rpluim, emacs-devel, hugo
> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: chad <yandros@gmail.com>, Juri Linkov <juri@linkov.net>, Robert Pluim
> <rpluim@gmail.com>, EMACS development team <emacs-devel@gnu.org>, Hugo
> Heagren <hugo@heagren.com>
> Date: Wed, 14 Sep 2022 14:29:23 +0200
>
> Sean Whitton <spwhitton@spwhitton.name> writes:
>
> > Right, but it goes via Emacs C code, right? 'M-x suspend-frame' invokes
> > the shell's job control too. So, having C-z at the end of a series of
> > keypresses do something other than invoke that function should be fine,
> > if we want it.
>
> Hm -- I'm not actually sure. Eli probably knows -- Eli?
I'm not sure I understand the question. Is the question whether we
can bind some command to C-z and have it work on a TTY? If so, the
answer is YES, since AFAIU we put the terminal into a mode where the
usual meaning of C-z is disabled. From init_sys_modes:
#ifdef VSWTCH
tty.main.c_cc[VSWTCH] = CDISABLE; /* Turn off shell layering use
of C-z */
#endif /* VSWTCH */
#ifdef VSUSP
tty.main.c_cc[VSUSP] = CDISABLE; /* Turn off handling of C-z. */
#endif /* VSUSP */
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-14 12:29 ` Lars Ingebrigtsen
2022-09-14 13:49 ` Eli Zaretskii
@ 2022-09-14 16:37 ` Sean Whitton
1 sibling, 0 replies; 80+ messages in thread
From: Sean Whitton @ 2022-09-14 16:37 UTC (permalink / raw)
To: Lars Ingebrigtsen, chad, Juri Linkov, Robert Pluim,
EMACS development team, Hugo Heagren
Hello,
On Wed 14 Sep 2022 at 02:29PM +02, Lars Ingebrigtsen wrote:
> But in any case, I don't think putting anything on `C-z' is a good
> idea.
I agree. Thanks for following up on the details nevertheless.
--
Sean Whitton
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-14 13:49 ` Eli Zaretskii
@ 2022-09-14 16:37 ` Sean Whitton
0 siblings, 0 replies; 80+ messages in thread
From: Sean Whitton @ 2022-09-14 16:37 UTC (permalink / raw)
To: Eli Zaretskii, Eli Zaretskii, Lars Ingebrigtsen, yandros, juri,
rpluim, emacs-devel, hugo
Hello,
On Wed 14 Sep 2022 at 04:49PM +03, Eli Zaretskii wrote:
> Is the question whether we can bind some command to C-z and have it
> work on a TTY?
It's more like whether this will *always* work, for any terminals anyone
uses.
> If so, the answer is YES, since AFAIU we put the terminal into a mode
> where the usual meaning of C-z is disabled.
That's what I thought, thank you for explaining exactly how.
--
Sean Whitton
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-14 6:53 ` Juri Linkov
@ 2022-09-14 16:52 ` Sean Whitton
2022-09-14 19:22 ` Juri Linkov
0 siblings, 1 reply; 80+ messages in thread
From: Sean Whitton @ 2022-09-14 16:52 UTC (permalink / raw)
To: Juri Linkov; +Cc: Lars Ingebrigtsen, emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1308 bytes --]
Hello,
On Wed 14 Sep 2022 at 09:53AM +03, Juri Linkov wrote:
>>> - tear-off-window - C-x w ^ - detach window to a new frame
>>> - tab-window-detach - C-x t ^ w - detach window to a new tab
>>> - tab-detach - C-x t ^ f - detach tab to a new frame
>>
>> My own intuition is that C-x t is for operations *on* tabs, and C-x w
>> for operations *on* windows, so what do you (and others) think about:
>>
>> C-x w ^ f -- tear-off-window
>> C-x w ^ t -- tab-window-detach
>> C-x t ^ -- tab-detach
>
> Nice, these keys also have transitional semantics:
>
> w ^ f - from window to frame
> w ^ t - from window to tab
Indeed!
> So for consistency tab-detach also could be:
>
> t ^ f - from tab to frame
>
> if another key also makes sense:
>
> t ^ w - from tab to window
Do you think it does?
Or perhaps we should do it anyway in case we later want to put another
detach command under the submap -- perhaps we'll want C-x t ^ F for some
variant on tab-detach, since '^' can't be capitalised.
Here is a patch for review, though it's pretty trivial -- I am wondering
if an additional NEWS entry is warranted or not. I don't believe there
are any manual updates required.
Nice to resolve this subthread.
--
Sean Whitton
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Use-key-for-detach-command-bindings.patch --]
[-- Type: text/x-patch, Size: 1476 bytes --]
From 2a128e9796b77f2b1d5c0b779929bd7deebe2ea1 Mon Sep 17 00:00:00 2001
From: Sean Whitton <spwhitton@spwhitton.name>
Date: Wed, 14 Sep 2022 09:49:27 -0700
Subject: [PATCH] Use '^' key for detach command bindings
* lisp/tab-bar.el (tab-prefix-map): Move tear-off-window to C-x w ^ f.
Bind tab-window-detach to C-x w ^ t.
* lisp/window.el (window-prefix-map): Bind tab-detach to C-x t ^ f.
---
lisp/tab-bar.el | 1 +
lisp/window.el | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index cf5ae09a24..abefd996a8 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -2411,6 +2411,7 @@ 'tab-list
(keymap-set tab-prefix-map "M" #'tab-move-to)
(keymap-set tab-prefix-map "G" #'tab-group)
(keymap-set tab-prefix-map "r" #'tab-rename)
+(keymap-set tab-prefix-map "^ f" #'tab-detach)
(keymap-set tab-prefix-map "RET" #'tab-switch)
(keymap-set tab-prefix-map "b" #'switch-to-buffer-other-tab)
(keymap-set tab-prefix-map "f" #'find-file-other-tab)
diff --git a/lisp/window.el b/lisp/window.el
index d5f42dd10b..905803b19e 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -10593,7 +10593,8 @@ window-prefix-map
"2" #'split-root-window-below
"3" #'split-root-window-right
"s" #'window-toggle-side-windows
- "f" #'tear-off-window
+ "^ f" #'tear-off-window
+ "^ t" #'tab-window-detach
"-" #'fit-window-to-buffer
"0" #'delete-windows-on)
(define-key ctl-x-map "w" window-prefix-map)
--
2.30.2
^ permalink raw reply related [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-14 16:52 ` Sean Whitton
@ 2022-09-14 19:22 ` Juri Linkov
2022-09-14 23:06 ` Sean Whitton
0 siblings, 1 reply; 80+ messages in thread
From: Juri Linkov @ 2022-09-14 19:22 UTC (permalink / raw)
To: Sean Whitton; +Cc: Lars Ingebrigtsen, emacs-devel
> Here is a patch for review, though it's pretty trivial --
Thanks, looks nice.
> I am wondering if an additional NEWS entry is warranted
> or not. I don't believe there are any manual updates required.
I think neither NEWS nor manual updates are needed.
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-14 19:22 ` Juri Linkov
@ 2022-09-14 23:06 ` Sean Whitton
2022-09-15 5:45 ` Eli Zaretskii
0 siblings, 1 reply; 80+ messages in thread
From: Sean Whitton @ 2022-09-14 23:06 UTC (permalink / raw)
To: Juri Linkov, Lars Ingebrigtsen, emacs-devel
Hello,
On Wed 14 Sep 2022 at 10:22PM +03, Juri Linkov wrote:
>> Here is a patch for review, though it's pretty trivial --
>
> Thanks, looks nice.
>
>> I am wondering if an additional NEWS entry is warranted
>> or not. I don't believe there are any manual updates required.
>
> I think neither NEWS nor manual updates are needed.
Thanks for reviewing. Others haven't chimed in on this part of the
discussion, and I've gone ahead and pushed.
--
Sean Whitton
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-14 23:06 ` Sean Whitton
@ 2022-09-15 5:45 ` Eli Zaretskii
2022-09-15 16:14 ` Sean Whitton
0 siblings, 1 reply; 80+ messages in thread
From: Eli Zaretskii @ 2022-09-15 5:45 UTC (permalink / raw)
To: Sean Whitton; +Cc: juri, larsi, emacs-devel
> From: Sean Whitton <spwhitton@spwhitton.name>
> Date: Wed, 14 Sep 2022 16:06:31 -0700
>
> Thanks for reviewing. Others haven't chimed in on this part of the
> discussion, and I've gone ahead and pushed.
FWIW, if you want to give people chance to chime in, you should wait
longer than you did in this case. Just 7 hours is not nearly enough.
The fact that people didn't speak up in the discussion until you post
an actual patch doesn't mean they won't want to say something about
the patch, it just means they didn't have anything they considered
useful to say in response to the previous messages. It definitely
doesn't mean no one else is interested in this discussion.
My rule of thumb is to wait for at least a week before concluding that
no one has anything to say about a patch. Yes, this slows down the
commit rate, but IMO it makes our community sense better, and
eventually the code cleaner.
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-13 9:33 ` Gregory Heytings
` (2 preceding siblings ...)
2022-09-13 18:16 ` Juri Linkov
@ 2022-09-15 7:19 ` Augusto Stoffel
2022-09-16 14:30 ` Gregory Heytings
3 siblings, 1 reply; 80+ messages in thread
From: Augusto Stoffel @ 2022-09-15 7:19 UTC (permalink / raw)
To: Gregory Heytings
Cc: Stefan Monnier, Sean Whitton, Lars Ingebrigtsen, Juri Linkov,
Robert Pluim, emacs-devel, Hugo Heagren
On Tue, 13 Sep 2022 at 09:33, Gregory Heytings wrote:
> Fully agreed. I we're going to put window commands on C-x w, I
> thought I might share the part of my configuration that deals with
> windows (see attached), which I adapted to that new prefix.
Since you mention various custom repeatable commands, I think we're
missing a less drastic version of delete-other-windows which deletes all
siblings in the window configuration tree of the selected window.
In other words, the non-root-window version on C-x 1.
I use this as a simplified replacement:
(lambda ()
"Delete other windows, but only vertically if applicable."
(interactive)
(or (delete-other-windows-vertically)
(delete-other-windows)))
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-15 5:45 ` Eli Zaretskii
@ 2022-09-15 16:14 ` Sean Whitton
0 siblings, 0 replies; 80+ messages in thread
From: Sean Whitton @ 2022-09-15 16:14 UTC (permalink / raw)
To: Eli Zaretskii, juri, larsi, emacs-devel
Hello,
On Thu 15 Sep 2022 at 08:45AM +03, Eli Zaretskii wrote:
>> From: Sean Whitton <spwhitton@spwhitton.name>
>> Date: Wed, 14 Sep 2022 16:06:31 -0700
>>
>> Thanks for reviewing. Others haven't chimed in on this part of the
>> discussion, and I've gone ahead and pushed.
>
> FWIW, if you want to give people chance to chime in, you should wait
> longer than you did in this case. Just 7 hours is not nearly enough.
> The fact that people didn't speak up in the discussion until you post
> an actual patch doesn't mean they won't want to say something about
> the patch, it just means they didn't have anything they considered
> useful to say in response to the previous messages. It definitely
> doesn't mean no one else is interested in this discussion.
>
> My rule of thumb is to wait for at least a week before concluding that
> no one has anything to say about a patch. Yes, this slows down the
> commit rate, but IMO it makes our community sense better, and
> eventually the code cleaner.
I meant that no-one was chiming in on the whole subthread since Monday,
despite lots of posts to other subthreads. Seven hours would obviously
be too short to say "others haven't chimed in".
I'll keep what you say in mind in general, anyway, thank you.
--
Sean Whitton
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-15 7:19 ` Augusto Stoffel
@ 2022-09-16 14:30 ` Gregory Heytings
2022-09-16 15:03 ` Augusto Stoffel
0 siblings, 1 reply; 80+ messages in thread
From: Gregory Heytings @ 2022-09-16 14:30 UTC (permalink / raw)
To: Augusto Stoffel
Cc: Stefan Monnier, Sean Whitton, Lars Ingebrigtsen, Juri Linkov,
Robert Pluim, emacs-devel, Hugo Heagren
>
> Since you mention various custom repeatable commands, I think we're
> missing a less drastic version of delete-other-windows which deletes all
> siblings in the window configuration tree of the selected window.
>
> In other words, the non-root-window version on C-x 1.
>
Is this what you have in mind?
(defun delete-other-windows-soft (&optional arg)
(interactive "P")
(if arg
(delete-other-windows)
(let* ((w (window-child (window-parent))) (wl (list w)))
(while (setq w (window-next-sibling w)) (push w wl))
(dolist (w wl)
(when (and (not (eq w (selected-window)))
(not (window-parameter w 'no-delete-other-windows)))
(ignore-errors (delete-window w)))))))
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-16 14:30 ` Gregory Heytings
@ 2022-09-16 15:03 ` Augusto Stoffel
0 siblings, 0 replies; 80+ messages in thread
From: Augusto Stoffel @ 2022-09-16 15:03 UTC (permalink / raw)
To: Gregory Heytings
Cc: Stefan Monnier, Sean Whitton, Lars Ingebrigtsen, Juri Linkov,
Robert Pluim, emacs-devel, Hugo Heagren
On Fri, 16 Sep 2022 at 14:30, Gregory Heytings wrote:
>>
>> Since you mention various custom repeatable commands, I think we're
>> missing a less drastic version of delete-other-windows which deletes
>> all siblings in the window configuration tree of the selected
>> window.
>>
>> In other words, the non-root-window version on C-x 1.
>>
>
> Is this what you have in mind?
>
> (defun delete-other-windows-soft (&optional arg)
> (interactive "P")
> (if arg
> (delete-other-windows)
> (let* ((w (window-child (window-parent))) (wl (list w)))
> (while (setq w (window-next-sibling w)) (push w wl))
> (dolist (w wl)
> (when (and (not (eq w (selected-window)))
> (not (window-parameter w 'no-delete-other-windows)))
> (ignore-errors (delete-window w)))))))
Yes. I can't comment on the completeness with respect to various window
parameters like 'no-delete-other-windows, but this works for me.
(I guess I'd call it `delete-window-siblings` or something in that
direction.)
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-11 11:03 ` Lars Ingebrigtsen
2022-09-11 17:48 ` Sean Whitton
@ 2022-09-19 6:53 ` Emanuel Berg
1 sibling, 0 replies; 80+ messages in thread
From: Emanuel Berg @ 2022-09-19 6:53 UTC (permalink / raw)
To: emacs-devel
(defun other-window-or-split ()
(interactive)
(when (one-window-p)
(split-window-below) )
(other-window 1) )
Bind to M-o or something short/close from asdf and jkl; if
relied upon ...
--
underground experts united
https://dataswamp.org/~incal
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-11 3:37 ` Richard Stallman
@ 2022-09-19 23:55 ` Emanuel Berg
2022-09-20 6:50 ` Juri Linkov
0 siblings, 1 reply; 80+ messages in thread
From: Emanuel Berg @ 2022-09-19 23:55 UTC (permalink / raw)
To: emacs-devel
;;; -*- lexical-binding: t -*-
;;
;; this file:
;; https://dataswamp.org/~incal/emacs-init/window-incal.el
(setq display-buffer-base-action '((display-buffer-reuse-window
display-buffer-same-window) ))
(defun beginning-of-line-at-top ()
(beginning-of-line)
(recenter 0) )
;; the two-window solution
(defun other-window-or-split ()
(interactive)
(when (one-window-p)
(split-window-below) )
(other-window 1) )
(defun swap-windows ()
(interactive)
(let ((buffer (current-buffer)))
(other-window 1)
(switch-to-buffer-other-window (current-buffer))
(other-window 1)
(switch-to-buffer buffer) ))
;; window size shorthands
(defun window-increase-size (&optional lines)
(interactive "p")
(unless (one-window-p)
(or lines (setq lines 1))
(window-resize nil lines) ))
(defun window-decrease-size (&optional lines)
(interactive "p")
(unless (one-window-p)
(or lines (setq lines 1))
(window-resize nil (* -1 lines) )))
(provide 'window-incal)
--
underground experts united
https://dataswamp.org/~incal
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-19 23:55 ` Emanuel Berg
@ 2022-09-20 6:50 ` Juri Linkov
2022-09-20 7:47 ` Emanuel Berg
0 siblings, 1 reply; 80+ messages in thread
From: Juri Linkov @ 2022-09-20 6:50 UTC (permalink / raw)
To: emacs-devel
> (defun other-window-or-split ()
> (interactive)
> (when (one-window-p)
> (split-window-below) )
> (other-window 1) )
A.k.a. windmove-create-window.
> (defun swap-windows ()
> (interactive)
> (let ((buffer (current-buffer)))
> (other-window 1)
> (switch-to-buffer-other-window (current-buffer))
> (other-window 1)
> (switch-to-buffer buffer) ))
A.k.a. windmove-swap-states.
> ;; window size shorthands
>
> (defun window-increase-size (&optional lines)
> (interactive "p")
> (unless (one-window-p)
> (or lines (setq lines 1))
> (window-resize nil lines) ))
>
> (defun window-decrease-size (&optional lines)
> (interactive "p")
> (unless (one-window-p)
> (or lines (setq lines 1))
> (window-resize nil (* -1 lines) )))
It was proposed to add this on 'C-x w r left/right/up/down'
with enlarge-window, enlarge-window-horizontally,
shrink-window, shrink-window-horizontally.
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-20 6:50 ` Juri Linkov
@ 2022-09-20 7:47 ` Emanuel Berg
2022-09-20 16:06 ` Juri Linkov
0 siblings, 1 reply; 80+ messages in thread
From: Emanuel Berg @ 2022-09-20 7:47 UTC (permalink / raw)
To: emacs-devel
Juri Linkov wrote:
>> (defun other-window-or-split ()
>> (interactive)
>> (when (one-window-p)
>> (split-window-below) )
>> (other-window 1) )
>
> A.k.a. windmove-create-window.
OK, I don't have that ...
>> (defun swap-windows ()
>> (interactive)
>> (let ((buffer (current-buffer)))
>> (other-window 1)
>> (switch-to-buffer-other-window (current-buffer))
>> (other-window 1)
>> (switch-to-buffer buffer) ))
>
> A.k.a. windmove-swap-states.
Same ...
>> (defun window-increase-size (&optional lines)
>> (interactive "p")
>> (unless (one-window-p)
>> (or lines (setq lines 1))
>> (window-resize nil lines) ))
>>
>> (defun window-decrease-size (&optional lines)
>> (interactive "p")
>> (unless (one-window-p)
>> (or lines (setq lines 1))
>> (window-resize nil (* -1 lines) )))
>
> It was proposed to add this on 'C-x w r left/right/up/down'
'C-x w' is undefined here, but if you add that (by "this" you
mean the shortcuts?) I'd add it with i, l, i and k instead (or
"as well").
'C-x' is not so ergonomic tho ... I take it 'w' is mnemonic
for "window" and 'r' for "resize", I think that should only be
considered when the keys are good. But they are.
--
underground experts united
https://dataswamp.org/~incal
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-20 7:47 ` Emanuel Berg
@ 2022-09-20 16:06 ` Juri Linkov
2022-09-20 21:24 ` Emanuel Berg
0 siblings, 1 reply; 80+ messages in thread
From: Juri Linkov @ 2022-09-20 16:06 UTC (permalink / raw)
To: emacs-devel
>> It was proposed to add this on 'C-x w r left/right/up/down'
>
> 'C-x w' is undefined here, but if you add that (by "this" you
> mean the shortcuts?) I'd add it with i, l, i and k instead (or
> "as well").
>
> 'C-x' is not so ergonomic tho ... I take it 'w' is mnemonic
> for "window" and 'r' for "resize", I think that should only be
> considered when the keys are good. But they are.
Actually, this is already possible with such customization:
(define-key resize-window-repeat-map [up] 'enlarge-window)
(define-key resize-window-repeat-map [right] 'enlarge-window-horizontally)
(define-key resize-window-repeat-map [left] 'shrink-window-horizontally)
(define-key resize-window-repeat-map [down] 'shrink-window)
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-20 16:06 ` Juri Linkov
@ 2022-09-20 21:24 ` Emanuel Berg
2022-09-21 18:41 ` Juri Linkov
0 siblings, 1 reply; 80+ messages in thread
From: Emanuel Berg @ 2022-09-20 21:24 UTC (permalink / raw)
To: emacs-devel
Juri Linkov wrote:
>>> It was proposed to add this on 'C-x
>>> w r left/right/up/down'
>>
>> 'C-x w' is undefined here, but if you add that (by "this"
>> you mean the shortcuts?) I'd add it with i, l, i and
>> k instead (or "as well").
>>
>> 'C-x' is not so ergonomic tho ... I take it 'w' is mnemonic
>> for "window" and 'r' for "resize", I think that should only
>> be considered when the keys are good. But they are.
>
> Actually, this
Again, "this" refers to what exactly?
If it's in vanilla Emacs already I'm happy to remove my stuff.
Is that what you are saying?
> is already possible with such customization:
>
> (define-key resize-window-repeat-map [up] 'enlarge-window)
> (define-key resize-window-repeat-map [right] 'enlarge-window-horizontally)
> (define-key resize-window-repeat-map [left] 'shrink-window-horizontally)
> (define-key resize-window-repeat-map [down] 'shrink-window)
Here are the hash quotes BTW: ####
--
underground experts united
https://dataswamp.org/~incal
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-20 21:24 ` Emanuel Berg
@ 2022-09-21 18:41 ` Juri Linkov
2022-09-21 21:16 ` Emanuel Berg
0 siblings, 1 reply; 80+ messages in thread
From: Juri Linkov @ 2022-09-21 18:41 UTC (permalink / raw)
To: emacs-devel
>>>> It was proposed to add this on 'C-x
>>>> w r left/right/up/down'
>>>
>>> 'C-x w' is undefined here, but if you add that (by "this"
>>> you mean the shortcuts?) I'd add it with i, l, i and
>>> k instead (or "as well").
>>>
>>> 'C-x' is not so ergonomic tho ... I take it 'w' is mnemonic
>>> for "window" and 'r' for "resize", I think that should only
>>> be considered when the keys are good. But they are.
>>
>> Actually, this
>
> Again, "this" refers to what exactly?
>
> If it's in vanilla Emacs already I'm happy to remove my stuff.
>
> Is that what you are saying?
"This" refers to the recent discussion about adding window resizing keys
to the new keymap 'C-x w'.
>> is already possible with such customization:
>>
>> (define-key resize-window-repeat-map [up] 'enlarge-window)
>> (define-key resize-window-repeat-map [right] 'enlarge-window-horizontally)
>> (define-key resize-window-repeat-map [left] 'shrink-window-horizontally)
>> (define-key resize-window-repeat-map [down] 'shrink-window)
>
> Here are the hash quotes BTW: ####
Thanks, now I know who to ask for the supply of more #'s.
^ permalink raw reply [flat|nested] 80+ messages in thread
* Re: master 6a2ee981c3: Add new functions for splitting the root window
2022-09-21 18:41 ` Juri Linkov
@ 2022-09-21 21:16 ` Emanuel Berg
0 siblings, 0 replies; 80+ messages in thread
From: Emanuel Berg @ 2022-09-21 21:16 UTC (permalink / raw)
To: emacs-devel
Juri Linkov wrote:
>> Is that what you are saying?
>
> "This" refers to the recent discussion about adding window
> resizing keys to the new keymap 'C-x w'.
Okay, well good idea then, keys are our game. As the interface
to automation ...
>>> is already possible with such customization:
>>>
>>> (define-key resize-window-repeat-map [up] 'enlarge-window)
>>> (define-key resize-window-repeat-map [right] 'enlarge-window-horizontally)
>>> (define-key resize-window-repeat-map [left] 'shrink-window-horizontally)
>>> (define-key resize-window-repeat-map [down] 'shrink-window)
>>
>> Here are the hash quotes BTW: ####
>
> Thanks, now I know who to ask for the supply of more #'s.
Happy to do my part for our software, sir.
--
underground experts united
https://dataswamp.org/~incal
^ permalink raw reply [flat|nested] 80+ messages in thread
end of thread, other threads:[~2022-09-21 21:16 UTC | newest]
Thread overview: 80+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <166240424802.11417.12502552895310232639@vcs2.savannah.gnu.org>
[not found] ` <20220905185728.838CEC0088A@vcs2.savannah.gnu.org>
2022-09-06 16:17 ` master 6a2ee981c3: Add new functions for splitting the root window Juri Linkov
2022-09-07 0:32 ` Sean Whitton
2022-09-07 12:57 ` Lars Ingebrigtsen
2022-09-07 18:01 ` Juri Linkov
2022-09-08 11:50 ` Lars Ingebrigtsen
2022-09-08 12:09 ` Robert Pluim
2022-09-08 12:18 ` Lars Ingebrigtsen
2022-09-08 14:54 ` [External] : " Drew Adams
2022-09-10 19:27 ` Juri Linkov
2022-09-11 11:03 ` Lars Ingebrigtsen
2022-09-11 17:48 ` Sean Whitton
2022-09-11 18:31 ` chad
2022-09-12 10:00 ` Lars Ingebrigtsen
2022-09-12 14:10 ` Sean Whitton
2022-09-13 11:11 ` Lars Ingebrigtsen
2022-09-13 13:52 ` Sean Whitton
2022-09-13 13:56 ` Lars Ingebrigtsen
2022-09-13 14:12 ` Sean Whitton
2022-09-14 12:29 ` Lars Ingebrigtsen
2022-09-14 13:49 ` Eli Zaretskii
2022-09-14 16:37 ` Sean Whitton
2022-09-14 16:37 ` Sean Whitton
2022-09-12 14:29 ` Visuwesh
2022-09-12 10:04 ` Lars Ingebrigtsen
2022-09-12 14:35 ` Sean Whitton
2022-09-13 4:08 ` Richard Stallman
2022-09-13 14:29 ` [External] : " Drew Adams
2022-09-12 17:34 ` Juri Linkov
2022-09-12 18:57 ` Sean Whitton
2022-09-12 19:31 ` Juri Linkov
2022-09-13 14:01 ` Sean Whitton
2022-09-13 18:29 ` Juri Linkov
2022-09-13 22:12 ` Sean Whitton
2022-09-14 6:53 ` Juri Linkov
2022-09-14 16:52 ` Sean Whitton
2022-09-14 19:22 ` Juri Linkov
2022-09-14 23:06 ` Sean Whitton
2022-09-15 5:45 ` Eli Zaretskii
2022-09-15 16:14 ` Sean Whitton
2022-09-12 17:50 ` Stefan Monnier
2022-09-12 18:55 ` Sean Whitton
2022-09-12 19:29 ` Juri Linkov
2022-09-12 23:40 ` Sean Whitton
2022-09-13 6:50 ` Juri Linkov
2022-09-13 13:54 ` Sean Whitton
2022-09-13 9:33 ` Gregory Heytings
2022-09-13 11:14 ` Lars Ingebrigtsen
2022-09-13 13:51 ` Sean Whitton
2022-09-13 14:01 ` Gregory Heytings
2022-09-13 14:19 ` Sean Whitton
2022-09-13 14:26 ` Gregory Heytings
2022-09-13 15:22 ` Yuri Khan
2022-09-13 16:33 ` Gregory Heytings
2022-09-13 17:09 ` Yuri Khan
2022-09-13 18:16 ` Juri Linkov
2022-09-13 19:28 ` Gregory Heytings
2022-09-14 6:47 ` Juri Linkov
2022-09-14 8:13 ` Gregory Heytings
2022-09-14 9:21 ` Yuri Khan
2022-09-14 10:51 ` Gregory Heytings
2022-09-14 12:11 ` Yuri Khan
2022-09-15 7:19 ` Augusto Stoffel
2022-09-16 14:30 ` Gregory Heytings
2022-09-16 15:03 ` Augusto Stoffel
2022-09-19 6:53 ` Emanuel Berg
2022-09-08 12:22 ` Gregory Heytings
2022-09-08 14:54 ` [External] : " Drew Adams
2022-09-08 17:25 ` Juri Linkov
2022-09-09 17:07 ` Lars Ingebrigtsen
2022-09-09 17:25 ` Visuwesh
2022-09-09 17:36 ` Lars Ingebrigtsen
2022-09-11 3:37 ` Richard Stallman
2022-09-19 23:55 ` Emanuel Berg
2022-09-20 6:50 ` Juri Linkov
2022-09-20 7:47 ` Emanuel Berg
2022-09-20 16:06 ` Juri Linkov
2022-09-20 21:24 ` Emanuel Berg
2022-09-21 18:41 ` Juri Linkov
2022-09-21 21:16 ` Emanuel Berg
2022-09-09 17:53 ` Stefan Monnier
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).