home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / gnu / emacs / help / 5200 < prev    next >
Encoding:
Text File  |  1992-12-30  |  1.7 KB  |  52 lines

  1. Path: sparky!uunet!spool.mu.edu!yale.edu!ira.uka.de!Sirius.dfn.de!mailgzrz.TU-Berlin.DE!mailgzrz.tu-berlin.de!nickel
  2. From: nickel@cs.tu-berlin.de (Juergen Nickelsen)
  3. Newsgroups: gnu.emacs.help
  4. Subject: Re: c-mode per file customisation
  5. Date: 30 Dec 1992 14:04:33 GMT
  6. Organization: STONE Project, Technical University of Berlin, Germany
  7. Lines: 38
  8. Message-ID: <NICKEL.92Dec30150430@tempest.cs.tu-berlin.de>
  9. References: <DAVE.92Dec30170656@grunge.auspost.com.au>
  10. Reply-To: nickel@cs.tu-berlin.de
  11. NNTP-Posting-Host: tempest.cs.tu-berlin.de
  12. In-reply-to: dave@grunge.auspost.com.au's message of Wed, 30 Dec 1992 07:06:56 GMT
  13.  
  14. In article <DAVE.92Dec30170656@grunge.auspost.com.au>
  15. dave@grunge.auspost.com.au (Dave Cole) writes:
  16.  
  17. > What would be nice is if you could embed the c-mode settings in each
  18. > source file - then set these as you read the file in to a buffer.
  19. > When you switch to a buffer would also be a nice time to change these
  20. > variables.
  21.  
  22. There are several variables that control the formatting style for C
  23. programs -- I set the following in my .emacs:
  24.  
  25.     (setq c-indent-level 4)
  26.     (setq c-continued-statement-offset 4)
  27.     (setq c-brace-offset -4)
  28.     (setq c-argdecl-indent 0)
  29.  
  30. (Please don't discuss these settings -- this is just an example of my
  31. *personal* preferences.)
  32.  
  33. You can set these variables in each sources files separately by using
  34. Emacs' "Local Variables" section (read the node "File Variables" in
  35. the Emacs manual). The bottom of a source file would then look like
  36. this:
  37.  
  38. /*
  39.  * Local Variables:
  40.  * c-indent-level: 4
  41.  * c-continued-statement-offset: 4
  42.  * c-brace-offset: -4
  43.  * c-argdecl-indent: 0
  44.  * End:
  45.  */
  46.  
  47. These variables (usually global) become buffer-local when set in this
  48. way.
  49.  
  50. --
  51. Juergen Nickelsen
  52.