[mcclim-devel] [patch] bug in map-over-command-table-keystrokes?

Daniel Barlow dan at telent.net
Wed Jun 15 18:04:08 UTC 2005


I noticed this while trying to persuade climacs to give me a list of
keybindings:

(map-over-command-table-keystrokes 
 (lambda (name key item)
   (format t "~A ~A ~A~%" name key item))
 'CLIMACS-GUI::GLOBAL-CLIMACS-TABLE)
=> debugger invoked on a UNBOUND-SLOT in thread 11974: The slot CLIM-INTERNALS::MENU-NAME is unbound in the object #<MENU-ITEM keystroke (- META) {9794829}>.

According to the specification 27.4, "function must be a function of
three arguments, the menu name (which will be nil if there is none),
the keystroke accelerator, and the command menu item".  I don't know
if the fix below is the Right Thing, but it does the trick for me.


Index: commands.lisp
===================================================================
RCS file: /project/mcclim/cvsroot/mcclim/commands.lisp,v
retrieving revision 1.51
diff -u -r1.51 commands.lisp
--- commands.lisp       24 Jan 2005 09:36:00 -0000      1.51
+++ commands.lisp       15 Jun 2005 17:57:40 -0000
@@ -474,7 +474,8 @@
       (loop for gesture in keystroke-accelerators
            for item in keystroke-items
            do (funcall function
-                       (command-menu-item-name item)
+                       (and (slot-boundp item 'menu-name)
+                            (command-menu-item-name item))
                        gesture
                        item)))))
 

-- 
Daniel Barlow   //   daniel.barlow at uk.clara.net   //   ext 3233 

world domination and a whole lot of money to spend



More information about the mcclim-devel mailing list