File: indent.el

package info (click to toggle)
botan1.10 1.10.8-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 12,288 kB
  • sloc: cpp: 61,853; python: 1,687; asm: 1,247; ansic: 252; perl: 89; sh: 52; makefile: 38; lisp: 34
file content (55 lines) | stat: -rw-r--r-- 1,445 bytes parent folder | download | duplicates (19)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
; This Emacs Lips code defines the indentation style used in Botan. If doesn't
; get everything perfectly correct, but it's pretty close. Copy this code into
; your .emacs file, or use M-x eval-buffer. Make sure to also set
; indent-tabs-mode to nil so spaces are inserted instead.
;
; This style is basically Whitesmiths style with 3 space indents (the Emacs
; "whitesmith" style seems more like a weird Whitesmiths/Allman mutant style).
;
; To activate using this style, open the file you want to edit and run this:
; M-x c-set-style <RET> and then enter "botan".

(setq botan-style '(
   (c-basic-offset . 3)
   (c-comment-only-line-offset . 0)
   (c-offsets-alist
      (c . 0)
      (comment-intro . 0)

      (statement-block-intro . 0)
      (statement-cont . +)

      (substatement . +)
      (substatement-open . +)

      (block-open . +)
      (block-close . 0)

      (defun-open . +)
      (defun-close . 0)
      (defun-block-intro . 0)
      (func-decl-cont . +)

      (class-open . +)
      (class-close . +)
      (inclass . +)
      (access-label . -)
      (inline-open . +)
      (inline-close . 0)

      (extern-lang-open . 0)
      (extern-lang-close . 0)
      (inextern-lang . 0)

      (statement-case-open +)

      (namespace-open . 0)
      (namespace-close . 0)
      (innamespace . 0)

      (label . 0)
      )
))

(add-hook 'c++-mode-common-hook
  (function (lambda () (c-add-style "botan" botan-style nil))))