-
Notifications
You must be signed in to change notification settings - Fork 374
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refined emacs handling of indentation. (#717)
Details: - This refines the emacs autoformatting to be better in line with contribution guidelines. - Removed a stray shebang in a .mk file which confuses emacs about the file mode, which should be makefile-mode. (emacs also removes stray whitespace at the ends of lines.)
- Loading branch information
1 parent
059f151
commit 0ba6e9e
Showing
2 changed files
with
38 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,32 @@ | ||
;; Emacs C mode formatting for the BLIS layout requirements. | ||
((c-mode . ((c-file-style . "stroustrup") | ||
(c-basic-offset . 4) | ||
(comment-start . "// ") | ||
(comment-end . "") | ||
(indent-tabs-mode . t) | ||
(tab-width . 4) | ||
(parens-require-spaces . nil) | ||
(require-final-newline . t) | ||
(eval add-hook `before-save-hook `delete-trailing-whitespace) | ||
))) | ||
;; Emacs formatting for the BLIS layout requirements. | ||
|
||
( | ||
;; Recognize *.mk files as Makefile fragments | ||
(auto-mode-alist . (("\\.mk\\'" . makefile-mode)) ) | ||
|
||
;; Makefiles require tabs and are almost always width 8 | ||
(makefile-mode . ( | ||
(indent-tabs-mode . t) | ||
(tab-width . 8) | ||
) | ||
) | ||
|
||
;; C code formatting roughly according to docs/CodingConventions.md | ||
(c-mode . ( | ||
(c-file-style . "bsd") | ||
(c-basic-offset . 4) | ||
(comment-start . "// ") | ||
(comment-end . "") | ||
(parens-require-spaces . nil) | ||
) | ||
) | ||
|
||
;; Default formatting for all source files not overriden above | ||
(prog-mode . ( | ||
(indent-tabs-mode . nil) | ||
(tab-width . 4) | ||
(require-final-newline . t) | ||
(eval add-hook `before-save-hook `delete-trailing-whitespace) | ||
) | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters