-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Am 13.07.2010 13:35, Aneesh Kumar wrote:
> With the attached patch we should be able to have a minimal dynamic
> tagging feature set.

Depends on what one considers "minimal", but ok...

> This is the last patch in the mail thread i mentioned in previous
> mail. I just added find_fallback function to this patch

So you took the patch from Perry and changed it? No idea what to do with the
author info in this case, but if no one complains (=Perry?), I guess I'm OK 
with it.

> +--- Find a suitable fallback tag.
> +-- @param screen The screen number to look for a tag on. [mouse.screen]
> +-- @param target A table of tags we consider unacceptable. [{selected()}]
> +function find_fallback(screen, invalids)
> +    local scr = screen or capi.mouse.screen
> +    local t = invalids or {selected()}

This should be "selectedlist(scr)" instead of "{selected()}" IMO. (Same for the
comment in the argument)

> +    -- Abort if we would have un-tagged clients.
> +    local clients = target_tag:clients()
> +    if #clients > 0 and ntags == 1 then return end

Could you turn this into "ntags <= 1"? It doesn't make sense to delete a tag if
there is none, but while we are at it, we can try to make this twice as
bullet-proof as possible. ;)

[...]
> +    -- Move the clients we can off of this tag.
> +    for _, c in pairs(clients) do
> +
> +        -- If a client has only this tag, or stickied clients with
> +        -- nowhere to go, abort.
> +        if (not c.sticky and #c:tags() == 1) or
> +                                    (c.sticky and fallback_tag == nil) then
> +            return
> +        else
> +            c:tags({fallback_tag})
> +        end
> +    end

What if fallback_tag == nil and the client is not sticky? It won't be attached
to any tags after this.

Which makes me wonder... Can that happen at all? The only way for fallback_tag
to be nil is because find_fallback() found nothing. This can only happen if
there is no other tag on this screen, but there was an "if" above which checked
for this already, no?

[...]

Cheers,
Uli

- -- 
- - Buck, when, exactly, did you lose your mind?
- - Three months ago. I woke up one morning married to a pineapple.
  An ugly pineapple... But I loved her!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEcBAEBCAAGBQJMPJ2SAAoJECLkKOvLj8sGtgwIALSt53TgtDnQhSATlOwUk1br
kkpczzUMBXLFfgHQwDFI3ZSOX2vzyCWeJ6MYzt9xBwQMIn3b3yUPH9ykx0Bu1vA/
zdiSuZ4LzXnGaKOS9xg6Ikc8gi1LkG7adiQT8p69+l4Wir6O37CJWWZRE3vkCXZf
Va7DiSzqdSHxPOtIX7vAGoDQL0cP9mTiP1MWK8XExl8JOj93Zc89nHwXt8nJDDb+
78cueWWHroa9qJZdGr7j/Th4BhzXSiY0odWiRDLoDF0AayBaSkken/aF1wuM/1/5
94NBuyzLpg0zR+cqLZ6JfneE+6I0OjsPMxj49CqzgVjeSxifIMk7d8OvWjw2z0I=
=eaGG
-----END PGP SIGNATURE-----

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

Reply via email to