|
From: | Johannes Altmanninger |
Subject: | Re: [RP] select patch |
Date: | Thu, 19 Jun 2014 13:00:36 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 |
Thanks for your response, I sometimes have multiple browser windows open, and some programs like gimp spawn multiple windows with the same name, when I have lots if windows open, this comes in handy as I do not have to remember the window number or cycle through all with next/previous. From what I understood, I can use somthing like strncmp(a,b,40) for the exact match and strncmp(a,b,strlen(a)) for the prefix match. Will this work as expected? strnlen() seems to be a GNU extension and I don't want to break compability with other libcs In this case strlen(a) should be safe as it is used in the parent function cmd_select() (a is the argument for the select function). Merging the two blocks will be sensible of course once we agree on how to implement it. Now I think there are three options how to implement my idea The behavior is a bit odd, of course. But the default select does depend on the order too: It selects the first matching name. - Make a new function - I don't like this because it would increase redundancy (I would just copy the majority of the current cmd_select()) - Make cmd-select() accept an additional bitmask or so, so that it could vary its behaviour, then bind ("select", "select-next", ...) to those - I don't know if this is possible, seems a bit hacky - Add a new ratpoison setting ("selectstyle") to control its behavior The last is my favourite option because it seems like it will give more flexibility while (probably) not needing much SLOC. For example it could be a bitmask like this: the first bit decides if we want to select the first(presumably the oldest) or last(youngest) window in the list the second one if it should cycle through the matching windows (etc) Best Regards, Johannes Altmanninger On 06/18/2014 08:51 PM, Jeff Abrahamson
wrote:
|
[Prev in Thread] | Current Thread | [Next in Thread] |