[commit: ghc] master: Greater customization of GHCi prompt (533037c)
git at git.haskell.org
git at git.haskell.org
Sun May 1 21:56:03 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/533037cc58a7c50e1c014e27e8b971d53e7b47bd/ghc
>---------------------------------------------------------------
commit 533037cc58a7c50e1c014e27e8b971d53e7b47bd
Author: niksaz <nikitasazanovich at gmail.com>
Date: Sun May 1 13:34:45 2016 +0200
Greater customization of GHCi prompt
This patch is trying to redesign the :set prompt option to take not a
String but a Haskell function, like [String] -> Int -> IO String, where
[String] is the list of the names of the currently loaded modules and
Int is the line number. Currently you may set prompt function with
**:set promt-function [String] -> Int -> IO String** option and old
version is also available - :set prompt String.
So, it looks like I've almost completed this patch:
1) Now we have a lot of escape sequences - 13 to be exact. Most of them
are similar to bash prompt escape sequences. Thus they are quite handy.
2) We may use the special escape sequence to call shell functions, for
example "%call(ls -l -a)".
3) We may use :set prompt-function to set PFunction to handle prompt.
It is just [String] -> Int -> IO String.
Reviewers: erikd, austin, mpickering, bgamari
Reviewed By: mpickering, bgamari
Subscribers: mpickering, thomie
Differential Revision: https://phabricator.haskell.org/D2084
GHC Trac Issues: #5850
>---------------------------------------------------------------
533037cc58a7c50e1c014e27e8b971d53e7b47bd
docs/users_guide/ghci.rst | 48 +++++-
ghc/GHCi/UI.hs | 257 ++++++++++++++++++++++------
ghc/GHCi/UI/Monad.hs | 9 +-
testsuite/tests/ghci/scripts/all.T | 3 +
testsuite/tests/ghci/scripts/ghci060.script | 7 +
testsuite/tests/ghci/scripts/ghci060.stderr | 5 +
testsuite/tests/ghci/scripts/ghci061.hs | 5 +
testsuite/tests/ghci/scripts/ghci061.script | 5 +
testsuite/tests/ghci/scripts/ghci061.stderr | 16 ++
9 files changed, 292 insertions(+), 63 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 533037cc58a7c50e1c014e27e8b971d53e7b47bd
More information about the ghc-commits
mailing list