Effective February 22, 2024, Google Groups will no longer support new Usenet content. Posting and subscribing will be disallowed, and new content from Usenet peers will not appear. Viewing and searching of historical data will still be supported as it is done today.

Flashing Buffer Region in other Window

0 views
Skip to first unread message

Nordlöw

unread,
Nov 11, 2009, 2:20:11 PM11/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, 11: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

Reply all
Reply to author
Forward
0 new messages