Commit ee7c4f43 authored by Ian Lynagh's avatar Ian Lynagh

Make -ignore-dot-ghci a dynamic flag

parent e6e3a960
......@@ -303,6 +303,7 @@ data DynFlag
| Opt_BuildingCabalPackage
| Opt_SSE2
| Opt_SSE4_2
| Opt_IgnoreDotGhci
| Opt_GhciSandbox
| Opt_GhciHistory
| Opt_HelpfulErrors
......@@ -1798,6 +1799,8 @@ dynamic_flags = [
, Flag "fpackage-trust" (NoArg setPackageTrust)
, Flag "fno-safe-infer" (NoArg (setSafeHaskell Sf_None))
]
++ map (mkFlag turnOn "" setDynFlag ) negatableFlags
++ map (mkFlag turnOff "no-" unSetDynFlag) negatableFlags
++ map (mkFlag turnOn "d" setDynFlag ) dFlags
++ map (mkFlag turnOff "dno-" unSetDynFlag) dFlags
++ map (mkFlag turnOn "f" setDynFlag ) fFlags
......@@ -1920,6 +1923,11 @@ fWarningFlags = [
( "warn-pointless-pragmas", Opt_WarnPointlessPragmas, nop ),
( "warn-unsupported-calling-conventions", Opt_WarnUnsupportedCallingConventions, nop ) ]
-- | These @-\<blah\>@ flags can all be reversed with @-no-\<blah\>@
negatableFlags :: [FlagSpec DynFlag]
negatableFlags = [
( "ignore-dot-ghci", Opt_IgnoreDotGhci, nop ) ]
-- | These @-d\<blah\>@ flags can all be reversed with @-dno-\<blah\>@
dFlags :: [FlagSpec DynFlag]
dFlags = [
......
......@@ -76,7 +76,6 @@ module StaticFlags (
opt_Static,
-- misc opts
opt_IgnoreDotGhci,
opt_ErrorSpans,
opt_GranMacros,
opt_HiVersion,
......@@ -195,9 +194,6 @@ unpacked_opts =
expandAts l = [l]
-}
opt_IgnoreDotGhci :: Bool
opt_IgnoreDotGhci = lookUp (fsLit "-ignore-dot-ghci")
-- debugging options
-- | Suppress all that is suppressable in core dumps.
-- Except for uniques, as some simplifier phases introduce new varibles that
......
......@@ -489,7 +489,7 @@
<row>
<entry><option>-ignore-dot-ghci</option></entry>
<entry>Disable reading of <filename>.ghci</filename> files</entry>
<entry>static</entry>
<entry>dynamic</entry>
<entry>-</entry>
</row>
<row>
......
......@@ -49,7 +49,6 @@ import Linker
import Maybes ( orElse, expectJust )
import NameSet
import Panic hiding ( showException )
import StaticFlags
import Util
-- Haskell Libraries
......@@ -389,8 +388,9 @@ withGhcAppData right left = do
runGHCi :: [(FilePath, Maybe Phase)] -> Maybe [String] -> GHCi ()
runGHCi paths maybe_exprs = do
dflags <- getDynFlags
let
read_dot_files = not opt_IgnoreDotGhci
read_dot_files = not (dopt Opt_IgnoreDotGhci dflags)
current_dir = return (Just ".ghci")
......@@ -431,7 +431,6 @@ runGHCi paths maybe_exprs = do
setGHCContextFromGHCiState
dflags <- getDynFlags
when (read_dot_files) $ do
mcfgs0 <- sequence $ [ current_dir, app_user_dir, home_dir ] ++ map (return . Just ) (ghciScripts dflags)
mcfgs <- liftIO $ mapM canonicalizePath' (catMaybes mcfgs0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment