*apps-map*, to make more room for program shortcuts

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

*apps-map*, to make more room for program shortcuts

Edward Trumbo
I prefer keyboard shortcuts to menus when it comes to launching
programs, but StumpWM's many default bindings already take up so many of
the ones I want. It occurred to me that if we already have a *group-map*
to hang group-related keybindings off of a prefix key, why not try the
same thing for users to map shortcuts to applications?

I've patched my StumpWM's bindings.lisp to include an *apps-map* and
assigned it to my equivalent of "C-t e". OK, I can already hear the
bellowing from the crowd, "That's our Emacs key, you fool! You fiend!"
Bear with me a moment; Emacs is still there on "C-t e e", just like
XTerm is on "C-t e c". The Ctrl-chorded versions are still there like
always. But by using an extra key to put us into an *apps-map*, we free
up so many more keys users can bind as shortcuts to favorite programs,
without shadowing important StumpWM keys or resorting to menus.

I'll include the patch here so you can see what it looks like, though at
this point I'm more interested in feeling out interest than in seriously
submitting it. So what do you all think -- an idea worth pursuing (as-is
or with changes) or drop it?

---
 bindings.lisp | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/bindings.lisp b/bindings.lisp
index 83c9593..f8186c3 100644
--- a/bindings.lisp
+++ b/bindings.lisp
@@ -25,7 +25,8 @@
 (in-package #:stumpwm)
 
 (export '(*groups-map*
-          *movement-map*
+          *movement-map*
+          *apps-map*
           *help-map*
   set-prefix-key))
 
@@ -43,6 +44,9 @@ C-t.")
 (defvar *exchange-window-map* nil
   "The keymap that exchange-window key bindings sit on. It is bound to @kbd{C-t x} by default.")
 
+(defvar *apps-map* nil
+  "The keymap that application related key bindings sit on. It is bound to @kbd{C-t e} by default.")
+
 (defvar *help-map* nil
   "Help related bindings hang from this keymap")
 
@@ -78,9 +82,8 @@ from most specific groups to most general groups.")
   *escape-key* '*root-map*)
 
 (fill-keymap *root-map*
-  (kbd "c")   "exec xterm"
   (kbd "C-c") "exec xterm"
-  (kbd "e")   "emacs"
+  (kbd "e")   '*apps-map*
   (kbd "C-e") "emacs"
   (kbd "b")   "banish"
   (kbd "C-b") "banish"
@@ -233,6 +236,9 @@ from most specific groups to most general groups.")
              (kbd "j")     "exchange-direction down"
              (kbd "l")     "exchange-direction left"
              (kbd "h")     "exchange-direction right")    
+(fill-keymap *apps-map*
+  (kbd "e") "emacs"
+  (kbd "c") "exec xterm")
 (fill-keymap *help-map*
   (kbd "v") "describe-variable"
   (kbd "f") "describe-function"
--
1.8.4


--
Edward Trumbo

"In Emacs Veritas."



_______________________________________________
Stumpwm-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel
Reply | Threaded
Open this post in threaded view
|

Re: *apps-map*, to make more room for program shortcuts

David Bjergaard
I like the idea, but I think for many C-t e may be a significant
change.  I would suggest either:
- Change the default key to bind the keys off of (ie not e)
- Allow this functionality, but don't give it a default key

I prefer the latter.  Then the user has a choice.  

Cheers,

    Dave

Edward Trumbo <[hidden email]> writes:

> I prefer keyboard shortcuts to menus when it comes to launching
> programs, but StumpWM's many default bindings already take up so many of
> the ones I want. It occurred to me that if we already have a *group-map*
> to hang group-related keybindings off of a prefix key, why not try the
> same thing for users to map shortcuts to applications?
>
> I've patched my StumpWM's bindings.lisp to include an *apps-map* and
> assigned it to my equivalent of "C-t e". OK, I can already hear the
> bellowing from the crowd, "That's our Emacs key, you fool! You fiend!"
> Bear with me a moment; Emacs is still there on "C-t e e", just like
> XTerm is on "C-t e c". The Ctrl-chorded versions are still there like
> always. But by using an extra key to put us into an *apps-map*, we free
> up so many more keys users can bind as shortcuts to favorite programs,
> without shadowing important StumpWM keys or resorting to menus.
>
> I'll include the patch here so you can see what it looks like, though at
> this point I'm more interested in feeling out interest than in seriously
> submitting it. So what do you all think -- an idea worth pursuing (as-is
> or with changes) or drop it?
>
> ---
>  bindings.lisp | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/bindings.lisp b/bindings.lisp
> index 83c9593..f8186c3 100644
> --- a/bindings.lisp
> +++ b/bindings.lisp
> @@ -25,7 +25,8 @@
>  (in-package #:stumpwm)
>  
>  (export '(*groups-map*
> -          *movement-map*
> +          *movement-map*
> +          *apps-map*
>            *help-map*
>    set-prefix-key))
>  
> @@ -43,6 +44,9 @@ C-t.")
>  (defvar *exchange-window-map* nil
>    "The keymap that exchange-window key bindings sit on. It is bound to @kbd{C-t x} by default.")
>  
> +(defvar *apps-map* nil
> +  "The keymap that application related key bindings sit on. It is bound to @kbd{C-t e} by default.")
> +
>  (defvar *help-map* nil
>    "Help related bindings hang from this keymap")
>  
> @@ -78,9 +82,8 @@ from most specific groups to most general groups.")
>    *escape-key* '*root-map*)
>  
>  (fill-keymap *root-map*
> -  (kbd "c")   "exec xterm"
>    (kbd "C-c") "exec xterm"
> -  (kbd "e")   "emacs"
> +  (kbd "e")   '*apps-map*
>    (kbd "C-e") "emacs"
>    (kbd "b")   "banish"
>    (kbd "C-b") "banish"
> @@ -233,6 +236,9 @@ from most specific groups to most general groups.")
>               (kbd "j")     "exchange-direction down"
>               (kbd "l")     "exchange-direction left"
>               (kbd "h")     "exchange-direction right")    
> +(fill-keymap *apps-map*
> +  (kbd "e") "emacs"
> +  (kbd "c") "exec xterm")
>  (fill-keymap *help-map*
>    (kbd "v") "describe-variable"
>    (kbd "f") "describe-function"
> --
> 1.8.4

_______________________________________________
Stumpwm-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel
Reply | Threaded
Open this post in threaded view
|

Re: *apps-map*, to make more room for program shortcuts

Edward Trumbo
OK, I thought "C-t e" might be too much of a shock. I'll try it without
an assigned key and leave it up to the user to bind in their init file.

--
Edward Trumbo

"In Emacs Veritas."


David Bjergaard <[hidden email]> writes:

> I like the idea, but I think for many C-t e may be a significant
> change.  I would suggest either:
> - Change the default key to bind the keys off of (ie not e)
> - Allow this functionality, but don't give it a default key
>
> I prefer the latter.  Then the user has a choice.  
>
> Cheers,
>
>     Dave

_______________________________________________
Stumpwm-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel
Reply | Threaded
Open this post in threaded view
|

Re: *apps-map*, to make more room for program shortcuts

Joram Schrijver
I'm not sure this should be provided by StumpWM, considering it
only binds two such shortcuts by default. Why not just let the
user do this themselves?

--
  Joram

On Fri, Feb 20, 2015, at 08:58 PM, Edward Trumbo wrote:

> OK, I thought "C-t e" might be too much of a shock. I'll try it without
> an assigned key and leave it up to the user to bind in their init file.
>
> --
> Edward Trumbo
>
> "In Emacs Veritas."
>
>
> David Bjergaard <[hidden email]> writes:
>
> > I like the idea, but I think for many C-t e may be a significant
> > change.  I would suggest either:
> > - Change the default key to bind the keys off of (ie not e)
> > - Allow this functionality, but don't give it a default key
> >
> > I prefer the latter.  Then the user has a choice.  
> >
> > Cheers,
> >
> >     Dave
>
> _______________________________________________
> Stumpwm-devel mailing list
> [hidden email]
> https://lists.nongnu.org/mailman/listinfo/stumpwm-devel

_______________________________________________
Stumpwm-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel
Reply | Threaded
Open this post in threaded view
|

Re: *apps-map*, to make more room for program shortcuts

Edward Trumbo
Let's consider the patch to be just a proof-of-concept, the idea is
what's important. The point is to have an *apps-map* available and ready
for the user to start doing (define-key *apps-map* ...) in their init.

--
Edward Trumbo

"In Emacs Veritas."


Joram Schrijver <[hidden email]> writes:

> I'm not sure this should be provided by StumpWM, considering it
> only binds two such shortcuts by default. Why not just let the
> user do this themselves?

_______________________________________________
Stumpwm-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel
Reply | Threaded
Open this post in threaded view
|

Re: *apps-map*, to make more room for program shortcuts

Edward Trumbo
In reply to this post by Edward Trumbo
You know what -- Joram is right. I don't know how I missed it all this
time, but the keymapping ability I was looking for already exists in
StumpWM, courtesy of 'make-sparse-keymap'.

So, let's disregard my whole embarrassing thread. I think I'll work on
getting make-sparse-keymap a little more publicity with something for
the wiki.

--
Edward Trumbo

"In Emacs Veritas."


Edward Trumbo <[hidden email]> writes:

> Let's consider the patch to be just a proof-of-concept, the idea is
> what's important. The point is to have an *apps-map* available and ready
> for the user to start doing (define-key *apps-map* ...) in their init.

_______________________________________________
Stumpwm-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel
Reply | Threaded
Open this post in threaded view
|

Re: *apps-map*, to make more room for program shortcuts

David Bjergaard
I like the idea though, maybe you could find an appropriate place on the
wiki to document this usage?

Cheers,

    Dave

Edward Trumbo <[hidden email]> writes:

> You know what -- Joram is right. I don't know how I missed it all this
> time, but the keymapping ability I was looking for already exists in
> StumpWM, courtesy of 'make-sparse-keymap'.
>
> So, let's disregard my whole embarrassing thread. I think I'll work on
> getting make-sparse-keymap a little more publicity with something for
> the wiki.

_______________________________________________
Stumpwm-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel
Reply | Threaded
Open this post in threaded view
|

Re: *apps-map*, to make more room for program shortcuts

Edward Trumbo
I'll write something for the wiki after I practice with this a bit,
likely using the *apps-map* idea as an example.

--
Edward Trumbo

"In Emacs Veritas."


David Bjergaard <[hidden email]> writes:

> I like the idea though, maybe you could find an appropriate place on the
> wiki to document this usage?
>
> Cheers,
>
>     Dave

_______________________________________________
Stumpwm-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel