From d2be74e1feda72c7812365d14282b81a1538c2ef Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 28 Apr 2009 22:54:55 +0200 Subject: [PATCH] beautiful: set metatable correctly Signed-off-by: Julien Danjou --- lib/beautiful.lua.in | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/lib/beautiful.lua.in b/lib/beautiful.lua.in index 1f3d7d49b..48ab8b9b6 100644 --- a/lib/beautiful.lua.in +++ b/lib/beautiful.lua.in @@ -22,19 +22,12 @@ local capi = image = image } ---- Theme library +--- Theme library. module("beautiful") -- Local data local theme = {} ---- Get a value directly. --- @param key The key. --- @return The value. -function __index(self, key) - return theme[key] -end - --- Init function, should be runned at the beginning of configuration file. -- @param path The theme file path. function init(path) @@ -71,9 +64,9 @@ end --- Get the current theme. -- @return The current theme table. function get() - return _M + return theme end -setmetatable(_M, _M) +setmetatable(_M, { __index = function(t, k) return theme[k] end }) -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80