xref: /minix3/crypto/external/bsd/openssl/dist/doc/c-indentation.el (revision ebfedea0ce5bbe81e252ddf32d732e40fb633fae)
1*ebfedea0SLionel Sambuc; This Emacs Lisp file defines a C indentation style that closely
2*ebfedea0SLionel Sambuc; follows most aspects of the one that is used throughout SSLeay,
3*ebfedea0SLionel Sambuc; and hence in OpenSSL.
4*ebfedea0SLionel Sambuc;
5*ebfedea0SLionel Sambuc; This definition is for the "CC mode" package, which is the default
6*ebfedea0SLionel Sambuc; mode for editing C source files in Emacs 20, not for the older
7*ebfedea0SLionel Sambuc; c-mode.el (which was the default in less recent releaes of Emacs 19).
8*ebfedea0SLionel Sambuc;
9*ebfedea0SLionel Sambuc; Copy the definition in your .emacs file or use M-x eval-buffer.
10*ebfedea0SLionel Sambuc; To activate this indentation style, visit a C file, type
11*ebfedea0SLionel Sambuc; M-x c-set-style <RET> (or C-c . for short), and enter "eay".
12*ebfedea0SLionel Sambuc; To toggle the auto-newline feature of CC mode, type C-c C-a.
13*ebfedea0SLionel Sambuc;
14*ebfedea0SLionel Sambuc; Apparently statement blocks that are not introduced by a statement
15*ebfedea0SLionel Sambuc; such as "if" and that are not the body of a function cannot
16*ebfedea0SLionel Sambuc; be handled too well by CC mode with this indentation style,
17*ebfedea0SLionel Sambuc; so you have to indent them manually (you can use C-q tab).
18*ebfedea0SLionel Sambuc;
19*ebfedea0SLionel Sambuc; For suggesting improvements, please send e-mail to bodo@openssl.org.
20*ebfedea0SLionel Sambuc
21*ebfedea0SLionel Sambuc(c-add-style "eay"
22*ebfedea0SLionel Sambuc	     '((c-basic-offset . 8)
23*ebfedea0SLionel Sambuc	       (indent-tabs-mode . t)
24*ebfedea0SLionel Sambuc	       (c-comment-only-line-offset . 0)
25*ebfedea0SLionel Sambuc	       (c-hanging-braces-alist)
26*ebfedea0SLionel Sambuc	       (c-offsets-alist	. ((defun-open . +)
27*ebfedea0SLionel Sambuc				   (defun-block-intro . 0)
28*ebfedea0SLionel Sambuc				   (class-open . +)
29*ebfedea0SLionel Sambuc				   (class-close . +)
30*ebfedea0SLionel Sambuc				   (block-open . 0)
31*ebfedea0SLionel Sambuc				   (block-close . 0)
32*ebfedea0SLionel Sambuc				   (substatement-open . +)
33*ebfedea0SLionel Sambuc				   (statement . 0)
34*ebfedea0SLionel Sambuc				   (statement-block-intro . 0)
35*ebfedea0SLionel Sambuc				   (statement-case-open . +)
36*ebfedea0SLionel Sambuc				   (statement-case-intro . +)
37*ebfedea0SLionel Sambuc				   (case-label . -)
38*ebfedea0SLionel Sambuc				   (label . -)
39*ebfedea0SLionel Sambuc				   (arglist-cont-nonempty . +)
40*ebfedea0SLionel Sambuc				   (topmost-intro . -)
41*ebfedea0SLionel Sambuc				   (brace-list-close . 0)
42*ebfedea0SLionel Sambuc				   (brace-list-intro . 0)
43*ebfedea0SLionel Sambuc				   (brace-list-open . +)
44*ebfedea0SLionel Sambuc				   ))))
45*ebfedea0SLionel Sambuc
46