From f08084b3630184035f320d18f060fabbd073f301 Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Tue, 17 May 2016 18:46:00 +0200 Subject: [PATCH] lisp-interaction-mode: indent using spaces Many users set `indent-tabs-mode' global value to nil. And I agree with those users, this should have been the default. But the reality is that it isn't the default. If you change the default locally, then your default is different from the "default default", which is a problem because most files that were authored by people who prefer to use tabs do NOT explicitly set the file local value to t, because that doing so would (theoretically) be redundant. If you do set `indent-tabs-mode' to nil despite this, then you will end up using spaces for indentation in files whose author decided to use tabs. What I do instead is to set the file-/buffer-local value for all files whose author I am. That's a bit inconvenient, but if I didn't do that then I would have to check every contributions for tabs. --- init.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index 9cf15ac..c8155d3 100644 --- a/init.el +++ b/init.el @@ -89,7 +89,10 @@ (use-package lisp-mode :config (add-hook 'emacs-lisp-mode-hook 'outline-minor-mode) - (add-hook 'emacs-lisp-mode-hook 'reveal-mode)) + (add-hook 'emacs-lisp-mode-hook 'reveal-mode) + (defun indent-spaces-mode () + (setq indent-tabs-mode nil)) + (add-hook 'lisp-interaction-mode-hook #'indent-spaces-mode)) (use-package magit :defer t