[plt-scheme] DrScheme 3.99 bug on meta keypresses

From: Danny Yoo (dyoo at cs.wpi.edu)
Date: Wed Nov 21 14:56:32 EST 2007

Hi everyone,


I'm seeing the following error message on DrScheme 3.99:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
car: expects argument of type <pair>; given {"File" . #<object:wx-menu%>}

  === context ===
/home/dyoo/local/plt-svn-2/collects/scheme/private/more-scheme.ss:170:2: 
call-with-break-parameterization
/home/dyoo/local/plt-svn-2/collects/mred/private/mrtop.ss:155:27: 
on-subwindow-char method in frame%
/home/dyoo/local/plt-svn-2/collects/scheme/private/more-scheme.ss:170:2: 
call-with-break-parameterization
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

It's triggered by pressing Alt-M.


The bug appears to be deep in MrEd rather than DrScheme.  It looks like 
collects/mred/private/mrmenu.ss sets a menu-item's data to a mutable 
pair... Ok, I think I found the bug.  There's a place in wxmenu that 
treats the result of get-menu-data as a pair, and that's what's causing 
the bug.


Here's the diff for the correction:

dyoo at kfisler-ra1:~/local/plt-svn-2$ svn diff collects/mred/
Index: collects/mred/private/wxmenu.ss
===================================================================
--- collects/mred/private/wxmenu.ss     (revision 7790)
+++ collects/mred/private/wxmenu.ss     (working copy)
@@ -64,8 +64,8 @@
                                            (ormap
                                             (lambda (i)
                                               (let* ([data (send (mred->wx 
i) get-menu-data)]
-                                                    [label (car data)]
-                                                    [menu (cdr data)])
+                                                    [label (mcar data)]
+                                                    [menu (mcdr data)])
                                                 (if (regexp-match re 
label)
                                                     (begin
                                                       (send menu select 
this)





I hope this helps!


Posted on the users mailing list.