Hi, On Sun, Jun 03, 2012 at 07:59:06PM +0100, Thomas Adam wrote: > So some observations/ideas (in no particular order): > > * I don't like the free() callbacks to each cmd-choose-* file. Ideally we > should probably look at centralising these where appropriate, perhaps in > window_choose_free()? > > * I am unsure if I've broken the reference counting on ctx->curclient and > ctx->curclient->session in each of the choose-* commands. > > There's probably more, but I can't think of it. Oh, this applies directly
Here's some more: * We currently keep "struct format_tree" around in "struct window_choose_data", far longer than we need it -- that is, past the point of us having called format_expand() -- it eventually gets free()d in the callback function for the choose command. Not sure if it's worth throwing it away in window_choose_add()? * Related to this is "struct window_choose_mode_item" -- I think this should probably go away, and instead, we can move the "name" member (which is nothing more than the result of format_expand()) directly inside "struct window_choose_data", and have an array of window_choose_data structs instead: struct window_choose_mode_data { struct screen screen; struct mode_key_data mdata; ARRAY_DECL(, struct window_choose_data) list; ... }; Then in window_choose_add() we can assign wcd->name the result of format_expand() directly. Note that I'm keen to leave the responsibility of expanding the format_tree when adding items to the list and not before -- especially if we split out the functionality of: window_choose_add_window(); window_choose_add_session(); But at this point, I'm still thinking if that's a good idea. I suspect it will be, if all it does is return information specific to the format template for windows/sessions, etc. Kindly, -- Thomas Adam -- "Deep in my heart I wish I was wrong. But deep in my heart I know I am not." -- Morrissey ("Girl Least Likely To" -- off of Viva Hate.) ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users