Skip to content

Commit

Permalink
Merge pull request #852 from liskin/renamed-named
Browse files Browse the repository at this point in the history
X.L.Renamed: Provide "named" convenience alias
  • Loading branch information
slotThe authored Dec 18, 2023
2 parents e75eb16 + 92a7c03 commit 0fe948f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
4 changes: 0 additions & 4 deletions XMonad/Layout/Named.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
5 changes: 5 additions & 0 deletions XMonad/Layout/Renamed.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
module XMonad.Layout.Renamed ( -- * Usage
-- $usage
renamed
, named
, Rename(..) ) where

import XMonad
Expand All @@ -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
Expand Down

0 comments on commit 0fe948f

Please sign in to comment.