From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Politz Newsgroups: gmane.emacs.help Subject: Re: Flashing Buffer Region in other Window Date: Wed, 11 Nov 2009 22:40:58 +0100 Message-ID: <871vk4loyd.fsf@fh-trier.de> References: <532d4892-1dec-401c-a473-8cea36b06981@z41g2000yqz.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1257975761 13903 80.91.229.12 (11 Nov 2009 21:42:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Nov 2009 21:42:41 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 11 22:42:33 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1N8KxV-0005PT-3R for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Nov 2009 22:42:33 +0100 Original-Received: from localhost ([127.0.0.1]:51262 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N8KxU-0002jy-KP for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Nov 2009 16:42:32 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N8KwX-0001ra-Jm for help-gnu-emacs@gnu.org; Wed, 11 Nov 2009 16:41:33 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N8KwT-0001kp-Lw for help-gnu-emacs@gnu.org; Wed, 11 Nov 2009 16:41:33 -0500 Original-Received: from [199.232.76.173] (port=54889 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N8KwT-0001kb-FM for help-gnu-emacs@gnu.org; Wed, 11 Nov 2009 16:41:29 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:44896) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N8KwT-00011U-02 for help-gnu-emacs@gnu.org; Wed, 11 Nov 2009 16:41:29 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.50) id 1N8KwQ-0004rn-TW for help-gnu-emacs@gnu.org; Wed, 11 Nov 2009 22:41:26 +0100 Original-Received: from dslb-084-059-197-240.pools.arcor-ip.net ([84.59.197.240]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 11 Nov 2009 22:41:26 +0100 Original-Received: from politza by dslb-084-059-197-240.pools.arcor-ip.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 11 Nov 2009 22:41:26 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 23 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: dslb-084-059-197-240.pools.arcor-ip.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:x3830XAVh7GJY5VYAfPx5gKJ1h8= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:69678 Archived-At: Nordlöw writes: > 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 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