Skip to content

Commit

Permalink
Refined emacs handling of indentation. (#717)
Browse files Browse the repository at this point in the history
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
leekillough authored Feb 18, 2023
1 parent 059f151 commit 0ba6e9e
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 18 deletions.
43 changes: 32 additions & 11 deletions .dir-locals.el
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)
)
)
)
13 changes: 6 additions & 7 deletions config/old/newarch/make_defs.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#
# BLIS
#
# BLIS
# An object-based framework for developing high-performance BLAS-like
# libraries.
#
Expand Down Expand Up @@ -47,7 +47,7 @@ CC := gcc
CC_VENDOR := gcc
endif

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

ifeq ($(CC_VENDOR),gcc)
CKVECFLAGS :=
CKVECFLAGS :=
else
ifeq ($(CC_VENDOR),icc)
CKVECFLAGS :=
CKVECFLAGS :=
else
ifeq ($(CC_VENDOR),clang)
CKVECFLAGS :=
CKVECFLAGS :=
else
$(error gcc, icc, or clang is required for this configuration.)
endif
Expand All @@ -83,4 +83,3 @@ endif
# Store all of the variables here to new variables containing the
# configuration name.
$(eval $(call store-make-defs,$(THIS_CONFIG)))

0 comments on commit 0ba6e9e

Please sign in to comment.