Haddock fixes

This commit is contained in:
Andrea Rossato
2007-10-12 10:04:16 +00:00
parent 85794b9558
commit a85718506b
7 changed files with 53 additions and 36 deletions

View File

@@ -11,7 +11,7 @@
-- Stability : unstable
-- Portability : unportable
--
-- More useful tiled layout that allows you to change a width/height of window.
-- More useful tiled layout that allows you to change a width\/height of window.
--
-----------------------------------------------------------------------------

View File

@@ -17,18 +17,18 @@
-- Remember that you need to call the setWMName action yourself (at least until
-- we have startup hooks). E.g., you can bind it in your Config.hs:
--
-- ((modMask .|. controlMask .|. shiftMask, xK_z), setWMName "LG3D") -- @@ Java hack
-- > ((modMask .|. controlMask .|. shiftMask, xK_z), setWMName "LG3D") -- @@ Java hack
--
-- and press the key combination before running the Java programs (you only
-- need to do it once per XMonad execution)
--
-- For details on the problems with running Java GUI programs in non-reparenting
-- WMs, see <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6429775> and
-- WMs, see "http:\/\/bugs.sun.com\/bugdatabase\/view_bug.do?bug_id=6429775" and
-- related bugs.
--
-- Setting WM name to "compiz" does not solve the problem, because of yet
-- another bug in AWT code (related to insets). For LG3D insets are explicitly
-- set to 0, while for other WMs the insets are "guessed" and the algorithm
-- set to 0, while for other WMs the insets are \"guessed\" and the algorithm
-- fails miserably by guessing absolutely bogus values.
-----------------------------------------------------------------------------

View File

@@ -12,7 +12,9 @@
-- each other, without having to move individual windows.
--
-- TODO: add quickcheck props for:
--
-- * double swap invariant (guarantees no 'loss' of workspaces)
--
-- * non-swapped ws's invariant
--
-----------------------------------------------------------------------------
@@ -28,13 +30,15 @@ import StackSet
-- $usage
-- Add this import to your Config.hs:
--
-- > import XMonadContrib.SwapWorkspaces
--
-- Throw this in your keys definition:
--
-- > ++
-- > [((modMask .|. controlMask, k), windows $ swapWithCurrent i)
-- > | (i, k) <- zip workspaces [xK_1 ..]]
--
-- %import XMonadContrib.SwapWorkspaces
-- %keybindlist ++
-- %keybindlist [((modMask .|. controlMask, k), windows $ swapWithCurrent i)

View File

@@ -36,11 +36,14 @@ import XMonadContrib.NamedWindows (getName)
-- where you left your XChat.
--
-- Place in your Config.hs:
--
-- > import XMonadContrib.WindowBringer
--
-- and in the keys definition:
--
-- > , ((modMask .|. shiftMask, xK_g ), gotoMenu)
-- > , ((modMask .|. shiftMask, xK_b ), bringMenu)
--
-- %import XMonadContrib.WindowBringer
-- %keybind ((modMask .|. shiftMask, xK_g ), gotoMenu)
-- %keybind ((modMask .|. shiftMask, xK_b ), bringMenu)

View File

@@ -266,13 +266,13 @@ keyPressHandle :: KeyMask -> KeyStroke -> XP ()
keyPressHandle mask (ks,_)
| mask == controlMask =
case () of
-- ^U
-- ctrl U
_ | ks == xK_u -> killBefore >> go
-- ^K
-- ctrl K
| ks == xK_k -> killAfter >> go
-- ^A
-- ctrl A
| ks == xK_a -> startOfLine >> go
-- ^E
-- ctrl E
| ks == xK_e -> endOfLine >> go
-- Unhandled control sequence
| otherwise -> eventLoop handle

View File

@@ -29,6 +29,7 @@ import XMonad
-- $usage
--
-- Add something like the following lines to Config.hs to use this module
--
-- > import XMonadContrib.XPropManage
--
-- > manageHook = xPropManageHook xPropMatches
@@ -51,7 +52,7 @@ import XMonad
-- a function to apply in 'windows' (see Operations.hs). So if the action does only work on the
-- WindowSet use just 'pmP function'.
--
-- *1 You can get the available properties of an application with the xprop utility. STRING properties
-- \*1 You can get the available properties of an application with the xprop utility. STRING properties
-- should work fine. Others might not work.
--

View File

@@ -4,36 +4,21 @@
-- Copyright : (C) 2007 Andrea Rossato, Matthew Sackman
-- License : BSD3
--
-- Maintainer : Andrea Rossato <andrea.rossato@unibz.it>, Matthew Sackman <matthew@wellquite.org>
-- Maintainer : Andrea Rossato <andrea.rossato@unibz.it>,
-- Matthew Sackman <matthew@wellquite.org>
-- Stability : unstable
-- Portability : unportable
--
-- A module for accessing and manipulating the X Window mouse selection (used in copy and pasting).
-- getSelection and putSelection are adaptations of Hxsel.hs and Hxput.hs from XMonad-utils, available:
-- $ darcs get http://gorgias.mine.nu/repos/xmonad-utils
--
-- $ darcs get "http:\/\/gorgias.mine.nu\/repos\/xmonad-utils"
-----------------------------------------------------------------------------
{- $usage
Add 'import XMonadContrib.XSelection' to the top of Config.hs
Then make use of getSelection or promptSelection as needed; if
one wanted to run Firefox with the selection as an argument (say,
the selection is an URL you just highlighted), then one could add
to the Config.hs a line like thus:
, ((modMask .|. shiftMask, xK_b ), promptSelection "firefox")
TODO:
* Fix Unicode handling. Currently it's still better than calling
'chr' to translate to ASCII, though.
As near as I can tell, the mangling happens when the String is
outputted somewhere, such as via promptSelection's passing through
the shell, or GHCi printing to the terminal. utf-string has IO functions
which can fix this, though I do not know have to use them here. It's
a complex issue; see
<http://www.haskell.org/pipermail/xmonad/2007-September/001967.html>
and <http://www.haskell.org/pipermail/xmonad/2007-September/001966.html>.
* Possibly add some more elaborate functionality: Emacs' registers are nice.
-}
module XMonadContrib.XSelection (getSelection, promptSelection, putSelection) where
module XMonadContrib.XSelection (
-- * Usage
-- $usage
getSelection, promptSelection, putSelection) where
-- getSelection, putSelection's imports:
import Graphics.X11.Xlib (allocaXEvent, createSimpleWindow, defaultScreen, destroyWindow, internAtom, nextEvent, openDisplay, rootWindow, selectionNotify, Display(), Atom(), XEventPtr(), selectionRequest, sendEvent, noEventMask, sync)
@@ -49,8 +34,32 @@ import XMonad (io, spawn, X ())
-- decode's imports
import Foreign (Word8(), (.&.), shiftL, (.|.))
{- $usage
Add 'import XMonadContrib.XSelection' to the top of Config.hs
Then make use of getSelection or promptSelection as needed; if
one wanted to run Firefox with the selection as an argument (say,
the selection is an URL you just highlighted), then one could add
to the Config.hs a line like thus:
> , ((modMask .|. shiftMask, xK_b ), promptSelection "firefox")
TODO:
* Fix Unicode handling. Currently it's still better than calling
'chr' to translate to ASCII, though.
As near as I can tell, the mangling happens when the String is
outputted somewhere, such as via promptSelection's passing through
the shell, or GHCi printing to the terminal. utf-string has IO functions
which can fix this, though I do not know have to use them here. It's
a complex issue; see
<http://www.haskell.org/pipermail/xmonad/2007-September/001967.html>
and <http://www.haskell.org/pipermail/xmonad/2007-September/001966.html>.
* Possibly add some more elaborate functionality: Emacs' registers are nice.
-}
-- | Returns a String corresponding to the current mouse selection in X; if there is none, an empty string is returned.. Note that this is
-- only reliable for ASCII text and currently mangles/escapes more complex UTF-8 characters.
-- only reliable for ASCII text and currently mangles\/escapes more complex UTF-8 characters.
getSelection :: IO String
getSelection = do
dpy <- openDisplay ""
@@ -113,7 +122,7 @@ putSelection text = do
processEvent dpy ty text e
-- | A wrapper around getSelection. Makes it convenient to run a program with the current selection as an argument. This is convenient
-- for handling URLs, in particular. For example, in your Config.hs you could bind a key to 'promptSelection "firefox"'; this would allow you to
-- for handling URLs, in particular. For example, in your Config.hs you could bind a key to @promptSelection \"firefox\"@; this would allow you to
-- highlight a URL string and then immediately open it up in Firefox.
promptSelection :: String -> X ()
promptSelection app = spawn . ((app ++ " ") ++) =<< io getSelection