From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: Scrolling text erases the search highlight Date: Fri, 23 Jul 2010 07:21:51 -0700 Message-ID: <9FA4FDC75D244DDA9979D6F2670C87E2@us.oracle.com> References: <4C3B0AE2.3060507@sdesigns.eu> <4C3C24DA.6080303@sdesigns.eu> <4C3C701B.7060704@sdesigns.eu> <4C495EC6.6070704@sdesigns.eu> <4C4974BE.9020500@easy-emacs.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1279894956 11439 80.91.229.12 (23 Jul 2010 14:22:36 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 23 Jul 2010 14:22:36 +0000 (UTC) To: Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jul 23 16:22:33 2010 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.69) (envelope-from ) id 1OcJ8w-0001LC-1q for geh-help-gnu-emacs@m.gmane.org; Fri, 23 Jul 2010 16:22:30 +0200 Original-Received: from localhost ([127.0.0.1]:51478 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OcJ8t-0001ga-6U for geh-help-gnu-emacs@m.gmane.org; Fri, 23 Jul 2010 10:22:27 -0400 Original-Received: from [140.186.70.92] (port=58195 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OcJ8T-0001gT-9I for help-gnu-emacs@gnu.org; Fri, 23 Jul 2010 10:22:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OcJ8R-0004WD-Pz for help-gnu-emacs@gnu.org; Fri, 23 Jul 2010 10:22:01 -0400 Original-Received: from rcsinet10.oracle.com ([148.87.113.121]:64652) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OcJ8R-0004Vt-KE for help-gnu-emacs@gnu.org; Fri, 23 Jul 2010 10:21:59 -0400 Original-Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o6NELv65029751 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 23 Jul 2010 14:21:58 GMT Original-Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o6NDbhJa031708 for ; Fri, 23 Jul 2010 14:21:54 GMT Original-Received: from abhmt019.oracle.com by acsmt354.oracle.com with ESMTP id 452694191279894912; Fri, 23 Jul 2010 07:21:52 -0700 Original-Received: from dradamslap1 (/10.159.216.179) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 23 Jul 2010 07:21:52 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <4C4974BE.9020500@easy-emacs.de> Thread-Index: AcsqVMRZUt1IO1NFRX2NejMP5G2tcgAGJfEQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 X-Source-IP: acsmt354.oracle.com [141.146.40.154] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090202.4C49A583.0196:SCFMA4539814,ss=1,fgs=0 X-detected-operating-system: by eggs.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:74257 Archived-At: > >> I am limited to scrolling the buffer that is near > >> a result of the searched text, and if I try to move the > >> cursor away in order to scroll more or just to > >> change some text around it will erase the search too (and > >> I come back with the original problem again). Any idea to > >> how to solve that? > > > > As far as I know, there is no way to get around that > > problem today. I think the main issue is that in Emacs > > point is always in the visible portion of the buffer. > > IMHO there is a way, > making functions doing de-highlighting conditional > (unless (or (eq last-command-event 'next) > (eq last-command-event 'prior)) > > for example > (defun isearch-dehighlight () > (unless (or (eq last-command-event 'next) > (eq last-command-event 'prior)) > (when isearch-overlay > (delete-overlay isearch-overlay)))) > > same with lazy-highlight-cleanup and maybe some more. > Produces visible effect here. > Some more/other will arise nonetheless: > isearch highlighting is done in visible portion of buffer only. > Starting scroll with both changes as above will keep the > highlights set so far, but not highlight further, now scrolled > portion. In addition to some of the other suggestions, you can try Icicles search, including `icicle-occur'. You can keep the highlighting after searching (toggle that on/off with `C-.' during search). And you can scroll anywhere during search (or afterward) - point is not tied to a search hit when you move the focus from the minibuffer to your search-hits buffer. This kind of search is quite different, so you will want to read up on it - do not expect the same thing you are used to with isearch. Essentially, all search hits are found for an initial regexp, and they are presented to you as completion candidates. You can navigate among the hits, and you can narrow the set of hits by typing input that the candidates must also match. (IOW, you can search within the set of search hits.) `icicle-occur' is a simplified version of this where the initial regexp is just `.*', which matches all text in each line. `icicle-occur' is on `C-''. `icicle-search' (more general) is on `C-`'. http://www.emacswiki.org/emacs/Icicles_-_Search_Commands%2c_Overview