From aaa1298bf557c299ea9b0fcf8b3711e3e97a6c16 Mon Sep 17 00:00:00 2001 From: Jeremy Baxter Date: Mon, 6 May 2024 09:04:51 +1200 Subject: [PATCH] emacs: set hook variables to be buffer-local --- .emacs.d/init.el | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index f49788f..c4d65b0 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -57,17 +57,17 @@ One will be created if none exist." ;; hooks (defun indent-common-hook () ;; set indent width to 4 spaces - (setq tab-width 4 - c-basic-offset 4 - c-syntactic-indentation nil - c-ts-mode-indent-offset 4 - lua-indent-level 4)) + (setq-local tab-width 4 + c-basic-offset 4 + c-syntactic-indentation nil + c-ts-mode-indent-offset 4 + lua-indent-level 4)) (defun indent-tab-hook () (indent-common-hook) - (setq indent-tabs-mode t)) + (setq-local indent-tabs-mode t)) (defun indent-spc-hook () (indent-common-hook) - (setq indent-tabs-mode nil)) + (setq-local indent-tabs-mode nil)) (add-hook 'prog-mode-hook 'display-line-numbers-mode) (add-hook 'text-mode-hook 'hl-line-mode)