Permalink
Browse files

doc updates

Conflicts:

	yi/src/library/Yi/Boot.hs
  • Loading branch information...
1 parent 10d25ba commit 66bdf812e7b1a2eac5f2dd758b0ce0633cca94b7 @coreyoconnor committed with Mar 21, 2012
Showing with 17 additions and 2 deletions.
  1. +17 −1 yi/src/library/Yi/Boot.hs
  2. +0 −1 yi/src/library/Yi/Editor.hs
@@ -1,4 +1,6 @@
--- | Boot process of Yi, as an instanciation of Dyre
+{-# LANGUAGE CPP #-}
+-- | Boot process of Yi.
+-- Uses Dyre to implement the XMonad-style dynamic reconfiguration.
module Yi.Boot (yi, yiDriver, reload) where
import qualified Config.Dyre as Dyre
@@ -16,11 +18,18 @@ import Yi.Keymap
import Yi.Main
import qualified Yi.UI.Common as UI
+-- | once the custom yi is compiled this restores the editor state (if requested) then proceeds to
+-- run the editor.
realMain :: (Config, ConsoleConfig) -> IO ()
realMain configs = do
editor <- restoreBinaryState Nothing
main configs editor
+-- | If the custom yi compile produces errors or warnings then the messages are presented as a
+-- separate activity in the editor.
+--
+-- The use of a separate activity prevents any other initial actions from immediately masking the
+-- output.
showErrorsInConf :: (Config, ConsoleConfig) -> String -> (Config, ConsoleConfig)
showErrorsInConf (conf, confcon) errs
= (conf { initialActions = (makeAction $ splitE >> newBufferE (Left "*errors*") (R.fromString errs)) : initialActions conf }
@@ -29,6 +38,8 @@ showErrorsInConf (conf, confcon) errs
yi, yiDriver :: Config -> IO ()
yi = yiDriver
+-- | Used by both the yi executable and the custom yi that is built from the user's configuration.
+-- The yi executable uses a default config.
yiDriver cfg = do
args <- Dyre.withDyreOptions Dyre.defaultParams getArgs
-- we do the arg processing before dyre, so we can extract '--ghc-option=' and '--help' and so on.
@@ -47,6 +58,11 @@ yiDriver cfg = do
}
in Dyre.wrapMain yiParams (finalCfg, cfgcon)
+-- | "reloads" the configuration
+--
+-- Serializes the editor state and relaunches Yi using the serialized state.
+-- The launch of Yi will result in recompilation of the user's custom yi. This, in effect, "reloads"
+-- the configuration.
reload :: YiM ()
reload = do
editor <- withEditor get
@@ -614,7 +614,6 @@ layoutManagerNextVariantE = modA (tabLayoutManagerA . currentTabA) nextVariant
layoutManagerPreviousVariantE :: EditorM ()
layoutManagerPreviousVariantE = modA (tabLayoutManagerA . currentTabA) previousVariant
-
-- | Enlarge the current window
enlargeWinE :: EditorM ()
enlargeWinE = error "enlargeWinE: not implemented"

0 comments on commit 66bdf81

Please sign in to comment.