mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -07:00
X.L.Named deprecate and implement using X.L.Renamed
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.
This commit is contained in:
parent
5b045e458d
commit
96f3456b96
@ -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)
|
||||
-- | (Deprecated) Rename a layout.
|
||||
named :: String -> l a -> ModifiedLayout Rename l a
|
||||
named s = renamed [Replace 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)
|
||||
|
||||
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]
|
||||
|
Loading…
x
Reference in New Issue
Block a user