<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I decided to try to beat on the cursor blink bug (<a href="http://trac.clozure.com/openmcl/ticket/64">http://trac.clozure.com/openmcl/ticket/64)</a> a little tonight and I think I've made some progress.  As far as I can tell, two drawInsertionPointInRect:color:turnedOn: method is being called from two different locations within OS X.  My guess is that one of these is the keystroke event handler and the other is the scheduled task that causes the cursor to blink.<div><br class="webkit-block-placeholder"></div><div>When drawInsertionPointInRect:color:turnedOn: is called from the scheduled cursor-blink task everything happens as it should.</div><div><br class="webkit-block-placeholder"></div><div>When the method is called from the key event handler two odd things happen.  The first is that the flag argument, which should be T (to indicate that the cursor should be drawn and the matching close-paren should not be) is NIL.</div><div><br class="webkit-block-placeholder"></div><div>Despite the fact that FLAG is NIL, the cursor does in fact get drawn (by OS X, not the drawInsertionPointInRect:color:turnedOn: method as far as I can tell).</div><div><br class="webkit-block-placeholder"></div><div>The second odd thing is this:</div><div><br class="webkit-block-placeholder"></div><div>The way the matching-paren-blink logic works, the matching paren is unconditionally erased, then conditionally redrawn if FLAG is NIL.  That the matching paren is not erased is the expected result of FLAG being NIL and not T as it should be.  However, it turns out that the matching paren is never even being erased despite the fact that drawInsertionPointInRect:color:turnedOn: is in fact being called.  The easiest way to see this is to replace</div><div><br class="webkit-block-placeholder"></div><div>(#/set blink-color)</div><div><br class="webkit-block-placeholder"></div><div>with</div><div><br class="webkit-block-placeholder"></div><div>(#/set (#/grayColor ns:ns-color))</div><div><br class="webkit-block-placeholder"></div><div>Now whenever the matching paren is erased it will be written over in gray.  Type a few open a close parens and it will be immediately apparent that the gray box is not being drawn when drawInsertionPointInRect:color:turnedOn: is called from the key event handler.  (I have verified that the method is in fact being called, and that the code to erase the paren is being reached.)</div><div><br class="webkit-block-placeholder"></div><div>The only theory I can come up with to explain this is that the graphics focus is not properly set, but it would seem to me that if that were the case then other things would be going wrong, and they aren't.</div><div><br class="webkit-block-placeholder"></div><div>I have now reached the current limits of my expertise (and wakefulness).</div><div><br class="webkit-block-placeholder"></div><div>rg</div><div><br class="webkit-block-placeholder"></div></body></html>