From 51146403e0e7b9d49efe8592ac8380f785ce9cf3 Mon Sep 17 00:00:00 2001 From: defanor Date: Tue, 28 Nov 2017 07:07:58 +0300 Subject: 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. --- Pancake/Command.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Pancake/Command.hs') 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 -- cgit v1.2.3