help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: automatic selection during search


From: Drew Adams
Subject: RE: automatic selection during search
Date: Thu, 26 Sep 2013 08:43:19 -0700 (PDT)

> > > But, the same behaviour is also shown in emacs -Q: When something is
> > > selected and the point is inside this selection and you start isearch,
> > > then the selection is automatically extended. I could imagine that an
> > > isearch hook could help which first switches off the selection…
> >
> > Yes, (add-hook 'isearch-mode-hook 'deactivate-mark) seems to do the trick.
> 
> That will break the common sequence C-@ C-s which *should* mark the
> region from where you started to where the search completes.

Yes.

It's fine for a given user to add such behavior via a hook, if s?he wants.

But the behavior of extending the active region during Isearch should not be
considered a bug.  A priori, Isearch should make no decisions about changing
the region activation.  Leave it up to the user.

FWIW, Isearch+ gives you choices in behavior wrt the active region, decided by
options `isearchp-deactivate-region-flag' and 
`isearchp-restrict-to-region-flag'.

* Non-nil `isearchp-deactivate-region-flag' means deactivate the region before
  searching, so you can better see the text etc. If nil, you get the ordinary
  Isearch behavior: no deactivation.

* Non-nil `isearchp-restrict-to-region-flag' limits searching to the active
  region.  If nil, you get the ordinary Isearch behavior: no restriction of
  searching to the region.

Isearch+ is here (and on MELPA):
 Code:        http://www.emacswiki.org/emacs-en/download/isearch%2b.el
 Description: http://www.emacswiki.org/IsearchPlus



reply via email to

[Prev in Thread] Current Thread [Next in Thread]