Okay, turned out flycheck was basically irrelevant except that it calls message a lot. And highlight-parentheses' only significance is that it makes overlays all over the place. I have a simple reproducer, run as emacs -Q -l bug-21824.el -f 21824-trigger The required circumstances appear to be that after a modification-hook has been run and there is an overlay in the *Messages* buffer, the message coalescing (the "[2 times]" thing) wrongly causes runs the modification-hook of the overlay in the 1st buffer, but with parameters from the *Messages* buffer modification. A sample backtrace (I put a call to `debug' when the current-buffer is incorrect). Debugger entered: (# t 223 223 10 #) (if (eq (current-buffer) (overlay-buffer overlay)) (message "21842-mod-overlay(%s %s %s %s %s), buf = %s" overlay afterp beg end len (current-buffer)) (setq 21842-repeat-message) (debug nil overlay afterp beg end len (current-buffer))) 21824-mod-overlay(# t 223 223 10) message("a message") 21824-trigger() command-line-1(("-l" "bug-21824.el" "-f" "21824-trigger")) command-line() normal-top-level()