Menu

#5829 Re-indent all mf files

Fixed
Maintainability
2020-03-11
2020-03-07
No

https://codereview.appspot.com/573610048

Now that Werner has banned all tabs from mf files, initially replacing them by 8 spaces each, it's time for the second step:

lemzwerg 2020/02=29 17:23:39
We could later decide to reduce the indentation to two (or four) spaces – which I like much better. However, this would be a lot of work and is probably not worth the trouble.

Design question: 2 or 4 character-indent?

  1. Applying a general indent of 2 or 4 characters to mf files will be less wasteful and better matches the usual 2 or 4 character indent used throughout.
  2. having saved quite a lot of space, ident fet_begingroup [...] fet_endgroup, too?

Examples for Question 2:

mf/accidentals.mf (current) already used indentation for fet_begringroup [...] fet_endgroup`

fet_begingroup ("accidentals");
        input feta-arrow;
        input feta-sharps;
        input feta-naturals;
        input feta-flats;
        input feta-parenthesis;
fet_endgroup ("accidentals");

mf/accidentals.mf (new) (reduced to, say, 2 characters)

fet_begingroup ("accidentals");
  input feta-arrow;
  input feta-sharps;
  input feta-naturals;
  input feta-flats;
  input feta-parenthesis;
fet_endgroup ("accidentals");

But, in contrast to that, most of the times, there was no fet_begingroup [...] fet_endgroup indent at all, e.g.:

mf/feta-pedals.mf (current)

[...]
fet_begingroup ("pedal");

pedalpha = 40;
pedbeta = 25;
[...]

mf/feta-pedals.mf (new)

[...]
fet_begingroup ("pedal");

  pedalpha = 40;
  pedbeta = 25;
[...]

Scope

Out of the currentyl 201 *.mf files, 59 do not have any indentation and thus need not be changed.
The remaining 43 files will be re-formatted on semi-automatic.

Adapt Contributor's guide METAFONT fomatting rules

The 13.6 METAFONT formatting rules still mention tabs. This should be changed and adapted, depending on the design descision taken and implemented here.

Decision: 2 char indent

Discussion

  • Werner LEMBERG

    Werner LEMBERG - 2020-03-07

    I favor two spaces.

    And for fet_begingroup I prefer the solution we currently have in the MF files: If fet_endgroup is 'not too far away', apply indentation, otherwise don't.

     
    • Torsten Hämmerle

      Splendid. Two spaces is my preference, too.
      And no extra indent beween fet_begingroupand fet_endgroup.

       
  • Torsten Hämmerle

    Issue 5829: Re-indent all mf files

    As a second step after having replaced all tabs by 8 character indentations,
    these indentations will now be reduced to 2 characters.

    "Tabs are used..." passage removed from
    Contributor's Guide 13.6 METAFONT formatting rules.

    https://codereview.appspot.com/573610048

     
  • Torsten Hämmerle

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,3 +1,5 @@
    +https://codereview.appspot.com/573610048
    +
     Now that Werner has banned all tabs from mf files, initially replacing them by 8 spaces each, it's time for the second step:
    
     > **lemzwerg 2020/02=29 17:23:39**
    @@ -62,3 +64,5 @@
    
     ## Adapt Contributor's guide METAFONT  fomatting rules
     The [13.6 METAFONT formatting rules](http://lilypond.org/doc/v2.19/Documentation/contributor/metafont-formatting-rules) still mention tabs. This should be changed and adapted, depending on the design descision taken and implemented here.
    +
    +#Decision: 2 char indent
    
    • Needs: -->
    • Type: -->
     
  • Anonymous

    Anonymous - 2020-03-08
    • Patch: new --> needs_work
     
  • Anonymous

    Anonymous - 2020-03-08

    Torsten, Rietveld won't provide a diff for me to test if the diffs are too large - like this one.

    You're going to have to attach a patch for me to test.

     
    • Torsten Hämmerle

      James, sorry I din't pay attention and overlooked the "too big" status.
      Here you go with an exceptionally large patch:

       
  • Anonymous

    Anonymous - 2020-03-09
    • Patch: needs_work --> review
     
  • Anonymous

    Anonymous - 2020-03-11
    • Patch: review --> countdown
    • Type: --> Maintainability
     
  • Anonymous

    Anonymous - 2020-03-11

    Patch on countdown for March 13th

     
  • Werner LEMBERG

    Werner LEMBERG - 2020-03-11
    • labels: --> Fixed_2_21_0
    • status: Started --> Fixed
    • Patch: countdown -->
     
  • Werner LEMBERG

    Werner LEMBERG - 2020-03-11

    Oops, applied the patch too early, sorry.

     
    😄
    1
  • Werner LEMBERG

    Werner LEMBERG - 2020-03-11

    Applied to staging as
    commit c9debce76a75ab4c5d81fa96e2ac5f45615803b3
    Author: Torsten Hämmerle torsten.haemmerle@web.de
    Date: Sat Mar 7 08:42:48 2020 +0100

    Issue 5829: Re-indent all mf files
    
    As a second step after having replaced all tabs by 8 character indentations,
    these indentations will now be reduced to 2 characters.
    
    "Tabs are used..." passage removed from
    Contributor's Guide 13.6 METAFONT formatting rules.
    
     
MongoDB Logo MongoDB