blob: bb2d2f4db2201f98f9d700c8491e671bcde9716d [file] [log] [blame]
Barry Warsaw0b324591996-12-09 21:57:25 +00001;;; ccpy-style.el --- cc-mode style definition for Python C code
2;;
Barry Warsawde4636c1999-12-01 22:52:19 +00003;; Author: 1996 Barry A. Warsaw
Barry Warsaw086bc361999-12-01 22:46:09 +00004;; Created: 6-Dec-1996
Barry Warsaw0b324591996-12-09 21:57:25 +00005;; Keywords: c python languages oop
6
7;;; Commentary
Barry Warsaw0319b3701999-12-01 22:38:59 +00008;;
9;; NOTE: This file is obsolete! All current versions of CC Mode
10;; include a "python" style by default.
11
Barry Warsaw0b324591996-12-09 21:57:25 +000012;; 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
Barry Warsaw6c3e3a91999-12-01 23:30:46 +000015;; <http://www.python.org/emacs/cc-mode>).
Barry Warsaw0b324591996-12-09 21:57:25 +000016
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;;
Barry Warsaw8c0710f1996-12-09 22:07:22 +000025;; M-x c-set-style RET python RET
Barry Warsaw0b324591996-12-09 21:57:25 +000026
27;;; Code:
28
29(defconst python-cc-style
Barry Warsaw8c0710f1996-12-09 22:07:22 +000030 '((indent-tabs-mode . t)
Barry Warsaw0b324591996-12-09 21:57:25 +000031 (c-basic-offset . 8)
Barry Warsaw7607e8f1996-12-20 16:42:04 +000032 (c-offsets-alist . ((substatement-open . 0)
33 ))
Barry Warsawfca83711996-12-20 16:43:32 +000034 (c-hanging-braces-alist . ((brace-list-open)
Barry Warsaw7607e8f1996-12-20 16:42:04 +000035 (brace-list-intro)
36 (brace-list-close)
37 (substatement-open after)
38 (block-close . c-snug-do-while)
39 ))
Barry Warsaw0b324591996-12-09 21:57:25 +000040 )
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))
Barry Warsaw1d757341996-12-10 16:29:21 +000046
47(provide 'ccpy-style)
48;;; ccpy-style.el ends here