On 12/08/2012 05:58 PM, Eli Zaretskii wrote: > buffer_shared is used only by xdisp.c, with the single exception of > modify_overlay. How about changing modify_overlay to compute this > value by itself? This is definitely possible (by enhancing window_loop, for example). But now I'm thinking about maintaining per-buffer window counter, which value is independent from the redisplay actions. This opens the way to a different optimizations (e.g. if we're modifying a buffer which isn't shown in a window, we can avoid redisplay at all). (My view of the whole thing is: Emacs global state is huge, and redisplay is controlled by too much amount of global variables. This is error-prone and makes some valuable things like threading too complicated or even impossible. So it's desirable to deduce redisplay actions from per-buffer/window/frame variables rather than from the global ones.) Dmitry