unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* query-replace on region highlights too much
@ 2005-02-12 21:38 Kai Großjohann
  2005-02-13  0:50 ` Miles Bader
  2005-02-15  6:18 ` Richard Stallman
  0 siblings, 2 replies; 3+ messages in thread
From: Kai Großjohann @ 2005-02-12 21:38 UTC (permalink / raw)


I mark a region, I invoke M-%.  This will perform the query-replace on
the marked region only.  (I forget whether that's always the case, or
whether I have turned on something to make it so.  I think it works
like this because I use transient-mark-mode.)

The problem is that the highlighting of the search string is performed
in the whole buffer, not only in the region where replacing is going
to happen.

Kai

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: query-replace on region highlights too much
  2005-02-12 21:38 query-replace on region highlights too much Kai Großjohann
@ 2005-02-13  0:50 ` Miles Bader
  2005-02-15  6:18 ` Richard Stallman
  1 sibling, 0 replies; 3+ messages in thread
From: Miles Bader @ 2005-02-13  0:50 UTC (permalink / raw)
  Cc: emacs-devel

On Sat, 12 Feb 2005 22:38:24 +0100, Kai Großjohann <kai@emptydomain.de> wrote:
> I mark a region, I invoke M-%.  This will perform the query-replace on
> the marked region only.  (I forget whether that's always the case, or
> whether I have turned on something to make it so.  I think it works
> like this because I use transient-mark-mode.)
> 
> The problem is that the highlighting of the search string is performed
> in the whole buffer, not only in the region where replacing is going
> to happen.

Yes, I find that very disturbing as well.  A particularly bad case is
where you're replacing a very common string (like a small space) in a
small region, in which case the bogus highlights can completely
overwhelm the cursor display and region highlighting!

Oh, also another problem with the "query-replace highlighting":  The
highlighting seems to be erased and re-done from scratch everytime you
hit "y" to replace an instance, which can be very annoying.  I suppose
the intent of this is to keep any highlighting up-to-date in the face
of buffer-modification, but it could be made much smarter (e.g., only
"refresh" the buffer region actually modified by the last
replacement).

Thanks,

-Miles
-- 
Do not taunt Happy Fun Ball.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: query-replace on region highlights too much
  2005-02-12 21:38 query-replace on region highlights too much Kai Großjohann
  2005-02-13  0:50 ` Miles Bader
@ 2005-02-15  6:18 ` Richard Stallman
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Stallman @ 2005-02-15  6:18 UTC (permalink / raw)
  Cc: emacs-devel

    The problem is that the highlighting of the search string is performed
    in the whole buffer, not only in the region where replacing is going
    to happen.

I wrote the code to handle this.  I will install it soon.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-02-15  6:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-12 21:38 query-replace on region highlights too much Kai Großjohann
2005-02-13  0:50 ` Miles Bader
2005-02-15  6:18 ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).