From: Ian Lynagh Date: Sun, 3 Apr 2011 12:46:22 +0000 (+0100) Subject: Merge branch 'master' of http://darcs.haskell.org/ghc X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=fb659757de8ebe10bb8a2c2ff5e198e365dc7b08;hp=ffb2e81c03a01e74825b3a0223e214df59241fab Merge branch 'master' of darcs.haskell.org/ghc --- diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs index 3062133..2685377 100644 --- a/ghc/InteractiveUI.hs +++ b/ghc/InteractiveUI.hs @@ -848,8 +848,11 @@ lookupCommand' str' = do macros <- readIORef macros_ref let{ (str, cmds) = case str' of ':' : rest -> (rest, builtin_commands) - _ -> (str', macros ++ builtin_commands) } + _ -> (str', builtin_commands ++ macros) } -- look for exact match first, then the first prefix match + -- We consider builtin commands first: since new macros are appended + -- on the *end* of the macros list, this is consistent with the view + -- that things defined earlier should take precedence. See also #3858 return $ case [ c | c <- cmds, str == cmdName c ] of c:_ -> Just c [] -> case [ c | c@(s,_,_) <- cmds, str `isPrefixOf` s ] of