On Wed, Jul 07, 2004 at 02:28:23AM +1000, Scott Smedley wrote:
>Hi Norman,
>
>> About a month ago, I sent in a patch to allow multiple window names in
>> conditions.
>
>I think being able to specify multiple windows in conditions is very
>useful.
>
>It's 2:30am ... let me see if I understand your patch correctly:
>
>If you have:
>
>Next (mozilla dillo netscape) Function ...
>
>The relationship b/w mozilla, dillo & netscape is a LOGICAL OR.
>
>but if I have:
>
>Next (!mozilla !dillo !netscape) Function ...
>
>the relationship is a LOGICAL AND.
>
>Have I got that right?

Yes.


>If I have, I'm concerned users might get confused. (I'm sure other
>people edit their .fvwm2rc at 2:30am too! :)

If you think that's confusing, think about what happens if there's
a mixture of inverted (with '!') and non-inverted window names.
The line:

Next (a !b c !d) Function ...

means "(a OR c) AND NOT b AND NOT d".

This isn't anything I'd plan to use; it's just a side effect of
the way I implemented it.

In any case, point taken: it'd be easier to do this right than to
repeatedly explain to users why it was done in a half-assed way.
To me, "right" means a full-blown boolean expression parser, with
AND, OR, NOT, and parentheses.  In coding, it'd probably be best to
make the individual conditions (the leaf nodes of the parse tree)
be the entire WindowConditionMask structure, not just the window
name, so that conditions like "CurrentScreen" and "Raised" could be
used as part of the boolean expression.  I think that could still
be backward-compatible with current .fvwm2rc files; the current
implicit operator for conditions like "CurrentScreen" is "AND", and
that could be preserved.  I don't think parentheses inside the
expression have any current meaning, nor do "&" (AND) or "|" (OR);
and "!" (NOT) could keep its current meaning.  A recursive-descent
parser for boolean expressions isn't that big a deal to write.  But
as my current patch satisfies my own needs, I'd write such a parser
only if it'd be accepted into the mainline fvwm code.
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [EMAIL PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]

Reply via email to