[commit: ghc] ghc-8.0: Print a message when loading a .ghci file. (45c4cc1)

git at git.haskell.org git at git.haskell.org
Wed Jan 13 19:34:20 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/45c4cc1e408e1fee5217fae2bdb01f279122d7d5/ghc

>---------------------------------------------------------------

commit 45c4cc1e408e1fee5217fae2bdb01f279122d7d5
Author: Kwang Yul Seo <kwangyul.seo at gmail.com>
Date:   Wed Jan 13 14:54:33 2016 +0100

    Print a message when loading a .ghci file.
    
    Test Plan: ./validate
    
    Reviewers: austin, thomie, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie
    
    Differential Revision: https://phabricator.haskell.org/D1756
    
    GHC Trac Issues: #11389
    
    (cherry picked from commit c3f92464bf64dacae76dc9b3566df9a9f6b3a85b)


>---------------------------------------------------------------

45c4cc1e408e1fee5217fae2bdb01f279122d7d5
 ghc/GHCi/UI.hs                             | 6 ++++--
 testsuite/tests/ghci/scripts/T10408.stdout | 2 ++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs
index 1303af5..29d3688 100644
--- a/ghc/GHCi/UI.hs
+++ b/ghc/GHCi/UI.hs
@@ -525,6 +525,7 @@ runGHCi paths maybe_exprs = do
              do runInputTWithPrefs defaultPrefs defaultSettings $
                           runCommands $ fileLoop hdl
                 liftIO (hClose hdl `catchIO` \_ -> return ())
+                liftIO $ putStrLn ("Loaded GHCi configuration from " ++ file)
 
   --
 
@@ -533,12 +534,13 @@ runGHCi paths maybe_exprs = do
   dot_cfgs <- if ignore_dot_ghci then return [] else do
     dot_files <- catMaybes <$> sequence [ current_dir, app_user_dir, home_dir ]
     liftIO $ filterM checkFileAndDirPerms dot_files
+  mdot_cfgs <- liftIO $ mapM canonicalizePath' dot_cfgs
+
   let arg_cfgs = reverse $ ghciScripts dflags
     -- -ghci-script are collected in reverse order
-  mcfgs <- liftIO $ mapM canonicalizePath' $ dot_cfgs ++ arg_cfgs
     -- We don't require that a script explicitly added by -ghci-script
     -- is owned by the current user. (#6017)
-  mapM_ sourceConfigFile $ nub $ catMaybes mcfgs
+  mapM_ sourceConfigFile $ nub $ (catMaybes mdot_cfgs) ++ arg_cfgs
     -- nub, because we don't want to read .ghci twice if the CWD is $HOME.
 
   -- Perform a :load for files given on the GHCi command line
diff --git a/testsuite/tests/ghci/scripts/T10408.stdout b/testsuite/tests/ghci/scripts/T10408.stdout
index b13d0a4..cef83bc 100644
--- a/testsuite/tests/ghci/scripts/T10408.stdout
+++ b/testsuite/tests/ghci/scripts/T10408.stdout
@@ -1,2 +1,4 @@
 "T10408A"
+Loaded GHCi configuration from T10408A.script
 "T10408B"
+Loaded GHCi configuration from T10408B.script



More information about the ghc-commits mailing list