Re: [dwm] some useful changes

From: Anselm R. Garbe <arg_AT_suckless.org>
Date: Mon, 27 Nov 2006 17:51:58 +0100

On Mon, Nov 27, 2006 at 07:47:04PM +0300, Alex Elide wrote:
> On Mon, Nov 27, 2006 at 05:31:14PM +0100, Anselm R. Garbe wrote:
> > On Mon, Nov 27, 2006 at 02:17:07PM +0100, Sander van Dijk wrote:
> > > On 11/27/06, Enno Gottox Boland <gottox_AT_gmail.com> wrote:
> > > >I think this change make the whole configuration more weird. I never
> > > >used more than one function per key.
> > >
> > > I agree with the "more weird" part, it makes config.h less intuitive;
> > > writing a wrapper function really isn't that hard (people who don't
> > > know enough C to do that, probably will be confused by this
> > > configuration approach as well). I somehow find this approach to be
> > > below par compared to the rest of dwm.
> >
> > What do others think about the change?
> > Anyone likes the change? If not, I'd consider removing it
> > again...
> >
> > Regards,
> > --
> > Anselm R. Garbe >< http://suckless.org/~arg/ >< GPG key: 0D73F361
> ---end quoted text---
>
> I've just removed return statement in keypress handler.
>
> diff -r 70472540c443 event.c
> --- a/event.c Sun Nov 26 15:43:16 2006 +0100
> +++ b/event.c Sun Nov 26 20:51:46 2006 +0300
> @@ -256,7 +231,6 @@ keypress(XEvent *e) {
> {
> if(key[i].func)
> key[i].func(&key[i].arg);
> - return;
> }
> }
> }
>
> so, I can write
>
> static Key key[] = { \
> /* skipped */ \
> { ctrl, XK_1, tag, { .i = 0 } }, \
> { ctrl, XK_1, view, { .i = 0 } }, \
> { ctrl, XK_2, tag, { .i = 1 } }, \
> { ctrl, XK_2, view, { .i = 1 } }, \
> /* skipped */ \
> };
>
> in my config.h and it works fine for me.

Hah, that's a nice trick, agreed, I remove that return and
people can use what they like! Thank you!

Regards,

-- 
 Anselm R. Garbe >< http://suckless.org/~arg/ >< GPG key: 0D73F361
Received on Mon Nov 27 2006 - 17:51:58 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:32:51 UTC