-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Emacs keymap for Yi editor
--   
--   Emacs keymap for Yi editor
@package yi-keymap-emacs
@version 0.19.0


module Yi.Keymap.Emacs.KillRing
uses :: forall a b f s. MonadState s f => Getting a s a -> (a -> b) -> f b

-- | Adds system clipboard's contents on top of the killring if not already
--   there
clipboardToKillring :: YiM ()

-- | Adds the top of the killring to the system clipboard
killringToClipboard :: YiM ()
killRegionB :: BufferM ()

-- | C-w Like <a>killRegionB</a>, but with system clipboard synchronization
killRegion :: YiM ()

-- | Kills current line
killLineB :: Maybe Int -> BufferM ()

-- | C-k | Like <a>killLineB</a>, but with system clipboard synchronization
killLine :: Maybe Int -> YiM ()
killringGet :: EditorM YiString
killringPut :: Direction -> YiString -> EditorM ()

-- | Yanks top of killbuffer
yankE :: EditorM ()

-- | C-y Like <a>yankE</a>, but with system clipboard synchronization
yank :: YiM ()

-- | Saves current selection to killring and then clears it
killRingSaveE :: EditorM ()

-- | M-w Like <a>killRingSaveE</a>, but with system clipboard
--   synchronization
killRingSave :: YiM ()

-- | M-y TODO: Handle argument, verify last command was a yank
yankPopE :: EditorM ()

-- | C-M-w
appendNextKillE :: EditorM ()


-- | This module is aimed at being a helper for the Emacs keybindings. In
--   particular this should be useful for anyone that has a custom keymap
--   derived from or based on the Emacs one.
module Yi.Keymap.Emacs.Utils
type UnivArgument = Maybe Int

-- | Convert the universal argument to a number of repetitions
argToInt :: UnivArgument -> Int

-- | Quits the editor if there are no unmodified buffers if there are
--   unmodified buffers then we ask individually for each modified buffer
--   whether or not the user wishes to save it or not. If we get to the end
--   of this list and there are still some modified buffers then we ask
--   again if the user wishes to quit, but this is then a simple yes or no.
askQuitEditor :: YiM ()
askSaveEditor :: YiM ()

-- | Quits the editor if there are no unmodified buffers if there are then
--   simply confirms with the user that they with to quit.
modifiedQuitEditor :: YiM ()

-- | <tt>withMinibuffer prompt completer act</tt>: open a minibuffer with
--   <tt>prompt</tt>. Once a string <tt>s</tt> is obtained, run <tt>act
--   s</tt>. <tt>completer</tt> can be used to complete functions: it
--   returns a list of possible matches.
withMinibuffer :: Text -> (Text -> YiM [Text]) -> (Text -> YiM ()) -> YiM ()
queryReplaceE :: YiM ()
isearchKeymap :: Direction -> Keymap

-- | cabal-configure
cabalConfigureE :: CommandArguments -> YiM ()

-- | cabal-build
cabalBuildE :: CommandArguments -> YiM ()
reloadProjectE :: String -> YiM ()
executeExtendedCommandE :: YiM ()
evalRegionE :: YiM ()
readUniversalArg :: KeymapM (Maybe Int)
scrollDownE :: UnivArgument -> BufferM ()
scrollUpE :: UnivArgument -> BufferM ()

-- | Prompts the user for a buffer name and switches to the chosen buffer.
switchBufferE :: YiM ()

-- | Prompts the user for a buffer name and kills the chosen buffer.
--   Prompts about really closing if the buffer is marked as changed since
--   last save.
killBufferE :: YiM ()

-- | Insert next character, "raw"
insertNextC :: UnivArgument -> KeymapM ()

-- | Open a file using the minibuffer. We have to set up some stuff to
--   allow hints and auto-completion.
findFile :: YiM ()

-- | Like <a>findFile</a> but sets the resulting buffer to read-only.
findFileReadOnly :: YiM ()

-- | Open a file in a new tab using the minibuffer.
findFileNewTab :: YiM ()

-- | Generic emacs style prompt file action. Takes a <tt>prompt</tt> and a
--   continuation <tt>act</tt> and prompts the user with file hints.
promptFile :: Text -> (Text -> YiM ()) -> YiM ()

-- | Prompt the user to give a tag and then jump to that tag
promptTag :: YiM ()

-- | If on separators (space, tab, unicode seps), reduce multiple
--   separators to just a single separator (or however many given through
--   <a>UnivArgument</a>).
--   
--   If we aren't looking at a separator, insert a single space. This is
--   like emacs ‘just-one-space’ but doesn't deal with negative argument
--   case but works with other separators than just space. What counts as a
--   separator is decided by <a>isAnySep</a> modulo <tt>n</tt> character.
--   
--   Further, it will only reduce a single type of separator at once: if we
--   have hard tabs followed by spaces, we are able to reduce one and not
--   the other.
justOneSep :: UnivArgument -> BufferM ()

-- | Join this line to previous (or next N if universal)
joinLinesE :: UnivArgument -> BufferM ()

-- | Counts the number of lines, words and characters inside selected
--   region. Coresponds to emacs' <tt>count-words-region</tt>.
countWordsRegion :: YiM ()


-- | This module aims at a mode that should be (mostly) intuitive to emacs
--   users, but mapping things into the Yi world when convenient. Hence, do
--   not go into the trouble of trying 100% emulation. For example,
--   <tt>M-x</tt> gives access to Yi (Haskell) functions, with their native
--   names.
module Yi.Keymap.Emacs
keymap :: KeymapSet
mkKeymapSet :: Proto ModeMap -> KeymapSet
defKeymap :: Proto ModeMap
data ModeMap
ModeMap :: Keymap -> Bool -> ModeMap
[_eKeymap] :: ModeMap -> Keymap
[_completionCaseSensitive] :: ModeMap -> Bool
eKeymap :: Lens' ModeMap Keymap
completionCaseSensitive :: Lens' ModeMap Bool

module Yi.Config.Default.Emacs
configureEmacs :: ConfigM ()
