[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why run-with-timer generates so many timers?
From: |
Michael Heerdegen |
Subject: |
Re: Why run-with-timer generates so many timers? |
Date: |
Sat, 18 Jul 2020 04:05:34 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
"numbchild@gmail.com" <numbchild@gmail.com> writes:
> Here is the code lines which running timer:
> https://github.com/stardiviner/emacs-rainbow-fart/blob/master/rainbow-fart.el#L245
Looks like you save the timer in a global variable; but your mode is
buffer local. In your implementation, enabling in any buffer starts a
new timer unconditionally and overwrites the global variable AUAIU.
Dunno whether this is the reason for all of the timers you see.
The question if you should use only one global timer for all buffers is
not trivial; if you can do that, it is preferable. Depends on things
like which buffers should be treated (all?, all visible?, only the
current buffer?). Haven't looked at your code that much.
Michael.