From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.6.10/8.6.6) id JAA03855 for caml-redistribution; Tue, 5 Dec 1995 09:49:27 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.6.10/8.6.6) with ESMTP id UAA25604 for ; Mon, 4 Dec 1995 20:44:06 +0100 Received: from louie.udel.edu (mmdf@louie.udel.edu [128.175.7.39]) by concorde.inria.fr (8.7.1/8.7.1) with SMTP id UAA16204 for ; Mon, 4 Dec 1995 20:44:01 +0100 (MET) Received: from sol.cis.udel.edu by louie.udel.edu id ab15928; 4 Dec 95 14:41 EST Received: from louie.udel.edu by sol.cis.udel.edu id ab13849; 4 Dec 95 19:41 GMT Received: from sol.cis.udel.edu by auriga.cis.udel.edu id aa14899; 4 Dec 95 19:40 GMT To: caml-list@pauillac.inria.fr Subject: CSL-1.12 and CamlTK4, text tag problem From: "Mark C. Chu-Carroll" Date: Mon, 04 Dec 1995 14:40:28 -0500 Sender: weis Message-ID: <9512041940.aa14899@auriga.cis.udel.edu> Greetings! I'm working on a TK based text editor/user environment loosely based on Rob Pike's Acme for Plan9. For some details of how some of the more advanced features are going to work, CSLs functors are probably going to turn out to be extremely useful. So when CSL-1.11 came out, I eagerly grabbed it, and compiled it with Camltk4 libraries that came with the MMM source distribution. It seems to be working pretty well, with one minor (frustrating) exception. One very important feature of Acme is the sweeping of text with the middle and right mouse buttons. To do this, I have an action associated with mouse motion events which inserts the swept text into a tag, and then tries to highlight the tag. After a lot of hacking, what I seem to have found is that tags are not being created correctly by Text.tag_add. The following code fragment demonstrates the problem: Text.tag_add textwin "command" t1 t2; let str = Text.get textwin (TextIndex(TagFirst("command"), [])) (TextIndex(TagLast("command"), [])) in print_string str In this fragment, "textwin" is a text window, and t1 and t2 are valid text indices. The indices are definitely not a problem; "Text.get textwin t1 t2" works correctly. But when the above code fragment is run, it produces "Fatal error: uncaught exception TkError". "Text.tag_allnames textwin" returns a list containing the "command" tag, so the tag is being created somehow. But any attempt to try to access the tag, or to use any index created from the tag, causes an exception. I took a quick look at the CamlTK4 source to see if I could figure out the problem. Unfortunately, I haven't been able to find anything obvious, and I won't have the time to figure it out for a while. Can anyone give me a clue of how to get this to work? I'd really hate to have to migrate back to itcl!