Skip to content

Commit 5923088

Browse files
committed
dir-locals.el: Adds White Space support
Trailing white spaces will be now always highlighted, not just in prog-mode. Also, the White Space package, which is available since GNU Emacs 22, is loaded and activated locally in prog-mode. Additionally, using White Space variables, we set highlighting through faces on wrong indentation and the maximum length of a coding line. Notice that: - The highlighting for the characters beyond the set length of a coding line is not activated by default, only for wrong indentations. - If the White Space package is not available, errors on loading or activation are ignored. - If the White Space mode is not activated the set variables would not have any effect. v2: Removed too long lines trail highlighting, as suggested by Ilia Mirkin. Signed-off-by: Andres Gomez <[email protected]> Acked-by: Ilia Mirkin <[email protected]>
1 parent 9730f27 commit 5923088

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.dir-locals.el

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
((prog-mode
1+
((nil . ((show-trailing-whitespace . t)))
2+
(prog-mode
23
(indent-tabs-mode . nil)
34
(tab-width . 8)
45
(c-basic-offset . 3)
@@ -8,6 +9,10 @@
89
(c-set-offset 'case-label '0)
910
(c-set-offset 'innamespace '0)
1011
(c-set-offset 'inline-open '0)))
11-
)
12+
(whitespace-style face indentation)
13+
(whitespace-line-column . 79)
14+
(eval ignore-errors
15+
(require 'whitespace)
16+
(whitespace-mode 1)))
1217
(makefile-mode (indent-tabs-mode . t))
1318
)

0 commit comments

Comments
 (0)