X-Git-Url: https://git.decadent.org.uk/gitweb/?p=ion3.git;a=blobdiff_plain;f=ioncore%2Fioncore_misc.lua;h=7dc63535b1c00cd31a43dd000cff177d3ba5f9b3;hp=17817659ff5a3af12f153570f443c37acdce2d54;hb=e3aec18706513a87eaa7839dfdaf7e0fcd0d8d2a;hpb=ae4260bb64817c11f9a7140324cd3e3ba113e297 diff --git a/ioncore/ioncore_misc.lua b/ioncore/ioncore_misc.lua index 1781765..7dc6353 100644 --- a/ioncore/ioncore_misc.lua +++ b/ioncore/ioncore_misc.lua @@ -1,7 +1,7 @@ -- -- ion/share/ioncore_misc.lua -- --- Copyright (c) Tuomo Valkonen 2004-2007. +-- Copyright (c) Tuomo Valkonen 2004-2009. -- -- See the included file LICENSE for details. -- @@ -22,7 +22,7 @@ local layouts={ -- attach/creation parameters given in \var{tab}. The layout -- "empty" may not be defined. function ioncore.deflayout(name, tab) - assert(layout ~= "empty") + assert(name ~= "empty") if name=="default" and not tab then layouts[name] = empty @@ -73,7 +73,7 @@ end --DOC -- gettext+string.format function ioncore.TR(s, ...) - return string.format(ioncore.gettext(s), unpack(arg)) + return string.format(ioncore.gettext(s), ...) end @@ -82,7 +82,10 @@ end -- depends on the types of attached regions and whether \var{reg} -- implements \code{attach_framed} and \code{attach}. If \var{param} -- is not set, the default of \verb!{switchto=true}! is used. +-- The function returns \code{true} if all tagged regions were +-- succesfully attached, and \code{false} otherwisse. function ioncore.tagged_attach(reg, param) + local errors=false if not param then param={switchto=true} end @@ -92,9 +95,9 @@ function ioncore.tagged_attach(reg, param) or reg.attach) if not (fn and fn(reg, r, param)) then - return false + errors=true end end - return true + return not errors end