emacs: set hook variables to be buffer-local

This commit is contained in:
Jeremy Baxter 2024-05-06 09:04:51 +12:00
parent f6f9d1d7b3
commit aaa1298bf5

View file

@ -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)