Path: blob/main/crypto/openssl/doc/openssl-c-indent.el
34869 views
;;; This Emacs Lisp file defines a C indentation style for OpenSSL.1;;;2;;; This definition is for the "CC mode" package, which is the default3;;; mode for editing C source files in Emacs 20, not for the older4;;; c-mode.el (which was the default in less recent releases of Emacs 19).5;;;6;;; Recommended use is to add this line in your .emacs:7;;;8;;; (load (expand-file-name "~/PATH/TO/openssl-c-indent.el"))9;;;10;;; To activate this indentation style, visit a C file, type11;;; M-x c-set-style <RET> (or C-c . for short), and enter "eay".12;;; To toggle the auto-newline feature of CC mode, type C-c C-a.13;;;14;;; If you're an OpenSSL developer, you might find it more comfortable15;;; to have this style be permanent in your OpenSSL development16;;; directory. To have that, please perform this:17;;;18;;; M-x add-dir-local-variable <RET> c-mode <RET> c-file-style <RET>19;;; "OpenSSL-II" <RET>20;;;21;;; A new buffer with .dir-locals.el will appear. Save it (C-x C-s).22;;;23;;; Alternatively, have a look at dir-locals.example.el2425;;; For suggesting improvements, please send e-mail to [email protected].2627;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;28;; Note, it could be easy to inherit from the "gnu" style... however,29;; one never knows if that style will change somewhere in the future,30;; so I've chosen to copy the "gnu" style values explicitly instead31;; and mark them with a comment. // RLevitte 2015-08-3132;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3334(c-add-style "OpenSSL-II"35'((c-basic-offset . 4)36(indent-tabs-mode . nil)37(fill-column . 78)38(comment-column . 33)39(c-comment-only-line-offset 0 . 0) ; From "gnu" style40(c-hanging-braces-alist ; From "gnu" style41(substatement-open before after) ; From "gnu" style42(arglist-cont-nonempty)) ; From "gnu" style43(c-offsets-alist44(statement-block-intro . +) ; From "gnu" style45(knr-argdecl-intro . 0)46(knr-argdecl . 0)47(substatement-open . +) ; From "gnu" style48(substatement-label . 0) ; From "gnu" style49(label . 1)50(statement-case-open . +) ; From "gnu" style51(statement-cont . +) ; From "gnu" style52(arglist-intro . c-lineup-arglist-intro-after-paren) ; From "gnu" style53(arglist-close . c-lineup-arglist) ; From "gnu" style54(inline-open . 0) ; From "gnu" style55(brace-list-open . +) ; From "gnu" style56(inextern-lang . 0) ; Don't indent inside extern block57(topmost-intro-cont first c-lineup-topmost-intro-cont58c-lineup-gnu-DEFUN-intro-cont) ; From "gnu" style59)60(c-special-indent-hook . c-gnu-impose-minimum) ; From "gnu" style61(c-block-comment-prefix . "* ")62))636465