mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-07-28 02:31:51 -07:00
X.L.Renamed: Provide "named" convenience alias
I believe this common use-case for the deprecated X.L.Named should still
be provided somewhere, rather than telling everybody to let-define this
themselves.
The other one – `nameTail` – only has about 6 uses in publicly available
configs (https://github.com/search?q=nameTail+path%3Axmonad&type=code),
so I'm not adding that one but I'm happy to be convinced to add it too.
Related: 3bf9d80c40
("XMonad.Layout.Named: Deprecate")
This commit is contained in:
@@ -68,7 +68,8 @@
|
||||
|
||||
* `XMonad.Layout.Named`
|
||||
|
||||
- Deprecated the entire module, use `XMonad.Layout.Renamed` instead.
|
||||
- Deprecated the entire module, use `XMonad.Layout.Renamed` (which newly
|
||||
provides `named` for convenience) instead.
|
||||
|
||||
* `XMonad.Actions.SinkAll`
|
||||
|
||||
|
@@ -44,10 +44,6 @@ import XMonad.Layout.Renamed
|
||||
-- Note that this module has been deprecated and may be removed in a future
|
||||
-- release, please use "XMonad.Layout.Renamed" instead.
|
||||
|
||||
-- | (Deprecated) Rename a layout.
|
||||
named :: String -> l a -> ModifiedLayout Rename l a
|
||||
named s = renamed [Replace s]
|
||||
|
||||
-- | (Deprecated) Remove the first word of the name.
|
||||
nameTail :: l a -> ModifiedLayout Rename l a
|
||||
nameTail = renamed [CutWordsLeft 1]
|
||||
|
@@ -19,6 +19,7 @@
|
||||
module XMonad.Layout.Renamed ( -- * Usage
|
||||
-- $usage
|
||||
renamed
|
||||
, named
|
||||
, Rename(..) ) where
|
||||
|
||||
import XMonad
|
||||
@@ -40,6 +41,10 @@ import XMonad.Layout.LayoutModifier
|
||||
renamed :: [Rename a] -> l a -> ModifiedLayout Rename l a
|
||||
renamed = ModifiedLayout . Chain
|
||||
|
||||
-- | Rename a layout. (Convenience alias for @renamed [Replace s]@.)
|
||||
named :: String -> l a -> ModifiedLayout Rename l a
|
||||
named s = renamed [Replace s]
|
||||
|
||||
-- | The available renaming operations
|
||||
data Rename a = CutLeft Int -- ^ Remove a number of characters from the left
|
||||
| CutRight Int -- ^ Remove a number of characters from the right
|
||||
|
Reference in New Issue
Block a user