home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / pub / palmos / pippy-0.6beta-src.tar.gz / pippy-0.6beta-src.tar / pippy-0.6beta-src / src / Misc / ccpy-style.el < prev    next >
Text File  |  2000-12-21  |  1KB  |  49 lines

  1. ;;; ccpy-style.el  ---  cc-mode style definition for Python C code
  2. ;;
  3. ;; Author:   1996 Barry A. Warsaw
  4. ;; Created:  6-Dec-1996
  5. ;; Keywords: c python languages oop
  6.  
  7. ;;; Commentary
  8. ;;
  9. ;; NOTE: This file is obsolete!  All current versions of CC Mode
  10. ;; include a "python" style by default.
  11.  
  12. ;; This file defines the standard C coding style for Python C files
  13. ;; and modules.  It is compatible with cc-mode.el which should be a
  14. ;; standard part of your Emacs distribution (or see
  15. ;; <http://www.python.org/emacs/cc-mode>).
  16.  
  17. ;; To use, make sure this file is on your Emacs load-path, and simply
  18. ;; add this to your .emacs file:
  19. ;;
  20. ;; (add-hook 'c-mode-common-hook '(lambda () (require 'python-style)))
  21.  
  22. ;; This file will self-install on your c-style-alist variable,
  23. ;; although you will have to install it on a per-file basis with:
  24. ;;
  25. ;; M-x c-set-style RET python RET
  26.  
  27. ;;; Code:
  28.  
  29. (defconst python-cc-style
  30.   '((indent-tabs-mode . t)
  31.     (c-basic-offset   . 8)
  32.     (c-offsets-alist  . ((substatement-open . 0)
  33.              ))
  34.     (c-hanging-braces-alist . ((brace-list-open)
  35.                    (brace-list-intro)
  36.                    (brace-list-close)
  37.                    (substatement-open after)
  38.                    (block-close . c-snug-do-while)
  39.                    ))
  40.     )
  41.   "Standard Python C coding style.")
  42.  
  43. (require 'cc-mode)
  44. (if (not (assoc "python" c-style-alist))
  45.     (c-add-style "python" python-cc-style))
  46.  
  47. (provide 'ccpy-style)
  48. ;;; ccpy-style.el ends here
  49.