[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PICT-SCRAP bug



   Subject:      PICT-SCRAP bug
In case anyone out there feels like hacking a weird bug, here is a recreation
of the problem with pict-scrap externalization.  It seems that pict scraps
don't get externalized properly unless command-c or command-x gets typed before
exiting Lisp.  It doesn't matter whether or not these commands actually DO
anything, just that the keys get pressed.  No other command keys achieve the
same effect, and command-c and command-x do it even if the entire edit menu is
disabled, or they are removed as command key equivalents for cut and paste. 
Hacker of the week award to the first person to figure this out.

Thanks IA,
E.

gat@robotics.jpl.nasa.gov

--- cut here ---

;;; Here is a succinct recreation of the pict-scrap bug.
;;;
;;; To demo this byg, start by copying some text into the clipboard.
;;; Verify that it's there by pulling up the clipboard display in the
;;; finder (i.e. select SHOW-CLIPBOARD under the finder edit menu.)
;;;
;;; Now evaluate the following forms.  DO NOT TYPE COMMAND-C or COMMAND-X.

(require 'traps)
(require 'quickdraw)
(require 'records)
(require 'pict-scrap) ; in the examples folder

(setq w (oneof *window*))

(put-scrap
 :pict
 (ask w
   (start-picture 0 0 50 50)
   (frame-rect 10 10 40 40)
   (get-picture)))

;;; Now go back to the finder and check the clipboard again.  The text
;;; that you copied earlier should still be there.
;;;
;;; Now select the untitled window that was created above.  (It actually
doesn't
;;; have to be the same window.  You can make a new one if you like. 
The only
;;; requirement is that the cut and copy menu items be disabled.)  Type either
;;; command-c or command-x and go back to the finder.  The clipboard should
;;; now contain a rectangle.