From e0730d0da80a878c47b18942054a3fe91d727f2d Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 3 Nov 2008 23:15:00 +0100 Subject: [PATCH] awful.client: deprecate swap() Signed-off-by: Julien Danjou --- lib/awful/client.lua.in | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/awful/client.lua.in b/lib/awful/client.lua.in index 8294bad4..d91ce019 100644 --- a/lib/awful/client.lua.in +++ b/lib/awful/client.lua.in @@ -13,6 +13,7 @@ local ipairs = ipairs local table = table local math = math local otable = otable +local setmetatable = setmetatable local capi = { client = client, @@ -343,7 +344,7 @@ end --- Swap a client by its relative index. -- @param i The index. -- @param c Optional client, otherwise focused one is used. -function swap(i, c) +function swap.byidx(i, c) local sel = c or capi.client.focus local target = next(i, sel) if target then @@ -351,6 +352,13 @@ function swap(i, c) end end +-- Compatibility +local function __swap(self, i, c) + util.deprecate() + swap.byidx(i, c) +end +setmetatable(swap, { __call = __swap }) + --- Get the master window. -- @param screen Optional screen number, otherwise screen mouse is used. -- @return The master window.