diff options
| author | Josh Triplett <josht@linux.vnet.ibm.com> | 2007-07-16 02:41:37 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-16 12:05:50 -0400 |
| commit | 4e7bd66318b3ae60fbba7d886d9a98b71ffbf74e (patch) | |
| tree | 02cb27db780c8c12f457f15bbabcb5859d29c7f6 /Documentation/CodingStyle | |
| parent | a923fd6ae7599aee63934ed13c3033fdefc7a18e (diff) | |
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>
Diffstat (limited to 'Documentation/CodingStyle')
| -rw-r--r-- | Documentation/CodingStyle | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle index 00bffa7b74..a667eb1fc2 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 | |||
| 738 | defined that you shouldn't reproduce in your code. | 738 | defined that you shouldn't reproduce in your code. |
| 739 | 739 | ||
| 740 | 740 | ||
| 741 | Chapter 18: Editor modelines and other cruft | ||
| 742 | |||
| 743 | Some editors can interpret configuration information embedded in source files, | ||
| 744 | indicated with special markers. For example, emacs interprets lines marked | ||
| 745 | like this: | ||
| 746 | |||
| 747 | -*- mode: c -*- | ||
| 748 | |||
| 749 | Or like this: | ||
| 750 | |||
| 751 | /* | ||
| 752 | Local Variables: | ||
| 753 | compile-command: "gcc -DMAGIC_DEBUG_FLAG foo.c" | ||
| 754 | End: | ||
| 755 | */ | ||
| 756 | |||
| 757 | Vim interprets markers that look like this: | ||
| 758 | |||
| 759 | /* vim:set sw=8 noet */ | ||
| 760 | |||
| 761 | Do not include any of these in source files. People have their own personal | ||
| 762 | editor configurations, and your source files should not override them. This | ||
| 763 | includes markers for indentation and mode configuration. People may use their | ||
| 764 | own custom mode, or may have some other magic method for making indentation | ||
| 765 | work correctly. | ||
| 766 | |||
| 767 | |||
| 741 | 768 | ||
| 742 | Appendix I: References | 769 | Appendix I: References |
| 743 | 770 | ||
