def-lkb/merlin — pull request #118 by lehy (2013-10-09 14:52:29+00:00)
Title: emacs: reorganize current error in echo area around idle timer

This uses an idle timer to show the current error in the echo area. This
should hopefully be lighter than using pre- and post-command hooks.

A second timer is used to cancel the idle timer when there are no more
buffers using Merlin (I wish idle timers could be local to a buffer, but
unfortunately, once you start merlin-mode on one buffer, the idle timer
will wakeup even when you are viewing buffers where merlin-mode is not
running).

I did test the functionality (seems to work fine for me: timers fire, errors are displayed, timers are removed automatically at most 10 seconds after the last Merlin-using buffer is killed), and did not see performance problems. However, do note that I could not precisely measure the difference in overhead of this method and the previous (using pre- and post-command hooks) since both seem negligible in my setup. Also, I do not think that using timers that are global to Emacs (as opposed to local to a buffer, as were command hooks) is very robust. In theory, this version can only be faster and should work, but theory...

Fixes #116.