-
Notifications
You must be signed in to change notification settings - Fork 35
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
Error running timer ‘aggressive-indent--indent-if-changed’: (wrong-type-argument timerp nil) on every pointer movement #138
Comments
Yes, I have noticed this too. I have resorted to removing this package. Restarting Emacs multiple times per day is no fun :( |
See the original issue for this problem #137. The fix by @tsdh works perfectly. At the moment I'm keeping it within my (defun aggressive-indent--indent-if-changed (buffer)
"Indent any region that changed in BUFFER in the last command loop."
(if (not (buffer-live-p buffer))
(and aggressive-indent--idle-timer
(cancel-timer aggressive-indent--idle-timer))
(with-current-buffer buffer
(when (and aggressive-indent-mode aggressive-indent--changed-list)
(save-excursion
(save-selected-window
(aggressive-indent--while-no-input
(aggressive-indent--proccess-changed-list-and-indent))))
(when (timerp aggressive-indent--idle-timer)
(cancel-timer aggressive-indent--idle-timer)))))) |
Let's try without this, nowadays most modes have a formatter that can be run instead. And also there was a bug in the code that is yet to be fixed: Malabarba/aggressive-indent-mode#138
Same issue here. Please fix it. I think this fix is more reliable. (when (timerp aggressive-indent--idle-timer)
(cancel-timer aggressive-indent--idle-timer)) |
There is a deeper problem here: if the buffer is killed, we have no access to the timer object, which is stored in a buffer-local variable, so we can't cancel it. Right now my Emacs session have four timers created by a-i-m which respective buffers no longer exists. To begin with, why we create a repeating timer to cancel it right away on
|
in commit 12a64b4 I'm experiencing this bug were after some hours the function
aggressive-indent--indent-if-changed
begins to fail on every point movement or key stroke, which is annoying.a workaround is just to re-start emacs.
This is my configuration related to
aggresive-indent-mode
or where I explicitly do something with the minor mode:The text was updated successfully, but these errors were encountered: