[clfswm-devel] [RFC PATCH 1/2] Support display of a CLFSWM version string.

Xavier Maillard xma at gnu.org
Tue Mar 18 14:21:47 UTC 2008


With current code, there is no way (even no version) to display
CLFSWM version and when it has been built.

This small patch just follow a STUMPWM idea (in fact, the code itself
has been stolen from the STUMPWM project) by:

1. creating a new package version that exports the *version* string
2. defining a new info-mode function (show-version)
3. binding the function to \#v in info-mode and second-mode

src/package.lisp and clfswm.asd has been updated to follow these changes.

Signed-off-by: Xavier Maillard <xma at gnu.org>
---
 clfswm.asd           |    6 ++++--
 src/clfswm-info.lisp |    5 +++++
 src/package.lisp     |    2 +-
 src/version.lisp     |   36 ++++++++++++++++++++++++++++++++++++
 4 files changed, 46 insertions(+), 3 deletions(-)
 create mode 100644 src/version.lisp

diff --git a/clfswm.asd b/clfswm.asd
index 3cafd1d..a689ce9 100644
--- a/clfswm.asd
+++ b/clfswm.asd
@@ -16,7 +16,7 @@
 			 (:file "my-html"
 			  :depends-on ("tools"))
 			 (:file "package"
-			  :depends-on ("my-html" "tools"))
+			  :depends-on ("my-html" "tools" "version"))
 			 (:file "config"
 			  :depends-on ("package"))
 			 (:file "keysyms"
@@ -32,10 +32,12 @@
 			 (:file "clfswm"
 			  :depends-on ("xlib-util" "netwm-util" "clfswm-keys" "config"
 						   "clfswm-internal" "tools"))
+			 (:file "version"
+			  :depends-on ("tools"))
 			 (:file "clfswm-second-mode"
 			  :depends-on ("package" "clfswm-internal"))
 			 (:file "clfswm-info"
-			  :depends-on ("package" "xlib-util" "config" "clfswm-keys" "clfswm" "clfswm-internal"))
+			  :depends-on ("package" "version" "xlib-util" "config" "clfswm-keys" "clfswm" "clfswm-internal"))
 			 (:file "clfswm-util"
 			  :depends-on ("clfswm" "keysyms" "clfswm-info" "clfswm-second-mode" "clfswm-query"))
 			 (:file "clfswm-query"
diff --git a/src/clfswm-info.lisp b/src/clfswm-info.lisp
index 0d129fc..0305e0b 100644
--- a/src/clfswm-info.lisp
+++ b/src/clfswm-info.lisp
@@ -417,6 +417,9 @@ key is a character, a keycode or a keysym"
 		    (#\l show-cd-playlist))))
 
 
+(defun show-version ()
+  "Show the current CD track"
+  (info-mode (list *version*)))
 
 (defun help-on-clfswm ()
   "Open the help and info window"
@@ -426,6 +429,7 @@ key is a character, a keycode or a keysym"
 		    (#\c show-cpu-proc)
 		    (#\m show-mem-proc)
 		    (#\x xmms-info-menu)
+		    (#\v show-version)
 		    (#\d info-on-cd-menu))))
 
 
@@ -437,6 +441,7 @@ key is a character, a keycode or a keysym"
 		    (#\c show-cpu-proc)
 		    (#\m show-mem-proc)
 		    (#\x xmms-info-menu)
+		    (#\v show-version)
 		    (#\d info-on-cd-menu))))
 
 
diff --git a/src/package.lisp b/src/package.lisp
index 4da2a18..f57253b 100644
--- a/src/package.lisp
+++ b/src/package.lisp
@@ -26,7 +26,7 @@
 (in-package :cl-user)
 
 (defpackage clfswm
-  (:use :common-lisp :my-html :tools)
+  (:use :common-lisp :my-html :tools :version)
   ;;(:shadow :defun)
   (:export :main))
 
diff --git a/src/version.lisp b/src/version.lisp
new file mode 100644
index 0000000..10e8bbd
--- /dev/null
+++ b/src/version.lisp
@@ -0,0 +1,36 @@
+;; Copyright (C) 2008 Xavier Maillard <xma at gnu.org>
+;; Copyright (C) 2006 Martin Bishop
+;;
+;;  Borrowed from Stumpwm
+;;  This file is part of clfswm.
+;;
+;; clfswm is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; clfswm is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this software; see the file COPYING.  If not, write to
+;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+;; Boston, MA 02111-1307 USA
+
+;; Commentary:
+;;
+;; This file contains version information.
+;;
+;; Code:
+
+(in-package :common-lisp-user)
+
+(defpackage version
+  (:use common-lisp tools)
+   (:export *version*))
+
+(in-package :version)
+
+(defparameter *version* #.(concatenate 'string "0.0.1-git built " (date-string)))
-- 
1.5.4.4.685.g64f14.dirty




More information about the clfswm-devel mailing list