Thank you for taking the time to investigate on this problem. I've never had this problem because, while I'm using Emacs on Linux all the time, I've not enabled x-select-enable-clipboard. (I don't feel this is needed because I do cut and paste between Emacs and XXE using X selection, that is, using the middle button of my mouse. Options|Options Edit section, check "Clicking with middle button pastes system selection")
I don't know what to do to fix this problem because a clipboard change is really an editing context change and therefore, this is really supposed to ``reset'' tools such as the Edit Tool and the Attribute Tool. Well, we'll see what we can do, now that we know how to reproduce the problem. If you want the full source code of XMLmind XML Editor, simply fill this form http://www.xmlmind.com/store/order.php (forget about the price section) and send it to me (mailto:hussein at xmlmind.com). This way I'll record you in our customer database and after that, you'll be able to download Professional Edition (which comes with the full source code of the product). Cay Horstmann wrote: > Thanks for sending me the source code for the autocompletion. I think I > am onto something. The culprit seems to be Emacs and the X clipboard. > > Here is what I did. > > 1) The tester app doesn't exhibit the problem. However, I was able to > add a few logging calls to AutoCompletion.java, compile it, and add the > class to the class path before xxe.jar. Then the logging calls showed up > when I ran XXE. > > 2) I noticed that hidePopup would be called once a second when I had > text selected in Emacs! > > 3) I then added a logging call to setEntry: > Logger.global.log(Level.INFO, "text=" + text, new Throwable()); > > After selecting text in Emacs, every second or so, I get this stack > trace. Note that the text is set to empty, which would explain why my > keystrokes kept getting wiped out. > > May 3, 2006 7:10:52 AM com.xmlmind.xmledit.guiutil.AutoCompletion setEntry > INFO: text= > java.lang.Throwable > at > com.xmlmind.xmledit.guiutil.AutoCompletion.setEntry(AutoCompletion.java:467) > > at > com.xmlmind.xmledit.dialog.AttributeEditor.clearForm2(AttributeEditor.java:716) > > at > com.xmlmind.xmledit.dialog.AttributeEditor.clearForm(AttributeEditor.java:699) > > at > com.xmlmind.xmledit.dialog.AttributeEditor.tableChanged(AttributeEditor.java:504) > > at > javax.swing.table.AbstractTableModel.fireTableChanged(AbstractTableModel.java:280) > > at > javax.swing.table.AbstractTableModel.fireTableDataChanged(AbstractTableModel.java:182) > > at > com.xmlmind.xmledit.dialog.AttributeTableModel.setElement(AttributeTableModel.java:120) > > at > com.xmlmind.xmledit.dialog.AttributeEditor.setElement(AttributeEditor.java:636) > > at > com.xmlmind.xmleditapp.kit.part.EditAttributePane.editingContextChanged(EditAttributePane.java:185) > > at > com.xmlmind.xmleditapp.kit.App.editingContextChanged(App.java:2235) > at > com.xmlmind.xmleditapp.kit.OpenedDocument.contextChanged(OpenedDocument.java:1877) > > at > com.xmlmind.xmledit.edit.MarkManager.notifyContextChangeListeners(MarkManager.java:954) > > at > com.xmlmind.xmledit.edit.MarkManager.notifyContextChangeListeners(MarkManager.java:945) > > at > com.xmlmind.xmledit.view.DocumentView.notifyContextChangeListeners(DocumentView.java:1119) > > at > com.xmlmind.xmleditapp.kit.part.ClipboardContentTool$1.run(ClipboardContentTool.java:74) > > at > java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) > at java.awt.EventQueue.dispatchEvent(EventQueue.java:461) > at > java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242) > > at > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163) > > at > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157) > at > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149) > at java.awt.EventDispatchThread.run(EventDispatchThread.java:110) > May 3, 2006 7:10:53 AM com.xmlmind.xmledit.guiutil.AutoCompletion setEntry > INFO: text= > java.lang.Throwable > at > ... > > 4) After closing down Emacs, the problem goes away immediately. > > Now I am the first to agree that X selection is a festering mess, and I > am probably not helping by setting x-select-enable-clipboard in Emacs > (see http://www.emacswiki.org/cgi-bin/wiki/CopyAndPaste). > > Still, it would seem to me that a clipboard change shouldn't affect the > autocompletion. > > Does this give you a clue? I'd be happy to do more sleuthing if you send > me more source.

