155714Skris; This Emacs Lisp file defines a C indentation style that closely
255714Skris; follows most aspects of the one that is used throughout SSLeay,
355714Skris; and hence in OpenSSL.
455714Skris;
555714Skris; This definition is for the "CC mode" package, which is the default
655714Skris; mode for editing C source files in Emacs 20, not for the older
755714Skris; c-mode.el (which was the default in less recent releaes of Emacs 19).
855714Skris;
955714Skris; Copy the definition in your .emacs file or use M-x eval-buffer.
1055714Skris; To activate this indentation style, visit a C file, type
1155714Skris; M-x c-set-style <RET> (or C-c . for short), and enter "eay".
1255714Skris; To toggle the auto-newline feature of CC mode, type C-c C-a.
1355714Skris;
1455714Skris; Apparently statement blocks that are not introduced by a statement
1555714Skris; such as "if" and that are not the body of a function cannot
16109998Smarkm; be handled too well by CC mode with this indentation style,
17109998Smarkm; so you have to indent them manually (you can use C-q tab).
18109998Smarkm;
19109998Smarkm; For suggesting improvements, please send e-mail to bodo@openssl.org.
2055714Skris
2155714Skris(c-add-style "eay"
2255714Skris	     '((c-basic-offset . 8)
23194206Ssimon	       (indent-tabs-mode . t)
2455714Skris	       (c-comment-only-line-offset . 0)
2555714Skris	       (c-hanging-braces-alist)
2655714Skris	       (c-offsets-alist	. ((defun-open . +)
2755714Skris				   (defun-block-intro . 0)
2859191Skris				   (class-open . +)
2959191Skris				   (class-close . +)
3055714Skris				   (block-open . 0)
3159191Skris				   (block-close . 0)
3255714Skris				   (substatement-open . +)
3359191Skris				   (statement . 0)
3455714Skris				   (statement-block-intro . 0)
3555714Skris				   (statement-case-open . +)
3655714Skris				   (statement-case-intro . +)
3755714Skris				   (case-label . -)
3855714Skris				   (label . -)
3959191Skris				   (arglist-cont-nonempty . +)
4059191Skris				   (topmost-intro . -)
4168651Skris				   (brace-list-close . 0)
4268651Skris				   (brace-list-intro . 0)
4368651Skris				   (brace-list-open . +)
4459191Skris				   ))))
4559191Skris
46