Skip to content

Commit 0ba6e9e

Browse files
authored
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.)
1 parent 059f151 commit 0ba6e9e

File tree

2 files changed

+38
-18
lines changed

2 files changed

+38
-18
lines changed

.dir-locals.el

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,32 @@
1-
;; Emacs C mode formatting for the BLIS layout requirements.
2-
((c-mode . ((c-file-style . "stroustrup")
3-
(c-basic-offset . 4)
4-
(comment-start . "// ")
5-
(comment-end . "")
6-
(indent-tabs-mode . t)
7-
(tab-width . 4)
8-
(parens-require-spaces . nil)
9-
(require-final-newline . t)
10-
(eval add-hook `before-save-hook `delete-trailing-whitespace)
11-
)))
1+
;; Emacs formatting for the BLIS layout requirements.
2+
3+
(
4+
;; Recognize *.mk files as Makefile fragments
5+
(auto-mode-alist . (("\\.mk\\'" . makefile-mode)) )
6+
7+
;; Makefiles require tabs and are almost always width 8
8+
(makefile-mode . (
9+
(indent-tabs-mode . t)
10+
(tab-width . 8)
11+
)
12+
)
13+
14+
;; C code formatting roughly according to docs/CodingConventions.md
15+
(c-mode . (
16+
(c-file-style . "bsd")
17+
(c-basic-offset . 4)
18+
(comment-start . "// ")
19+
(comment-end . "")
20+
(parens-require-spaces . nil)
21+
)
22+
)
23+
24+
;; Default formatting for all source files not overriden above
25+
(prog-mode . (
26+
(indent-tabs-mode . nil)
27+
(tab-width . 4)
28+
(require-final-newline . t)
29+
(eval add-hook `before-save-hook `delete-trailing-whitespace)
30+
)
31+
)
32+
)

config/old/newarch/make_defs.mk

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#!/bin/bash
21
#
3-
# BLIS
2+
#
3+
# BLIS
44
# An object-based framework for developing high-performance BLAS-like
55
# libraries.
66
#
@@ -47,7 +47,7 @@ CC := gcc
4747
CC_VENDOR := gcc
4848
endif
4949

50-
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
50+
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
5151
# NOTE: This is needed to enable posix_memalign().
5252
CPPROCFLAGS := -D_POSIX_C_SOURCE=200112L
5353
CMISCFLAGS := -std=c99
@@ -67,13 +67,13 @@ endif
6767
CKOPTFLAGS := $(COPTFLAGS)
6868

6969
ifeq ($(CC_VENDOR),gcc)
70-
CKVECFLAGS :=
70+
CKVECFLAGS :=
7171
else
7272
ifeq ($(CC_VENDOR),icc)
73-
CKVECFLAGS :=
73+
CKVECFLAGS :=
7474
else
7575
ifeq ($(CC_VENDOR),clang)
76-
CKVECFLAGS :=
76+
CKVECFLAGS :=
7777
else
7878
$(error gcc, icc, or clang is required for this configuration.)
7979
endif
@@ -83,4 +83,3 @@ endif
8383
# Store all of the variables here to new variables containing the
8484
# configuration name.
8585
$(eval $(call store-make-defs,$(THIS_CONFIG)))
86-

0 commit comments

Comments
 (0)