blob: dd74b0d4f7743aa0c82dbe0856c1aec25783c116 [file] [log] [blame]
Barry Warsaw0b324591996-12-09 21:57:25 +00001;;; ccpy-style.el --- cc-mode style definition for Python C code
2;;
3;; Author: 1996 Barry A. Warsaw
4;; Created: 6-Dec-1996
5;; Version: $Revision$
6;; Last Modified: $Date$
7;; Keywords: c python languages oop
8
9;;; Commentary
10;; This file defines the standard C coding style for Python C files
11;; and modules. It is compatible with cc-mode.el which should be a
12;; standard part of your Emacs distribution (or see
13;; <http://www.python.org/ftp/emacs/>).
14
15;; To use, make sure this file is on your Emacs load-path, and simply
16;; add this to your .emacs file:
17;;
18;; (add-hook 'c-mode-common-hook '(lambda () (require 'python-style)))
19
20;; This file will self-install on your c-style-alist variable,
21;; although you will have to install it on a per-file basis with:
22;;
Barry Warsaw8c0710f1996-12-09 22:07:22 +000023;; M-x c-set-style RET python RET
Barry Warsaw0b324591996-12-09 21:57:25 +000024
25;;; Code:
26
27(defconst python-cc-style
Barry Warsaw8c0710f1996-12-09 22:07:22 +000028 '((indent-tabs-mode . t)
Barry Warsaw0b324591996-12-09 21:57:25 +000029 (c-basic-offset . 8)
Barry Warsaw7607e8f1996-12-20 16:42:04 +000030 (c-offsets-alist . ((substatement-open . 0)
31 ))
Barry Warsawfca83711996-12-20 16:43:32 +000032 (c-hanging-braces-alist . ((brace-list-open)
Barry Warsaw7607e8f1996-12-20 16:42:04 +000033 (brace-list-intro)
34 (brace-list-close)
35 (substatement-open after)
36 (block-close . c-snug-do-while)
37 ))
Barry Warsaw0b324591996-12-09 21:57:25 +000038 )
39 "Standard Python C coding style.")
40
41(require 'cc-mode)
42(if (not (assoc "python" c-style-alist))
43 (c-add-style "python" python-cc-style))
Barry Warsaw1d757341996-12-10 16:29:21 +000044
45(provide 'ccpy-style)
46;;; ccpy-style.el ends here