Subject: fvwm24_convert needs update

From: Dominik Vogt <[email-masked]>
Date: Sun, 18 Mar 2001 15:45:01 +0100

The fvwm24_convert script does not handle the new placement style
names yet.  Also, some of the GlobalOpts options are not
converted.  The conversion tables are in the man page, but
implementing them will be tricky because there is no one to one
mapping between the new styles/globalopts.

I'd do this myself, but I have never written a perl script.

Bye

Dominik ^_^  ^_^

--
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
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: Dan Espen <[email-masked]>
Date: Sun, 18 Mar 2001 09:56:26 -0500

Dominik Vogt <[email-masked]> writes:
> names yet.

Which commands are you referring to?
It looks like we have SmartPlacementIsReallySmart, etc.

> Also, some of the GlobalOpts options are not

I thought I got them all, which options do you mean?

Note that options that didn't change name like
WindowShadeShrinks, just get converted without being explicitly listed
in the script.

> I'd do this myself, but I have never written a perl script.

I'm still at the beginner stage, I use the man pages
quite a bit as I write.  I'd say its certainly worth learning.
I find that I get to a certain point with sed, awk, or sh and it becomes
clear that something better is needed.  Perl usually does the job.

The first hint I have is never try to understand that bootstrap
stuff you sometimes find at the top of the file.

--
Dan Espen
444 Hoes Lane  Room RRC 1C-214           E-mail: [email-masked]
Piscataway, NJ 08854                     Phone: (732) 699-5570
--
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: Dominik Vogt <[email-masked]>
Date: Sun, 18 Mar 2001 17:29:44 +0100

> It looks like we have SmartPlacementIsReallySmart, etc.

  Style ... MinOverlapPlacement
  Style ... ManualPlacement
  Style ... TileManualPlacement

and so on.  Here is the conversion table from the man page:

  GlobalOpts SmartPlacementIsReallySmart
  Style * SmartPlacement
becomes
  Style * SmartPlacement, CleverPlacement
  
  Global SmartPlacementIsNormal
  Style * SmartPlacement
becomes
  Style * SmartPlacement, CleverPlacementOff
  
  Style * DumbPlacement, RandomPlacement
becomes
  Style * CascadePlacement
  
  Style * DumbPlacement, ActivePlacement
becomes
  Style * ManualPlacement
  
  Style * SmartPlacement + RandomPlacement + CleverPlacementOff
becomes
  Style * TileCascadePlacement
  
  Style * SmartPlacement + ActivePlacement + CleverPlacementOff
becomes
  Style * TileManualPlacement
  
  Style * SmartPlacement + CleverPlacement
becomes
  Style * MinOverlapPlacement
  
  Style * SmartPlacement, ActivePlacement, CleverPlacement
becomes
  Style * MinOverlapPercentPlacement

  Style * ActivePlacementsHonorsStartsOnPage
becomes
  Style * ManualPlacementsHonorsStartsOnPage

  Style * ActivePlacementsHonorsStartsOnPageOff
becomes
  Style * ManualPlacementsHonorsStartsOnPageOff

I'm not sure how we can possibly convert from mutliple old style
names into a single new style name without building the whole
syntax of the file into the script.  The problem is that the
styles may appear on separate lines or even in functions, or
menus that define functions that define menus that define
functions and so on.

> WindowShadeShrinks, just get converted without being explicitly listed

Ah, okay, I missed that point.  But still, some options are
converted incorrectly to the old style names, e.g.

  GlobalOpts ActivePlacementHonorsStartsOnPage

is converted to

  Style * ActivePlacementHonorsStartsOnPage

but should be converted to

  Style * ManualPlacementHonorsStartsOnPage

> clear that something better is needed.  Perl usually does the job.

Ah, with zsh I rarely see a need for a more complex language.
It's so powerful! :-)

Bye

Dominik ^_^  ^_^

---

From: Dan Espen <[email-masked]>
Date: Sun, 18 Mar 2001 14:12:37 -0500

>   Style ... TileManualPlacement

I don't see anything like this is 2.2.5.

The conversion script is primarily for users moving from a 2.2.x official
release to a 2.4.x official release.  Users using beta releases are
supposed to be able to handle the changes themselves.

>   Style * SmartPlacement, CleverPlacement

This one seems to be handled.  It doesn't check for SmartPlacement,
but it does do the conversion of SmartPlacementIsReallySmart.

>   Style * SmartPlacement, CleverPlacementOff

Theres another place in the man page where is shows:

GlobalOpts SmartPlacementIsNormal
  -->
Style * TileCascadePlacement

The script converts it to SmartPlacement, so the man page
must have shown that at one time.

The script was written by copying the man page into the script
and making changes.

Oh, I see now, first the GlobalOpts are shown as being converted
to Styles, and now some of the placement styles are changed too.

I changed it to convert SmartPlacementIsNormal to TileCascadePlacement.
...

> menus that define functions that define menus that define

I could set up something that attempted to
recognize back to back commands, and only write out the
the new command when something else intervened, but I think
some of the stuff you are concerned with appeared during betas.
I don't think we have to worry about that stuff.

>   Style * ManualPlacementHonorsStartsOnPage

Done.

---

From: Dominik Vogt <[email-masked]>
Date: Thu, 22 Mar 2001 03:16:23 +0100

It would be nice if the script detected the old FvwmButtons panel
syntax and printed a message that points to the section about
converting the config in the FvwmButtons man page.

Bye

Dominik ^_^  ^_^

---

From: Dan Espen <[email-masked]>
Date: Wed, 21 Mar 2001 20:30:06 -0500

> converting the config in the FvwmButtons man page.

The only way I can see to detect them would be to look for:

/^[*]FvwmButtonsPanel /

But with aliases, this becomes:

/^[*]*Panel /

so I guess it could issue a warning.  What do you think?

---

From: Dominik Vogt <[email-masked]>
Date: Thu, 22 Mar 2001 03:56:43 +0100

> But with aliases, this becomes:

I don't know the way you write regexps in perl, but I think this
would be the correct one:

  ^[[:space:]]*[*].*[pP][aA][nN][eE][lL]

(Are spaces before the asterisk allowed?)

> so I guess it could issue a warning.  What do you think?

That must suffice.  We can't hope to convert the config
automatically anyway.

Bye

Dominik ^_^  ^_^

---

From: Dan Espen <[email-masked]>
Date: Wed, 21 Mar 2001 21:56:22 -0500

> (Are spaces before the asterisk allowed?)

No, no space is allowed.  Line 942, functions.c.

This makes more sense:

/^[*]\S+PANEL /i

the i after // is for case insensitive.
the // is for matching.
then * in col 1
\S is non-whitespace
+ is one or more
then "panel" in any case, followed by a space.

Ok, I admit it, I did "man perlre".

---

From: Dominik Vogt <[email-masked]>
Date: Thu, 22 Mar 2001 10:59:23 +0100

> No, no space is allowed.  Line 942, functions.c.

Actually, spaces *are* allowed.  Try it out:

  " *FvwmIdentFont 5x7"

works.  Don't try to understand the code :-)

> /^[*]\S+PANEL /i
              ^^^

A space is not required here.  You could image something like

  *FvwmButtons(Title foo, Panel"" foo)
                               ^^

That would make it

  /^\s*[*]\S+PANEL/i

I'll commit that change.

Bye

Dominik ^_^  ^_^

--
Dominik Vogt, email: [email-masked]
LifeBits Aktiengesellschaft, Albrechtstr. 9, D-72072 Tuebingen
fon: ++49 (0) 7071/7965-0, fax: ++49 (0) 7071/7965-20
--
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: Dan Espen <[email-masked]>
Date: Thu, 22 Mar 2001 08:02:33 -0500

>   *FvwmButtons(Title foo, Panel"" foo)

I think a quote there is unlikely, but:

   /^\s*[*]\S+PANEL[ \t"']i

would cover it.

---

From: Dominik Vogt <[email-masked]>
Date: Thu, 22 Mar 2001 14:14:54 +0100

> I think a quote there is unlikely, but:

Okay, I'll commit tah one.  BTW, does this handle lines continued
with backslashed before the newline?

Bye

Dominik ^_^  ^_^

---

From: Dan Espen <[email-masked]>
Date: Thu, 22 Mar 2001 09:13:14 -0500

> with backslashed before the newline?

It does for pixmappath, etc, but it doesn't need to for this
command.

---

From: Dominik Vogt <[email-masked]>
Date: Thu, 22 Mar 2001 15:32:58 +0100

> It does for pixmappath, etc, but it doesn't need to for this

You could have a line like this:

  *FvwmButtons(3x1+18+0, Padding 2, \
    Panel(smooth, indicator 15) foo "exec foo")

Bye

Dominik ^_^  ^_^

---

From: Dan Espen <[email-masked]>
Date: Thu, 22 Mar 2001 09:41:34 -0500

>     Panel(smooth, indicator 15) foo "exec foo")

Maybe I don't understand, isn't that a new style panel definition?

---

From: Dominik Vogt <[email-masked]>
Date: Thu, 22 Mar 2001 16:05:01 +0100

> Maybe I don't understand, isn't that a new style panel definition?

Yes, the example is wrong, but it's the same for the old syntax:

*FvwmButtons(Title Tools, \
  Panel Tools)

Bye

Dominik ^_^  ^_^

---

From: Dominik Vogt <[email-masked]>
Date: Sat, 24 Mar 2001 01:57:16 +0100

I have looked into converting placement styles, but I think we
should simply ignore this.  It's almost impossible to do
correctly, and since the old syntax still works, let's rather
print a message so that the user can convert it manually.  I
already coded this.

I think the only fail safe way to detect panel lines is this:

  /PANEL/i

not

  /^\s*[*]\S+PANEL/i

since otherwise we'd have to deal with backslashed newlines.
(also committed).

Bye

Dominik ^_^  ^_^