Re: [GHC] #2652: fancier prompts for ghci
#2652: fancier prompts for ghci -+-- Reporter: jsnx |Owner: igloo Type: feature request | Status: reopened Priority: normal|Milestone: 6.10 branch Component: GHCi | Version: 6.8.3 Severity: normal| Resolution: Keywords:| Difficulty: Unknown Testcase:| Os: Unknown/Multiple Architecture: Unknown/Multiple | -+-- Changes (by jsnx): * status: closed = reopened * resolution: fixed = Comment: Replying to [comment:5 igloo]: Thanks for the patch! I've applied a slightly different version: Prompt strings starting with are treated as Haskell strings; otherwise they are treated as literal strings. Is this going to be in 6.12? I've noticed it's not included in 6.10. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/2652#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #2652: fancier prompts for ghci
#2652: fancier prompts for ghci -+-- Reporter: jsnx |Owner: igloo Type: feature request | Status: reopened Priority: normal|Milestone: 6.10 branch Component: GHCi | Version: 6.8.3 Severity: normal| Resolution: Keywords:| Difficulty: Unknown Testcase:| Os: Unknown/Multiple Architecture: Unknown/Multiple | -+-- Comment (by igloo): Yes, this patch is only in the HEAD (which will become 6.12): {{{ Fri Oct 31 14:52:27 GMT 2008 Ian Lynagh ig...@earth.li * :set prompt now understand Haskell String syntax; trace #2652 }}} -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/2652#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #2652: fancier prompts for ghci
#2652: fancier prompts for ghci -+-- Reporter: jsnx |Owner: igloo Type: feature request | Status: closed Priority: normal|Milestone: 6.10 branch Component: GHCi | Version: 6.8.3 Severity: normal| Resolution: fixed Keywords:| Difficulty: Unknown Testcase:| Os: Unknown/Multiple Architecture: Unknown/Multiple | -+-- Changes (by igloo): * status: reopened = closed * resolution: = fixed -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/2652#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #2652: fancier prompts for ghci
#2652: fancier prompts for ghci --+- Reporter: jsnx | Owner: igloo Type: feature request | Status: new Priority: normal| Milestone: 6.10 branch Component: GHCi |Version: 6.8.3 Severity: normal| Resolution: Keywords:| Difficulty: Unknown Testcase:| Architecture: Unknown/Multiple Os: Unknown/Multiple | --+- Changes (by igloo): * owner: = igloo -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/2652#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #2652: fancier prompts for ghci
#2652: fancier prompts for ghci --+- Reporter: jsnx | Owner: igloo Type: feature request | Status: closed Priority: normal| Milestone: 6.10 branch Component: GHCi |Version: 6.8.3 Severity: normal| Resolution: fixed Keywords:| Difficulty: Unknown Testcase:| Architecture: Unknown/Multiple Os: Unknown/Multiple | --+- Changes (by igloo): * status: new = closed * resolution: = fixed Comment: Thanks for the patch! I've applied a slightly different version: Prompt strings starting with are treated as Haskell strings; otherwise they are treated as literal strings. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/2652#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #2652: fancier prompts for ghci
#2652: fancier prompts for ghci --+- Reporter: jsnx | Owner: Type: feature request | Status: new Priority: normal| Milestone: 6.10 branch Component: GHCi |Version: 6.8.3 Severity: normal| Resolution: Keywords:| Difficulty: Unknown Testcase:| Architecture: Unknown/Multiple Os: Unknown/Multiple | --+- Comment (by jsnx): I've integrated this with GHC 6.8.3 sources. There's not much to it. {{{ #!diff --- 0/compiler/ghci/InteractiveUI.hs2008-06-16 10:27:16.0 -0700 +++ 1/compiler/ghci/InteractiveUI.hs2008-10-28 02:57:03.0 -0700 @@ -1447,11 +1447,19 @@ setPrompt value = do st - getGHCiState if null value - then io $ hPutStrLn stderr $ syntax: :set prompt prompt, currently \ ++ prompt st ++ \ - else setGHCiState st{ prompt = remQuotes value } + then io $ hPutStrLn stderr $ +syntax: :set prompt prompt, currently \ ++ prompt st ++ \ + else setGHCiState st{ prompt = read . handleQuotes $ value } where - remQuotes ('\':xs) | not (null xs) last xs == '\' = init xs - remQuotes x = x + -- the prompt can be input with quote marks and string escaping, or + -- with plain character escaping. + handleQuotes s | length s 2 last s == '' head s == '' = s +| otherwise = wrap . escapeQuotes $ s + wrap = (\ ++) . (++ \) + escapeQuotes ('\\':'':r) = '\\' : '' : escapeQuotes r + escapeQuotes ('':r) = '\\' : '' : escapeQuotes r + escapeQuotes (c:r) = c : escapeQuotes r + escapeQuotes [ ] = [ ] setOptions wds = do -- first, deal with the GHCi opts (+s, +t, etc.) }}} With quotes, it uses string escapes and retains spaces: {{{ Prelude :set prompt {- %s\n -} {- Prelude -} }}} Without quotes, it uses only character escapes: {{{ Prelude :set prompt {-\SP\SP%s\n\SP-}\SP {- Prelude -} }}} -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/2652#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #2652: fancier prompts for ghci
#2652: fancier prompts for ghci --+- Reporter: jsnx | Owner: Type: feature request | Status: new Priority: normal| Milestone: 6.10 branch Component: Compiler |Version: 6.8.3 Severity: normal| Resolution: Keywords:| Difficulty: Unknown Testcase:| Architecture: Unknown/Multiple Os: Unknown/Multiple | --+- Changes (by igloo): * difficulty: = Unknown * milestone: = 6.10 branch -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/2652#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
[GHC] #2652: fancier prompts for ghci
#2652: fancier prompts for ghci -+-- Reporter: jsnx | Owner: Type: feature request | Status: new Priority: normal| Component: Compiler Version: 6.8.3 |Severity: normal Keywords:|Testcase: Architecture: Unknown/Multiple | Os: Unknown/Multiple -+-- It'd be nice to put newlines in a GHCi prompt using standard escape sequences. It is really unnecessary to support anything more than `%s` as a formatting directive. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/2652 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs