Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Emacs Configuration for C++ #11

Open
wants to merge 2 commits into
base: excelsior
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Contributing to Tangerine

Contributions are welcome!
Here are some pointers.

## C++ Style Guide

C++ code written for Tangerine (i.e. in `tangerine/`, not in `third_party/`) should generally follow the [Unreal Engine coding standards](https://docs.unrealengine.com/5.1/en-US/epic-cplusplus-coding-standard-for-unreal-engine/), except that Tangerine does not use Hungarian notation.

The main points are:

- Indent with tabs, one tab per indentation level.
Tabs are to be 4 characters wide.

- Braces are always on their own line at the same indentation level as the surrounding scope.

- `TitleCase` is used for all class names, function names, variable names, constants, and so on.

- Variable names should be descriptive and useful.

- Single digit variables may be lower case for loop counters, but should generally be uppercase otherwise.

- Single digit variable names should be avoided in favor of more descriptive names, but they do show up as loop counters, coordinates, and sometimes math terms.

- `UPPER_SNAKE_CASE` is used for preprocessor defines.

- Preprocessor directives should be lowercase and have no space between the `#` and the name, like so: `#define FNORD 1`.

- Preprocessor directives generally aren't indented, but may be if it improves clarity.

- `snake_case` is used for labels.

- Labels should not be indented.

- `goto` is acceptable when it improves readability.

- There's no line limit, but the code should probably read ok on a modest 1080p monitor in a full screen window with a reasonable font size.
33 changes: 33 additions & 0 deletions tangerine/.dir-locals.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
;; See ../CONTRIBUTING.md for details.
((auto-mode-alist . (("\\.h\\'" . c++-mode)))
(c++-mode . ((c-file-style . "linux")
(indent-tabs-mode . t)
(tab-width . 4)
(c-basic-offset . 4)
(c-file-offsets
(arglist-cont . 0)
(arglist-intro . +)
(block-close . 0)
(brace-entry-open . 0)
(brace-list-close . 0)
(brace-list-entry . 0)
(brace-list-intro . +)
(class-close . 0)
(class-open . 0)
(case-label . 0)
(defun-block-intro . +)
(defun-close . 0)
(defun-open . 0)
(else-clause . 0)
(inclass . +)
(inline-close . 0)
(inline-open . 0)
(label . 0)
(member-init-cont . -)
(member-init-intro . +)
(statement . 0)
(statement-block-intro . +)
(statement-case-intro . +)
(statement-cont . +)
(substatement-open . 0)
(topmost-intro . 0)))))