Index: esa.lisp
===================================================================
RCS file: /project/gsharp/cvsroot/gsharp/esa.lisp,v
retrieving revision 1.4
diff -u -r1.4 esa.lisp
--- esa.lisp	8 Aug 2005 00:22:07 -0000	1.4
+++ esa.lisp	2 Sep 2005 09:42:56 -0000
@@ -264,6 +264,8 @@
        for maybe-error = t
        do (restart-case
 	   (progn
+             (format *debug-io* "Command-table: ~S~%" (command-table (car (windows frame))))
+             (finish-output *debug-io*)
 	     (handler-case
 	      (with-input-context 
 		  (`(command :command-table ,(command-table (car (windows frame)))))
Index: gui.lisp
===================================================================
RCS file: /project/gsharp/cvsroot/gsharp/gui.lisp,v
retrieving revision 1.23
diff -u -r1.23 gui.lisp
--- gui.lisp	7 Aug 2005 23:18:02 -0000	1.23
+++ gui.lisp	2 Sep 2005 09:42:56 -0000
@@ -13,7 +13,9 @@
       :height 20 :max-height 20 :min-height 20))
 
 (define-command-table total-melody-table
-    :inherit-from (melody-table global-gsharp-table))
+    :inherit-from (melody-table global-gsharp-table gsharp))
+(define-command-table total-lyrics-table
+    :inherit-from (lyrics-table global-gsharp-table gsharp))
 
 (define-application-frame gsharp (standard-application-frame
 				  esa-frame-mixin)
@@ -422,6 +424,11 @@
     (if success layer (error 'no-such-layer))))
 
 (defmethod select-layer :after (cursor (layer layer))
+  (typecase layer
+    (lyrics-layer (setf (command-table (first (windows *application-frame*)))
+                          (find-command-table 'total-lyrics-table)))
+    (melody-layer (setf (command-table (first (windows *application-frame*)))
+                          (find-command-table 'total-melody-table))))
   ;; set the command tables here
   )
 
