[darcs-users] darcs patch: Use haskeline to have a readline-like behavior when as...

David Roundy droundy at darcs.net
Tue Jul 29 17:17:21 UTC 2008


Applied.  Thanks!

David

On Sat, Jul 19, 2008 at 10:14:08AM +0200, gaetan.lehmann at jouy.inra.fr wrote:
> Sat Jul 19 08:50:33 CEST 2008  gaetan.lehmann at jouy.inra.fr
>   * Use haskeline to have a readline-like behavior when asking something to the user
>   Unlike the implementations using readline or editline packages, this code
>   code doesn't break the Ctrl-C behavior.

Content-Description: A darcs patch for your repository!
> 
> New patches:
> 
> [Use haskeline to have a readline-like behavior when asking something to the user
> gaetan.lehmann at jouy.inra.fr**20080719065033
>  Unlike the implementations using readline or editline packages, this code
>  code doesn't break the Ctrl-C behavior.
> ] hunk ./configure.ac 169
> +dnl See if we have haskeline
> +
> +GHC_CHECK_MODULE(System.Console.Haskeline( runInputT, defaultSettings, getInputLine ),
> +                 haskeline,
> +                 runInputT defaultSettings (getInputLine "prompt: ") :: IO (Maybe String),
> +                 [haskelinefound=yes],
> +                 [haskelinefound=no])
> +if test $haskelinefound = "yes"; then
> +  AC_MSG_CHECKING([whether to use haskeline])
> +  AC_ARG_ENABLE(haskeline,
> +                AS_HELP_STRING([--disable-haskeline], [do not use haskeline, even if it is present]),
> +                haskeline=$enableval,
> +                haskeline=yes)
> +  AC_MSG_RESULT($haskeline)
> +  # If we aren't instructed to avoid haskeline, and we did successfully find haskeline...
> +  if test $haskeline = "yes"; then
> +     GHCFLAGS="$GHCFLAGS -DHAVE_HASKELINE"
> +  fi
> +fi
> +
> hunk ./src/Darcs/Utils.lhs 33
> -import Data.Maybe ( listToMaybe, isJust )
> +import Data.Maybe ( listToMaybe, isJust, fromMaybe )
> hunk ./src/Darcs/Utils.lhs 44
> +#ifdef HAVE_HASKELINE
> +import System.Console.Haskeline ( runInputT, defaultSettings, getInputLine )
> +#endif
> +
> hunk ./src/Darcs/Utils.lhs 149
> +#ifdef HAVE_HASKELINE
> +askUser prompt = withoutProgress $ fromMaybe "\EOT" `fmap` runInputT defaultSettings (getInputLine prompt)
> +#else
> hunk ./src/Darcs/Utils.lhs 160
> +#endif
> 
> Context:
> 
> [Better avoid silly manpage error.
> Trent W. Buck <trentbuck at gmail.com>**20080704024920
>  
>  It turned out only initialize's help string used 'quotes', so just
>  remove them.  This makes init's docstring consistent with the others.
> ] 
> [Missing period at end of sentence.
> Trent W. Buck <trentbuck at gmail.com>**20080704024232] 
> [darcs --overview no longer works, so don't document it.
> Trent W. Buck <trentbuck at gmail.com>**20080704030804] 
> [Avoid silly manpage error.
> Trent W. Buck <trentbuck at gmail.com>**20080703010733
>  man (nroff) treats an apostrophe in the first column specially,
>  resulting in a syntax error without this patch.
>  
>  Ideally, all cases of 'foo' in the manpage (i.e. docstrings) should
>  become `foo', since man -Tps turns ` and ' into left and right single
>  quotes respectively.
> ] 
> [obliterate whitespace in Darcs.Commands.Get
> gwern0 at gmail.com**20080627192026
>  'twas causing lhs/haddock difficulties where a \end{code} wasn't getting recognized.
> ] 
> [rm haddock CPP business
> gwern0 at gmail.com**20080627191413
>  Try as I might, I can't see any reason to special-case some Haddock CPP logic to deal with some *commented-out guards*, unless CPP magically restores and uncomments the code if Haddock isn't being run.
> ] 
> [make pull less verbose when --verbose flag is given.
> David Roundy <droundy at darcs.net>**20080624170035] 
> [fix makefile to remember to regenerate version information after running configure.
> David Roundy <droundy at darcs.net>**20080624170001] 
> [TAG 2.0.2
> David Roundy <droundy at darcs.net>**20080624012041] 
> Patch bundle hash:
> 71c2521126e06dac4bdb0eb51e3c778cf483cc1b


-- 
David Roundy
Department of Physics
Oregon State University


More information about the darcs-users mailing list