(defhydra windows (global-map "C-c w" :post flash-active-buffer)
"window moving"
("o" other-window "other"))
(make-face 'flash-active-buffer-face)
(set-face-attribute 'flash-active-buffer-face nil
:background "red"
:foreground "black")
(defun flash-active-buffer ()
(interactive)
(run-at-time "250 millisec" nil
(lambda (remap-cookie)
(face-remap-remove-relative remap-cookie))
(face-remap-add-relative 'default 'flash-active-buffer-face)))
The above works as you'd expect: when the hydra exits, the final window flashes. What I'd like is to flash the window as the focus moves about the frame. However, instead of flashing the window, it will leave all other windows with the flash-color (in this case, completely red).
How can I get each window to flash as expected when using :pre
?
flash-active-buffer
with overlays, since you can specify the window in which the overlay is visible. Your current approach works badly if there are many windows with the same buffer. – abo-abo Jul 07 '15 at 14:41avy--make-backgrounds
- you can use it almost without change. – abo-abo Jul 07 '15 at 14:52