[clfswm-cvs] r424 - in clfswm: . src

Philippe Brochard pbrochard at common-lisp.net
Mon Mar 7 22:53:46 UTC 2011


Author: pbrochard
Date: Mon Mar  7 17:53:46 2011
New Revision: 424

Log:
src/clfswm-info.lisp (show-config-variable); src/clfswm-autodoc.lisp (produce-configuration-variables): Use the new defconfig method.

Modified:
   clfswm/ChangeLog
   clfswm/src/clfswm-autodoc.lisp
   clfswm/src/clfswm-configuration.lisp
   clfswm/src/clfswm-info.lisp
   clfswm/src/tools.lisp

Modified: clfswm/ChangeLog
==============================================================================
--- clfswm/ChangeLog	(original)
+++ clfswm/ChangeLog	Mon Mar  7 17:53:46 2011
@@ -1,5 +1,11 @@
 2011-03-07  Philippe Brochard  <pbrochard at common-lisp.net>
 
+	* src/clfswm-info.lisp (show-config-variable): Use the new
+	defconfig method.
+
+	* src/clfswm-autodoc.lisp (produce-configuration-variables): Use
+	the new defconfig method.
+
 	* src/clfswm-configuration.lisp (create-configuration-menu):
 	Change the config system with a more lispy one and a less string
 	based one: (defconfig name value group doc).

Modified: clfswm/src/clfswm-autodoc.lisp
==============================================================================
--- clfswm/src/clfswm-autodoc.lisp	(original)
+++ clfswm/src/clfswm-autodoc.lisp	Mon Mar  7 17:53:46 2011
@@ -304,18 +304,18 @@
   (format t " done~%"))
 
 
-;;; Configuration variables
 (defun produce-configuration-variables (stream &optional (group t))
   (format stream "    * CLFSWM Configuration variables *~%")
   (format stream "      ------------------------------~2%")
-  (format stream "  <= ~A =>~2%" (if (equal group t) "" group))
-  (with-all-internal-symbols (symbol :clfswm)
-    (when (and (is-config-p symbol)
-	       (or (equal group t)
-		   (string-equal group (config-group symbol))))
-      (format stream "~A = ~S~%~A~%" symbol (symbol-value symbol)
-	      (config-documentation symbol))))
-    (format stream "~2& Those variables can be changed in clfswm.
+  (format stream "  <= ~A =>~2%" (if (equal group t) ""
+                                     (config-group->string group)))
+  (maphash (lambda (key val)
+             (when (or (equal group t)
+                       (equal group (configvar-group val)))
+               (format stream "~A = ~S~%~A~%" key (symbol-value key)
+                       (documentation key 'variable))))
+           *config-var-table*)
+  (format stream "~2& Those variables can be changed in clfswm.
 Maybe you'll need to restart clfswm to take care of new values~2%"))
 
 

Modified: clfswm/src/clfswm-configuration.lisp
==============================================================================
--- clfswm/src/clfswm-configuration.lisp	(original)
+++ clfswm/src/clfswm-configuration.lisp	Mon Mar  7 17:53:46 2011
@@ -129,9 +129,6 @@
 (defun group->menu (group)
   (intern (string-upcase (format nil "conf-~A" group)) :clfswm))
 
-(defun group-name (group)
-  (format nil "~:(~A~) Group" (substitute #\Space #\- (string group))))
-
 (defun query-conf-value (var string original)
   (labels ((warn-wrong-type (result original)
 	     (if (equal (simple-type-of result) (simple-type-of original))
@@ -179,7 +176,7 @@
     (loop for group in all-groups
        for i from 0
        do (let ((menu (group->menu group)))
-	    (add-sub-menu 'configuration-menu (number->char i) menu (group-name group))
+	    (add-sub-menu 'configuration-menu (number->char i) menu (config-group->string group))
 	    (loop for var in all-variables
 	       with j = -1
 	       do (when (equal (second var) group)

Modified: clfswm/src/clfswm-info.lisp
==============================================================================
--- clfswm/src/clfswm-info.lisp	(original)
+++ clfswm/src/clfswm-info.lisp	Mon Mar  7 17:53:46 2011
@@ -537,9 +537,10 @@
   "Show all configurable variables"
   (let ((all-groups nil)
 	(result nil))
-    (with-all-internal-symbols (symbol :clfswm)
-      (when (is-config-p symbol)
-	(pushnew (config-group symbol) all-groups :test #'string-equal)))
+    (maphash (lambda (key val)
+               (declare (ignore key))
+               (pushnew (configvar-group val) all-groups :test #'equal))
+             *config-var-table*)
     (labels ((rec ()
 	       (setf result nil)
 	       (info-mode-menu (loop :for group :in all-groups
@@ -548,7 +549,7 @@
 						 (let ((group group))
 						   (lambda ()
 						     (setf result group)))
-						 group)))
+						 (config-group->string group))))
 	       (when result
 		 (info-mode (configuration-variable-colorize-line
 			     (split-string (append-newline-space

Modified: clfswm/src/tools.lisp
==============================================================================
--- clfswm/src/tools.lisp	(original)
+++ clfswm/src/tools.lisp	Mon Mar  7 17:53:46 2011
@@ -32,6 +32,7 @@
 	   :awhen
 	   :aif
            :defconfig :*config-var-table* :configvar-value :configvar-group :config-default-value
+           :config-group->string
 	   :find-in-hash
 	   :nfuncall
 	   :pfuncall
@@ -143,6 +144,8 @@
     (when config
       (configvar-value config))))
 
+(defun config-group->string (group)
+  (format nil "~:(~A group~)" (substitute #\Space #\- (string group))))
 
 
 




More information about the clfswm-cvs mailing list