Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X.L.Renamed: Provide "named" convenience alias #852

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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