Subject: simplify styles list

From: Olivier Chapuis <[email-masked]>
Date: Sat, 14 Jun 2003 19:04:51 +0200

Hello,

My "WindowStyle" patch leads me to study the __simplify_style_list
function.

Here some possible amelioration:

1 - style name compatibility:

Example:

Style abc* options1
Style hop* options2
Style abc* options3

with options2 flags-inter options3 not empty. This is not simplified,
but as no window can match both abc* and hop*, in fact this can
be simplified to 

Style hop* options1
Style abc* merge(options1, option2)

The point is to write down a efficent algo for: given two pattern p1
and p2, decides whether there exists a string which matchs both p1 and
p2. I've done this.

2 - string matching sets inclusion 

Style hop options1
Style hop* option2

where options1 is a "flags-subset" of options2. This is not simplified
but as every string which match hop match hop*, this can be
simplified to

Style hop* option2

Again the point is to write down an efficient algo for: given two patterns
p1 and p2, decides whether all string which match p1 match also p2.
I should write this ...

3 - Upward simplification

Example:
 
Style * SloppyFocus
Style toc ClickToFocus
Style * NoIcon

is not simplified into:

Style * SloppyFocus, NoIcon
Style toc ClickToFocus

This type of case are easy to handle.

Any comments?

Olivier, Regards
--
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-masked].
To report problems, send mail to [email-masked]

---

From: Mikhael Goikhman <[email-masked]>
Date: Sat, 14 Jun 2003 18:37:34 +0000

> and p2, decides whether there exists a string which matchs both p1 and

The problem here is that it is easy to create a window that matches both
"abc*" and "hop*".  xterm -class abc -title hop

> p1 and p2, decides whether all string which match p1 match also p2.

I suppose the second pattern may be also "ho*", "h*" or "*".
This seems to be safe simplification.

> This type of case are easy to handle.

This seems to be safe simplification too.
I.e. it is safe to move any style entry with some flags down or up
through all style entries not containing these style flags.

Regards,
Mikhael.

---

From: Olivier Chapuis <[email-masked]>
Date: Sun, 15 Jun 2003 08:01:26 +0200

> "abc*" and "hop*".  xterm -class abc -title hop

Ooops, yes this simplification was stupid.

Regards, Olivier

---

From: Olivier Chapuis <[email-masked]>
Date: Sun, 15 Jun 2003 18:58:35 +0200

> Ooops, yes this simplification was stupid.

Note however that this logic can be applied in between WindowStyle
style ... 

Regards, Olivier