summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Triplett <josht@linux.vnet.ibm.com>2007-07-15 23:41:37 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-16 09:05:50 -0700
commit4e7bd66318b3ae60fbba7d886d9a98b71ffbf74e (patch)
tree02cb27db780c8c12f457f15bbabcb5859d29c7f6
parenta923fd6ae7599aee63934ed13c3033fdefc7a18e (diff)
downloadtalos-obmc-linux-4e7bd66318b3ae60fbba7d886d9a98b71ffbf74e.tar.gz
talos-obmc-linux-4e7bd66318b3ae60fbba7d886d9a98b71ffbf74e.zip
CodingStyle: add information about editor modelines
I recently received a patch including a file that had a vim modeline, and I realized that nothing specifically proscribed that practice. Signed-off-by: Josh Triplett <josh@freedesktop.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--Documentation/CodingStyle27
1 files changed, 27 insertions, 0 deletions
diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle
index 00bffa7b740e..a667eb1fc26e 100644
--- a/Documentation/CodingStyle
+++ b/Documentation/CodingStyle
@@ -738,6 +738,33 @@ need them. Feel free to peruse that header file to see what else is already
defined that you shouldn't reproduce in your code.
+ Chapter 18: Editor modelines and other cruft
+
+Some editors can interpret configuration information embedded in source files,
+indicated with special markers. For example, emacs interprets lines marked
+like this:
+
+-*- mode: c -*-
+
+Or like this:
+
+/*
+Local Variables:
+compile-command: "gcc -DMAGIC_DEBUG_FLAG foo.c"
+End:
+*/
+
+Vim interprets markers that look like this:
+
+/* vim:set sw=8 noet */
+
+Do not include any of these in source files. People have their own personal
+editor configurations, and your source files should not override them. This
+includes markers for indentation and mode configuration. People may use their
+own custom mode, or may have some other magic method for making indentation
+work correctly.
+
+
Appendix I: References
OpenPOWER on IntegriCloud