darcs-2.16.2: a distributed, interactive, smart revision control system

Safe HaskellNone
LanguageHaskell2010

Darcs.UI.External

Synopsis

Documentation

generateEmail Source #

Arguments

:: Handle

handle to write email to

-> String

From

-> String

To

-> String

Subject

-> String

CC

-> Doc

body

-> IO () 

sendEmailDoc Source #

Arguments

:: String

from

-> String

to

-> String

subject

-> String

cc

-> String

send command

-> Maybe (Doc, Doc)

(content,bundle)

-> Doc

body

-> IO () 

Send an email, optionally containing a patch bundle (more precisely, its description and the bundle itself)

viewDoc :: Doc -> IO () Source #

darcsProgram :: IO String Source #

Get the name of the darcs executable (as supplied by getExecutablePath)

editFile :: FilePathLike p => p -> IO (ExitCode, Bool) Source #

editFile f lets the user edit a file which could but does not need to already exist. This function returns the exit code from the text editor and a flag indicating if the user made any changes.

setDarcsEncodings :: IO () Source #

On Posix systems, GHC by default uses the user's locale encoding to determine how to decode/encode the raw byte sequences in the Posix API to/from String. It also uses certain special variants of this encoding to determine how to handle encoding errors.

See GHC.IO.Encoding for details.

In particular, the default variant used for command line arguments and environment variables is /ROUNDTRIP, which means that any/ byte sequence can be decoded and re-encoded w/o failure or loss of information. To enable this, GHC uses code points that are outside the range of the regular unicode set. This is what you get with getFileSystemEncoding.

We need to preserve the raw bytes e.g. for file names passed in by the user and also when reading file names from disk; also when re-generating files from patches, and when we display them to the user.

So we want to use this encoding variant for *all* IO and for (almost) all conversions between raw bytes and Strings. The encoding used for IO from and to handles is controlled by setLocaleEncoding which we use here to make it equal to the //ROUNDTRIP variant.

setDarcsEncoding should be called before the first time any darcs operation is run, and again if anything else might have set those encodings to different values.

Note that it isn't thread-safe and has a global effect on your program.

On Windows, this function does (and should) not do anything.

isUTF8Locale :: String -> Bool Source #

isUTF8 checks if an encoding is UTF-8 (or ascii, since it is a subset of UTF-8).