diff --git a/parinfer-rust-mode.el b/parinfer-rust-mode.el index 67fee18..3451883 100644 --- a/parinfer-rust-mode.el +++ b/parinfer-rust-mode.el @@ -486,7 +486,8 @@ parinfer autofix them, or if there is no reasonable way for (if-let (issue (or (parinfer-rust--check-for-tabs) (parinfer-rust--check-for-indentation))) (parinfer-rust-mode -1)) - (remove-hook 'before-change-functions #'parinfer-rust--check-for-issues t)) + (remove-hook 'first-change-hook #'parinfer-rust--check-for-issues t)) + (defun parinfer-rust--switch-mode (&optional mode) "Switch to a different Parinfer MODE. @@ -530,7 +531,7 @@ Checks if MODE is a valid Parinfer mode, and uses (track-changes-unregister parinfer-rust--change-tracker) (setq-local parinfer-rust--change-tracker nil)) (setq-local parinfer-rust-enabled nil) - (remove-hook 'before-change-functions #'parinfer-rust--check-for-issues t) + (remove-hook 'first-change-hook #'parinfer-rust--check-for-issues t) (parinfer-rust--dim-parens)) (defun parinfer-rust-toggle-disable () @@ -563,7 +564,7 @@ This includes stopping tracking of all changes." buffer-read-only) ;; Defer checking for changes until a user changes the buffer (setq-local parinfer-rust--disable t) - (add-hook 'before-change-functions #'parinfer-rust--check-for-issues nil t)) + (add-hook 'first-change-hook #'parinfer-rust--check-for-issues nil t)) ((eq 'immediate parinfer-rust-check-before-enable) (setq-local parinfer-rust--disable t)