[add :command and :normal mode to jhci to allow switching to and from command mode
John Meacham <john@repetae.net>**20060130032308] hunk ./Util/Interact.hs 47
+    (":command", "enter command mode"),
+    (":normal", "enter normal mode"),
hunk ./Util/Interact.hs 59
-basicParse comm s = f s' where
-    s' = reverse $ dropWhile isSpace (reverse $ dropWhile isSpace s)
+basicParse comm s = f (cleanupWhitespace s) where
hunk ./Util/Interact.hs 61
-    f (':':rs) = Left (':':map toLower as,dropWhile isSpace rest) where
+    f (':':rs) = Left (':':dropWhile (== ':')  (map toLower as),dropWhile isSpace rest) where
hunk ./Util/Interact.hs 63
-    f _ = Right s'
+    f s = Right s
hunk ./Util/Interact.hs 81
+    interactCommandMode :: Bool,                -- ^ whether we are in command mode
hunk ./Util/Interact.hs 96
+    interactCommandMode = False,
hunk ./Util/Interact.hs 109
+thePrompt Interact { interactCommandMode = False, interactPrompt = p } = p
+thePrompt Interact { interactCommandMode = True } = ":"
+
hunk ./Util/Interact.hs 129
-    case basicParse (interactComment act) s of
+    case basicParse (interactComment act) (if interactCommandMode act then ':':s else s) of
hunk ./Util/Interact.hs 158
+            [":command"] -> return act { interactCommandMode = True }
+            [":normal"] -> return act {interactCommandMode = False }
hunk ./Util/Interact.hs 185
-        s <- readLine (interactPrompt act) (return . expand)
+        s <- readLine (thePrompt act) (return . expand)