mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -07:00
X.U.Run: Add examples to Haddocks
This commit is contained in:
parent
e466d9b1dc
commit
b6be0dca40
@ -414,19 +414,32 @@ termInDir = inTerm >-> inWorkingDir
|
|||||||
|
|
||||||
-- | Transform the given input into an elisp function; i.e., surround it
|
-- | Transform the given input into an elisp function; i.e., surround it
|
||||||
-- with parentheses.
|
-- with parentheses.
|
||||||
|
--
|
||||||
|
-- >>> elispFun "arxiv-citation URL"
|
||||||
|
-- " '( arxiv-citation URL )' "
|
||||||
elispFun :: String -> String
|
elispFun :: String -> String
|
||||||
elispFun f = " '(" <> f <> " )' "
|
elispFun f = " '( " <> f <> " )' "
|
||||||
|
|
||||||
-- | Treat an argument as a string; i.e., wrap it with quotes.
|
-- | Treat an argument as a string; i.e., wrap it with quotes.
|
||||||
|
--
|
||||||
|
-- >>> asString "string"
|
||||||
|
-- " \"string\" "
|
||||||
asString :: String -> String
|
asString :: String -> String
|
||||||
asString s = " \"" <> s <> "\" "
|
asString s = " \"" <> s <> "\" "
|
||||||
|
|
||||||
-- | Wrap the given commands in a @progn@. The commands need not be
|
-- | Wrap the given commands in a @progn@ and also escape it by wrapping
|
||||||
-- wrapped in parentheses, this will be done by the function.
|
-- it inside single quotes. The given commands need not be wrapped in
|
||||||
|
-- parentheses, this will be done by the function. For example:
|
||||||
|
--
|
||||||
|
-- >>> progn [require "this-lib", "function-from-this-lib arg", "(other-function arg2)"]
|
||||||
|
-- " '( progn (require (quote this-lib)) (function-from-this-lib arg) (other-function arg2) )' "
|
||||||
progn :: [String] -> String
|
progn :: [String] -> String
|
||||||
progn cmds = elispFun $ "progn " <> unwords (map inParens cmds)
|
progn cmds = elispFun $ "progn " <> unwords (map inParens cmds)
|
||||||
|
|
||||||
-- | Require a package.
|
-- | Require a package.
|
||||||
|
--
|
||||||
|
-- >>> require "arxiv-citation"
|
||||||
|
-- "(require (quote arxiv-citation))"
|
||||||
require :: String -> String
|
require :: String -> String
|
||||||
require = inParens . ("require " <>) . inParens . ("quote " <>)
|
require = inParens . ("require " <>) . inParens . ("quote " <>)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user