summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Levitte <richard@levitte.org>2015-08-31 17:25:17 +0200
committerRichard Levitte <levitte@openssl.org>2015-08-31 18:21:04 +0200
commit82f42f525bcdaa2d615fb46f6140865b814e9523 (patch)
treed7c7e9519227402f340d6fd66f14ac1a96c81bca
parentab3f51f4b031c98a916969bafd59d663efa8c57b (diff)
Add an example .dir-locals.el
This file, when copied to .dir-locals.el in the OpenSSL source top, will make sure that the CC mode style "OpenSSL-II" will be used for all C files. Additionally, I makes sure that tabs are never used as indentation character, regardless of the emacs mode, and that the fill column is 78. Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 0927f0d822b1e0f55cb7d8bacf9004ad3495514b)
-rw-r--r--doc/dir-locals.example.el17
-rw-r--r--doc/openssl-c-indent.el2
2 files changed, 19 insertions, 0 deletions
diff --git a/doc/dir-locals.example.el b/doc/dir-locals.example.el
new file mode 100644
index 0000000000..a9fa24464e
--- /dev/null
+++ b/doc/dir-locals.example.el
@@ -0,0 +1,17 @@
+;;; This is an example of what a .dir-locals.el suitable for OpenSSL
+;;; development could look like.
+;;;
+;;; Apart from setting the CC mode style to "OpenSSL-II", it also
+;;; makes sure that tabs are never used for indentation in any file,
+;;; and that the fill column is 78.
+;;;
+;;; For more information see (info "(emacs) Directory Variables")
+
+((nil
+ (indent-tabs-mode . nil)
+ (fill-column . 78)
+ ;; (auto-fill-mode . t) ;; optional.
+ )
+ (c-mode
+ (auto-fill-mode . nil) ;; auto-fill makes more harm than good in C
+ (c-file-style . "OpenSSL-II")))
diff --git a/doc/openssl-c-indent.el b/doc/openssl-c-indent.el
index d0b19c8936..144a915675 100644
--- a/doc/openssl-c-indent.el
+++ b/doc/openssl-c-indent.el
@@ -21,6 +21,8 @@
;;;
;;; A new buffer with .dir-locals.el will appear. Save it (C-x C-s).
;;;
+;;; Alternatively, have a look at dir-locals.example.el
+
;;; For suggesting improvements, please send e-mail to levitte@openssl.org.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;