
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'.
22 lines
832 B
EmacsLisp
22 lines
832 B
EmacsLisp
;; 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 "^ *")))))
|