Add a .dir-locals.el that configures emacs' treatment of tabs.
The Haskell code uses tabs for indentation, and displays well with tab-width set to 2. So, I created a .dir-locals.el (applies to all files opened in emacs at or below ./), which sets 'tab-width' to 2, turns on 'indent-tabs-mode', and highlights leading spaces in 'haskell-mode'.
This commit is contained in:
parent
6c8507ee1b
commit
4453351ca4
1 changed files with 22 additions and 0 deletions
22
.dir-locals.el
Normal file
22
.dir-locals.el
Normal file
|
@ -0,0 +1,22 @@
|
|||
;; Configure emacs' treatment of tabs.
|
||||
;;
|
||||
;; See
|
||||
;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html
|
||||
;; for a description of this file.
|
||||
;;
|
||||
;; The 'nil' below applies to all modes.
|
||||
((nil . ((indent-tabs-mode . t)
|
||||
(tab-width . 2)))
|
||||
(haskell-mode . (
|
||||
;; Highlight leading space characters, to avoid indenting with
|
||||
;; spaces.
|
||||
;;
|
||||
;; Emacs will prompt you about this, saying it's unsafe, but
|
||||
;; you can permanently store an exception by pressing "!",
|
||||
;; which inserts
|
||||
;;
|
||||
;; (safe-local-variable-values . (quote ((eval highlight-regexp "^ *"))))
|
||||
;;
|
||||
;; in your ~/.emacs ... except the exception doesn't work, and
|
||||
;; emacs still asks you on each file you open :P
|
||||
(eval . (highlight-regexp "^ *")))))
|
Loading…
Reference in a new issue