Hello all,
For almost 4 years now I have been trying to solve the
following problem (not really Hugs-specific, but very useful
for Hugs users). This is a Unix specific problem.
To integrate Hugs with other systems (editor, development
system, graphical user interface, etc.), I wrote a little
program (first in "sh", later in C), that given a Hugs
interpreter:
userInput --> [ Hugs ] --> terminalOutput
gives me a handle on the input and the output:
specialInput \ / output --> [ Parser ] --> feedback
=--> [ Hugs ] --=
userInput / \ terminalOutput
In other words, Hugs works as it always has, but now another
program can feed *extra* input to Hugs (for example ":r",
":t", or evaluating an expression), and it can read feedback
(an error message, the type of an expression, the result).
The program works fine and I have been using it for almost
4 years now.
The only problem is that I don't know how to deal with
control-C! Control-C interrupts this whole program, instead
of just Hugs. I have been trying to play with traps in
"sh", and even worse in C, but I cannot make Hugs behave as
I want. (And if I had, I would have made my program public,
but now it seems useless for "real" use).
I can't help but think that there must be better
Unix-hackers than me who have solved this problem already.
If so, please tell me! :-)
Regards,
Koen.
--
Koen Claessen http://www.cs.chalmers.se/~koen
phone:+46-31-772 5424 e-mail:[EMAIL PROTECTED]
-----------------------------------------------------
Chalmers University of Technology, Gothenburg, Sweden