C++ code beautifier for emacs/linux
- by aaa
hi
I am looking for code beautifier for UNIX/emacs. I have looked at gnu indent, artistic style, however I need something a bit different. For example, I would like the following:
for( int x= 0;; ++ x) if(x) break; to be formatted as for (int x = 0; ; ++x) if (x) break;. As far as I can tell artistic style does not do that (correct me if I am wrong).
What can you recommend?
Thanks
edit
both, artistic style and indent remove whitespace. Here is a small interactive command to beautify region:
405 (defun my-emacs-command-beautify-region()
406 (interactive)
407 (let ((cmd "astyle"))
408 (shell-command-on-region (region-beginning) (region-end) cmd (current-buffer) t))