home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / gnu / emacs / help / 5238 < prev    next >
Encoding:
Text File  |  1993-01-05  |  2.5 KB  |  69 lines

  1. Newsgroups: gnu.emacs.help
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!src.bae.co.UK!moore
  3. From: moore@src.bae.co.UK (Chris Moore)
  4. Subject: c-mode per file customisation
  5. Message-ID: <9301050748.AA21343@sun19.src.bae.co.uk>
  6. Sender: daemon@cis.ohio-state.edu
  7. Organization: Gatewayed from the GNU Project mailing list help-gnu-emacs@prep.ai.mit.edu
  8. References: <DAVE.92Dec30170656@grunge.auspost.com.au>
  9. Date: Tue, 5 Jan 1993 07:48:46 GMT
  10. Lines: 57
  11.  
  12.  
  13. dave@grunge.auspost.com.au (Dave Cole) said:
  14.  
  15. > Has anyone tackled the problem you have when more than one person
  16. > works on some system where multiple formatting styles are present.
  17.  
  18. > What would be nice is if you could embed the c-mode settings in each
  19. > source file - then set these as you read the file in to a buffer.
  20. > When you switch to a buffer would also be a nice time to change these
  21. > variables.
  22.  
  23. There's a package in the emacs lisp code archive which allows you to define
  24. a set of named styles (eg. "BSD", "K&R", "GNU", etc), then you can tag
  25. each file with the name of the style you want to use.
  26.  
  27. From the top of the file:
  28.  
  29. -----cut-----8<-----here-----8<--------------8<--------------
  30. ; Definitions for buffer specific c-mode indentation style.
  31. ; Written by Daniel LaLiberte (liberte@a.cs.uiuc.edu)
  32. ; while at Gould.  This is free.
  33.  
  34. ; There are several ways to call set-c-style.
  35. ;
  36. ; 1. Set the c-style variable in the local variables list 
  37. ;    with "c-style: GNU" or whatever you like and
  38. ;    call set-c-style without argument in c-mode-hook.
  39. ;
  40. ; 2. Call set-c-style with style argument in c-mode-hook.
  41. ;    This will set the style for every c file the same.
  42. ;
  43. ; 3. Put "eval: (set-c-style 'GNU)" in the local variables list.
  44. ; 4. Call set-c-style interactively.  It prompts for the style name.
  45.  
  46. ; The default value of c-style is default-c-style.
  47. ; I put (autoload 'set-c-style "c-style.el" nil t) in my .emacs.
  48. -----cut-----8<-----here-----8<--------------8<--------------
  49.  
  50. The LCD entry:
  51.  
  52. -----cut-----8<-----here-----8<--------------8<--------------
  53.         GNU Emacs Lisp Code Directory Apropos -- "c-style"
  54.  
  55.  
  56. c-style          87-08-27
  57.      D. LaLiberte, <liberte@a.cs.uiuc.edu>
  58.      archive.cis.ohio-state.edu:/pub/gnu/emacs/elisp-archive/as-is/c-src-doc.el.Z
  59.      C-mode indentation.
  60. -----cut-----8<-----here-----8<--------------8<--------------
  61.  
  62. Chris.
  63. --
  64. moore@src.bae.co.uk   /      Chris Moore      \
  65.                      / Sowerby Research Centre \
  66.                      \  British Aerospace PLC  /
  67. tel: +44 272 363375   \      BRISTOL, UK      /
  68.