Csound Csound-dev Csound-tekno Search About

[Cs-dev] Csound 6

Date2012-03-31 22:21
FromMichael Gogins
Subject[Cs-dev] Csound 6
As some of us will be rewriting considerable portions of Csound, I
would like to propose that we adopt some sort of agreed upon coding
standard. I wouldn't like this to be too complex or detailed, but I
think we should agree about certain things like naming conventions,
#include file usage, what and what not to comment, and so on.

Regards,
Mike

-- 
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-04-02 22:12
FromSteven Yi
SubjectRe: [Cs-dev] Csound 6
Hi Michael,

I think we've had some understood agreements about coding standards,
but never had it written down.  I think it's a good idea to have some
kind of reference to refer to.  Last I remembered, we moved from C89
to C99, but not C1X/C11.  As for other things, seems like any public
Csound API method should be documented with Doxygen style comments,
and anything that seems like it'd be a courtesy to other developers to
document would be good (not sure myself what criteria to apply here).

I'd prefer somewhat verbose function and variable names except for
temp vars, as it makes the code a bit more self-documenting.

Google has a style guide for C++ (that covers C as well) here:

http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml

and they have an emacs settings file linked here:

http://code.google.com/p/google-styleguide/

Perhaps we should model whatever guide we come up with on that, as it
seems to cover things well.

Thanks!
steven

On Sat, Mar 31, 2012 at 10:21 PM, Michael Gogins
 wrote:
> As some of us will be rewriting considerable portions of Csound, I
> would like to propose that we adopt some sort of agreed upon coding
> standard. I wouldn't like this to be too complex or detailed, but I
> think we should agree about certain things like naming conventions,
> #include file usage, what and what not to comment, and so on.
>
> Regards,
> Mike
>
> --
> Michael Gogins
> Irreducible Productions
> http://www.michael-gogins.com
> Michael dot Gogins at gmail dot com
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-04-03 00:02
FromMichael Gogins
SubjectRe: [Cs-dev] Csound 6
I've read through the Google coding standard. Although it is pretty
much the way I have been habitually doing things, there are some
exceptions, and also some places where I think Csound needs some
different standards.

The main thing that's different from what I do is that I use multiple
inheritance all the time, and I think it's very useful. On the other
hand, I don't think this is likely to be necessary in Csound code.

As for what might be different in Csound code versus the Google
standard, I don't think the business about one header file per source
file really makes sense for us. There are too many files in Csound,
frankly. Most of the opcodes really shouldn't have header files at
all, they can and should be defined purely in the source code file.
Also, a C API (as opposed to a C++ API) usually reads better if it is
in just one or a few header files.

Anyway, thanks for the pointer. I wonder if anyone else will have suggestions.

I like the idea of adopting an Emacs mode. Using astyle with a Csound
formatter would do the same job.

I also think we should target our comments towards Doxygen and
actually minimize the use of other comments.

Regards,
Mike



On Mon, Apr 2, 2012 at 5:12 PM, Steven Yi  wrote:
> Hi Michael,
>
> I think we've had some understood agreements about coding standards,
> but never had it written down.  I think it's a good idea to have some
> kind of reference to refer to.  Last I remembered, we moved from C89
> to C99, but not C1X/C11.  As for other things, seems like any public
> Csound API method should be documented with Doxygen style comments,
> and anything that seems like it'd be a courtesy to other developers to
> document would be good (not sure myself what criteria to apply here).
>
> I'd prefer somewhat verbose function and variable names except for
> temp vars, as it makes the code a bit more self-documenting.
>
> Google has a style guide for C++ (that covers C as well) here:
>
> http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml
>
> and they have an emacs settings file linked here:
>
> http://code.google.com/p/google-styleguide/
>
> Perhaps we should model whatever guide we come up with on that, as it
> seems to cover things well.
>
> Thanks!
> steven
>
> On Sat, Mar 31, 2012 at 10:21 PM, Michael Gogins
>  wrote:
>> As some of us will be rewriting considerable portions of Csound, I
>> would like to propose that we adopt some sort of agreed upon coding
>> standard. I wouldn't like this to be too complex or detailed, but I
>> think we should agree about certain things like naming conventions,
>> #include file usage, what and what not to comment, and so on.
>>
>> Regards,
>> Mike
>>
>> --
>> Michael Gogins
>> Irreducible Productions
>> http://www.michael-gogins.com
>> Michael dot Gogins at gmail dot com
>>
>> ------------------------------------------------------------------------------
>> This SF email is sponsosred by:
>> Try Windows Azure free for 90 days Click Here
>> http://p.sf.net/sfu/sfd2d-msazure
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> ------------------------------------------------------------------------------
> Better than sec? Nothing is better than sec when it comes to
> monitoring Big Data applications. Try Boundary one-second
> resolution app monitoring today. Free.
> http://p.sf.net/sfu/Boundary-dev2dev
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel



-- 
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com

------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-04-03 00:22
FromAdam Puckett
SubjectRe: [Cs-dev] Csound 6
I like the idea of an Emacs mode.

One suggestion I have (this may or may not have been discussed
earlier) is to possibly make Cygwin another platform for Csound. I
know the official build on Windows is with MinGW, but I have a hunch
that the -l stdin feature could work under Cygwin, since the code for
-l apparently is POSIX-specific.

Thoughts?

------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-04-03 00:27
FromMichael Gogins
SubjectRe: [Cs-dev] Csound 6
As a replacement for MinGW, no way, but I don't think that's what you
mean. As another platform, fine, assuming it's easy enough to
maintain.

Regards,
Mike

On Mon, Apr 2, 2012 at 7:22 PM, Adam Puckett  wrote:
> I like the idea of an Emacs mode.
>
> One suggestion I have (this may or may not have been discussed
> earlier) is to possibly make Cygwin another platform for Csound. I
> know the official build on Windows is with MinGW, but I have a hunch
> that the -l stdin feature could work under Cygwin, since the code for
> -l apparently is POSIX-specific.
>
> Thoughts?
>
> ------------------------------------------------------------------------------
> Better than sec? Nothing is better than sec when it comes to
> monitoring Big Data applications. Try Boundary one-second
> resolution app monitoring today. Free.
> http://p.sf.net/sfu/Boundary-dev2dev
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel



-- 
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com

------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-04-03 00:43
FromAdam Puckett
SubjectRe: [Cs-dev] Csound 6
No, I don't mean to replace the MinGW build with a Cygwin build.

------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-04-03 16:43
Fromjpff@cs.bath.ac.uk
SubjectRe: [Cs-dev] Csound 6
I have been using emacs code layout for years.  How else does one organise
things?

(add-hook 'c-mode-hook
      '(lambda ()
;;         (load-library "cc-styles")         ; As needed to customise
         (imenu-add-to-menubar "Index")
	 (defun c-mode-align-equals (start end) ; from Paul Hudson, Monotype
	   "make the first assignment operator on each line line up vertically"
	   (interactive "*r")
	   (save-excursion
	     (let ((indent 0))
	       (narrow-to-region start end)
	       (goto-char (point-min))
	       (while (not (eobp))
		 (if (find-assignment)
		     (progn
	       (exchange-point-and-mark)
		       (setq indent (max indent (current-column)))
		       (delete-horizontal-space)
		       (insert " ")))
		 (forward-line 1))
	       (goto-char (point-min))
	       (while (not (eobp))
		 (if (find-assignment)
		     (indent-to-column (1+ (- indent  (- (mark) (point))))))
		 (forward-line 1)))
	     (widen)))
	 (defun find-assignment ()
	   (if (re-search-forward
	     "[^<>=!]=\\|\\+=\\|-=\\|\\*=\\|/=\\|&=\\||=\\|\\^=\\|<<=\\|>>="
	     (save-excursion (end-of-line) (point)) t)
	       (progn
		 (goto-char (match-beginning 0))
		 (if (looking-at ".==")
		     nil
		   (if (looking-at
			"\\+=\\|-=\\|\\*=\\|/=\\|&=\\||=\\|\\^=\\|<<=\\|>>=")
		       (set-mark (match-end 0))
		     (forward-char 1)
		     (set-mark (1+ (point))))
		   (delete-horizontal-space)
		   t))
	     nil))
         (define-key c-mode-map "\C-c\C-a" 'c-mode-align-equals)
         (c-set-offset 'defun-block-intro 4)
         (setq c-block-comments-indent-p nil)
         (setq c-basic-offset 2)
         (setq c-recognize-knr-p nil)	; I am an ANSI person
         (define-key c-mode-map "\C-c\C-x" 'cpp-parse-buffer)
         (define-key c-mode-map "\C-c\C-z" 'cpp-parse-reset)
         (define-key c-mode-map "\C-c\C-w" 'cpp-parse-edit)
         (setq imenu-sort-function 'imenu--sort-by-name)
         (setq font-lock-maximum-decoration 2)
         (turn-on-font-lock)))



> I like the idea of an Emacs mode.
>
> One suggestion I have (this may or may not have been discussed
> earlier) is to possibly make Cygwin another platform for Csound. I
> know the official build on Windows is with MinGW, but I have a hunch
> that the -l stdin feature could work under Cygwin, since the code for
> -l apparently is POSIX-specific.
>
> Thoughts?
>
> ------------------------------------------------------------------------------
> Better than sec? Nothing is better than sec when it comes to
> monitoring Big Data applications. Try Boundary one-second
> resolution app monitoring today. Free.
> http://p.sf.net/sfu/Boundary-dev2dev
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
>



------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-04-03 16:52
FromSteven Yi
SubjectRe: [Cs-dev] Csound 6
Hi John,

As much as I'd like to believe I could write well formatted code
without the use of tools--of course, a joke :D--I to use the code
formatters in the IDE's I use for formatting, and adjust the settings
within the application.

I think if anything, it would be good if we were on the same page for
indentation and style.  I myself don't use emacs (prefer IDE's or
vim), but I think having something like a devsupport folder that has
things like this would be good so that we can all share the same
settings.  Using a 3rd party code formatter would be nice too, as then
it'd be easier to use regardless of preferred editor.

I've read about projects in the past having something like a build
target just for code formatting. I thought there was something in the
past in Csound's repo for that, but I don't remember exactly and don't
see it.

steven

On Tue, Apr 3, 2012 at 4:43 PM,   wrote:
> I have been using emacs code layout for years.  How else does one organise
> things?
>
> (add-hook 'c-mode-hook
>      '(lambda ()
> ;;         (load-library "cc-styles")         ; As needed to customise
>         (imenu-add-to-menubar "Index")
>         (defun c-mode-align-equals (start end) ; from Paul Hudson, Monotype
>           "make the first assignment operator on each line line up vertically"
>           (interactive "*r")
>           (save-excursion
>             (let ((indent 0))
>               (narrow-to-region start end)
>               (goto-char (point-min))
>               (while (not (eobp))
>                 (if (find-assignment)
>                     (progn
>               (exchange-point-and-mark)
>                       (setq indent (max indent (current-column)))
>                       (delete-horizontal-space)
>                       (insert " ")))
>                 (forward-line 1))
>               (goto-char (point-min))
>               (while (not (eobp))
>                 (if (find-assignment)
>                     (indent-to-column (1+ (- indent  (- (mark) (point))))))
>                 (forward-line 1)))
>             (widen)))
>         (defun find-assignment ()
>           (if (re-search-forward
>             "[^<>=!]=\\|\\+=\\|-=\\|\\*=\\|/=\\|&=\\||=\\|\\^=\\|<<=\\|>>="
>             (save-excursion (end-of-line) (point)) t)
>               (progn
>                 (goto-char (match-beginning 0))
>                 (if (looking-at ".==")
>                     nil
>                   (if (looking-at
>                        "\\+=\\|-=\\|\\*=\\|/=\\|&=\\||=\\|\\^=\\|<<=\\|>>=")
>                       (set-mark (match-end 0))
>                     (forward-char 1)
>                     (set-mark (1+ (point))))
>                   (delete-horizontal-space)
>                   t))
>             nil))
>         (define-key c-mode-map "\C-c\C-a" 'c-mode-align-equals)
>         (c-set-offset 'defun-block-intro 4)
>         (setq c-block-comments-indent-p nil)
>         (setq c-basic-offset 2)
>         (setq c-recognize-knr-p nil)   ; I am an ANSI person
>         (define-key c-mode-map "\C-c\C-x" 'cpp-parse-buffer)
>         (define-key c-mode-map "\C-c\C-z" 'cpp-parse-reset)
>         (define-key c-mode-map "\C-c\C-w" 'cpp-parse-edit)
>         (setq imenu-sort-function 'imenu--sort-by-name)
>         (setq font-lock-maximum-decoration 2)
>         (turn-on-font-lock)))
>
>
>
>> I like the idea of an Emacs mode.
>>
>> One suggestion I have (this may or may not have been discussed
>> earlier) is to possibly make Cygwin another platform for Csound. I
>> know the official build on Windows is with MinGW, but I have a hunch
>> that the -l stdin feature could work under Cygwin, since the code for
>> -l apparently is POSIX-specific.
>>
>> Thoughts?
>>
>> ------------------------------------------------------------------------------
>> Better than sec? Nothing is better than sec when it comes to
>> monitoring Big Data applications. Try Boundary one-second
>> resolution app monitoring today. Free.
>> http://p.sf.net/sfu/Boundary-dev2dev
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>>
>>
>
>
>
> ------------------------------------------------------------------------------
> Better than sec? Nothing is better than sec when it comes to
> monitoring Big Data applications. Try Boundary one-second
> resolution app monitoring today. Free.
> http://p.sf.net/sfu/Boundary-dev2dev
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-04-03 16:57
FromSteven Yi
SubjectRe: [Cs-dev] Csound 6
Hi All,

Just a general question, has anyone used astyle or uncrustify for code
formatting?

http://astyle.sourceforge.net/
http://uncrustify.sourceforge.net/

This program also looks interesting:

http://universalindent.sourceforge.net/

It uses astyle, uncrustify, or other formatters and can show the
results (seems useful for creating the formatter setting file).

Thanks!
steven


On Tue, Apr 3, 2012 at 4:52 PM, Steven Yi  wrote:
> Hi John,
>
> As much as I'd like to believe I could write well formatted code
> without the use of tools--of course, a joke :D--I to use the code
> formatters in the IDE's I use for formatting, and adjust the settings
> within the application.
>
> I think if anything, it would be good if we were on the same page for
> indentation and style.  I myself don't use emacs (prefer IDE's or
> vim), but I think having something like a devsupport folder that has
> things like this would be good so that we can all share the same
> settings.  Using a 3rd party code formatter would be nice too, as then
> it'd be easier to use regardless of preferred editor.
>
> I've read about projects in the past having something like a build
> target just for code formatting. I thought there was something in the
> past in Csound's repo for that, but I don't remember exactly and don't
> see it.
>
> steven
>
> On Tue, Apr 3, 2012 at 4:43 PM,   wrote:
>> I have been using emacs code layout for years.  How else does one organise
>> things?
>>
>> (add-hook 'c-mode-hook
>>      '(lambda ()
>> ;;         (load-library "cc-styles")         ; As needed to customise
>>         (imenu-add-to-menubar "Index")
>>         (defun c-mode-align-equals (start end) ; from Paul Hudson, Monotype
>>           "make the first assignment operator on each line line up vertically"
>>           (interactive "*r")
>>           (save-excursion
>>             (let ((indent 0))
>>               (narrow-to-region start end)
>>               (goto-char (point-min))
>>               (while (not (eobp))
>>                 (if (find-assignment)
>>                     (progn
>>               (exchange-point-and-mark)
>>                       (setq indent (max indent (current-column)))
>>                       (delete-horizontal-space)
>>                       (insert " ")))
>>                 (forward-line 1))
>>               (goto-char (point-min))
>>               (while (not (eobp))
>>                 (if (find-assignment)
>>                     (indent-to-column (1+ (- indent  (- (mark) (point))))))
>>                 (forward-line 1)))
>>             (widen)))
>>         (defun find-assignment ()
>>           (if (re-search-forward
>>             "[^<>=!]=\\|\\+=\\|-=\\|\\*=\\|/=\\|&=\\||=\\|\\^=\\|<<=\\|>>="
>>             (save-excursion (end-of-line) (point)) t)
>>               (progn
>>                 (goto-char (match-beginning 0))
>>                 (if (looking-at ".==")
>>                     nil
>>                   (if (looking-at
>>                        "\\+=\\|-=\\|\\*=\\|/=\\|&=\\||=\\|\\^=\\|<<=\\|>>=")
>>                       (set-mark (match-end 0))
>>                     (forward-char 1)
>>                     (set-mark (1+ (point))))
>>                   (delete-horizontal-space)
>>                   t))
>>             nil))
>>         (define-key c-mode-map "\C-c\C-a" 'c-mode-align-equals)
>>         (c-set-offset 'defun-block-intro 4)
>>         (setq c-block-comments-indent-p nil)
>>         (setq c-basic-offset 2)
>>         (setq c-recognize-knr-p nil)   ; I am an ANSI person
>>         (define-key c-mode-map "\C-c\C-x" 'cpp-parse-buffer)
>>         (define-key c-mode-map "\C-c\C-z" 'cpp-parse-reset)
>>         (define-key c-mode-map "\C-c\C-w" 'cpp-parse-edit)
>>         (setq imenu-sort-function 'imenu--sort-by-name)
>>         (setq font-lock-maximum-decoration 2)
>>         (turn-on-font-lock)))
>>
>>
>>
>>> I like the idea of an Emacs mode.
>>>
>>> One suggestion I have (this may or may not have been discussed
>>> earlier) is to possibly make Cygwin another platform for Csound. I
>>> know the official build on Windows is with MinGW, but I have a hunch
>>> that the -l stdin feature could work under Cygwin, since the code for
>>> -l apparently is POSIX-specific.
>>>
>>> Thoughts?
>>>
>>> ------------------------------------------------------------------------------
>>> Better than sec? Nothing is better than sec when it comes to
>>> monitoring Big Data applications. Try Boundary one-second
>>> resolution app monitoring today. Free.
>>> http://p.sf.net/sfu/Boundary-dev2dev
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>
>>>
>>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Better than sec? Nothing is better than sec when it comes to
>> monitoring Big Data applications. Try Boundary one-second
>> resolution app monitoring today. Free.
>> http://p.sf.net/sfu/Boundary-dev2dev
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-04-03 17:20
FromTito Latini
SubjectRe: [Cs-dev] Csound 6
AttachmentsNone  

Date2012-04-04 15:52
Fromjpff
SubjectRe: [Cs-dev] Csound 6
> I've read about projects in the past having something like a build
> target just for code formatting. I thought there was something in the
> past in Csound's repo for that, but I don't remember exactly and don't
> see it.

There was a script from Istvan that applied certain sanity rules, and
I apply some of them regularly, like

NO TABS
Strings that are not in code wrapped with Str()
Lines less than 80 chars wide

There are others that O do not apply ruthlessly as I am sure no one
agrees with me, like where {} go and the distinction between a
function and syntax

==John ffitch

------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-04-04 16:32
FromMichael Gogins
SubjectRe: [Cs-dev] Csound 6
I have astyle installed as a tool in my text editor (SciTE, which I
prefer to Emacs). And I use it.

Regards,
Mike

On Tue, Apr 3, 2012 at 11:57 AM, Steven Yi  wrote:
> Hi All,
>
> Just a general question, has anyone used astyle or uncrustify for code
> formatting?
>
> http://astyle.sourceforge.net/
> http://uncrustify.sourceforge.net/
>
> This program also looks interesting:
>
> http://universalindent.sourceforge.net/
>
> It uses astyle, uncrustify, or other formatters and can show the
> results (seems useful for creating the formatter setting file).
>
> Thanks!
> steven
>
>
> On Tue, Apr 3, 2012 at 4:52 PM, Steven Yi  wrote:
>> Hi John,
>>
>> As much as I'd like to believe I could write well formatted code
>> without the use of tools--of course, a joke :D--I to use the code
>> formatters in the IDE's I use for formatting, and adjust the settings
>> within the application.
>>
>> I think if anything, it would be good if we were on the same page for
>> indentation and style.  I myself don't use emacs (prefer IDE's or
>> vim), but I think having something like a devsupport folder that has
>> things like this would be good so that we can all share the same
>> settings.  Using a 3rd party code formatter would be nice too, as then
>> it'd be easier to use regardless of preferred editor.
>>
>> I've read about projects in the past having something like a build
>> target just for code formatting. I thought there was something in the
>> past in Csound's repo for that, but I don't remember exactly and don't
>> see it.
>>
>> steven
>>
>> On Tue, Apr 3, 2012 at 4:43 PM,   wrote:
>>> I have been using emacs code layout for years.  How else does one organise
>>> things?
>>>
>>> (add-hook 'c-mode-hook
>>>      '(lambda ()
>>> ;;         (load-library "cc-styles")         ; As needed to customise
>>>         (imenu-add-to-menubar "Index")
>>>         (defun c-mode-align-equals (start end) ; from Paul Hudson, Monotype
>>>           "make the first assignment operator on each line line up vertically"
>>>           (interactive "*r")
>>>           (save-excursion
>>>             (let ((indent 0))
>>>               (narrow-to-region start end)
>>>               (goto-char (point-min))
>>>               (while (not (eobp))
>>>                 (if (find-assignment)
>>>                     (progn
>>>               (exchange-point-and-mark)
>>>                       (setq indent (max indent (current-column)))
>>>                       (delete-horizontal-space)
>>>                       (insert " ")))
>>>                 (forward-line 1))
>>>               (goto-char (point-min))
>>>               (while (not (eobp))
>>>                 (if (find-assignment)
>>>                     (indent-to-column (1+ (- indent  (- (mark) (point))))))
>>>                 (forward-line 1)))
>>>             (widen)))
>>>         (defun find-assignment ()
>>>           (if (re-search-forward
>>>             "[^<>=!]=\\|\\+=\\|-=\\|\\*=\\|/=\\|&=\\||=\\|\\^=\\|<<=\\|>>="
>>>             (save-excursion (end-of-line) (point)) t)
>>>               (progn
>>>                 (goto-char (match-beginning 0))
>>>                 (if (looking-at ".==")
>>>                     nil
>>>                   (if (looking-at
>>>                        "\\+=\\|-=\\|\\*=\\|/=\\|&=\\||=\\|\\^=\\|<<=\\|>>=")
>>>                       (set-mark (match-end 0))
>>>                     (forward-char 1)
>>>                     (set-mark (1+ (point))))
>>>                   (delete-horizontal-space)
>>>                   t))
>>>             nil))
>>>         (define-key c-mode-map "\C-c\C-a" 'c-mode-align-equals)
>>>         (c-set-offset 'defun-block-intro 4)
>>>         (setq c-block-comments-indent-p nil)
>>>         (setq c-basic-offset 2)
>>>         (setq c-recognize-knr-p nil)   ; I am an ANSI person
>>>         (define-key c-mode-map "\C-c\C-x" 'cpp-parse-buffer)
>>>         (define-key c-mode-map "\C-c\C-z" 'cpp-parse-reset)
>>>         (define-key c-mode-map "\C-c\C-w" 'cpp-parse-edit)
>>>         (setq imenu-sort-function 'imenu--sort-by-name)
>>>         (setq font-lock-maximum-decoration 2)
>>>         (turn-on-font-lock)))
>>>
>>>
>>>
>>>> I like the idea of an Emacs mode.
>>>>
>>>> One suggestion I have (this may or may not have been discussed
>>>> earlier) is to possibly make Cygwin another platform for Csound. I
>>>> know the official build on Windows is with MinGW, but I have a hunch
>>>> that the -l stdin feature could work under Cygwin, since the code for
>>>> -l apparently is POSIX-specific.
>>>>
>>>> Thoughts?
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Better than sec? Nothing is better than sec when it comes to
>>>> monitoring Big Data applications. Try Boundary one-second
>>>> resolution app monitoring today. Free.
>>>> http://p.sf.net/sfu/Boundary-dev2dev
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Better than sec? Nothing is better than sec when it comes to
>>> monitoring Big Data applications. Try Boundary one-second
>>> resolution app monitoring today. Free.
>>> http://p.sf.net/sfu/Boundary-dev2dev
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> ------------------------------------------------------------------------------
> Better than sec? Nothing is better than sec when it comes to
> monitoring Big Data applications. Try Boundary one-second
> resolution app monitoring today. Free.
> http://p.sf.net/sfu/Boundary-dev2dev
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel



-- 
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com

------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net