Subject: Re: bug#24153: 25.1; Feature request: per-buffer cursor-color variable

From: [email-masked]
Date: Thu, 04 Aug 2016 21:21:17 -0400

Tej Chajed <[email-masked]> writes:
>
> Evil emulates a per-window cursor color in order to have the cursor
> color of the active window reflect the buffer state (eg,
> distinguishing insert and normal mode). It does so by advising
> set-window and calling set-cursor-color if necessary; this can lead to
> slowdowns when code calls set-window repeatedly (eg, through
> with-selected-window).

There's no `set-window' function, did you mean `select-window'?  I find
in the docstring for that function:

    Selections that "really count" are those causing a visible change in
    the next redisplay of WINDOW’s frame and should be always recorded.
    So if you think of running a function each time a window gets
    selected put it on ‘buffer-list-update-hook’.

Perhaps using ‘buffer-list-update-hook’ instead of advising
`select-window' would help?