diff options
author | defanor <defanor@uberspace.net> | 2017-11-28 07:07:58 +0300 |
---|---|---|
committer | defanor <defanor@uberspace.net> | 2017-11-28 07:07:58 +0300 |
commit | 51146403e0e7b9d49efe8592ac8380f785ce9cf3 (patch) | |
tree | 380666e46e05906c586db0b5090ff360235d3b7c /Pancake/Command.hs | |
parent | 6d6696fc45013f88c63decab3e53b8ee26dde1b4 (diff) |
Introduce initial image support
Pancake reports saved files to Emacs, Emacs inserts them into
appropriate positions if they are images; `pancake-load-images' just
sends "save" commands for all the images.
`pancake-display-hook' was added as well, so that image loading can be
requested automatically, among other things.
There is a few things to improve: currently the images don't get
sliced, there's no caching or parallelization, and no tracking of
explicitly requested images.
Diffstat (limited to 'Pancake/Command.hs')
-rw-r--r-- | Pancake/Command.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Pancake/Command.hs b/Pancake/Command.hs index e0c76f6..028012a 100644 --- a/Pancake/Command.hs +++ b/Pancake/Command.hs @@ -109,20 +109,20 @@ pFilePath = do -- | 'Save' command parser for 'RURI'. save :: Parser Command save = Save - <$> (string "save" *> spaces *> (RURI <$> pURI)) - <*> (spaces *> optionMaybe pFilePath) + <$> (string "save" *> space *> (RURI <$> pURI)) + <*> optionMaybe (space *> pFilePath) <* eof -- | 'Save' command parser for 'RNumber'. saveRef :: String -> Parser Command saveRef digits = Save - <$> (string "save" *> spaces *> (RNumber <$> pNumber digits)) - <*> (spaces *> optionMaybe pFilePath) <* eof + <$> (string "save" *> space *> (RNumber <$> pNumber digits)) + <*> optionMaybe (space *> pFilePath) <* eof -- | 'Save' command parser for 'RCurrent'. saveCurrent :: Parser Command -saveCurrent = Save RCurrent <$> (string "save" *> spaces *> char ',' - *> spaces *> optionMaybe pFilePath <* eof) +saveCurrent = Save RCurrent <$> (string "save" *> space *> char ',' + *> optionMaybe (space *> pFilePath) <* eof) -- | 'GoTo' command parser for 'RURI'. goTo :: Parser Command |