Julien Danjou <[email protected]> writes:

Hi Julien,
> Try something like this:
>
> function switch_to_tag(tag)
>     for k, v in ipairs(tags)
>         if v == tag then
>             break
>         end
>     end
>     -- Now k is the index of the tag in the array 'tags`
>     switch_to_tag_by_number(k)
> end

That didn't work, because the tags table has a little different
structure, but it put me on the right track.  Now I use

--8<---------------cut here---------------start------------->8---
function switch_to_tag (tag)
   for s, v in ipairs(tags) do
      for num, t in ipairs(v) do
         if t == tag then
            switch_to_tag_by_number(num)
            return
         end
      end
   end
end
--8<---------------cut here---------------end--------------->8---

which does what I want.  Thanks a lot!

Bye,
Tassilo

-- 
To unsubscribe, send mail to [email protected].

Reply via email to