Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Flashing Buffer Region in other Window

0 views
Skip to first unread message

Nordlöw

unread,
Nov 11, 2009, 7:20:11 AM11/11/09
to
I am trying to find a function that temporarily highlight/flash the a
buffer region in a window other than the active one (other-window).
Neither hl-line-highlight nor highwin works. They require the flashing
window to be active. Do I have to create the overlay myself and delete
it after a timeout? How does grep and occur solve their flashing? Any
other package to recommend for this purpose?

Thanks,
Nordlöw

Andreas Politz

unread,
Nov 11, 2009, 4:40:58 PM11/11/09
to help-gn...@gnu.org
Nordlöw <per.n...@gmail.com> writes:

Some imagination please.

(defun flash-region (start end &optional window timeout face)
(with-selected-window (or window (selected-window))
(let ((ov (make-overlay start end)))
(overlay-put ov 'window (selected-window))
(overlay-put ov 'face (or face 'next-error))
(run-with-timer (or timeout 0.35) nil #'delete-overlay ov)
nil)))

-ap

0 new messages