stumpwm-devel
[Top][All Lists]
Advanced

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

[STUMP] a "help" command


From: Manuel Giraud
Subject: [STUMP] a "help" command
Date: Fri, 14 Apr 2006 11:05:26 +0200
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (berkeley-unix)

... + the previous bug patch.

cvs diff: Diffing .
Index: core.lisp
===================================================================
RCS file: /cvsroot/stumpwm/stumpwm/core.lisp,v
retrieving revision 1.39
diff -u -r1.39 core.lisp
--- core.lisp   8 Apr 2006 01:31:08 -0000       1.39
+++ core.lisp   14 Apr 2006 09:03:11 -0000
@@ -212,7 +212,7 @@
 
 (defun find-free-window-number (screen)
   "Return a free window number for SCREEN."
-  (find-free-number (mapcar-hash (lambda (val) (gethash :number val))
+  (find-free-number (mapcar-hash (lambda (key val) (declare (ignore key)) 
(gethash :number val))
                                 (screen-window-hash screen))))
 
 (defun process-new-window (win)
Index: kmap.lisp
===================================================================
RCS file: /cvsroot/stumpwm/stumpwm/kmap.lisp,v
retrieving revision 1.4
diff -u -r1.4 kmap.lisp
--- kmap.lisp   8 Apr 2006 01:31:08 -0000       1.4
+++ kmap.lisp   14 Apr 2006 09:03:11 -0000
@@ -82,9 +82,11 @@
 
 (defun parse-char-name (string)
   "Return the char-code of the char whose name is STRING."
-  (or (name-char string)
+  (let ((ch (name-char string)))
+    (if ch
+       (char-code ch)
       (and (= (length string) 1)
-          (char-code (char string 0)))))
+          (char-code (char string 0))))))
 
 (defun parse-key (string)
   "Parse STRING and return a key structure."
Index: primitives.lisp
===================================================================
RCS file: /cvsroot/stumpwm/stumpwm/primitives.lisp,v
retrieving revision 1.23
diff -u -r1.23 primitives.lisp
--- primitives.lisp     8 Apr 2006 00:08:21 -0000       1.23
+++ primitives.lisp     14 Apr 2006 09:03:11 -0000
@@ -214,12 +214,10 @@
     (sort copy sort-fn)))
 
 (defun mapcar-hash (fn hash)
-  "Just like maphash except it accumulates the result in a list and
-calls fn on the value for the key hash-key, not the pair."
+  "Just like maphash except it accumulates the result in a list."
   (let ((accum nil))
     (labels ((mapfn (key val)
-              (declare (ignore key))
-              (push (funcall fn val) accum)))
+               (push (funcall fn key val) accum)))
       (maphash #'mapfn hash))
     accum))
 
Index: user.lisp
===================================================================
RCS file: /cvsroot/stumpwm/stumpwm/user.lisp,v
retrieving revision 1.30
diff -u -r1.30 user.lisp
--- user.lisp   8 Apr 2006 01:31:08 -0000       1.30
+++ user.lisp   14 Apr 2006 09:03:11 -0000
@@ -67,9 +67,10 @@
     (define-key m (kbd "f") "fselect")
     (define-key m (kbd "F") "curframe")
     (define-key m (kbd "t") "meta")
-    ;;(define-key m (kbd "C-N") "number")
+    (define-key m (kbd "C-N") "number")
     (define-key m (kbd ";") "colon")
     (define-key m (kbd ":") "eval")
+    (define-key m (kbd "C-h") "help")
     m)
   "The default bindings that hang off the prefix key.")
 
@@ -467,6 +468,12 @@
   (asdf:operate 'asdf:load-op :stumpwm)
   (echo-string screen "Reloading StumpWM...Done."))
 
+(defun display-keybinding (screen kmap)
+  (echo-string-list screen (mapcar-hash #'(lambda (k v) (format nil "~A -> ~A" 
(print-key k) v)) kmap)))
+
+(define-stumpwm-command "help" (screen)
+  (display-keybinding screen *root-map*))
+
 ;; Trivial function
 (define-stumpwm-command "abort" (screen)
   (declare (ignore screen)))
-- 
Manuel Giraud                _      10-12 avenue de l'Europe
tel: +33 1 39253902         { \,"   78140 Vélizy
fax: +33 1 39254778        {_`/     France
address@hidden   `      http://www.cetp.ipsl.fr

reply via email to

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