I'm implementing a (optional, de-activable) real-time syntax checker. Each time the user types/deletes anything, I want to run my spell-checking funtion :
I tried (add-hook 'post-self-insert-hook 'syntax-check-continuous)
but now even when I type in the minibuffer, the function is run.
What would be the good practice for that? An advice
after an insert function? An (add-to-list 'before-change-functions 'syntax-check-continuous)
?
I'd really like to see existing real-time syntax checker implementations, I don't want to make Emacs behave in a weird way.
flymake-mode
. It can run a compiler or a linter on a buffer from time to time. There's alsoflyspell-mode
(with a variant forprog-mode
descendants as well) that runs a spell checker on what you type into a buffer. Both of them ship with Emacs.(message "type!")
after each key press in the my-mode buffers.