cpython-withatomic / Misc / ccpy-style.el

;;; ccpy-style.el  ---  cc-mode style definition for Python C code
;; Author:  1996 Barry A. Warsaw
;; Created:  6-Dec-1996
;; Version: $Revision$
;; Last Modified: $Date$
;; Keywords: c python languages oop

;;; Commentary
;; 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
;; <>).

;; 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:
;; M-x c-set-style RET python RET

;;; Code:

(defconst python-cc-style
  '((indent-tabs-mode . t)
    (c-basic-offset   . 8)
    (c-offsets-alist  . ((substatement-open . 0)
    (c-hanging-braces-alist . ((brace-list-open)
			       (substatement-open after)
			       (block-close . c-snug-do-while)
  "Standard Python C coding style.")

(require 'cc-mode)
(if (not (assoc "python" c-style-alist))
    (c-add-style "python" python-cc-style))

(provide 'ccpy-style)
;;; ccpy-style.el ends here
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.