stumpwm-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [STUMP] Better example for StumpWM manual


From: Shawn Betts
Subject: Re: [STUMP] Better example for StumpWM manual
Date: Sun, 26 Jul 2009 22:53:07 -0700

On Sun, Jul 26, 2009 at 9:23 PM, Adlai C<address@hidden> wrote:
> I was reading about keymaps in the StumpWM manual, and I came across this
> example, on this page
> <http://www.nongnu.org/stumpwm/manual/stumpwm_2.html#SEC8>:
>
> (defvar *my-frame-bindings*
>   (let ((m (stumpwm:make-sparse-keymap)))
>     (stumpwm:define-key m (stumpwm:kbd "f") "curframe")
>     (stumpwm:define-key m (stumpwm:kbd "M-b") "move-focus left")
>     m ; NOTE: this is important
>   ))
>
> (stumpwm:define-key stumpwm:*root-map* (stumpwm:kbd "C-f")
> '*my-frame-bindings*)
>
> However, this seems to me more concise and also clearer to any non-lispers
> who may happen to browse StumpWM:
>
> (defvar *my-frame-bindings* (stumpwm:make-sparse-keymap))
> (stumpwm:define-key *my-frame-bindings* (stumpwm:kbd "f") "curframe")
> (stumpwm:define-key *my-frame-bindings* (stumpwm:kbd "M-b") "move-focus
> left")
> (stumpwm:define-key stumpwm:*root-map* (stumpwm:kbd "C-f")
> *my-frame-bindings*)

Yes that's probably easier to understand. The original uses a trick
that isn't useful in understanding keymaps.

> Also, note that I removed the quote before the frame name in the last
> definition -- that worked for me, and is simpler too.

This will work until you (setf *my-frame-bindings*
(stumpwm:make-sparse-keymap)) and then you'll have the old keymap
hanging around. I don't know if that's an issue.

-Shawn




reply via email to

[Prev in Thread] Current Thread [Next in Thread]