]> git.decadent.org.uk Git - ion3.git/blobdiff - ioncore/ioncore_misc.lua
Add 20080207-1.
[ion3.git] / ioncore / ioncore_misc.lua
index 17817659ff5a3af12f153570f443c37acdce2d54..dde914ecc7cef299c21ccda3e3955b9ce5c8c921 100644 (file)
@@ -1,7 +1,7 @@
 --
 -- ion/share/ioncore_misc.lua
 -- 
--- Copyright (c) Tuomo Valkonen 2004-2007.
+-- Copyright (c) Tuomo Valkonen 2004-2008.
 --
 -- See the included file LICENSE for details.
 --
@@ -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