[comp.emacs] Reformatting C files w/ emacs...

jsv@dusk.gatech.edu (Jeffrey Vetter) (06/01/91)

Are there any scripts/functions available to reformat C files when you
bring them into emacs? 

I already use the electric-C functions, but I know of no command that
will reformat a file using my personal electric-C variable settings.
For instance, I am now editing someone else's C code that uses
drastically different styles than I. I just want to pull their file
into emacs, type a key, and "presto," I have a perfectly formatted C
file.

Did I miss something??

Thanks.
Jeffrey S. Vetter               jsv@cc.gatech.edu                 (404)875-8859
      MS student, College of Computing, Georgia Tech, Atlanta, GA, 30332 
                28428 Georgia Tech Station, Atlanta, GA, 30332
-------------------------------------------------------------------------------

wdn@reef.cis.ufl.edu (William Dean Norris II) (06/02/91)

>>>>> On 31 May 91 22:47:20 GMT, jsv@dusk.gatech.edu (Jeffrey Vetter) said:


Jeffrey> Are there any scripts/functions available to reformat C files when you
Jeffrey> bring them into emacs? 

Use indent-region, which is bound to C-M-\.

Jeffrey> Jeffrey S. Vetter               jsv@cc.gatech.edu                 (404)875-8859

dean.
--
-----
William Dean Norris II		"Darling it's better down
University of Florida		 where it's wetter..."
wdn@cis.ufl.edu				Sebastian in "A Little Mermaid"

liberte@ncsa.uiuc.edu (Daniel LaLiberte) (06/04/91)

Alternatively, if you want to keep with the formatting style used in
an existing file, consider using my c-style package from the elisp
archives.

Dan LaLiberte
National Center for Supercomputing Applications
liberte@ncsa.uiuc.edu