Re: window-matcher avoid . nil

Am Sat, 30 Oct 2010 17:08:22 -0500
schrieb Jeremy Hankins <nowan nowan org>:

> Christopher Roy Bratusek <zanghar freenet de> writes:
> > Hi all,
> >
> > I've been playing around with window-matcher avoid . nil and this is what I
> > have:
> Well, I played a bit with this.  These work as you'd expect, without
> applying your patch:
> (add-window-matcher 'WM_CLASS "^Pager/pager$"
>                     `(avoid . ,nil))
> (add-window-matcher 'WM_CLASS "^Pager/pager$"
>                     '(avoid . ()))
> But this doesn't:
> (add-window-matcher 'WM_CLASS "^Pager/pager$"
>                     '(avoid . nil))
> The problem is that with that last matcher the avoid property gets the
> value 'nil (i.e., the *symbol* nil) as opposed to '(), which is what nil
> (unquoted) evaluates to.

Good catch. Another thing I've found: SawfishConfig does not write (avoid . nil)
,or whatever, it writes (avoid . #f) to .sawfish/custom, so I guess that's why it can't be
set from the UI. #f in scheme-boolean.jl seems fine, it just needs to be "translated"
before writing, just as #t is.
> This was a bit of a surprise.  I'm not a lisp expert by any means, but
> in the only other lisp variant I'm much familiar with (emacs lisp) this
> evaluates to true:
> (eq nil 'nil)
> But in rep it's false. 

I expect it to be false, nil is boolean false, and 'nil is the symbol nil.

> I was wondering if I was going crazy tracing
> through the window-avoided-p definition until I realized that sometimes
> (window-get w 'avoid) returned "nil" and sometimes "()".

So… with a timer, nil is just fine. rep is sometimes a bit strange. ;)

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]