stumpwm-devel
[Top][All Lists]
Advanced

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

[STUMP] Better example for StumpWM manual


From: Adlai C
Subject: [STUMP] Better example for StumpWM manual
Date: Mon, 27 Jul 2009 07:23:15 +0300

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*)

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

Ideas?

Thanks,
Adlai

reply via email to

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