Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unbalance enable/disable hooks? #132

Open
conao3 opened this issue Nov 16, 2019 · 0 comments · May be fixed by #133
Open

Unbalance enable/disable hooks? #132

conao3 opened this issue Nov 16, 2019 · 0 comments · May be fixed by #133

Comments

@conao3
Copy link

conao3 commented Nov 16, 2019

Description

Hi!
I found aggressive-indent-mode has unbalanced enable/disable hook configuration.

There are any special meanings?

(add-hook 'after-change-functions #'aggressive-indent--keep-track-of-changes nil 'local)
(add-hook 'after-revert-hook #'aggressive-indent--clear-change-list nil 'local)
(add-hook 'before-save-hook #'aggressive-indent--proccess-changed-list-and-indent nil 'local))
;; Clean the hooks
(when (timerp aggressive-indent--idle-timer)
(cancel-timer aggressive-indent--idle-timer))
(remove-hook 'after-change-functions #'aggressive-indent--keep-track-of-changes 'local)
(remove-hook 'after-revert-hook #'aggressive-indent--clear-change-list 'local)
(remove-hook 'before-save-hook #'aggressive-indent--proccess-changed-list-and-indent 'local)
(remove-hook 'post-command-hook #'aggressive-indent--softly-indent-defun 'local)))

(if aggressive-indent-mode
      ;; {{hide something}}
      (add-hook 'after-change-functions #'aggressive-indent--keep-track-of-changes nil 'local)
      (add-hook 'after-revert-hook #'aggressive-indent--clear-change-list nil 'local)
      (add-hook 'before-save-hook #'aggressive-indent--proccess-changed-list-and-indent nil 'local))
    ;; Clean the hooks
    (when (timerp aggressive-indent--idle-timer)
      (cancel-timer aggressive-indent--idle-timer))
    (remove-hook 'after-change-functions #'aggressive-indent--keep-track-of-changes 'local)
    (remove-hook 'after-revert-hook #'aggressive-indent--clear-change-list 'local)
    (remove-hook 'before-save-hook #'aggressive-indent--proccess-changed-list-and-indent 'local)
    (remove-hook 'post-command-hook #'aggressive-indent--softly-indent-defun 'local))

Emacs info

Emacs: GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.12) of 2019-10-26
Aggressive-indent: 20190828.1828
@conao3 conao3 linked a pull request Nov 16, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant