X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=ioncore%2Fioncore_misc.lua;h=a392c5344e99a6197214f5672d325d72d1f69e68;hb=214381793227e299ae1e72caa24ad2cfde029ef1;hp=4637279d798fa7c108b32a97a6c4ae58927b3f53;hpb=de22e45179cb3bafa490294d31d47f361047a30a;p=ion3.git diff --git a/ioncore/ioncore_misc.lua b/ioncore/ioncore_misc.lua index 4637279..a392c53 100644 --- a/ioncore/ioncore_misc.lua +++ b/ioncore/ioncore_misc.lua @@ -3,10 +3,7 @@ -- -- Copyright (c) Tuomo Valkonen 2004-2007. -- --- Ion is free software; you can redistribute it and/or modify it under --- the terms of the GNU Lesser General Public License as published by --- the Free Software Foundation; either version 2.1 of the License, or --- (at your option) any later version. +-- See the included file LICENSE for details. -- local group_tmpl = { type="WGroupWS" } @@ -85,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 @@ -95,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