]> git.decadent.org.uk Git - ion3.git/blobdiff - mod_query/mod_query.lua
Imported Upstream version 20090110
[ion3.git] / mod_query / mod_query.lua
index 3685adedf95c5fc86c7ad6a7f95f171014669e3d..bd3414bd95764cd5c6d62147d9181e4af0e44d18 100644 (file)
@@ -1,7 +1,7 @@
 --
 -- ion/query/mod_query.lua -- Some common queries for Ion
 -- 
--- Copyright (c) Tuomo Valkonen 2004-2008.
+-- Copyright (c) Tuomo Valkonen 2004-2009.
 -- 
 -- See the included file LICENSE for details.
 --
@@ -65,9 +65,10 @@ function mod_query.query(mplex, prompt, initvalue, handler, completor,
         wedln:complete('prev', 'normal')
     end
 
-    -- Check that no other queries are open in the mplex.
-    local ok=mplex:managed_i(function(r) 
-                                 return not obj_is(r, "WEdln") 
+    -- Check that no other queries or message boxes are open in the mplex.
+    local ok=mplex:managed_i(function(r)
+                                 return not (obj_is(r, "WEdln") or
+                                             obj_is(r, "WMessage"))
                              end)
     if not ok then
         return
@@ -1027,6 +1028,7 @@ function mod_query.do_handle_lua(mplex, env, code)
     local print_res
     local function collect_print(...)
         local tmp=""
+        local arg={...}
         local l=#arg
         for i=1,l do
             tmp=tmp..tostring(arg[i])..(i==l and "\n" or "\t")