> > Well, I agree it needs to be destroyed eventually but the issue is that
> > if a user thinks of the client as being set to [read from] a keytable
> > with a name then they will likely think binding a key into a keytable of
> > that name will be the same table even if the bind happens after the set.
> 
> This will still work if the key table is a pointer, both the bind and
> the set will use the same key table.
> 
> Or are you thinking of creating the table after running the set command?
> This shouldn't work - you shouldn't be able to set a client to a
> nonexistent table.

I guess I don't super care what happens since I won't personally be
writing any switch-client -T into an empty table but I had assumed we
would allow switching to a new [and ephemeral] table since otherwise
switch-client -T can fail which just seems weird to me.

In many ways it is a different view of things.  I was thinking of key
bindings as now indexed by the table and the key rather than just the
key whereas the direction this patch is heading is that the table itself
as a map is an exposed part of the model rather than an implementation
detail.

That said, reiterate your commitment once more to failing switch-client
-T into an empty table and I'm happy to do it.

> > My opinion about safety is completely countered by ref counting (it was
> > the final unbind's deletion having to know about and clean up
> > outstanding references from clients that was worrying me) and the
> > weirdness with stale keytables of duplicate names isn't that big of a
> > deal for the sanity we're gonna save in code.
> 
> They don't need to know about the specific references from clients, they
> can check every client in the clients list. All clients will be in the
> list and nobody will have more than at most a few hundred so walking
> them all would be fine.
> 
> Or reference counting the tables would work too if you prefer.

Reference counting it is for sure.  Performance wasn't really my
concern, the spooky ownership-at-a-distance was.  It just seems fragile
for clients to hold a reference they don't really own and have the
actual owner (key-bindings.c) have to be aware of these extra
references.  With reference counting it's entirely moot though.

Keith

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to