Skip to content

Commit

Permalink
Remove before-change-functions
Browse files Browse the repository at this point in the history
  • Loading branch information
justinbarclay committed May 2, 2024
1 parent f525b56 commit 6e4baf0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions parinfer-rust-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 ()
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 6e4baf0

Please sign in to comment.