Malabarba / aggressive-indent-mode

Emacs minor mode that keeps your code always indented. More reliable than electric-indent-mode.
850 stars 36 forks source link

Unbalance enable/disable hooks? #132

Open conao3 opened 4 years ago

conao3 commented 4 years ago

Description

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

There are any special meanings?

https://github.com/Malabarba/aggressive-indent-mode/blob/c28246ba09d53e32cd9d8cafb1830f50387d9985/aggressive-indent.el#L510-L519

(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