diff options
-rw-r--r-- | Pancake.hs | 6 | ||||
-rw-r--r-- | Pancake/Command.hs | 2 | ||||
-rw-r--r-- | README | 1 | ||||
-rw-r--r-- | pancake.1 | 2 | ||||
-rw-r--r-- | pancake.el | 5 |
5 files changed, 16 insertions, 0 deletions
@@ -317,6 +317,12 @@ command Quit = liftIO $ do command Interrupt = putErrLn "Received SIGINT. Interrupt twice in a row to quit." command (SetWidth w) = modify $ \s -> s { columns = w } +command Redisplay = do + st <- get + case history st of + ((uri, doc):_, _) -> printDoc uri doc + _ -> putErrLn "There's nothing to redisplay" + -- | Reads commands, runs them. eventLoop :: MonadIO m => StateT LoopState m () diff --git a/Pancake/Command.hs b/Pancake/Command.hs index 5126146..4c34a19 100644 --- a/Pancake/Command.hs +++ b/Pancake/Command.hs @@ -61,6 +61,7 @@ data Command = Quit | Shortcut String String | ReloadConfig | SetWidth (Maybe Int) + | Redisplay deriving (Show, Eq) -- | Parses a user command. @@ -77,6 +78,7 @@ basicCommand = choice . map (\(s, c) -> try (string s <* eof) *> pure c) $ , ("reload config", ReloadConfig) , ("help", Help) , ("?", ShowCurrent) + , ("redisplay", Redisplay) , ("", More)] -- | Link number parser. @@ -74,6 +74,7 @@ Commands :<shortcut> <query>: run a query using a shortcut defined in the configuration (e.g., search) :set width[ <columns>]: set terminal/window width manually +:redisplay: redisplay current document pancake-mode provides additional aliases and commands, see built-in emacs documentation (``C-h m``) for those. @@ -59,6 +59,8 @@ run a query using a shortcut defined in the configuration (e.g., search) .IP "\fBset width\fR[ \fIcolumns\fR]" set terminal/window width manually +.IP "\fBredisplay\fR" +redisplay current document .SH DEFAULT SHORTCUTS .IP "\fBg\fR" @@ -403,6 +403,11 @@ use. Current window width is used if none is provided." (interactive) (pancake-process-send ",")) +(defun pancake-redisplay () + "Redisplay the current document." + (interactive) + (pancake-process-send "redisplay")) + (defun pancake-display-current-uri () "Display current URI and put it into the kill ring." (interactive) |