Skip to content

Commit

Permalink
Merge branch 'master' of http://darcs.haskell.org/ghc
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Peyton Jones committed Sep 2, 2011
2 parents 0ccf2c3 + af7840e commit 000824d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions compiler/main/DynFlags.hs
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ data DynFlag
| Opt_SSE2
| Opt_SSE4_2
| Opt_GhciSandbox
| Opt_GhciHistory
| Opt_HelpfulErrors

-- temporary flags
Expand Down Expand Up @@ -1741,6 +1742,7 @@ fFlags = [
( "ext-core", AlwaysAllowed, Opt_EmitExternalCore, nop ),
( "shared-implib", AlwaysAllowed, Opt_SharedImplib, nop ),
( "ghci-sandbox", AlwaysAllowed, Opt_GhciSandbox, nop ),
( "ghci-history", AlwaysAllowed, Opt_GhciHistory, nop ),
( "helpful-errors", AlwaysAllowed, Opt_HelpfulErrors, nop ),
( "building-cabal-package", AlwaysAllowed, Opt_BuildingCabalPackage, nop ),
( "implicit-import-qualified", AlwaysAllowed, Opt_ImplicitImportQualified, nop )
Expand Down Expand Up @@ -1916,6 +1918,7 @@ defaultFlags
Opt_EmbedManifest,
Opt_PrintBindContents,
Opt_GhciSandbox,
Opt_GhciHistory,
Opt_HelpfulErrors
]

Expand Down
6 changes: 6 additions & 0 deletions docs/users_guide/flags.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2727,6 +2727,12 @@ phase <replaceable>n</replaceable></entry>
<entry>static</entry>
<entry>-</entry>
</row>
<row>
<entry><option>-fno-ghci-history</option></entry>
<entry>Do not use the load/store the GHCi command history from/to <literal>ghci_history</literal>.</entry>
<entry>dynamic</entry>
<entry>-</entry>
</row>
<row>
<entry><option>-fno-ghci-sandbox</option></entry>
<entry>Turn off the GHCi sandbox. Means computations are run in the main thread, rather than a forked thread.</entry>
Expand Down
7 changes: 5 additions & 2 deletions ghc/InteractiveUI.hs
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,11 @@ runGHCi paths maybe_exprs = do

runGHCiInput :: InputT GHCi a -> GHCi a
runGHCiInput f = do
histFile <- liftIO $ withGhcAppData (\dir -> return (Just (dir </> "ghci_history")))
(return Nothing)
dflags <- getDynFlags
histFile <- if dopt Opt_GhciHistory dflags
then liftIO $ withGhcAppData (\dir -> return (Just (dir </> "ghci_history")))
(return Nothing)
else return Nothing
let settings = setComplete ghciCompleteWord
$ defaultSettings {historyFile = histFile}
runInputT settings f
Expand Down

0 comments on commit 000824d

Please sign in to comment.