summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Nathan Collins <nathan.collins@gmail.com>2012-06-10 02:11:40 -0700
committerGravatar Nathan Collins <nathan.collins@gmail.com>2012-06-10 02:11:40 -0700
commit4453351ca4b3dfe313b475bbf6e1de9a9b250fb5 (patch)
treecbe94aef1e4488b931f70dc731e9a8c80587397a
parent6c8507ee1b0a5bd361c38ec0fa342e616b990357 (diff)
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'.
-rw-r--r--.dir-locals.el22
1 files changed, 22 insertions, 0 deletions
diff --git a/.dir-locals.el b/.dir-locals.el
new file mode 100644
index 000000000..e523528e2
--- /dev/null
+++ b/.dir-locals.el
@@ -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 "^ *")))))