1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
diff -Naur helium-1.1.old/heliumNT/src/Makefile.in helium-1.1/heliumNT/src/Makefile.in
--- helium-1.1.old/heliumNT/src/Makefile.in 2003-03-12 22:35:28.000000000 +0000
+++ helium-1.1/heliumNT/src/Makefile.in 2003-03-12 22:33:19.000000000 +0000
@@ -200,7 +200,7 @@
texthint: texthint/Main.hs utils/OSSpecific.hs
# GHC HeliumInterpreter
- $(HC) --make -iutils -o $(HELIUMBINDIR)/texthint$(EXE) texthint/Main.hs
+ $(HC) --make -package util -iutils -o $(HELIUMBINDIR)/texthint$(EXE) texthint/Main.hs
$(STRIP) $(HELIUMBINDIR)/texthint$(EXE)
# AG sources
diff -Naur helium-1.1.old/heliumNT/src/texthint/Main.hs helium-1.1/heliumNT/src/texthint/Main.hs
--- helium-1.1.old/heliumNT/src/texthint/Main.hs 2003-03-06 14:45:13.000000000 +0000
+++ helium-1.1/heliumNT/src/texthint/Main.hs 2003-03-12 22:38:29.000000000 +0000
@@ -2,6 +2,7 @@
import Char
import List(isPrefixOf, isSuffixOf)
+import Readline
import Monad(when)
import IO(stdout, hFlush)
import System(system, getEnv, getArgs, exitWith, ExitCode(..))
@@ -64,6 +65,11 @@
cmdLoadModule (head args) initialState
else
return initialState
+
+ -- Initialize readline
+ initialize
+ -- Deactivate filename completion
+ setCompletionEntryFunction (Just (const $ return []))
-- Enter read-eval-print loop
loop stateAfterLoad
@@ -79,9 +85,9 @@
loop :: State -> IO State
loop state = do
- putStr (prompt state)
- hFlush stdout
- command' <- getLine
+ command'' <- readline (prompt state)
+ let command' = maybe ":q" id command''
+ addHistory command'
let command = trim command'
newState <- case command of
(':':cmd:rest) ->
|