Tuomo Valkonen wrote:
In other words, can I set the complection table from outside the callback function to pass to mod_query.query?

No.

Indeed, I had a look to wedl_do_call_completor()...

so the only work around with:
mod_query.query(mplex, TR("Prompt: "), nil, hanlder, history_completor,
"lua")
would be something like this...
I'm posting that in the hope it could be helpful.
I think I'm going to rewrite the script I was referring before.
Thanks for your kind attention.
Andrea

code follows:

defbindings("WEdln", {
               kpress("Mod1+w", "toggle_compl(_)"),
            }
         )
local Mycompl1 = {
   [1] = "ciao",
   [2] = "ciaociao",
}
local Mycompl2 = {
   [1] = "dove",
   [2] = "dovedove",
}
local compl = 1
function toggle_compl(mplex)
   if compl == 1 then
      compl = 2
   else compl = 1 end
   WEdln.complete(mplex)
end
function history_completor(...)
   if compl == 1 then
      arg[1]:set_completions(Mycompl1)
   else
      arg[1]:set_completions(Mycompl2)
   end
end


Reply via email to