Re: CVS tadam: Start of perl style cleanup to fvwm-menu-desktop

2010-12-28 Thread Thomas Adam
On Mon, Dec 27, 2010 at 08:17:01PM -0500, des...@verizon.net wrote:
 c...@math.uh.edu writes:
 
  Log message:
  Start of perl style cleanup to fvwm-menu-desktop
 
  Tentative leap into cleaning this script up.
 
 Hi,

Hello,

 That worked pretty well.
 
 I've been working on creating an FvwmForm that prompts for new command
 line arguments and invoking FvwmForm instead of fvwm-menu-desktop when
 regenerate menus is selected.
 
 I updated and got a few conflicts, but they were easily resolved.
 

How far through that are you?  I've a tonne of other cleanups and what have
you but don't want to cause you a massive headache with resolving conflicts;
and it would be easier for me to fix those up this end.

-- Thomas Adam

-- 
It was the cruelest game I've ever played and it's played inside my head.
-- Hush The Warmth, Gorky's Zygotic Mynci.



CVS dane: * fvwm-menu-desktop.in: New root menu name, FvwmMenu.

2010-12-28 Thread cvs
CVSROOT:/home/cvs/fvwm
Module name:fvwm
Changes by: dane10/12/27 22:04:37

Modified files:
bin: ChangeLog fvwm-menu-desktop.in 
modules: ChangeLog 
modules/FvwmForm: Makefile.am 
Added files:
modules/FvwmForm: FvwmForm-Desktop 

Log message:
* fvwm-menu-desktop.in: New root menu name, FvwmMenu.
Regenerate menu using a prompt for new options.
Comments about more changes.
* FvwmForm/Makefile.am: Add file FvwmForm-Desktop.
* FvwmForm/FvwmForm-Desktop: New form, FvwmForm-Desktop.




Re: CVS tadam: Start of perl style cleanup to fvwm-menu-desktop

2010-12-28 Thread despen
Thomas Adam tho...@fvwm.org writes:
 On Mon, Dec 27, 2010 at 08:17:01PM -0500, des...@verizon.net wrote:
 c...@math.uh.edu writes:
 
  Log message:
  Start of perl style cleanup to fvwm-menu-desktop
 
  Tentative leap into cleaning this script up.
 
 Hi,

 Hello,

 That worked pretty well.
 
 I've been working on creating an FvwmForm that prompts for new command
 line arguments and invoking FvwmForm instead of fvwm-menu-desktop when
 regenerate menus is selected.
 
 I updated and got a few conflicts, but they were easily resolved.

 How far through that are you?  I've a tonne of other cleanups and what have
 you but don't want to cause you a massive headache with resolving conflicts;
 and it would be easier for me to fix those up this end.

Go ahead.  I checked in what I have.
I'll lay off for a few days.

The cleanups are nice.
I have a bunch of basic function issues which I've listed at the
front of the file.



Re: CVS tadam: Start of perl style cleanup to fvwm-menu-desktop

2010-12-28 Thread Thomas Adam
On Tue, Dec 28, 2010 at 11:20:30AM -0500, des...@verizon.net wrote:
 Go ahead.  I checked in what I have.
 I'll lay off for a few days.

Well, I've made a lot of changes -- I'd be grateful if you'd have a look and
ensure I've not botched any CVS conflicts which I had to resolve -- it seems
to work for me, but I might not be testing the same areas as you.

 The cleanups are nice.
 I have a bunch of basic function issues which I've listed at the
 front of the file.

I'll get to those in a bit.  I am more interested in cleaning up what's
currently there, as a lot of the inherited xdg-menu code from the SuSE
people is nothing short of abysmal to be frank.

However, the things to take away from my latest commit are:

* Reindented the entire file by hand (because Vim did a piss-poor job) so
  that the following rules hold true:

  - Braces are on a line of their own for all block construct, so for
instance:

sub foo
{

}

if (some_condition)
{

}

  - White space around parenthesis is OK, although consistency is better off
if it's obvious, and as such, I've removed the whte space, so we now
have:

foo(...);
bar(foo(option, option2));

Rather than:

foo( ... );

or even:

foo ( () );

  - Nested if statements in the form:

if (...)
{
} else {
}

Should be written as:

if (...)
{
}
else
{
}

* In-line logic conditions (if/unless, etc) like this:

  foo($bar) unless $baz;

  Should be written as such, without the extraneous parenthesis where
  applicable -- that is, *not* like this:

  foo($bar) unless ($baz);

  (It makes it easier to see).

  Also, I've seen this sort of thing:

  while {$i  $j) { push @bar, $baz++ };

  The idiom here is to do:

  push @bar, $baz++ while (some_condition);

I am sure there were other things, but these are the main ones.

Now I'll concentrate on removing the hideous amount of duplication we have
between subroutines, refactoring those, and making the code less unwieldy.
:)

-- Thomas Adam

-- 
It was the cruelest game I've ever played and it's played inside my head.
-- Hush The Warmth, Gorky's Zygotic Mynci.



Re: CVS tadam: Start of perl style cleanup to fvwm-menu-desktop

2010-12-28 Thread despen
Thomas Adam tho...@xteddy.org writes:

 On Tue, Dec 28, 2010 at 11:20:30AM -0500, des...@verizon.net wrote:
 Go ahead.  I checked in what I have.
 I'll lay off for a few days.

 Well, I've made a lot of changes -- I'd be grateful if you'd have a look and
 ensure I've not botched any CVS conflicts which I had to resolve -- it seems
 to work for me, but I might not be testing the same areas as you.

I found the easiest way to resolve conflicts is first determine if I
liked the committed code.  If so, just delete the whole block.
Then update again.

 The cleanups are nice.
 I have a bunch of basic function issues which I've listed at the
 front of the file.

 I'll get to those in a bit.  I am more interested in cleaning up what's
 currently there, as a lot of the inherited xdg-menu code from the SuSE
 people is nothing short of abysmal to be frank.

 However, the things to take away from my latest commit are:

 * Reindented the entire file by hand (because Vim did a piss-poor job) so
   that the following rules hold true:

   - Braces are on a line of their own for all block construct, so for
 instance:

Yeah, well, I don't like that, but others do so I guess I have no
choice.  I'm outvoted it seems.

It seems to me pretty dumb to waste vertical space like that.

 if (...)
 {
 } else {
 }

 Should be written as:

 if (...)
 {
 }
 else
 {
 }

Yep, 3 lines:

  if (...) {
  } else {
  }

to 6, but I'm pretty lonely in my camp.
Seems other people like to see things line up,
but they don't line up to me.

Anyway, if you download perltidy and give it the right
options, it's deal with most of that.

 * In-line logic conditions (if/unless, etc) like this:

   foo($bar) unless $baz;

Lots of that, and I think it's all backwards.

  if ( ! $baz ) {
foo($bar);
  }

 Now I'll concentrate on removing the hideous amount of duplication we have
 between subroutines, refactoring those, and making the code less unwieldy.
 :)

Go for it and don't pay attention to my rants about style.
I have my preferences but I'll live with majority opinion.



CVS tadam: Lots of cleanups to fvwm-menu-desktop

2010-12-28 Thread cvs
CVSROOT:/home/cvs/fvwm
Module name:fvwm
Changes by: tadam   10/12/28 15:01:22

Modified files:
bin: fvwm-menu-desktop.in 

Log message:
Lots of cleanups to fvwm-menu-desktop

* Hugely reindent entire file.
* Make some constructs more perl like, and less like C.
* Add sanity checks for various things.