From: Gabriel TEIXEIRA <gabriel_teixeira@sdesigns.eu>
To: help-gnu-emacs@gnu.org
Subject: Re: Scrolling text erases the search highlight
Date: Fri, 23 Jul 2010 13:29:54 +0200 [thread overview]
Message-ID: <4C497D32.4080300@sdesigns.eu> (raw)
In-Reply-To: <4C4974BE.9020500@easy-emacs.de>
On 23/07/2010 12:53, Andreas Röhler wrote:
> Am 23.07.2010 11:25, schrieb Deniz Dogan:
>> 2010/7/23 Gabriel TEIXEIRA<gabriel_teixeira@sdesigns.eu>:
>>> On 13/07/2010 15:54, Gabriel TEIXEIRA wrote:
>>>>
>>>> On 13/07/2010 15:38, Deniz Dogan wrote:
>>>>>
>>>>> 2010/7/13 Gabriel TEIXEIRA<gabriel_teixeira@sdesigns.eu>:
>>>>>>
>>>>>> On 13/07/2010 09:14, Deniz Dogan wrote:
>>>>>>
>>>>>>> 2010/7/12 Qiang Guo<mcknight0219@gmail.com>:
>>>>>>>
>>>>>>>> You may want to check variable 'isearch-allow-scroll'
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>> This is a good suggestion. But you may also want to know about
>>>>>>> "M-s o".
>>>>>>>
>>>>>>> M-s o runs the command occur, which is an interactive compiled Lisp
>>>>>>> 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 REGEXP.
>>>>>>> This function can not handle matches that span more than one line.
>>>>>>>
>>>>>>>
>>>>>> Thanks for the answers and sorry for the multiple messages, the
>>>>>> M-s o is
>>>>>>
>>>>>> very useful, but the isearch-allow-scroll doesn't work very well
>>>>>> with
>>>>>> me. It
>>>>>> will conserve the search if I do C-l or C-v, but won't if I use the
>>>>>> mouse
>>>>>> scroll wheel or if I use the arrow keys to move the cursor (which
>>>>>> are
>>>>>> the
>>>>>> way I scroll the screen mostly). I want something that works
>>>>>> similar to
>>>>>> the
>>>>>> Linux man search, the vim or the gedit, that conserves the
>>>>>> highlight as
>>>>>> long
>>>>>> as the search is erased. Any other suggestions?
>>>>>>
>>>>>>
>>>>>>
>>>>> For what it's worth, scrolling using the mouse works fine using: GNU
>>>>> 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
>>>> be the
>>>> version of emacs. I will install a newer version to check it out.
>>>> 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
>>> scrolling were
>>> solved mostly, but now after some time of usage I noticed a weird
>>> behaviour:
>>> Now that I can scroll freely, I noticed that it won't scroll beyond the
>>> position were the cursor is located (meaning that if I have one
>>> result in
>>> the line 150 and my text has 1000 lines and my buffer is 80 lines
>>> tall, I
>>> can't scroll to see above the line 70 nor after the line 230), so 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.
>>
>
> 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
> set so far, but not highlight further, now scrolled portion.
>
>
> Cheers
>
>
> Andreas
>
> --
> 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.
I will try to find by myself the solution using the tips you gave me
(Not before I master emacs a little bit further, I'm just starting...).
Vielen Dank!
Gabriel Teixeira
next prev parent reply other threads:[~2010-07-23 11:29 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-12 12:30 Scrolling text erases the search highlight Gabriel TEIXEIRA
2010-07-12 19:31 ` Qiang Guo
2010-07-13 7:14 ` Deniz Dogan
2010-07-13 8:33 ` Gabriel TEIXEIRA
2010-07-13 13:33 ` Suvayu Ali
2010-07-13 13:38 ` Deniz Dogan
2010-07-13 13:54 ` Gabriel TEIXEIRA
2010-07-23 9:20 ` Gabriel TEIXEIRA
2010-07-23 9:25 ` Deniz Dogan
2010-07-23 10:53 ` Andreas Röhler
2010-07-23 11:29 ` Gabriel TEIXEIRA [this message]
2010-07-23 14:21 ` Drew Adams
2010-07-26 8:20 ` Gabriel TEIXEIRA
2010-07-26 13:51 ` Drew Adams
-- strict thread matches above, loose matches on Subject: below --
2010-07-12 12:22 Gabriel TEIXEIRA
2010-07-12 11:54 Gabriel TEIXEIRA
2010-07-12 10:04 Gabriel TEIXEIRA
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C497D32.4080300@sdesigns.eu \
--to=gabriel_teixeira@sdesigns.eu \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.