Universal argument a lá Emacs for Xmonad

Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Universal argument a lá Emacs for Xmonad

Ruben Astudillo
Dear all

On Emacs you can pass certain functions an interactive argument via the
C-u chord. For example you can press C-u 5 C-n to move 5 lines down the
buffer. Sometimes I've wanted this functionality on XMonad, for example
to be able to do stuff like `C-u 3 modm-m` to move to the third window
counted from the main window if it exists. I wonder if somebody know if
that's implemented as a module.

--
-- Ruben
-- PGP: 4EE9 28F7 932E F4AD


_______________________________________________
xmonad mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad

signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Universal argument a lá Emacs for Xmonad

Brandon Allbery
I don't know of one, but see no reason the machinery in (say) X.A.CycleWindows couldn't be extended to do so. It'd be easier if held to single digits, though.

General numeric argument as in emacs is harder, since the only automatic parameter to commands is the focused window and even that is only for mouse actions; there's nowhere to stick it except ExtensibleState for other commands. Hypothetically a wrapper could repeat a command based on said state, but that's not necessarily how you want to handle the parameter in all cases (consider the question of whether the repeats start from the original state or the final one, when the command changes e.g. focused window; and worse when the focused window change happens only later such that you can't really do something based on it).

On Fri, Nov 22, 2019 at 11:43 PM Ruben Astudillo <[hidden email]> wrote:
Dear all

On Emacs you can pass certain functions an interactive argument via the
C-u chord. For example you can press C-u 5 C-n to move 5 lines down the
buffer. Sometimes I've wanted this functionality on XMonad, for example
to be able to do stuff like `C-u 3 modm-m` to move to the third window
counted from the main window if it exists. I wonder if somebody know if
that's implemented as a module.

--
-- Ruben
-- PGP: 4EE9 28F7 932E F4AD

_______________________________________________
xmonad mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad


--
brandon s allbery kf8nh

_______________________________________________
xmonad mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad
Reply | Threaded
Open this post in threaded view
|

Re: Universal argument a lá Emacs for Xmonad

Paul Fertser
In reply to this post by Ruben Astudillo
Hey Ruben,

On Sat, Nov 23, 2019 at 01:43:36AM -0300, Ruben Astudillo wrote:
> C-u chord. For example you can press C-u 5 C-n to move 5 lines down the

Is there any reason you're using C-u 5 and not M-5 here?

--
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:[hidden email]
_______________________________________________
xmonad mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad
Reply | Threaded
Open this post in threaded view
|

Re: Universal argument a lá Emacs for Xmonad

Brandon Allbery
That's a good point too: it'd have to be M-C-u or have some starter sequence like X.A.CycleWindows (M-Tab), or other programs would lose use of C-u.

On Sat, Nov 23, 2019 at 8:19 AM Paul Fertser <[hidden email]> wrote:
Hey Ruben,

On Sat, Nov 23, 2019 at 01:43:36AM -0300, Ruben Astudillo wrote:
> C-u chord. For example you can press C-u 5 C-n to move 5 lines down the

Is there any reason you're using C-u 5 and not M-5 here?

--
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:[hidden email]
_______________________________________________
xmonad mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad


--
brandon s allbery kf8nh

_______________________________________________
xmonad mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad