From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Gabriel TEIXEIRA Newsgroups: gmane.emacs.help Subject: Re: Scrolling text erases the search highlight Date: Fri, 23 Jul 2010 13:29:54 +0200 Message-ID: <4C497D32.4080300@sdesigns.eu> 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; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1279884631 7255 80.91.229.12 (23 Jul 2010 11:30:31 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 23 Jul 2010 11:30:31 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jul 23 13:30:28 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 1OcGSP-0007HE-5B for geh-help-gnu-emacs@m.gmane.org; Fri, 23 Jul 2010 13:30:25 +0200 Original-Received: from localhost ([127.0.0.1]:56484 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OcGSN-0002bk-Ts for geh-help-gnu-emacs@m.gmane.org; Fri, 23 Jul 2010 07:30:23 -0400 Original-Received: from [140.186.70.92] (port=34618 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OcGRz-0002bT-7t for help-gnu-emacs@gnu.org; Fri, 23 Jul 2010 07:30:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OcGRx-0004Iw-GY for help-gnu-emacs@gnu.org; Fri, 23 Jul 2010 07:29:59 -0400 Original-Received: from a.mx.sdesigns.eu ([78.31.43.6]:3571) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1OcGRw-0004IY-Vv for help-gnu-emacs@gnu.org; Fri, 23 Jul 2010 07:29:57 -0400 Original-Received: from [172.27.0.213] (kobe.france.sdesigns.com [172.27.0.213]) by mailhost.france.sdesigns.com (Postfix) with ESMTP id 1248B164072 for ; Fri, 23 Jul 2010 13:29:55 +0200 (CEST) User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4 In-Reply-To: <4C4974BE.9020500@easy-emacs.de> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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:74254 Archived-At: On 23/07/2010 12:53, Andreas R=F6hler wrote: > Am 23.07.2010 11:25, schrieb Deniz Dogan: >> 2010/7/23 Gabriel TEIXEIRA: >>> On 13/07/2010 15:54, Gabriel TEIXEIRA wrote: >>>> >>>> On 13/07/2010 15:38, Deniz Dogan wrote: >>>>> >>>>> 2010/7/13 Gabriel TEIXEIRA: >>>>>> >>>>>> On 13/07/2010 09:14, Deniz Dogan wrote: >>>>>> >>>>>>> 2010/7/12 Qiang Guo: >>>>>>> >>>>>>>> You may want to check variable 'isearch-allow-scroll' >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> This is a good suggestion. But you may also want to know about=20 >>>>>>> "M-s o". >>>>>>> >>>>>>> M-s o runs the command occur, which is an interactive compiled Li= sp >>>>>>> function in `replace.el'. >>>>>>> >>>>>>> It is bound to M-s o. >>>>>>> >>>>>>> (occur REGEXP&optional NLINES) >>>>>>> >>>>>>> Show all lines in the current buffer containing a match for REGEX= P. >>>>>>> This function can not handle matches that span more than one line= . >>>>>>> >>>>>>> >>>>>> Thanks for the answers and sorry for the multiple messages, the=20 >>>>>> M-s o is >>>>>> >>>>>> very useful, but the isearch-allow-scroll doesn't work very well=20 >>>>>> with >>>>>> me. It >>>>>> will conserve the search if I do C-l or C-v, but won't if I use th= e >>>>>> mouse >>>>>> scroll wheel or if I use the arrow keys to move the cursor (which=20 >>>>>> are >>>>>> the >>>>>> way I scroll the screen mostly). I want something that works=20 >>>>>> similar to >>>>>> the >>>>>> Linux man search, the vim or the gedit, that conserves the=20 >>>>>> highlight as >>>>>> long >>>>>> as the search is erased. Any other suggestions? >>>>>> >>>>>> >>>>>> >>>>> For what it's worth, scrolling using the mouse works fine using: GN= U >>>>> Emacs 24.0.50.1 (i386-mingw-nt6.1.7600) of 2010-07-12 on 3249CTO >>>>> >>>> Yes, I'm using version 23.1.1. I couldn't realize that this could=20 >>>> be the >>>> version of emacs. I will install a newer version to check it out.=20 >>>> Hopefully >>>> won't break with my .emacs config file :) >>>> Many many thanks for your help >>>> >>>> >>> Hello back >>> >>> After I recompiled my emacs to the 24.0.50.1, the problems of=20 >>> scrolling were >>> solved mostly, but now after some time of usage I noticed a weird=20 >>> behaviour: >>> Now that I can scroll freely, I noticed that it won't scroll beyond t= he >>> position were the cursor is located (meaning that if I have one=20 >>> result in >>> the line 150 and my text has 1000 lines and my buffer is 80 lines=20 >>> tall, I >>> can't scroll to see above the line 70 nor after the line 230), so I a= m >>> limited to scrolling the buffer that is near a result of the=20 >>> 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=20 >>> 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. >> > > Hi, > > 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=20 > set so far, but not highlight further, now scrolled portion. > > > Cheers > > > Andreas > > --=20 > https://code.launchpad.net/~a-roehler/python-mode > https://code.launchpad.net/s-x-emacs-werkstatt/ > > > > Well, I tried just the isearch-dehighlight, but it doesn't work at all.=20 I will try to find by myself the solution using the tips you gave me=20 (Not before I master emacs a little bit further, I'm just starting...). Vielen Dank! Gabriel Teixeira