Subject: bug#15292: 24.3.50; Isearch: handle commands properly when called at top level

From: Drew Adams <[email-masked]>
Date: Fri, 6 Sep 2013 11:56:45 -0700 (PDT)

Isearch now has quite a few commands that can be invoked during Isearch,
using keys.  None of these commands currently take care of the fact that
they might get called at top level, e.g., with `isearch-mode' = nil.

Some such commands, such as `isearch-help-for-help' should be callable
outside of Isearch.  Others, such as `isearch-repeat-forward', should
not.  For those that should not, an error should be raised, saying that
the command is for use only in Isearch.

For those that should be allowable outside of Isearch, the code should
take care to DTRT when not in `isearch-mode':

* wrt messages (mostly inhibit messages, esp. if they use
  `isearch-message-prefix' etc.)

* wrt Isearch highlighting (they should not do any highlighting)

* wrt calling `isearch-update' etc. (they should not do it)

* wrt calling `exit-minibuffer' (they should not do it: no catch for
  throw)

Some commands, such as `isearch-describe-bindings' and
`isearch-highlight-regexp' can be used outside of Isearch with no change
- they work well already.  This includes even `isearch-edit-string',
which can be called outside Isearch but which then continues in Isearch
with no problem.

Among the comands that might be useful, or at least allowable, outside
of Isearch (dunno), but that might need some minor fixup are the
following.  They should not call `isearch-update' etc.

* isearch-help-for-help

* isearch-describe-key (should explicitly use `isearch-mode-map')

* isearch-describe-mode

* isearch-toggle-*

Dunno whether there is any use for these commands outside Isearch:

* isearch-cancel (moves point to last Isearch start)

* isearch-abort

In GNU Emacs 24.3.50.1 (i686-pc-mingw32)
 of 2013-08-23 on ODIEONE
Bzr revision: 113986 [email-masked]
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=/c/Devel/emacs/binary --enable-checking=yes,glyphs
 'CFLAGS=-O0 -g3' LDFLAGS=-Lc:/Devel/emacs/lib
 CPPFLAGS=-Ic:/Devel/emacs/include'