Artistic Style indenter/formatter take #2

Tal Davidson davidsont at bigfoot.com
Mon Sep 20 19:30:23 BST 1999


Richard, Bernd, Michael, et al

Thanks for the letters so far.

1)

> Would it be possible to allow people to configure the indentation using
> the GUI? I would like to have a dialog that displays a sample piece of
> code which you can indent how you like it, then have that style applied
> globally. I have seen this in JBuilder and it is a *very* nice way to
> configure the indentation.

This is pretty much what I have started to create.
It seemed that as a good first step, I should have a nice astyle setup
dialog
in which you can write some code - or drag some source into, change the
style 
options, apply the changes on the code frgagment, and at the end save
the 
new setup options to be used for global indentation.
This setup dialog should be good both for astyle users running KDE which
just want
 to easily setup their styling options, AND KDevelop users, as part of
the GUI.
(It is also a great way for me to get into QT and KDE - which is finally
C++ as it is supposed to be -
 so much simpler and prettier than I am used to from Microsoft's MFC.


2)

> What I personally would find even more interesting would be
> the possibility to reindent the source-code while editing,
> more precisely in the Emacs style (pressing Tab reindents the
> current line).

An important detail which remains unresolved is the way astyle styling
should be applied globally.
Currenty - in opposition to emacs - astyle is built to reindent/reformat
an entire file at once, and thus reindent/reformat an entire buffer
globally (upon request of a button or menu item), rather than one line
at a time.
Another option is indenting one-line-at-a-time, in emacs style. Although
it would be quite possible  (and interesting) to work on astyle so that
it CAN style one line at a time - and I am definatlely thinking of this
option, I am REALLY NOT SURE it is needed.
Moreover,while it does make sense to reindent on a per-line basis, it
seems rather strange to reformat on a one-line basis. 
(Actually, emacs does NOT have reformatting ability, and I wish emacs
had the ability to globally REINDENT a buffer (although perhaps this is
possible with some Emacs LISP programming)).


3)

> I think KDevelop 2 (in the HEAD branch) will have
>some kind of plugin system (either via KOM or via shared libraries)
> in which a nice frontend could seamlessly be integrated.

What would be the best way to integrate astyle and the astyle setup
dialog into the CURRENT KDevelop? Is there any basis for plug-ins
currently?

4)

> It shouldn't be difficult to integrate this into any project.  You just
> include it in the build rules, before the compile.

This is a very DANGEROUS proposition. It is best to have the programmer
view the buffer during the change, and understand exactly where he/she
is looking at.



Anyway, I will post the setup dialog when I feal it is minimally ready
for use (which I hope will be quite soon).

Cheers,
Tal Davidson




Richard Moore wrote:
> 
> Would it be possible to allow people to configure the indentation using
> the GUI? I would like to have a dialog that displays a sample piece of
> code which you can indent how you like it, then have that style applied
> globally. I have seen this in JBuilder and it is a *very* nice way to
> configure the indentation.
> 
> Rich.
> --
>      Richard Moore              rich at ipso-facto.freeserve.co.uk
> http://www.robocast.com/        richard at robocast.com
> http://developer.kde.org/       rich at kde.org



More information about the KDevelop mailing list