1996-12-09 21:57:25 +00:00
|
|
|
;;; ccpy-style.el --- cc-mode style definition for Python C code
|
|
|
|
;;
|
1999-12-01 22:52:19 +00:00
|
|
|
;; Author: 1996 Barry A. Warsaw
|
1999-12-01 22:46:09 +00:00
|
|
|
;; Created: 6-Dec-1996
|
1996-12-09 21:57:25 +00:00
|
|
|
;; Keywords: c python languages oop
|
|
|
|
|
|
|
|
;;; Commentary
|
1999-12-01 22:38:59 +00:00
|
|
|
;;
|
|
|
|
;; NOTE: This file is obsolete! All current versions of CC Mode
|
|
|
|
;; include a "python" style by default.
|
|
|
|
|
1996-12-09 21:57:25 +00:00
|
|
|
;; This file defines the standard C coding style for Python C files
|
|
|
|
;; and modules. It is compatible with cc-mode.el which should be a
|
|
|
|
;; standard part of your Emacs distribution (or see
|
1999-12-01 23:30:46 +00:00
|
|
|
;; <http://www.python.org/emacs/cc-mode>).
|
1996-12-09 21:57:25 +00:00
|
|
|
|
|
|
|
;; To use, make sure this file is on your Emacs load-path, and simply
|
|
|
|
;; add this to your .emacs file:
|
|
|
|
;;
|
|
|
|
;; (add-hook 'c-mode-common-hook '(lambda () (require 'python-style)))
|
|
|
|
|
|
|
|
;; This file will self-install on your c-style-alist variable,
|
|
|
|
;; although you will have to install it on a per-file basis with:
|
|
|
|
;;
|
1996-12-09 22:07:22 +00:00
|
|
|
;; M-x c-set-style RET python RET
|
1996-12-09 21:57:25 +00:00
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
|
|
|
(defconst python-cc-style
|
1996-12-09 22:07:22 +00:00
|
|
|
'((indent-tabs-mode . t)
|
1996-12-09 21:57:25 +00:00
|
|
|
(c-basic-offset . 8)
|
1996-12-20 16:42:04 +00:00
|
|
|
(c-offsets-alist . ((substatement-open . 0)
|
|
|
|
))
|
1996-12-20 16:43:32 +00:00
|
|
|
(c-hanging-braces-alist . ((brace-list-open)
|
1996-12-20 16:42:04 +00:00
|
|
|
(brace-list-intro)
|
|
|
|
(brace-list-close)
|
|
|
|
(substatement-open after)
|
|
|
|
(block-close . c-snug-do-while)
|
|
|
|
))
|
1996-12-09 21:57:25 +00:00
|
|
|
)
|
|
|
|
"Standard Python C coding style.")
|
|
|
|
|
|
|
|
(require 'cc-mode)
|
|
|
|
(if (not (assoc "python" c-style-alist))
|
|
|
|
(c-add-style "python" python-cc-style))
|
1996-12-10 16:29:21 +00:00
|
|
|
|
|
|
|
(provide 'ccpy-style)
|
|
|
|
;;; ccpy-style.el ends here
|