formatting of maxima code



"Stavros Macrakis" <stavros.macrakis@verizon.net> writes:

> > Can any of the emacs lisp files for maxima reformat code,
> > ie, putting in indentation for block structure,
> 
> maxima.el (in interfaces/emacs/emaxima/) claims to do some smart
> formatting, but it has some weird conventions.

I've improved it some (perhaps), I'll check it into CVS when the
freeze is over.
However, in the examples given, commands were ended with commas.
As I understand it, commands end in ; or $, unless they are
parenthesized.  Is that right?
Also, the way I have it set up now, inside parentheses, lines will
typically be indented one more than the opening parenthesis.  If the
opening parenthesis is well into a line, the output begins to look
bad; e.g.,
something somethingelse andanotherthingtoo(
                                           The next line starts here
This can be fixed by:
   Not worrying about it (perhaps the above situation just shouldn't
     occur)
   Changing the indentation so that it doesn't depend on where the
     opening parenthesis is (perhaps indent based on the level of
     nesting of parentheses)
   Something else ...?

> Even worse than its, um, idiosyncratic formatting, it is not consistent
> between the NEWLINE indentation and the TAB indentation.  If you go back
> to the above and hit TAB at the beginning of each line, you get:

The newline indentation and tab indentation won't be the same unless
you use reindent-then-newline-and-indent for a newline.  (I noticed
that in some programming modes reindent-then-newline-and-indent is
bound to C-m, while in others, such as C mode, it isn't used at all.
Perhaps it should optionally be bound to RET or LFD.)

Jay