Thanks, Geoffrey, for your initial thoughts on a PLplot C/C++ coding style.

I wanted to return to and emphasize my previous point which is a lot of us
use emacs so that specifying an emacs settings file should be beneficial
since it should help to focus the discussion and make it easy for us
to bring the PLplot C/C++ code into conformance with our style guide as
expressed by that emacs settings file.

Dmitri previously mentioned the google C/C++ style guide so I looked that up
(http://code.google.com/p/google-styleguide/), and there is actually an
associated emacs settings file at
http://google-styleguide.googlecode.com/svn/trunk/google-c-style.el.  I
figured the google types probably haven't made any huge blunders with their
C/C++ style so I suggest we use that as a first approximation.

Therefore, I downloaded and committed (revision 10075) that file (with
essentially all instances of google changed to plplot) as plplot-c-style.el.
I suggest we view this file as just a first approximation to where we want
to go with a uniform C/C++ coding style for PLplot.  So, for example, if a
consensus develops that the indentation enforced by that file is not to our
collective liking, then we can always change it and reprocess all our source
files (ideally with a script) to bring them into conformance with the
adopted change in style.

I am currently trying plplot-c-style.el as follows:

softw...@raven> tail -6 ~/.emacs
;--------------------
; Support PLplot C/C++ style
;--------------------
(load "/home/software/plplot_cvs/HEAD/plplot_cmake_qt/plplot-c-style.el")
(add-hook 'c-mode-common-hook 'plplot-make-newline-indent)
(add-hook 'c-mode-common-hook 'plplot-set-c-style)

Of course your own load command will be different depending on the location
of the head of the PLplot source-code tree on your computer.

I am an emacs newbie so the only method I know to enforce the PLplot style
as given by plplot-c-style.el is to select all the text of the file and then
hit ctrl-alt-backslash to change the indentation according to
plplot-c-style.el. Resetting the indentation that way does work (i.e.,
plplot-c-style.el gives different indentation results than the emacs default
c style, and both plplot-c-style.el and default C emacs indentation are
different than revision 10073 of qt.cpp). I have committed the reindented
(according to plplot-c-style.el) result as revision 10074 after confirming
with svn diff -x -w qt.cpp that the changes are just whitespace ones.

However, style is obviously more than just indentation.  So I assume there
are other emacs commands that I should be using to force qt.cpp to conform
to the PLplot style as given by plplot-c-style.el.  Can somebody advise what
additional emacs commands I should use besides ctrl-alt-backslash to enforce
that style?

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________

------------------------------------------------------------------------------
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to