aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Layout/Named.hs
diff options
context:
space:
mode:
authorAnders Engstrom <ankaan@gmail.com>2010-04-01 23:24:03 +0200
committerAnders Engstrom <ankaan@gmail.com>2010-04-01 23:24:03 +0200
commitc4637cc12c0b64fed0b515f1026681464efe7ab3 (patch)
tree17b7f7129d480a3574caa4f265e36794e3f28ead /XMonad/Layout/Named.hs
parent1e216e1cafbb2f0912f5ff81ea9a52e5bc29ed4e (diff)
downloadXMonadContrib-c4637cc12c0b64fed0b515f1026681464efe7ab3.tar.gz
XMonadContrib-c4637cc12c0b64fed0b515f1026681464efe7ab3.tar.xz
XMonadContrib-c4637cc12c0b64fed0b515f1026681464efe7ab3.zip
X.L.Named deprecate and implement using X.L.Renamed
Ignore-this: a74963ef4990c9e845b9142b8648cf26 nameTail behaves slightly different if there are whitespace before the first word or the name contains tabs or other such whitespace. But I expect few users are affected since the only usecase where nameTail is actually needed is to remove automatically added prefixes. These prefixes will be removed as they should by the new implementation. darcs-hash:20100401212403-8978f-756f76fe1fd7128f020c4527e44d0e03529d5d41.gz
Diffstat (limited to 'XMonad/Layout/Named.hs')
-rw-r--r--XMonad/Layout/Named.hs31
1 files changed, 12 insertions, 19 deletions
diff --git a/XMonad/Layout/Named.hs b/XMonad/Layout/Named.hs
index 54071d9..25ae437 100644
--- a/XMonad/Layout/Named.hs
+++ b/XMonad/Layout/Named.hs
@@ -10,7 +10,8 @@
-- Stability : unstable
-- Portability : unportable
--
--- A module for assigning a name to a given layout.
+-- A module for assigning a name to a given layout. Deprecated, use
+-- "XMonad.Layout.Renamed" instead.
--
-----------------------------------------------------------------------------
@@ -21,8 +22,8 @@ module XMonad.Layout.Named
nameTail
) where
-import XMonad
import XMonad.Layout.LayoutModifier
+import XMonad.Layout.Renamed
-- $usage
-- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@:
@@ -38,22 +39,14 @@ import XMonad.Layout.LayoutModifier
-- For more detailed instructions on editing the layoutHook see:
--
-- "XMonad.Doc.Extending#Editing_the_layout_hook"
+--
+-- Note that this module has been deprecated and may be removed in a future
+-- release, please use "XMonad.Layout.Renamed" instead.
--- | Rename a layout.
-named :: String -> l a -> ModifiedLayout Named l a
-named s = ModifiedLayout (Named s)
-
-data Named a = Named String deriving ( Read, Show )
-
-instance LayoutModifier Named a where
- modifyDescription (Named n) _ = n
-
-
--- | Remove the first word of the name.
-nameTail :: l a -> ModifiedLayout NameTail l a
-nameTail = ModifiedLayout NameTail
-
-data NameTail a = NameTail deriving (Read,Show)
+-- | (Deprecated) Rename a layout.
+named :: String -> l a -> ModifiedLayout Rename l a
+named s = renamed [Replace s]
-instance LayoutModifier NameTail a where
- modifyDescription NameTail i = dropWhile (==' ') $ dropWhile (/=' ') $ description i
+-- | (Deprecated) Remove the first word of the name.
+nameTail :: l a -> ModifiedLayout Rename l a
+nameTail = renamed [CutWordsLeft 1]